Ticket #10092: mythfrontendsetup-14-02-2012.diff
| File mythfrontendsetup-14-02-2012.diff, 222.8 KB (added by , 15 years ago) |
|---|
-
mythtv/programs/mythfrontend/audiogeneralsettings.cpp
diff --git a/mythtv/programs/mythfrontend/audiogeneralsettings.cpp b/mythtv/programs/mythfrontend/audiogeneralsettings.cpp index 1115c27..d41df4f 100644
a b class TriggeredItem : public TriggeredConfigurationGroup 48 48 }; 49 49 50 50 AudioDeviceComboBox::AudioDeviceComboBox(AudioConfigSettings *parent) : 51 HostComboBox ("AudioOutputDevice", true), m_parent(parent)51 HostComboBoxSetting("AudioOutputDevice", true), m_parent(parent) 52 52 { 53 53 setLabel(QObject::tr("Audio output device")); 54 54 #ifdef USING_ALSA … … AudioDeviceComboBox::AudioDeviceComboBox(AudioConfigSettings *parent) : 70 70 this, SLOT(AudioDescriptionHelp(const QString&))); 71 71 } 72 72 73 void AudioDeviceComboBox::edit(MythScreenType * screen) 74 { 75 AudioRescan(); 76 HostComboBoxSetting::edit(screen); 77 } 78 73 79 void AudioDeviceComboBox::AudioRescan() 74 80 { 81 LOG(VB_GENERAL, LOG_ERR, 82 QString("AudioDeviceComboBox::AudioRescan()")); 75 83 AudioOutput::ADCVect &vect = m_parent->AudioDeviceVect(); 76 84 AudioOutput::ADCVect::const_iterator it; 77 85 … … void AudioDeviceComboBox::AudioRescan() 80 88 81 89 QString value = getValue(); 82 90 clearSelections(); 83 resetMaxCount(vect.size());91 //TODO resetMaxCount(vect.size()); 84 92 85 93 bool found = false; 86 94 for (it = vect.begin(); it != vect.end(); ++it) … … void AudioDeviceComboBox::AudioRescan() 88 96 value == it->name ? (found = true) : false); 89 97 if (!found) 90 98 { 91 resetMaxCount(vect.size()+1);99 //TODO resetMaxCount(vect.size()+1); 92 100 addSelection(value, value, true); 93 101 } 94 102 // For some reason, it adds an empty entry, remove it 95 removeSelection(QString::null);103 //TODO removeSelection(QString::null); 96 104 } 97 105 98 106 void AudioDeviceComboBox::AudioDescriptionHelp(const QString &device) … … void AudioDeviceComboBox::AudioDescriptionHelp(const QString &device) 101 109 setHelpText(desc); 102 110 } 103 111 104 AudioConfigSettings::AudioConfigSettings( ConfigurationWizard *parent) :105 VerticalConfigurationGroup(false, true, false, false),112 AudioConfigSettings::AudioConfigSettings() : 113 GroupSetting(), 106 114 m_OutputDevice(NULL), m_MaxAudioChannels(NULL), 107 115 m_AudioUpmix(NULL), m_AudioUpmixType(NULL), 108 116 m_AC3PassThrough(NULL), m_DTSPassThrough(NULL), 109 m_EAC3PassThrough(NULL),m_TrueHDPassThrough(NULL), m_DTSHDPassThrough(NULL), 110 m_parent(parent) 117 m_EAC3PassThrough(NULL),m_TrueHDPassThrough(NULL), m_DTSHDPassThrough(NULL) 111 118 { 112 119 setLabel(QObject::tr("Audio System")); 113 setUseLabel(false); 114 115 ConfigurationGroup *devicegroup = new HorizontalConfigurationGroup(false, 116 false); 117 devicegroup->addChild((m_OutputDevice = new AudioDeviceComboBox(this))); 118 // Rescan button 119 TransButtonSetting *rescan = new TransButtonSetting("rescan"); 120 rescan->setLabel(QObject::tr("Rescan")); 121 rescan->setHelpText(QObject::tr("Rescan for available audio devices. " 122 "Current entry will be checked and " 123 "capability entries populated.")); 124 devicegroup->addChild(rescan); 125 connect(rescan, SIGNAL(pressed()), this, SLOT(AudioRescan())); 126 addChild(devicegroup); 120 121 this->addChild((m_OutputDevice = new AudioDeviceComboBox(this))); 127 122 128 123 QString name = m_OutputDevice->getValue(); 129 124 AudioOutput::AudioDeviceConfig *adc = … … AudioConfigSettings::AudioConfigSettings(ConfigurationWizard *parent) : 139 134 140 135 delete adc; 141 136 142 ConfigurationGroup *maingroup = new VerticalConfigurationGroup(false,143 false);144 addChild(maingroup);145 137 146 m_triggerDigital = new TransCheckBoxSetting(); 138 m_triggerDigital = new GroupSetting(); 139 147 140 m_AC3PassThrough = AC3PassThrough(); 148 141 m_DTSPassThrough = DTSPassThrough(); 149 142 m_EAC3PassThrough = EAC3PassThrough(); 150 143 m_TrueHDPassThrough = TrueHDPassThrough(); 151 144 m_DTSHDPassThrough = DTSHDPassThrough(); 152 145 153 m_cgsettings = new HorizontalConfigurationGroup();154 m_cgsettings->setLabel(QObject::tr("Digital Audio Capabilities"));155 m_cgsettings->addChild(m_AC3PassThrough);156 m_cgsettings->addChild(m_DTSPassThrough);157 m_cgsettings->addChild(m_EAC3PassThrough);158 m_cgsettings->addChild(m_TrueHDPassThrough);159 m_cgsettings->addChild(m_DTSHDPassThrough);160 146 161 TriggeredItem *sub1 = new TriggeredItem(m_triggerDigital, m_cgsettings); 147 //m_cgsettings = new GroupSetting(); 148 m_triggerDigital->setLabel(QObject::tr("Digital Audio Capabilities")); 149 m_triggerDigital->addChild(m_AC3PassThrough); 150 m_triggerDigital->addChild(m_DTSPassThrough); 151 m_triggerDigital->addChild(m_EAC3PassThrough); 152 m_triggerDigital->addChild(m_TrueHDPassThrough); 153 m_triggerDigital->addChild(m_DTSHDPassThrough); 154 addChild(m_triggerDigital); 162 155 163 maingroup->addChild(sub1);156 /*TriggeredItem *sub1 = new TriggeredItem(m_triggerDigital, m_cgsettings); 164 157 165 maingroup->addChild((m_MaxAudioChannels = MaxAudioChannels())); 166 maingroup->addChild((m_AudioUpmix = AudioUpmix())); 167 maingroup->addChild((m_AudioUpmixType = AudioUpmixType())); 158 maingroup->addChild(sub1);*/ 168 159 169 TransButtonSetting *test = new TransButtonSetting("test"); 160 addChild((m_MaxAudioChannels = MaxAudioChannels())); 161 addChild((m_AudioUpmix = AudioUpmix())); 162 addChild((m_AudioUpmixType = AudioUpmixType())); 163 addChild(MythControlsVolume()); 164 165 166 GroupSetting *test = new GroupSetting(/*"test"*/); 170 167 test->setLabel(QObject::tr("Test")); 171 168 test->setHelpText(QObject::tr("Will play a test pattern on all configured " 172 169 "speakers")); 173 connect(test, SIGNAL(pressed()), this, SLOT(StartAudioTest()));170 //connect(test, SIGNAL(pressed()), this, SLOT(StartAudioTest())); 174 171 addChild(test); 175 172 176 TransButtonSetting *advanced = new TransButtonSetting("advanced");177 advanced->setLabel(QObject::tr("Advanced Audio Settings"));173 // GroupSetting *advanced = new AudioAdvancedSettings(/*"advanced"*/); 174 /*advanced->setLabel(QObject::tr("Advanced Audio Settings")); 178 175 advanced->setHelpText(QObject::tr("Enable extra audio settings. Under most " 179 176 "usage all options should be left alone")); 180 connect(advanced, SIGNAL(pressed()), this, SLOT(AudioAdvanced()));181 addChild(advanced); 177 //connect(advanced, SIGNAL(pressed()), this, SLOT(AudioAdvanced())); 178 addChild(advanced);*/ 182 179 183 180 // Set slots 184 181 connect(m_MaxAudioChannels, SIGNAL(valueChanged(const QString&)), … … AudioConfigSettings::AudioConfigSettings(ConfigurationWizard *parent) : 200 197 201 198 void AudioConfigSettings::AudioRescan() 202 199 { 200 201 LOG(VB_GENERAL, LOG_ERR, 202 QString("AudioConfigSettings::AudioRescan()")); 203 203 if (!slotlock.tryLock()) 204 204 return; 205 205 … … void AudioConfigSettings::UpdateVisibility(const QString &device) 260 260 AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 261 261 const QString &device) 262 262 { 263 LOG(VB_GENERAL, LOG_ERR, 264 QString("AudioConfigSettings::UpdateCapabilities")); 263 265 int max_speakers = 8; 264 266 int realmax_speakers = 8; 265 267 … … AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 271 273 !m_AC3PassThrough || !m_DTSPassThrough || 272 274 !m_EAC3PassThrough || !m_TrueHDPassThrough || !m_DTSHDPassThrough) 273 275 return settings; 276 LOG(VB_GENERAL, LOG_ERR, 277 QString("AudioConfigSettings::UpdateCapabilities 2")); 274 278 275 279 if (!slotlock.tryLock()) // Doing a rescan of channels 276 280 return settings; 277 281 282 LOG(VB_GENERAL, LOG_ERR, 283 QString("AudioConfigSettings::UpdateCapabilities 3")); 284 278 285 bool bAC3 = true; 279 286 bool bDTS = true; 280 287 bool bLPCM = true; … … AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 290 297 } 291 298 else 292 299 { 300 301 LOG(VB_GENERAL, LOG_ERR, 302 QString("AudioConfigSettings::UpdateCapabilities 4")); 293 303 bool bForceDigital = 294 304 gCoreContext->GetNumSetting("PassThruDeviceOverride", false); 295 305 … … AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 320 330 max_speakers = 6; 321 331 } 322 332 323 m_triggerDigital->set Value(invalid || settingsdigital.canFeature(333 m_triggerDigital->setEnabled(invalid || settingsdigital.canFeature( 324 334 FEATURE_AC3 | FEATURE_DTS | FEATURE_EAC3 | 325 335 FEATURE_TRUEHD | FEATURE_DTSHD)); 336 326 337 m_EAC3PassThrough->setEnabled(bEAC3); 327 338 m_TrueHDPassThrough->setEnabled(bTRUEHD); 328 339 m_DTSHDPassThrough->setEnabled(bDTSHD); … … AudioOutputSettings AudioConfigSettings::UpdateCapabilities( 337 348 338 349 // Remove everything and re-add available channels 339 350 m_MaxAudioChannels->clearSelections(); 340 m_MaxAudioChannels->resetMaxCount(3);351 //TODO m_MaxAudioChannels->resetMaxCount(3); 341 352 for (int i = 1; i <= max_speakers; i++) 342 353 { 343 354 if (invalid || settings.IsSupportedChannels(i)) … … void AudioConfigSettings::AudioAdvanced() 399 410 } 400 411 } 401 412 402 HostComboBox *AudioConfigSettings::MaxAudioChannels()413 HostComboBoxSetting *AudioConfigSettings::MaxAudioChannels() 403 414 { 404 415 QString name = "MaxChannels"; 405 HostComboBox *gc = new HostComboBox(name, false);416 HostComboBoxSetting *gc = new HostComboBoxSetting(name, false); 406 417 gc->setLabel(QObject::tr("Speaker configuration")); 407 418 gc->addSelection(QObject::tr("Stereo"), "2", true); // default 408 419 gc->setHelpText(QObject::tr("Select the maximum number of audio " … … HostComboBox *AudioConfigSettings::MaxAudioChannels() 411 422 return gc; 412 423 } 413 424 414 HostCheckBox *AudioConfigSettings::AudioUpmix()425 HostCheckBoxSetting *AudioConfigSettings::AudioUpmix() 415 426 { 416 HostCheckBox *gc = new HostCheckBox("AudioDefaultUpmix");427 HostCheckBoxSetting *gc = new HostCheckBoxSetting("AudioDefaultUpmix"); 417 428 gc->setLabel(QObject::tr("Upconvert stereo to 5.1 surround")); 418 429 gc->setValue(true); 419 430 gc->setHelpText(QObject::tr("If enabled, MythTV will upconvert stereo " … … HostCheckBox *AudioConfigSettings::AudioUpmix() 422 433 return gc; 423 434 } 424 435 425 HostComboBox *AudioConfigSettings::AudioUpmixType()436 HostComboBoxSetting *AudioConfigSettings::AudioUpmixType() 426 437 { 427 HostComboBox *gc = new HostComboBox("AudioUpmixType",false);438 HostComboBoxSetting *gc = new HostComboBoxSetting("AudioUpmixType",false); 428 439 gc->setLabel(QObject::tr("Upmix Quality")); 429 440 gc->addSelection(QObject::tr("Good"), "1"); 430 441 gc->addSelection(QObject::tr("Best"), "2", true); // default … … HostComboBox *AudioConfigSettings::AudioUpmixType() 432 443 return gc; 433 444 } 434 445 435 HostCheckBox *AudioConfigSettings::AC3PassThrough()446 HostCheckBoxSetting *AudioConfigSettings::AC3PassThrough() 436 447 { 437 HostCheckBox *gc = new HostCheckBox("AC3PassThru");448 HostCheckBoxSetting *gc = new HostCheckBoxSetting("AC3PassThru"); 438 449 gc->setLabel(QObject::tr("Dolby Digital")); 439 450 gc->setValue(false); 440 451 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … HostCheckBox *AudioConfigSettings::AC3PassThrough() 443 454 return gc; 444 455 } 445 456 446 HostCheckBox *AudioConfigSettings::DTSPassThrough()457 HostCheckBoxSetting *AudioConfigSettings::DTSPassThrough() 447 458 { 448 HostCheckBox *gc = new HostCheckBox("DTSPassThru");459 HostCheckBoxSetting *gc = new HostCheckBoxSetting("DTSPassThru"); 449 460 gc->setLabel(QObject::tr("DTS")); 450 461 gc->setValue(false); 451 462 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … HostCheckBox *AudioConfigSettings::DTSPassThrough() 454 465 return gc; 455 466 } 456 467 457 HostCheckBox *AudioConfigSettings::EAC3PassThrough()468 HostCheckBoxSetting *AudioConfigSettings::EAC3PassThrough() 458 469 { 459 HostCheckBox *gc = new HostCheckBox("EAC3PassThru");470 HostCheckBoxSetting *gc = new HostCheckBoxSetting("EAC3PassThru"); 460 471 gc->setLabel(QObject::tr("E-AC3")); 461 472 gc->setValue(false); 462 473 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … HostCheckBox *AudioConfigSettings::EAC3PassThrough() 464 475 return gc; 465 476 } 466 477 467 HostCheckBox *AudioConfigSettings::TrueHDPassThrough()478 HostCheckBoxSetting *AudioConfigSettings::TrueHDPassThrough() 468 479 { 469 HostCheckBox *gc = new HostCheckBox("TrueHDPassThru");480 HostCheckBoxSetting *gc = new HostCheckBoxSetting("TrueHDPassThru"); 470 481 gc->setLabel(QObject::tr("TrueHD")); 471 482 gc->setValue(false); 472 483 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … HostCheckBox *AudioConfigSettings::TrueHDPassThrough() 474 485 return gc; 475 486 } 476 487 477 HostCheckBox *AudioConfigSettings::DTSHDPassThrough()488 HostCheckBoxSetting *AudioConfigSettings::DTSHDPassThrough() 478 489 { 479 HostCheckBox *gc = new HostCheckBox("DTSHDPassThru");490 HostCheckBoxSetting *gc = new HostCheckBoxSetting("DTSHDPassThru"); 480 491 gc->setLabel(QObject::tr("DTS-HD")); 481 492 gc->setValue(false); 482 493 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … bool AudioConfigSettings::CheckPassthrough() 508 519 return ok; 509 520 } 510 521 522 //TODO create a interface instead 523 void fillSelectionsFromDir(HostComboBoxSetting *comboBox, const QDir& dir, bool absPath = true) 524 525 { 526 QFileInfoList il = dir.entryInfoList(); 527 528 for (QFileInfoList::Iterator it = il.begin(); 529 it != il.end(); 530 ++it ) 531 { 532 QFileInfo &fi = *it; 533 534 if (absPath) 535 comboBox->addSelection( fi.absoluteFilePath() ); 536 else 537 comboBox->addSelection( fi.fileName() ); 538 } 539 } 540 541 HostComboBoxSetting *AudioConfigSettings::MixerDevice() 542 { 543 HostComboBoxSetting *gc = new HostComboBoxSetting("MixerDevice", true); 544 gc->setLabel(QObject::tr("Mixer device")); 545 546 #ifdef USING_OSS 547 QDir dev("/dev", "mixer*", QDir::Name, QDir::System); 548 fillSelectionsFromDir(gc, dev); 549 550 dev.setPath("/dev/sound"); 551 if (dev.exists()) 552 { 553 fillSelectionsFromDir(gc, dev); 554 } 555 #endif 556 #ifdef USING_ALSA 557 gc->addSelection("ALSA:default", "ALSA:default"); 558 #endif 559 #ifdef USING_MINGW 560 gc->addSelection("DirectX:", "DirectX:"); 561 gc->addSelection("Windows:", "Windows:"); 562 #endif 563 #if !defined(USING_MINGW) 564 gc->addSelection("software", "software"); 565 gc->setHelpText(QObject::tr("Setting the mixer device to \"software\" " 566 "lets MythTV control the volume of all audio at the " 567 "expense of a slight quality loss.")); 568 #endif 569 570 return gc; 571 } 572 573 static const char* MixerControlControls[] = { "PCM", 574 "Master" }; 575 576 HostComboBoxSetting *AudioConfigSettings::MixerControl() 577 { 578 HostComboBoxSetting *gc = new HostComboBoxSetting("MixerControl", true); 579 gc->setLabel(QObject::tr("Mixer controls")); 580 for (unsigned int i = 0; i < sizeof(MixerControlControls) / sizeof(char*); 581 ++i) 582 { 583 gc->addSelection(QObject::tr(MixerControlControls[i]), 584 MixerControlControls[i]); 585 } 586 587 gc->setHelpText(QObject::tr("Changing the volume adjusts the selected mixer.")); 588 return gc; 589 } 590 591 592 //TODO was a slider 593 HostSpinBoxSetting *AudioConfigSettings::MixerVolume() 594 { 595 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MasterMixerVolume", 0, 100, 1); 596 gs->setLabel(QObject::tr("Master mixer volume")); 597 gs->setValue(70); 598 gs->setHelpText(QObject::tr("Initial volume for the Master mixer. " 599 "This affects all sound created by the audio device. " 600 "Note: Do not set this too low.")); 601 return gs; 602 } 603 604 //TODO was a slider 605 HostSpinBoxSetting *AudioConfigSettings::PCMVolume() 606 { 607 HostSpinBoxSetting *gs = new HostSpinBoxSetting("PCMMixerVolume", 0, 100, 1); 608 gs->setLabel(QObject::tr("PCM mixer volume")); 609 gs->setValue(70); 610 gs->setHelpText(QObject::tr("Initial volume for PCM output. Using the " 611 "volume keys in MythTV will adjust this parameter.")); 612 return gs; 613 } 614 615 616 HostCheckBoxSetting *AudioConfigSettings::MythControlsVolume() 617 { 618 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MythControlsVolume"); 619 gc->setLabel(QObject::tr("Use internal volume controls")); 620 gc->setValue(true); 621 gc->setHelpText(QObject::tr("If enabled, MythTV will control the PCM and " 622 "master mixer volume. Disable this option if you prefer " 623 "to control the volume externally (for example, using " 624 "your amplifier) or if you use an external mixer program.")); 625 626 gc->addTargetedChild("1",MixerDevice()); 627 gc->addTargetedChild("1",MixerControl()); 628 gc->addTargetedChild("1",MixerVolume()); 629 gc->addTargetedChild("1",PCMVolume()); 630 return gc; 631 } 632 511 633 void AudioConfigSettings::StartAudioTest() 512 634 { 513 635 AudioOutputSettings settings = UpdateCapabilities(QString::null); … … AudioTestGroup::AudioTestGroup(QString main, QString passthrough, 946 1068 addChild(new AudioTest(main, passthrough, channels, settings)); 947 1069 } 948 1070 949 HostCheckBox *AudioMixerSettings::MythControlsVolume()1071 HostCheckBoxSetting *AudioAdvancedSettings::MPCM() 950 1072 { 951 HostCheckBox *gc = new HostCheckBox("MythControlsVolume"); 952 gc->setLabel(QObject::tr("Use internal volume controls")); 953 gc->setValue(true); 954 gc->setHelpText(QObject::tr("If enabled, MythTV will control the PCM and " 955 "master mixer volume. Disable this option if you prefer " 956 "to control the volume externally (for example, using " 957 "your amplifier) or if you use an external mixer program.")); 958 return gc; 959 } 960 961 HostComboBox *AudioMixerSettings::MixerDevice() 962 { 963 HostComboBox *gc = new HostComboBox("MixerDevice", true); 964 gc->setLabel(QObject::tr("Mixer device")); 965 966 #ifdef USING_OSS 967 QDir dev("/dev", "mixer*", QDir::Name, QDir::System); 968 gc->fillSelectionsFromDir(dev); 969 970 dev.setPath("/dev/sound"); 971 if (dev.exists()) 972 { 973 gc->fillSelectionsFromDir(dev); 974 } 975 #endif 976 #ifdef USING_ALSA 977 gc->addSelection("ALSA:default", "ALSA:default"); 978 #endif 979 #ifdef USING_MINGW 980 gc->addSelection("DirectX:", "DirectX:"); 981 gc->addSelection("Windows:", "Windows:"); 982 #endif 983 #if !defined(USING_MINGW) 984 gc->addSelection("software", "software"); 985 gc->setHelpText(QObject::tr("Setting the mixer device to \"software\" " 986 "lets MythTV control the volume of all audio at the " 987 "expense of a slight quality loss.")); 988 #endif 989 990 return gc; 991 } 992 993 const char* AudioMixerSettings::MixerControlControls[] = { "PCM", 994 "Master" }; 995 996 HostComboBox *AudioMixerSettings::MixerControl() 997 { 998 HostComboBox *gc = new HostComboBox("MixerControl", true); 999 gc->setLabel(QObject::tr("Mixer controls")); 1000 for (unsigned int i = 0; i < sizeof(MixerControlControls) / sizeof(char*); 1001 ++i) 1002 { 1003 gc->addSelection(QObject::tr(MixerControlControls[i]), 1004 MixerControlControls[i]); 1005 } 1006 1007 gc->setHelpText(QObject::tr("Changing the volume adjusts the selected mixer.")); 1008 return gc; 1009 } 1010 1011 HostSlider *AudioMixerSettings::MixerVolume() 1012 { 1013 HostSlider *gs = new HostSlider("MasterMixerVolume", 0, 100, 1); 1014 gs->setLabel(QObject::tr("Master mixer volume")); 1015 gs->setValue(70); 1016 gs->setHelpText(QObject::tr("Initial volume for the Master mixer. " 1017 "This affects all sound created by the audio device. " 1018 "Note: Do not set this too low.")); 1019 return gs; 1020 } 1021 1022 HostSlider *AudioMixerSettings::PCMVolume() 1023 { 1024 HostSlider *gs = new HostSlider("PCMMixerVolume", 0, 100, 1); 1025 gs->setLabel(QObject::tr("PCM mixer volume")); 1026 gs->setValue(70); 1027 gs->setHelpText(QObject::tr("Initial volume for PCM output. Using the " 1028 "volume keys in MythTV will adjust this parameter.")); 1029 return gs; 1030 } 1031 1032 AudioMixerSettings::AudioMixerSettings() : 1033 TriggeredConfigurationGroup(false, true, false, false) 1034 { 1035 setLabel(QObject::tr("Audio Mixer")); 1036 setUseLabel(false); 1037 1038 Setting *volumeControl = MythControlsVolume(); 1039 addChild(volumeControl); 1040 1041 // Mixer settings 1042 ConfigurationGroup *settings = 1043 new VerticalConfigurationGroup(false, true, false, false); 1044 settings->addChild(MixerDevice()); 1045 settings->addChild(MixerControl()); 1046 settings->addChild(MixerVolume()); 1047 settings->addChild(PCMVolume()); 1048 1049 ConfigurationGroup *dummy = 1050 new VerticalConfigurationGroup(false, true, false, false); 1051 1052 // Show Mixer config only if internal volume controls enabled 1053 setTrigger(volumeControl); 1054 addTarget("0", dummy); 1055 addTarget("1", settings); 1056 } 1057 1058 AudioGeneralSettings::AudioGeneralSettings() 1059 { 1060 addChild(new AudioConfigSettings(this)); 1061 addChild(new AudioMixerSettings()); 1062 } 1063 1064 HostCheckBox *AudioAdvancedSettings::MPCM() 1065 { 1066 HostCheckBox *gc = new HostCheckBox("StereoPCM"); 1073 HostCheckBoxSetting *gc = new HostCheckBoxSetting("StereoPCM"); 1067 1074 gc->setLabel(QObject::tr("Stereo PCM Only")); 1068 1075 gc->setValue(false); 1069 1076 gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder " … … HostCheckBox *AudioAdvancedSettings::MPCM() 1073 1080 return gc; 1074 1081 } 1075 1082 1076 HostCheckBox *AudioAdvancedSettings::SRCQualityOverride()1083 HostCheckBoxSetting *AudioAdvancedSettings::SRCQualityOverride() 1077 1084 { 1078 HostCheckBox *gc = new HostCheckBox("SRCQualityOverride");1085 HostCheckBoxSetting *gc = new HostCheckBoxSetting("SRCQualityOverride"); 1079 1086 gc->setLabel(QObject::tr("Override SRC quality")); 1080 1087 gc->setValue(false); 1081 1088 gc->setHelpText(QObject::tr("Enable to override audio sample rate " … … HostCheckBox *AudioAdvancedSettings::SRCQualityOverride() 1083 1090 return gc; 1084 1091 } 1085 1092 1086 HostComboBox *AudioAdvancedSettings::SRCQuality()1093 HostComboBoxSetting *AudioAdvancedSettings::SRCQuality() 1087 1094 { 1088 HostComboBox *gc = new HostComboBox("SRCQuality", false);1095 HostComboBoxSetting *gc = new HostComboBoxSetting("SRCQuality", false); 1089 1096 gc->setLabel(QObject::tr("Sample rate conversion")); 1090 1097 gc->addSelection(QObject::tr("Disabled"), "-1"); 1091 1098 gc->addSelection(QObject::tr("Fastest"), "0"); … … HostComboBox *AudioAdvancedSettings::SRCQuality() 1098 1105 return gc; 1099 1106 } 1100 1107 1101 HostCheckBox *AudioAdvancedSettings::Audio48kOverride()1108 HostCheckBoxSetting *AudioAdvancedSettings::Audio48kOverride() 1102 1109 { 1103 HostCheckBox *gc = new HostCheckBox("Audio48kOverride");1110 HostCheckBoxSetting *gc = new HostCheckBoxSetting("Audio48kOverride"); 1104 1111 gc->setLabel(QObject::tr("Force audio device output to 48kHz")); 1105 1112 gc->setValue(false); 1106 1113 gc->setHelpText(QObject::tr("Force audio sample rate to 48kHz. " … … HostCheckBox *AudioAdvancedSettings::Audio48kOverride() 1109 1116 return gc; 1110 1117 } 1111 1118 1112 HostCheckBox *AudioAdvancedSettings::PassThroughOverride()1119 HostCheckBoxSetting *AudioAdvancedSettings::PassThroughOverride() 1113 1120 { 1114 HostCheckBox *gc = new HostCheckBox("PassThruDeviceOverride");1121 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PassThruDeviceOverride"); 1115 1122 gc->setLabel(QObject::tr("Separate digital output device")); 1116 1123 gc->setValue(false); 1117 1124 gc->setHelpText(QObject::tr("Use a distinct digital output device from " … … HostCheckBox *AudioAdvancedSettings::PassThroughOverride() 1120 1127 return gc; 1121 1128 } 1122 1129 1123 HostComboBox *AudioAdvancedSettings::PassThroughOutputDevice()1130 HostComboBoxSetting *AudioAdvancedSettings::PassThroughOutputDevice() 1124 1131 { 1125 HostComboBox *gc = new HostComboBox("PassThruOutputDevice", true);1132 HostComboBoxSetting *gc = new HostComboBoxSetting("PassThruOutputDevice", true); 1126 1133 1127 1134 gc->setLabel(QObject::tr("Digital output device")); 1128 1135 gc->addSelection(QObject::tr("Default"), "Default"); … … HostComboBox *AudioAdvancedSettings::PassThroughOutputDevice() 1141 1148 return gc; 1142 1149 } 1143 1150 1144 HostCheckBox *AudioAdvancedSettings::SPDIFRateOverride()1151 HostCheckBoxSetting *AudioAdvancedSettings::SPDIFRateOverride() 1145 1152 { 1146 HostCheckBox *gc = new HostCheckBox("SPDIFRateOverride");1153 HostCheckBoxSetting *gc = new HostCheckBoxSetting("SPDIFRateOverride"); 1147 1154 gc->setLabel(QObject::tr("SPDIF 48k rate override")); 1148 1155 gc->setValue(false); 1149 1156 gc->setHelpText(QObject::tr("ALSA only. By default, let ALSA determine " … … HostCheckBox *AudioAdvancedSettings::SPDIFRateOverride() 1153 1160 return gc; 1154 1161 } 1155 1162 1156 HostCheckBox *AudioAdvancedSettings::HBRPassthrough()1163 HostCheckBoxSetting *AudioAdvancedSettings::HBRPassthrough() 1157 1164 { 1158 HostCheckBox *gc = new HostCheckBox("HBRPassthru");1165 HostCheckBoxSetting *gc = new HostCheckBoxSetting("HBRPassthru"); 1159 1166 gc->setLabel(QObject::tr("HBR passthrough support")); 1160 1167 gc->setValue(true); 1161 1168 gc->setHelpText(QObject::tr("HBR support is required for TrueHD and DTS-HD " … … HostCheckBox *AudioAdvancedSettings::HBRPassthrough() 1169 1176 1170 1177 AudioAdvancedSettings::AudioAdvancedSettings(bool mpcm) 1171 1178 { 1172 ConfigurationGroup *settings3 =1173 new HorizontalConfigurationGroup(false, false);1174 1179 1175 1180 m_PassThroughOverride = PassThroughOverride(); 1176 TriggeredItem *sub3 = 1177 new TriggeredItem(m_PassThroughOverride, PassThroughOutputDevice()); 1178 settings3->addChild(m_PassThroughOverride); 1179 settings3->addChild(sub3); 1180 1181 ConfigurationGroup *settings4 = 1182 new HorizontalConfigurationGroup(false, false); 1183 Setting *srcqualityoverride = SRCQualityOverride(); 1184 TriggeredItem *sub4 = 1185 new TriggeredItem(srcqualityoverride, SRCQuality()); 1186 settings4->addChild(srcqualityoverride); 1187 settings4->addChild(sub4); 1188 1189 ConfigurationGroup *settings5 = 1190 new HorizontalConfigurationGroup(false, false); 1191 settings5->addChild(Audio48kOverride()); 1192 #if USING_ALSA 1193 settings5->addChild(SPDIFRateOverride()); 1194 #endif 1181 m_PassThroughOverride->addTargetedChild("1",PassThroughOutputDevice()); 1182 addChild(m_PassThroughOverride); 1195 1183 1196 ConfigurationGroup *settings6 = 1197 new HorizontalConfigurationGroup(false, false); 1198 settings6->addChild(HBRPassthrough()); 1184 StandardSetting *srcqualityoverride = SRCQualityOverride(); 1185 srcqualityoverride->addTargetedChild("1",SRCQuality()); 1199 1186 1200 addChild( settings4);1201 addChild(settings5); 1202 addChild( settings3);1203 addChild(settings6); 1187 addChild(Audio48kOverride()); 1188 #if USING_ALSA 1189 addChild(SPDIFRateOverride()); 1190 #endif 1204 1191 1205 if (mpcm) 1206 { 1207 ConfigurationGroup *settings7; 1208 settings7 = new HorizontalConfigurationGroup(false, false); 1209 settings7->addChild(MPCM()); 1210 addChild(settings7); 1211 } 1192 addChild(HBRPassthrough()); 1193 StandardSetting * setting = MPCM(); 1194 addChild(setting); 1195 setting->setEnabled(mpcm); 1212 1196 } 1213 1197 1214 1198 AudioAdvancedSettingsGroup::AudioAdvancedSettingsGroup(bool mpcm) 1215 1199 { 1216 addChild(new AudioAdvancedSettings(mpcm));1200 // addChild(new AudioAdvancedSettings(mpcm)); 1217 1201 } 1218 1202 // vim:set sw=4 ts=4 expandtab: -
mythtv/programs/mythfrontend/audiogeneralsettings.h
diff --git a/mythtv/programs/mythfrontend/audiogeneralsettings.h b/mythtv/programs/mythfrontend/audiogeneralsettings.h index fe31bd8..b7221d6 100644
a b 12 12 #include "audiooutput.h" 13 13 #include "mythcontext.h" 14 14 #include "settings.h" 15 #include "standardsettings.h" 15 16 #include "mthread.h" 16 17 17 18 class AudioDeviceComboBox; 18 19 19 class AudioConfigSettings : public VerticalConfigurationGroup20 class AudioConfigSettings : public GroupSetting 20 21 { 21 22 Q_OBJECT 22 23 23 24 public: 24 AudioConfigSettings( ConfigurationWizard *);25 AudioConfigSettings(); 25 26 26 27 typedef QMap<QString,AudioOutput::AudioDeviceConfig> ADCMap; 27 28 … … class AudioConfigSettings : public VerticalConfigurationGroup 37 38 38 39 private: 39 40 AudioDeviceComboBox *OutputDevice(); 40 HostComboBox *MaxAudioChannels(); 41 HostCheckBox *AudioUpmix(); 42 HostComboBox *AudioUpmixType(); 43 HostCheckBox *AC3PassThrough(); 44 HostCheckBox *DTSPassThrough(); 45 HostCheckBox *EAC3PassThrough(); 46 HostCheckBox *TrueHDPassThrough(); 47 HostCheckBox *DTSHDPassThrough(); 41 HostComboBoxSetting *MaxAudioChannels(); 42 HostCheckBoxSetting *AudioUpmix(); 43 HostComboBoxSetting *AudioUpmixType(); 44 HostCheckBoxSetting *AC3PassThrough(); 45 HostCheckBoxSetting *DTSPassThrough(); 46 HostCheckBoxSetting *EAC3PassThrough(); 47 HostCheckBoxSetting *TrueHDPassThrough(); 48 HostCheckBoxSetting *DTSHDPassThrough(); 49 HostCheckBoxSetting *MythControlsVolume(); 50 HostComboBoxSetting *MixerDevice(); 51 HostComboBoxSetting *MixerControl(); 52 HostSpinBoxSetting *MixerVolume(); 53 HostSpinBoxSetting *PCMVolume(); 48 54 bool CheckPassthrough(); 49 55 50 ConfigurationGroup*m_cgsettings;56 GroupSetting *m_cgsettings; 51 57 AudioDeviceComboBox *m_OutputDevice; 52 HostComboBox *m_MaxAudioChannels;53 HostCheckBox *m_AudioUpmix;54 HostComboBox *m_AudioUpmixType;55 CheckBoxSetting *m_triggerDigital;56 HostCheckBox *m_AC3PassThrough;57 HostCheckBox *m_DTSPassThrough;58 HostCheckBox *m_EAC3PassThrough;59 HostCheckBox *m_TrueHDPassThrough;60 HostCheckBox *m_DTSHDPassThrough;58 HostComboBoxSetting *m_MaxAudioChannels; 59 HostCheckBoxSetting *m_AudioUpmix; 60 HostComboBoxSetting *m_AudioUpmixType; 61 GroupSetting *m_triggerDigital; 62 HostCheckBoxSetting *m_AC3PassThrough; 63 HostCheckBoxSetting *m_DTSPassThrough; 64 HostCheckBoxSetting *m_EAC3PassThrough; 65 HostCheckBoxSetting *m_TrueHDPassThrough; 66 HostCheckBoxSetting *m_DTSHDPassThrough; 61 67 ADCMap audiodevs; 62 68 AudioOutput::ADCVect devices; 63 69 QMutex slotlock; 64 ConfigurationWizard*m_parent;70 GroupSetting *m_parent; 65 71 }; 66 72 67 class AudioDeviceComboBox : public HostComboBox 73 class AudioDeviceComboBox : public HostComboBoxSetting 68 74 { 69 75 Q_OBJECT 70 76 public: 71 77 AudioDeviceComboBox(AudioConfigSettings*); 72 78 void AudioRescan(); 73 79 80 virtual void edit(MythScreenType * screen); 81 74 82 private slots: 75 83 void AudioDescriptionHelp(const QString&); 76 84 … … class AudioDeviceComboBox : public HostComboBox 78 86 AudioConfigSettings *m_parent; 79 87 }; 80 88 81 class AudioMixerSettings : public TriggeredConfigurationGroup89 class AudioMixerSettings : public GroupSetting 82 90 { 83 91 public: 84 92 AudioMixerSettings(); 85 93 private: 86 HostCheckBox *MythControlsVolume(); 87 HostComboBox *MixerDevice(); 88 HostComboBox *MixerControl(); 89 HostSlider *MixerVolume(); 90 HostSlider *PCMVolume(); 91 static const char *MixerControlControls[]; 92 }; 93 94 class AudioGeneralSettings : public ConfigurationWizard 95 { 96 public: 97 AudioGeneralSettings(); 94 HostCheckBoxSetting *MythControlsVolume(); 95 HostComboBoxSetting *MixerDevice(); 96 HostComboBoxSetting *MixerControl(); 97 HostSpinBoxSetting *MixerVolume(); 98 HostSpinBoxSetting *PCMVolume(); 99 static const char *MixerControlControls[]; 98 100 }; 99 101 100 class AudioAdvancedSettings : public VerticalConfigurationGroup102 class AudioAdvancedSettings : public GroupSetting 101 103 { 102 104 public: 103 105 AudioAdvancedSettings(bool mpcm); 104 106 105 HostCheckBox *MPCM();106 HostCheckBox *SRCQualityOverride();107 HostComboBox *SRCQuality();108 HostCheckBox *Audio48kOverride();109 HostCheckBox *PassThroughOverride();110 HostComboBox *PassThroughOutputDevice();111 HostCheckBox *SPDIFRateOverride();112 HostCheckBox *HBRPassthrough();113 114 CheckBoxSetting *m_triggerMPCM;115 HostCheckBox *m_MPCM;116 HostCheckBox *m_PassThroughOverride;107 HostCheckBoxSetting *MPCM(); 108 HostCheckBoxSetting *SRCQualityOverride(); 109 HostComboBoxSetting *SRCQuality(); 110 HostCheckBoxSetting *Audio48kOverride(); 111 HostCheckBoxSetting *PassThroughOverride(); 112 HostComboBoxSetting *PassThroughOutputDevice(); 113 HostCheckBoxSetting *SPDIFRateOverride(); 114 HostCheckBoxSetting *HBRPassthrough(); 115 116 CheckBoxSetting *m_triggerMPCM; 117 HostCheckBoxSetting *m_MPCM; 118 HostCheckBoxSetting *m_PassThroughOverride; 117 119 }; 118 120 119 121 class AudioAdvancedSettingsGroup : public ConfigurationWizard -
mythtv/programs/mythfrontend/globalsettings.cpp
diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp index 7e6fad3..c8062bf 100644
a b 3 3 4 4 // Standard UNIX C headers 5 5 #include <unistd.h> 6 #include <cmath> 6 7 #include <fcntl.h> 7 8 #include <sys/types.h> 8 9 #include <sys/stat.h> … … 39 40 #include "mythdirs.h" 40 41 #include "mythuihelper.h" 41 42 42 static HostCheckBox *DecodeExtraAudio()43 static HostCheckBoxSetting *DecodeExtraAudio() 43 44 { 44 HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");45 HostCheckBoxSetting *gc = new HostCheckBoxSetting("DecodeExtraAudio"); 45 46 gc->setLabel(QObject::tr("Extra audio buffering")); 46 47 gc->setValue(true); 47 48 gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing " … … static HostCheckBox *DecodeExtraAudio() 53 54 return gc; 54 55 } 55 56 56 static HostComboBox *PIPLocationComboBox()57 static HostComboBoxSetting *PIPLocationComboBox() 57 58 { 58 HostComboBox *gc = new HostComboBox("PIPLocation");59 HostComboBoxSetting *gc = new HostComboBoxSetting("PIPLocation"); 59 60 gc->setLabel(QObject::tr("PIP video location")); 60 61 for (uint loc = 0; loc < kPIP_END; ++loc) 61 62 gc->addSelection(toString((PIPLocation) loc), QString::number(loc)); … … static HostComboBox *PIPLocationComboBox() 63 64 return gc; 64 65 } 65 66 66 static HostComboBox *DisplayRecGroup()67 static HostComboBoxSetting *DisplayRecGroup() 67 68 { 68 HostComboBox *gc = new HostComboBox("DisplayRecGroup");69 HostComboBoxSetting *gc = new HostComboBoxSetting("DisplayRecGroup"); 69 70 gc->setLabel(QObject::tr("Default group filter to apply")); 70 71 71 72 gc->addSelection(QObject::tr("All Programs"), QString("All Programs")); … … static HostComboBox *DisplayRecGroup() 102 103 return gc; 103 104 } 104 105 105 static HostCheckBox *QueryInitialFilter()106 static HostCheckBoxSetting *QueryInitialFilter() 106 107 { 107 HostCheckBox *gc = new HostCheckBox("QueryInitialFilter");108 HostCheckBoxSetting *gc = new HostCheckBoxSetting("QueryInitialFilter"); 108 109 gc->setLabel(QObject::tr("Always prompt for initial group filter")); 109 110 gc->setValue(false); 110 111 gc->setHelpText(QObject::tr("If enabled, always prompt the user for the " … … static HostCheckBox *QueryInitialFilter() 113 114 return gc; 114 115 } 115 116 116 static HostCheckBox *RememberRecGroup()117 static HostCheckBoxSetting *RememberRecGroup() 117 118 { 118 HostCheckBox *gc = new HostCheckBox("RememberRecGroup");119 HostCheckBoxSetting *gc = new HostCheckBoxSetting("RememberRecGroup"); 119 120 gc->setLabel(QObject::tr("Save current group filter when changed")); 120 121 gc->setValue(true); 121 122 gc->setHelpText(QObject::tr("If enabled, remember the last selected filter " … … static HostCheckBox *RememberRecGroup() 124 125 return gc; 125 126 } 126 127 127 static HostCheckBox *UseGroupNameAsAllPrograms()128 static HostCheckBoxSetting *UseGroupNameAsAllPrograms() 128 129 { 129 HostCheckBox *gc = new HostCheckBox("DispRecGroupAsAllProg");130 HostCheckBoxSetting *gc = new HostCheckBoxSetting("DispRecGroupAsAllProg"); 130 131 gc->setLabel(QObject::tr("Show filter name instead of \"All Programs\"")); 131 132 gc->setValue(false); 132 133 gc->setHelpText(QObject::tr("If enabled, use the name of the display " … … static HostCheckBox *UseGroupNameAsAllPrograms() 135 136 return gc; 136 137 } 137 138 138 static HostCheckBox *PBBStartInTitle()139 static HostCheckBoxSetting *PBBStartInTitle() 139 140 { 140 HostCheckBox *gc = new HostCheckBox("PlaybackBoxStartInTitle");141 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackBoxStartInTitle"); 141 142 gc->setLabel(QObject::tr("Start in group list")); 142 143 gc->setValue(true); 143 144 gc->setHelpText(QObject::tr("If enabled, the focus will " … … static HostCheckBox *PBBStartInTitle() 146 147 return gc; 147 148 } 148 149 149 static HostCheckBox *SmartForward()150 static HostCheckBoxSetting *SmartForward() 150 151 { 151 HostCheckBox *gc = new HostCheckBox("SmartForward");152 HostCheckBoxSetting *gc = new HostCheckBoxSetting("SmartForward"); 152 153 gc->setLabel(QObject::tr("Smart fast forwarding")); 153 154 gc->setValue(false); 154 155 gc->setHelpText(QObject::tr("If enabled, then immediately after " … … static HostCheckBox *SmartForward() 157 158 return gc; 158 159 } 159 160 160 static HostCheckBox *ExactSeeking()161 static HostCheckBoxSetting *ExactSeeking() 161 162 { 162 HostCheckBox *gc = new HostCheckBox("ExactSeeking");163 HostCheckBoxSetting *gc = new HostCheckBoxSetting("ExactSeeking"); 163 164 gc->setLabel(QObject::tr("Seek to exact frame")); 164 165 gc->setValue(false); 165 166 gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but " … … static HostCheckBox *ExactSeeking() 167 168 return gc; 168 169 } 169 170 170 static GlobalComboBox *CommercialSkipMethod()171 static GlobalComboBoxSetting *CommercialSkipMethod() 171 172 { 172 GlobalComboBox *bc = new GlobalComboBox("CommercialSkipMethod");173 GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("CommercialSkipMethod"); 173 174 bc->setLabel(QObject::tr("Commercial detection method")); 174 175 bc->setHelpText(QObject::tr( 175 176 "This determines the method used by MythTV to " … … static GlobalComboBox *CommercialSkipMethod() 182 183 return bc; 183 184 } 184 185 185 static GlobalCheckBox *CommFlagFast()186 static GlobalCheckBoxSetting *CommFlagFast() 186 187 { 187 GlobalCheckBox *gc = new GlobalCheckBox("CommFlagFast");188 GlobalCheckBoxSetting *gc = new GlobalCheckBoxSetting("CommFlagFast"); 188 189 gc->setLabel(QObject::tr("Enable experimental speedup of commercial detection")); 189 190 gc->setValue(false); 190 191 gc->setHelpText(QObject::tr("If enabled, experimental commercial detection " … … static GlobalCheckBox *CommFlagFast() 192 193 return gc; 193 194 } 194 195 195 static HostComboBox *AutoCommercialSkip()196 static HostComboBoxSetting *AutoCommercialSkip() 196 197 { 197 HostComboBox *gc = new HostComboBox("AutoCommercialSkip");198 HostComboBoxSetting *gc = new HostComboBoxSetting("AutoCommercialSkip"); 198 199 gc->setLabel(QObject::tr("Automatically skip commercials")); 199 200 gc->addSelection(QObject::tr("Off"), "0"); 200 201 gc->addSelection(QObject::tr("Notify, but do not skip"), "2"); … … static HostComboBox *AutoCommercialSkip() 206 207 return gc; 207 208 } 208 209 209 static GlobalCheckBox *AutoMetadataLookup()210 static GlobalCheckBoxSetting *AutoMetadataLookup() 210 211 { 211 GlobalCheckBox *bc = new GlobalCheckBox("AutoMetadataLookup");212 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoMetadataLookup"); 212 213 bc->setLabel(QObject::tr("Run metadata lookup")); 213 214 bc->setValue(true); 214 215 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoMetadataLookup() 217 218 return bc; 218 219 } 219 220 220 static GlobalCheckBox *AutoCommercialFlag()221 static GlobalCheckBoxSetting *AutoCommercialFlag() 221 222 { 222 GlobalCheckBox *bc = new GlobalCheckBox("AutoCommercialFlag");223 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoCommercialFlag"); 223 224 bc->setLabel(QObject::tr("Run commercial detection")); 224 225 bc->setValue(true); 225 226 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoCommercialFlag() 228 229 return bc; 229 230 } 230 231 231 static GlobalCheckBox *AutoTranscode()232 static GlobalCheckBoxSetting *AutoTranscode() 232 233 { 233 GlobalCheckBox *bc = new GlobalCheckBox("AutoTranscode");234 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoTranscode"); 234 235 bc->setLabel(QObject::tr("Run transcoder")); 235 236 bc->setValue(false); 236 237 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoTranscode() 239 240 return bc; 240 241 } 241 242 242 static GlobalComboBox *DefaultTranscoder() 243 /*TODO This function is borrowed from RecordingProfile::fillSelections and sligthly modified 244 I will need to change the original to use a pure abstract class instead of SelectSetting 245 */ 246 void RecordingProfile_fillSelections(MythUIComboBoxSetting *setting, int group, 247 bool foldautodetect) 243 248 { 244 GlobalComboBox *bc = new GlobalComboBox("DefaultTranscoder"); 249 if (!group) 250 { 251 for (uint i = 0; !availProfiles[i].isEmpty(); i++) 252 setting->addSelection(availProfiles[i], availProfiles[i]); 253 return; 254 } 255 256 MSqlQuery result(MSqlQuery::InitCon()); 257 result.prepare( 258 "SELECT name, id " 259 "FROM recordingprofiles " 260 "WHERE profilegroup = :GROUP " 261 "ORDER BY id"); 262 result.bindValue(":GROUP", group); 263 264 if (!result.exec()) 265 { 266 MythDB::DBError("RecordingProfile::fillSelections 1", result); 267 return; 268 } 269 else if (!result.next()) 270 { 271 return; 272 } 273 274 if (group == RecordingProfile::TranscoderGroup && foldautodetect) 275 { 276 QString id = QString::number(RecordingProfile::TranscoderAutodetect); 277 setting->addSelection(QObject::tr("Autodetect"), id); 278 } 279 280 do 281 { 282 QString name = result.value(0).toString(); 283 QString id = result.value(1).toString(); 284 285 if (group == RecordingProfile::TranscoderGroup) 286 { 287 if (name == "RTjpeg/MPEG4" || name == "MPEG2") 288 { 289 if (!foldautodetect) 290 { 291 setting->addSelection( 292 QObject::tr("Autodetect from %1").arg(name), id); 293 } 294 } 295 else 296 { 297 setting->addSelection(name, id); 298 } 299 continue; 300 } 301 302 setting->addSelection(name, id); 303 } 304 while (result.next()); 305 } 306 307 static GlobalComboBoxSetting *DefaultTranscoder() 308 { 309 GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("DefaultTranscoder"); 245 310 bc->setLabel(QObject::tr("Default transcoder")); 246 RecordingProfile ::fillSelections(bc, RecordingProfile::TranscoderGroup,311 RecordingProfile_fillSelections(bc, RecordingProfile::TranscoderGroup, 247 312 true); 313 248 314 bc->setHelpText(QObject::tr("This is the default value used for the " 249 315 "transcoder setting when a new scheduled " 250 316 "recording is created.")); 251 317 return bc; 252 318 } 253 319 254 static GlobalSpinBox *DeferAutoTranscodeDays()320 static GlobalSpinBoxSetting *DeferAutoTranscodeDays() 255 321 { 256 GlobalSpinBox *gs = new GlobalSpinBox("DeferAutoTranscodeDays", 0, 365, 1);322 GlobalSpinBoxSetting *gs = new GlobalSpinBoxSetting("DeferAutoTranscodeDays", 0, 365, 1); 257 323 gs->setLabel(QObject::tr("Deferral days for auto transcode jobs")); 258 324 gs->setHelpText(QObject::tr("If non-zero, automatic transcode jobs will " 259 325 "be scheduled to run this many days after a recording " … … static GlobalSpinBox *DeferAutoTranscodeDays() 262 328 return gs; 263 329 } 264 330 265 static GlobalCheckBox *AutoRunUserJob(uint job_num)331 static GlobalCheckBoxSetting *AutoRunUserJob(uint job_num) 266 332 { 267 333 QString dbStr = QString("AutoRunUserJob%1").arg(job_num); 268 334 QString label = QObject::tr("Run user job #%1") 269 335 .arg(job_num); 270 GlobalCheckBox *bc = new GlobalCheckBox(dbStr);336 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting(dbStr); 271 337 bc->setLabel(label); 272 338 bc->setValue(false); 273 339 bc->setHelpText(QObject::tr("This is the default value used for the " … … static GlobalCheckBox *AutoRunUserJob(uint job_num) 278 344 return bc; 279 345 } 280 346 281 static GlobalCheckBox *AggressiveCommDetect()347 static GlobalCheckBoxSetting *AggressiveCommDetect() 282 348 { 283 GlobalCheckBox *bc = new GlobalCheckBox("AggressiveCommDetect");349 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AggressiveCommDetect"); 284 350 bc->setLabel(QObject::tr("Strict commercial detection")); 285 351 bc->setValue(true); 286 352 bc->setHelpText(QObject::tr("Enable stricter commercial detection code. " … … static GlobalCheckBox *AggressiveCommDetect() 288 354 return bc; 289 355 } 290 356 291 static HostSpinBox *CommRewindAmount()357 static HostSpinBoxSetting *CommRewindAmount() 292 358 { 293 HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);359 HostSpinBoxSetting *gs = new HostSpinBoxSetting("CommRewindAmount", 0, 10, 1); 294 360 gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)")); 295 361 gs->setHelpText(QObject::tr("MythTV will automatically rewind " 296 362 "this many seconds after performing a commercial skip.")); … … static HostSpinBox *CommRewindAmount() 298 364 return gs; 299 365 } 300 366 301 static HostSpinBox *CommNotifyAmount()367 static HostSpinBoxSetting *CommNotifyAmount() 302 368 { 303 HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);369 HostSpinBoxSetting *gs = new HostSpinBoxSetting("CommNotifyAmount", 0, 10, 1); 304 370 gs->setLabel(QObject::tr("Commercial skip notify amount (secs)")); 305 371 gs->setHelpText(QObject::tr("MythTV will act like a commercial " 306 372 "begins this many seconds early. This can be useful " … … static HostSpinBox *CommNotifyAmount() 310 376 return gs; 311 377 } 312 378 313 static GlobalSpinBox *MaximumCommercialSkip()379 static GlobalSpinBoxSetting *MaximumCommercialSkip() 314 380 { 315 GlobalSpinBox *bs = new GlobalSpinBox("MaximumCommercialSkip", 0, 3600, 10);381 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("MaximumCommercialSkip", 0, 3600, 10); 316 382 bs->setLabel(QObject::tr("Maximum commercial skip (secs)")); 317 383 bs->setHelpText(QObject::tr("MythTV will discourage long manual commercial " 318 384 "skips. Skips which are longer than this will require the " … … static GlobalSpinBox *MaximumCommercialSkip() 322 388 return bs; 323 389 } 324 390 325 static GlobalSpinBox *MergeShortCommBreaks()391 static GlobalSpinBoxSetting *MergeShortCommBreaks() 326 392 { 327 GlobalSpinBox *bs = new GlobalSpinBox("MergeShortCommBreaks", 0, 3600, 5);393 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("MergeShortCommBreaks", 0, 3600, 5); 328 394 bs->setLabel(QObject::tr("Merge short commercial breaks (secs)")); 329 395 bs->setHelpText(QObject::tr("Treat consecutive commercial breaks shorter " 330 396 "than this as one break when skipping forward. Useful if " … … static GlobalSpinBox *MergeShortCommBreaks() 334 400 return bs; 335 401 } 336 402 337 static GlobalSpinBox *AutoExpireExtraSpace()403 static GlobalSpinBoxSetting *AutoExpireExtraSpace() 338 404 { 339 GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireExtraSpace", 0, 200, 1);405 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireExtraSpace", 0, 200, 1); 340 406 bs->setLabel(QObject::tr("Extra disk space (GB)")); 341 407 bs->setHelpText(QObject::tr("Extra disk space (in gigabytes) beyond what " 342 408 "MythTV requires that you want to keep free on the " … … static GlobalSpinBox *AutoExpireExtraSpace() 345 411 return bs; 346 412 }; 347 413 348 static GlobalCheckBox *AutoExpireInsteadOfDelete() 349 { 350 GlobalCheckBox *cb = new GlobalCheckBox("AutoExpireInsteadOfDelete"); 351 cb->setLabel(QObject::tr("Auto-Expire instead of delete recording")); 352 cb->setValue(false); 353 cb->setHelpText(QObject::tr("If enabled, move deleted recordings to the " 354 "'Deleted' recgroup and turn on autoexpire " 355 "instead of deleting immediately.")); 356 return cb; 357 } 358 359 static GlobalSpinBox *DeletedMaxAge() 414 static GlobalSpinBoxSetting *DeletedMaxAge() 360 415 { 361 GlobalSpinBox *bs = new GlobalSpinBox("DeletedMaxAge", 0, 365, 1);416 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("DeletedMaxAge", 0, 365, 1); 362 417 bs->setLabel(QObject::tr("Deleted max age (days)")); 363 418 bs->setHelpText(QObject::tr("When set to a number greater than zero, " 364 419 "Auto-Expire will force expiration of Deleted recordings " … … static GlobalSpinBox *DeletedMaxAge() 367 422 return bs; 368 423 }; 369 424 370 static GlobalCheckBox *DeletedFifoOrder()425 static GlobalCheckBoxSetting *DeletedFifoOrder() 371 426 { 372 GlobalCheckBox *cb = new GlobalCheckBox("DeletedFifoOrder");427 GlobalCheckBoxSetting *cb = new GlobalCheckBoxSetting("DeletedFifoOrder"); 373 428 cb->setLabel(QObject::tr("Expire in deleted order")); 374 429 cb->setValue(false); 375 430 cb->setHelpText(QObject::tr( … … static GlobalCheckBox *DeletedFifoOrder() 378 433 return cb; 379 434 }; 380 435 381 class DeletedExpireOptions : public TriggeredConfigurationGroup 382 { 383 public: 384 DeletedExpireOptions() : 385 TriggeredConfigurationGroup(false, false, false, false) 386 { 387 setLabel(QObject::tr("DeletedExpireOptions")); 388 Setting* enabled = AutoExpireInsteadOfDelete(); 389 addChild(enabled); 390 setTrigger(enabled); 391 392 HorizontalConfigurationGroup* settings = 393 new HorizontalConfigurationGroup(false); 394 settings->addChild(DeletedFifoOrder()); 395 settings->addChild(DeletedMaxAge()); 396 addTarget("1", settings); 397 398 // show nothing if fillEnabled is off 399 addTarget("0", new HorizontalConfigurationGroup(true)); 400 }; 401 }; 436 static GlobalCheckBoxSetting *AutoExpireInsteadOfDelete() 437 { 438 GlobalCheckBoxSetting *cb = new GlobalCheckBoxSetting("AutoExpireInsteadOfDelete"); 439 cb->setLabel(QObject::tr("Auto-Expire instead of delete recording")); 440 cb->setValue(false); 441 cb->setHelpText(QObject::tr("If enabled, move deleted recordings to the " 442 "'Deleted' recgroup and turn on autoexpire " 443 "instead of deleting immediately.")); 402 444 403 static GlobalComboBox *AutoExpireMethod() 445 cb->addTargetedChild("1",DeletedFifoOrder()); 446 cb->addTargetedChild("1",DeletedMaxAge()); 447 return cb; 448 } 449 450 static GlobalComboBoxSetting *AutoExpireMethod() 404 451 { 405 GlobalComboBox *bc = new GlobalComboBox("AutoExpireMethod");452 GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("AutoExpireMethod"); 406 453 bc->setLabel(QObject::tr("Auto-Expire method")); 407 454 bc->addSelection(QObject::tr("Oldest show first"), "1"); 408 455 bc->addSelection(QObject::tr("Lowest priority first"), "2"); … … static GlobalComboBox *AutoExpireMethod() 414 461 return bc; 415 462 } 416 463 417 static GlobalCheckBox *AutoExpireWatchedPriority()464 static GlobalCheckBoxSetting *AutoExpireWatchedPriority() 418 465 { 419 GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireWatchedPriority");466 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoExpireWatchedPriority"); 420 467 bc->setLabel(QObject::tr("Watched before unwatched")); 421 468 bc->setValue(false); 422 469 bc->setHelpText(QObject::tr("If enabled, programs that have been marked as " … … static GlobalCheckBox *AutoExpireWatchedPriority() 425 472 return bc; 426 473 } 427 474 428 static GlobalSpinBox *AutoExpireDayPriority()475 static GlobalSpinBoxSetting *AutoExpireDayPriority() 429 476 { 430 GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireDayPriority", 1, 400, 1);477 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireDayPriority", 1, 400, 1); 431 478 bs->setLabel(QObject::tr("Priority weight")); 432 479 bs->setHelpText(QObject::tr("The number of days bonus a program gets for " 433 480 "each priority point. This is only used when the Weighted " … … static GlobalSpinBox *AutoExpireDayPriority() 436 483 return bs; 437 484 }; 438 485 439 static GlobalCheckBox *AutoExpireDefault()486 static GlobalCheckBoxSetting *AutoExpireDefault() 440 487 { 441 GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireDefault");488 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoExpireDefault"); 442 489 bc->setLabel(QObject::tr("Auto-Expire default")); 443 490 bc->setValue(true); 444 491 bc->setHelpText(QObject::tr("If enabled, any new recording schedules " … … static GlobalCheckBox *AutoExpireDefault() 447 494 return bc; 448 495 } 449 496 450 static GlobalSpinBox *AutoExpireLiveTVMaxAge()497 static GlobalSpinBoxSetting *AutoExpireLiveTVMaxAge() 451 498 { 452 GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireLiveTVMaxAge", 1, 365, 1);499 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireLiveTVMaxAge", 1, 365, 1); 453 500 bs->setLabel(QObject::tr("Live TV max age (days)")); 454 501 bs->setHelpText(QObject::tr("Auto-Expire will force expiration of Live " 455 502 "TV recordings when they are this many days old. Live TV " 456 503 "recordings may also be expired early if necessary to " 457 504 "free up disk space.")); 458 bs->setValue( 1);505 bs->setValue((int)1); 459 506 return bs; 460 507 }; 461 508 … … static GlobalSpinBox *MinRecordDiskThreshold() 474 521 } 475 522 #endif 476 523 477 static GlobalCheckBox *RerecordWatched()524 static GlobalCheckBoxSetting *RerecordWatched() 478 525 { 479 GlobalCheckBox *bc = new GlobalCheckBox("RerecordWatched");526 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("RerecordWatched"); 480 527 bc->setLabel(QObject::tr("Re-record watched")); 481 528 bc->setValue(false); 482 529 bc->setHelpText(QObject::tr("If enabled, programs that have been marked as " … … static GlobalCheckBox *RerecordWatched() 485 532 return bc; 486 533 } 487 534 488 static GlobalSpinBox *RecordPreRoll()535 static GlobalSpinBoxSetting *RecordPreRoll() 489 536 { 490 GlobalSpinBox *bs = new GlobalSpinBox("RecordPreRoll", 0, 600, 60, true);537 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("RecordPreRoll", 0, 600, 60, true); 491 538 bs->setLabel(QObject::tr("Time to record before start of show " 492 539 "(secs)")); 493 540 bs->setHelpText(QObject::tr("This global setting allows the recorder " … … static GlobalSpinBox *RecordPreRoll() 498 545 return bs; 499 546 } 500 547 501 static GlobalSpinBox *RecordOverTime()548 static GlobalSpinBoxSetting *RecordOverTime() 502 549 { 503 GlobalSpinBox *bs = new GlobalSpinBox("RecordOverTime", 0, 1800, 60, true);550 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("RecordOverTime", 0, 1800, 60, true); 504 551 bs->setLabel(QObject::tr("Time to record past end of show (secs)")); 505 552 bs->setValue(0); 506 553 bs->setHelpText(QObject::tr("This global setting allows the recorder " … … static GlobalSpinBox *RecordOverTime() 510 557 return bs; 511 558 } 512 559 513 static GlobalComboBox *OverTimeCategory()560 static GlobalComboBoxSetting *OverTimeCategory() 514 561 { 515 GlobalComboBox *gc = new GlobalComboBox("OverTimeCategory");562 GlobalComboBoxSetting *gc = new GlobalComboBoxSetting("OverTimeCategory"); 516 563 gc->setLabel(QObject::tr("Category of shows to be extended")); 517 564 gc->setHelpText(QObject::tr("For a special category (e.g. " 518 565 "\"Sports event\"), request that shows be autoextended. " 519 566 "Only works if a show's category can be determined.")); 520 567 521 568 MSqlQuery query(MSqlQuery::InitCon()); 569 //TODO We should not have any SQL here 522 570 query.prepare("SELECT DISTINCT category FROM program GROUP BY category;"); 523 571 524 572 gc->addSelection("", ""); 573 525 574 if (query.exec()) 526 575 { 527 576 while (query.next()) … … static GlobalComboBox *OverTimeCategory() 535 584 return gc; 536 585 } 537 586 538 static GlobalSpinBox *CategoryOverTime()587 static GlobalSpinBoxSetting *CategoryOverTime() 539 588 { 540 GlobalSpinBox *bs = new GlobalSpinBox("CategoryOverTime",589 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("CategoryOverTime", 541 590 0, 180, 60, true); 542 591 bs->setLabel(QObject::tr("Record past end of show (mins)")); 543 592 bs->setValue(30); … … static GlobalSpinBox *CategoryOverTime() 548 597 return bs; 549 598 } 550 599 551 static VerticalConfigurationGroup*CategoryOverTimeSettings()600 static GroupSetting *CategoryOverTimeSettings() 552 601 { 553 VerticalConfigurationGroup *vcg = 554 new VerticalConfigurationGroup(false, false); 555 602 GroupSetting *vcg = new GroupSetting(); 556 603 vcg->setLabel(QObject::tr("Category record over-time")); 557 vcg->setUseLabel(true);558 604 vcg->addChild(OverTimeCategory()); 559 605 vcg->addChild(CategoryOverTime()); 560 606 return vcg; … … void PlaybackProfileConfigs::triggerChanged(const QString &trig) 1248 1294 { 1249 1295 TriggeredConfigurationGroup::triggerChanged(trig); 1250 1296 } 1297 /* 1298 class PlaybackProfileConfigsButton : public StandardSetting, public TransientStorage 1299 { 1300 public: 1301 PlaybackProfileConfigsButton():StandardSetting(),TransientStorage() 1302 { 1303 setLabel() 1304 1305 }; 1251 1306 1252 static HostComboBox *PlayBoxOrdering() 1307 virtual void Load(void){StandardSetting::Load();}; 1308 virtual void Save(void){StandardSetting::Save();}; 1309 virtual bool edit(MythScreenType * screen); 1310 virtual void resultEdit(DialogCompletionEvent *dce, MythUIButtonListItem *item){}; 1311 virtual void applyChange(){}; 1312 };*/ 1313 1314 static HostComboBoxSetting *PlayBoxOrdering() 1253 1315 { 1254 1316 QString str[4] = 1255 1317 { … … static HostComboBox *PlayBoxOrdering() 1264 1326 "refers to sections (e.g. \"All Programs\") which list " 1265 1327 "multiple titles. Sections in parentheses are not affected."); 1266 1328 1267 HostComboBox *gc = new HostComboBox("PlayBoxOrdering");1329 HostComboBoxSetting *gc = new HostComboBoxSetting("PlayBoxOrdering"); 1268 1330 gc->setLabel(QObject::tr("Episode sort orderings")); 1269 1331 1270 1332 for (int i = 0; i < 4; ++i) … … static HostComboBox *PlayBoxOrdering() 1276 1338 return gc; 1277 1339 } 1278 1340 1279 static HostComboBox *PlayBoxEpisodeSort()1341 static HostComboBoxSetting *PlayBoxEpisodeSort() 1280 1342 { 1281 HostComboBox *gc = new HostComboBox("PlayBoxEpisodeSort");1343 HostComboBoxSetting *gc = new HostComboBoxSetting("PlayBoxEpisodeSort"); 1282 1344 gc->setLabel(QObject::tr("Sort episodes")); 1283 1345 gc->addSelection(QObject::tr("Record date"), "Date"); 1284 1346 gc->addSelection(QObject::tr("Season/Episode"), "Season"); … … static HostComboBox *PlayBoxEpisodeSort() 1288 1350 return gc; 1289 1351 } 1290 1352 1291 static HostSpinBox *FFRewReposTime()1353 static HostSpinBoxSetting *FFRewReposTime() 1292 1354 { 1293 HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);1355 HostSpinBoxSetting *gs = new HostSpinBoxSetting("FFRewReposTime", 0, 200, 5); 1294 1356 gs->setLabel(QObject::tr("Fast forward/rewind reposition amount")); 1295 1357 gs->setValue(100); 1296 1358 gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind " … … static HostSpinBox *FFRewReposTime() 1301 1363 return gs; 1302 1364 } 1303 1365 1304 static HostCheckBox *FFRewReverse()1366 static HostCheckBoxSetting *FFRewReverse() 1305 1367 { 1306 HostCheckBox *gc = new HostCheckBox("FFRewReverse");1368 HostCheckBoxSetting *gc = new HostCheckBoxSetting("FFRewReverse"); 1307 1369 gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind")); 1308 1370 gc->setValue(true); 1309 1371 gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key " … … static HostCheckBox *FFRewReverse() 1314 1376 return gc; 1315 1377 } 1316 1378 1317 static HostComboBox *MenuTheme()1379 static HostComboBoxSetting *MenuTheme() 1318 1380 { 1319 HostComboBox *gc = new HostComboBox("MenuTheme");1381 HostComboBoxSetting *gc = new HostComboBoxSetting("MenuTheme"); 1320 1382 gc->setLabel(QObject::tr("Menu theme")); 1321 1383 1322 1384 QList<ThemeInfo> themelist = GetMythUI()->GetThemes(THEME_MENU); … … static HostComboBox MUNUSED *DecodeVBIFormat() 1348 1410 return gc; 1349 1411 } 1350 1412 1351 static HostSpinBox *OSDCC708TextZoomPercentage(void)1413 static HostSpinBoxSetting *OSDCC708TextZoomPercentage(void) 1352 1414 { 1353 HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);1415 HostSpinBoxSetting *gs = new HostSpinBoxSetting("OSDCC708TextZoom", 50, 200, 5); 1354 1416 gs->setLabel(QObject::tr("Subtitle text zoom percentage")); 1355 1417 gs->setValue(100); 1356 1418 gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles.")); … … static HostSpinBox *OSDCC708TextZoomPercentage(void) 1358 1420 return gs; 1359 1421 } 1360 1422 1361 static HostComboBox *SubtitleFont()1423 static HostComboBoxSetting *SubtitleFont() 1362 1424 { 1363 HostComboBox *hcb = new HostComboBox("OSDSubFont");1425 HostComboBoxSetting *hcb = new HostComboBoxSetting("OSDSubFont"); 1364 1426 QFontDatabase db; 1365 1427 QStringList fonts = db.families(); 1366 1428 QStringList hide = db.families(QFontDatabase::Symbol); … … static HostComboBox *SubtitleFont() 1375 1437 return hcb; 1376 1438 } 1377 1439 1378 static HostComboBox *SubtitleCodec()1440 static HostComboBoxSetting *SubtitleCodec() 1379 1441 { 1380 HostComboBox *gc = new HostComboBox("SubtitleCodec");1442 HostComboBoxSetting *gc = new HostComboBoxSetting("SubtitleCodec"); 1381 1443 1382 1444 gc->setLabel(QObject::tr("Subtitle Codec")); 1383 1445 QList<QByteArray> list = QTextCodec::availableCodecs(); … … static HostComboBox *SubtitleCodec() 1390 1452 return gc; 1391 1453 } 1392 1454 1393 static HostComboBox *ChannelOrdering()1455 static HostComboBoxSetting *ChannelOrdering() 1394 1456 { 1395 HostComboBox *gc = new HostComboBox("ChannelOrdering");1457 HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelOrdering"); 1396 1458 gc->setLabel(QObject::tr("Channel ordering")); 1397 1459 gc->addSelection(QObject::tr("channel number"), "channum"); 1398 1460 gc->addSelection(QObject::tr("callsign"), "callsign"); 1399 1461 return gc; 1400 1462 } 1401 1463 1402 static HostSpinBox *VertScanPercentage()1464 static HostSpinBoxSetting *VertScanPercentage() 1403 1465 { 1404 HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);1466 HostSpinBoxSetting *gs = new HostSpinBoxSetting("VertScanPercentage", -100, 100, 1); 1405 1467 gs->setLabel(QObject::tr("Vertical scaling")); 1406 1468 gs->setValue(0); 1407 1469 gs->setHelpText(QObject::tr( … … static HostSpinBox *VertScanPercentage() 1410 1472 return gs; 1411 1473 } 1412 1474 1413 static HostSpinBox *HorizScanPercentage()1475 static HostSpinBoxSetting *HorizScanPercentage() 1414 1476 { 1415 HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);1477 HostSpinBoxSetting *gs = new HostSpinBoxSetting("HorizScanPercentage", -100, 100, 1); 1416 1478 gs->setLabel(QObject::tr("Horizontal scaling")); 1417 1479 gs->setValue(0); 1418 1480 gs->setHelpText(QObject::tr( … … static HostSpinBox *HorizScanPercentage() 1421 1483 return gs; 1422 1484 }; 1423 1485 1424 static HostSpinBox *XScanDisplacement()1486 static HostSpinBoxSetting *XScanDisplacement() 1425 1487 { 1426 HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);1488 HostSpinBoxSetting *gs = new HostSpinBoxSetting("XScanDisplacement", -50, 50, 1); 1427 1489 gs->setLabel(QObject::tr("Scan displacement (X)")); 1428 1490 gs->setValue(0); 1429 1491 gs->setHelpText(QObject::tr("Adjust this to move the image horizontally.")); 1430 1492 return gs; 1431 1493 } 1432 1494 1433 static HostSpinBox *YScanDisplacement()1495 static HostSpinBoxSetting *YScanDisplacement() 1434 1496 { 1435 HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);1497 HostSpinBoxSetting *gs = new HostSpinBoxSetting("YScanDisplacement", -50, 50, 1); 1436 1498 gs->setLabel(QObject::tr("Scan displacement (Y)")); 1437 1499 gs->setValue(0); 1438 1500 gs->setHelpText(QObject::tr("Adjust this to move the image vertically.")); 1439 1501 return gs; 1440 1502 }; 1441 1503 1442 static HostCheckBox *CCBackground()1504 static HostCheckBoxSetting *CCBackground() 1443 1505 { 1444 HostCheckBox *gc = new HostCheckBox("CCBackground");1506 HostCheckBoxSetting *gc = new HostCheckBoxSetting("CCBackground"); 1445 1507 gc->setLabel(QObject::tr("Black background for closed captioning")); 1446 1508 gc->setValue(false); 1447 1509 gc->setHelpText(QObject::tr( … … static HostCheckBox *CCBackground() 1451 1513 return gc; 1452 1514 } 1453 1515 1454 static HostCheckBox *DefaultCCMode()1516 static HostCheckBoxSetting *DefaultCCMode() 1455 1517 { 1456 HostCheckBox *gc = new HostCheckBox("DefaultCCMode");1518 HostCheckBoxSetting *gc = new HostCheckBoxSetting("DefaultCCMode"); 1457 1519 gc->setLabel(QObject::tr("Always display closed captioning or subtitles")); 1458 1520 gc->setValue(false); 1459 1521 gc->setHelpText(QObject::tr( … … static HostCheckBox *DefaultCCMode() 1464 1526 return gc; 1465 1527 } 1466 1528 1467 static HostCheckBox *PreferCC708()1529 static HostCheckBoxSetting *PreferCC708() 1468 1530 { 1469 HostCheckBox *gc = new HostCheckBox("Prefer708Captions");1531 HostCheckBoxSetting *gc = new HostCheckBoxSetting("Prefer708Captions"); 1470 1532 gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions")); 1471 1533 gc->setValue(true); 1472 1534 gc->setHelpText( … … static HostCheckBox *PreferCC708() 1477 1539 return gc; 1478 1540 } 1479 1541 1480 static HostCheckBox *EnableMHEG()1542 static HostCheckBoxSetting *EnableMHEG() 1481 1543 { 1482 HostCheckBox *gc = new HostCheckBox("EnableMHEG");1544 HostCheckBoxSetting *gc = new HostCheckBoxSetting("EnableMHEG"); 1483 1545 gc->setLabel(QObject::tr("Enable interactive TV")); 1484 1546 gc->setValue(false); 1485 1547 gc->setHelpText(QObject::tr( … … static HostCheckBox *EnableMHEG() 1489 1551 return gc; 1490 1552 } 1491 1553 1492 static HostCheckBox *PersistentBrowseMode()1554 static HostCheckBoxSetting *PersistentBrowseMode() 1493 1555 { 1494 HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");1556 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PersistentBrowseMode"); 1495 1557 gc->setLabel(QObject::tr("Always use browse mode in Live TV")); 1496 1558 gc->setValue(true); 1497 1559 gc->setHelpText( … … static HostCheckBox *PersistentBrowseMode() 1501 1563 return gc; 1502 1564 } 1503 1565 1504 static HostCheckBox *BrowseAllTuners()1566 static HostCheckBoxSetting *BrowseAllTuners() 1505 1567 { 1506 HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");1568 HostCheckBoxSetting *gc = new HostCheckBoxSetting("BrowseAllTuners"); 1507 1569 gc->setLabel(QObject::tr("Browse all channels")); 1508 1570 gc->setValue(false); 1509 1571 gc->setHelpText( … … static HostCheckBox *BrowseAllTuners() 1514 1576 return gc; 1515 1577 } 1516 1578 1517 static HostCheckBox *ClearSavedPosition()1579 static HostCheckBoxSetting *ClearSavedPosition() 1518 1580 { 1519 HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");1581 HostCheckBoxSetting *gc = new HostCheckBoxSetting("ClearSavedPosition"); 1520 1582 gc->setLabel(QObject::tr("Clear bookmark on playback")); 1521 1583 gc->setValue(true); 1522 1584 gc->setHelpText(QObject::tr("If enabled, automatically clear the " … … static HostCheckBox *ClearSavedPosition() 1526 1588 return gc; 1527 1589 } 1528 1590 1529 static HostCheckBox *AltClearSavedPosition()1591 static HostCheckBoxSetting *AltClearSavedPosition() 1530 1592 { 1531 HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");1593 HostCheckBoxSetting *gc = new HostCheckBoxSetting("AltClearSavedPosition"); 1532 1594 gc->setLabel(QObject::tr("Alternate clear and save bookmark")); 1533 1595 gc->setValue(true); 1534 1596 gc->setHelpText(QObject::tr("During playback the SELECT key " … … static HostCheckBox *AltClearSavedPosition() 1539 1601 return gc; 1540 1602 } 1541 1603 1542 static HostComboBox *PlaybackExitPrompt()1604 static HostComboBoxSetting *PlaybackExitPrompt() 1543 1605 { 1544 HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");1606 HostComboBoxSetting *gc = new HostComboBoxSetting("PlaybackExitPrompt"); 1545 1607 gc->setLabel(QObject::tr("Action on playback exit")); 1546 1608 gc->addSelection(QObject::tr("Just exit"), "0"); 1547 1609 gc->addSelection(QObject::tr("Save position and exit"), "2"); … … static HostComboBox *PlaybackExitPrompt() 1555 1617 return gc; 1556 1618 } 1557 1619 1558 static HostCheckBox *EndOfRecordingExitPrompt()1620 static HostCheckBoxSetting *EndOfRecordingExitPrompt() 1559 1621 { 1560 HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");1622 HostCheckBoxSetting *gc = new HostCheckBoxSetting("EndOfRecordingExitPrompt"); 1561 1623 gc->setLabel(QObject::tr("Prompt at end of recording")); 1562 1624 gc->setValue(false); 1563 1625 gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing " … … static HostCheckBox *EndOfRecordingExitPrompt() 1566 1628 return gc; 1567 1629 } 1568 1630 1569 static HostCheckBox *JumpToProgramOSD()1631 static HostCheckBoxSetting *JumpToProgramOSD() 1570 1632 { 1571 HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");1633 HostCheckBoxSetting *gc = new HostCheckBoxSetting("JumpToProgramOSD"); 1572 1634 gc->setLabel(QObject::tr("Jump to program OSD")); 1573 1635 gc->setValue(true); 1574 1636 gc->setHelpText(QObject::tr( … … static HostCheckBox *JumpToProgramOSD() 1580 1642 return gc; 1581 1643 } 1582 1644 1583 static HostCheckBox *ContinueEmbeddedTVPlay()1645 static HostCheckBoxSetting *ContinueEmbeddedTVPlay() 1584 1646 { 1585 HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");1647 HostCheckBoxSetting *gc = new HostCheckBoxSetting("ContinueEmbeddedTVPlay"); 1586 1648 gc->setLabel(QObject::tr("Continue playback when embedded")); 1587 1649 gc->setValue(false); 1588 1650 gc->setHelpText(QObject::tr( … … static HostCheckBox *ContinueEmbeddedTVPlay() 1593 1655 return gc; 1594 1656 } 1595 1657 1596 static HostCheckBox *AutomaticSetWatched()1658 static HostCheckBoxSetting *AutomaticSetWatched() 1597 1659 { 1598 HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");1660 HostCheckBoxSetting *gc = new HostCheckBoxSetting("AutomaticSetWatched"); 1599 1661 gc->setLabel(QObject::tr("Automatically mark a recording as watched")); 1600 1662 gc->setValue(false); 1601 1663 gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a " … … static HostCheckBox *AutomaticSetWatched() 1606 1668 return gc; 1607 1669 } 1608 1670 1609 static HostSpinBox *LiveTVIdleTimeout()1671 static HostSpinBoxSetting *LiveTVIdleTimeout() 1610 1672 { 1611 HostSpinBox *gs = new HostSpinBox("LiveTVIdleTimeout", 0, 3600, 1);1673 HostSpinBoxSetting *gs = new HostSpinBoxSetting("LiveTVIdleTimeout", 0, 3600, 1); 1612 1674 gs->setLabel(QObject::tr("Live TV idle timeout (mins)")); 1613 1675 gs->setValue(0); 1614 1676 gs->setHelpText(QObject::tr( … … static HostSpinBox *LiveTVIdleTimeout() 1643 1705 // return gc; 1644 1706 // } 1645 1707 1646 static HostCheckBox *UseVirtualKeyboard()1708 static HostCheckBoxSetting *UseVirtualKeyboard() 1647 1709 { 1648 HostCheckBox *gc = new HostCheckBox("UseVirtualKeyboard");1710 HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseVirtualKeyboard"); 1649 1711 gc->setLabel(QObject::tr("Use line edit virtual keyboards")); 1650 1712 gc->setValue(true); 1651 1713 gc->setHelpText(QObject::tr("If enabled, you can use a virtual keyboard " … … static HostCheckBox *UseVirtualKeyboard() 1654 1716 return gc; 1655 1717 } 1656 1718 1657 static HostComboBox *OverrideExitMenu()1719 static HostComboBoxSetting *OverrideExitMenu() 1658 1720 { 1659 HostComboBox *gc = new HostComboBox("OverrideExitMenu");1721 HostComboBoxSetting *gc = new HostComboBoxSetting("OverrideExitMenu"); 1660 1722 gc->setLabel(QObject::tr("Customize exit menu options")); 1661 1723 gc->addSelection(QObject::tr("Default"), "0"); 1662 1724 gc->addSelection(QObject::tr("Show quit"), "1"); … … static HostComboBox *OverrideExitMenu() 1671 1733 return gc; 1672 1734 } 1673 1735 1674 static Host LineEdit*RebootCommand()1736 static HostTextEditSetting *RebootCommand() 1675 1737 { 1676 Host LineEdit *ge = new HostLineEdit("RebootCommand");1738 HostTextEditSetting *ge = new HostTextEditSetting("RebootCommand"); 1677 1739 ge->setLabel(QObject::tr("Reboot command")); 1678 1740 ge->setValue(""); 1679 1741 ge->setHelpText(QObject::tr("Optional. Script to run if you select " … … static HostLineEdit *RebootCommand() 1683 1745 return ge; 1684 1746 } 1685 1747 1686 static Host LineEdit*HaltCommand()1748 static HostTextEditSetting *HaltCommand() 1687 1749 { 1688 Host LineEdit *ge = new HostLineEdit("HaltCommand");1750 HostTextEditSetting *ge = new HostTextEditSetting("HaltCommand"); 1689 1751 ge->setLabel(QObject::tr("Halt command")); 1690 1752 ge->setValue(""); 1691 1753 ge->setHelpText(QObject::tr("Optional. Script to run if you select " … … static HostLineEdit *HaltCommand() 1695 1757 return ge; 1696 1758 } 1697 1759 1698 static Host LineEdit*LircDaemonDevice()1760 static HostTextEditSetting *LircDaemonDevice() 1699 1761 { 1700 Host LineEdit *ge = new HostLineEdit("LircSocket");1762 HostTextEditSetting *ge = new HostTextEditSetting("LircSocket"); 1701 1763 ge->setLabel(QObject::tr("LIRC daemon socket")); 1702 1764 1703 1765 /* lircd socket moved from /dev/ to /var/run/lirc/ in lirc 0.8.6 */ … … static HostLineEdit *LircDaemonDevice() 1712 1774 return ge; 1713 1775 } 1714 1776 1715 static Host LineEdit*ScreenShotPath()1777 static HostTextEditSetting *ScreenShotPath() 1716 1778 { 1717 Host LineEdit *ge = new HostLineEdit("ScreenShotPath");1779 HostTextEditSetting *ge = new HostTextEditSetting("ScreenShotPath"); 1718 1780 ge->setLabel(QObject::tr("Screen shot path")); 1719 1781 ge->setValue("/tmp/"); 1720 1782 ge->setHelpText(QObject::tr("Path to screenshot storage location. Should be writable by the frontend")); 1721 1783 return ge; 1722 1784 } 1723 1785 1724 static Host LineEdit*SetupPinCode()1786 static HostTextEditSetting *SetupPinCode() 1725 1787 { 1726 Host LineEdit *ge = new HostLineEdit("SetupPinCode");1788 HostTextEditSetting *ge = new HostTextEditSetting("SetupPinCode"); 1727 1789 ge->setLabel(QObject::tr("Setup PIN code")); 1728 1790 ge->setHelpText(QObject::tr("This PIN is used to control access to the " 1729 1791 "setup menus. If you want to use this feature, then " … … static HostLineEdit *SetupPinCode() 1732 1794 return ge; 1733 1795 } 1734 1796 1735 static HostCheckBox *SetupPinCodeRequired()1797 static HostCheckBoxSetting *SetupPinCodeRequired() 1736 1798 { 1737 HostCheckBox *gc = new HostCheckBox("SetupPinCodeRequired");1799 HostCheckBoxSetting *gc = new HostCheckBoxSetting("SetupPinCodeRequired"); 1738 1800 gc->setLabel(QObject::tr("Require setup PIN") + " "); 1739 1801 gc->setValue(false); 1740 1802 gc->setHelpText(QObject::tr("If enabled, you will not be able to return " … … static HostCheckBox *SetupPinCodeRequired() 1743 1805 return gc; 1744 1806 } 1745 1807 1746 static HostComboBox *XineramaScreen()1808 static HostComboBoxSetting *XineramaScreen() 1747 1809 { 1748 HostComboBox *gc = new HostComboBox("XineramaScreen", false);1810 HostComboBoxSetting *gc = new HostComboBoxSetting("XineramaScreen"); 1749 1811 int num = MythDisplay::GetNumberXineramaScreens(); 1750 1812 for (int i=0; i<num; ++i) 1751 1813 gc->addSelection(QString::number(i), QString::number(i)); … … static HostComboBox *XineramaScreen() 1758 1820 } 1759 1821 1760 1822 1761 static HostComboBox *XineramaMonitorAspectRatio()1823 static HostComboBoxSetting *XineramaMonitorAspectRatio() 1762 1824 { 1763 HostComboBox *gc = new HostComboBox("XineramaMonitorAspectRatio");1825 HostComboBoxSetting *gc = new HostComboBoxSetting("XineramaMonitorAspectRatio"); 1764 1826 gc->setLabel(QObject::tr("Monitor aspect ratio")); 1765 1827 gc->addSelection(QObject::tr("4:3"), "1.3333"); 1766 1828 gc->addSelection(QObject::tr("16:9"), "1.7777"); … … static HostComboBox *XineramaMonitorAspectRatio() 1771 1833 return gc; 1772 1834 } 1773 1835 1774 static HostComboBox *LetterboxingColour()1836 static HostComboBoxSetting *LetterboxingColour() 1775 1837 { 1776 HostComboBox *gc = new HostComboBox("LetterboxColour");1838 HostComboBoxSetting *gc = new HostComboBoxSetting("LetterboxColour"); 1777 1839 gc->setLabel(QObject::tr("Letterboxing color")); 1778 1840 for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m) 1779 1841 gc->addSelection(toString((LetterBoxColour)m), QString::number(m)); … … static HostComboBox *LetterboxingColour() 1786 1848 return gc; 1787 1849 } 1788 1850 1789 static HostComboBox *AspectOverride()1851 static HostComboBoxSetting *AspectOverride() 1790 1852 { 1791 HostComboBox *gc = new HostComboBox("AspectOverride");1853 HostComboBoxSetting *gc = new HostComboBoxSetting("AspectOverride"); 1792 1854 gc->setLabel(QObject::tr("Video aspect override")); 1793 1855 for (int m = kAspect_Off; m < kAspect_END; ++m) 1794 1856 gc->addSelection(toString((AspectOverrideMode)m), QString::number(m)); … … static HostComboBox *AspectOverride() 1799 1861 return gc; 1800 1862 } 1801 1863 1802 static HostComboBox *AdjustFill()1864 static HostComboBoxSetting *AdjustFill() 1803 1865 { 1804 HostComboBox *gc = new HostComboBox("AdjustFill");1866 HostComboBoxSetting *gc = new HostComboBoxSetting("AdjustFill"); 1805 1867 gc->setLabel(QObject::tr("Zoom")); 1806 1868 for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m) 1807 1869 gc->addSelection(toString((AdjustFillMode)m), QString::number(m)); … … static HostComboBox *AdjustFill() 1817 1879 1818 1880 // Theme settings 1819 1881 1820 static HostSpinBox *GuiWidth()1882 static HostSpinBoxSetting *GuiWidth() 1821 1883 { 1822 HostSpinBox *gs = new HostSpinBox("GuiWidth", 0, 1920, 8, true);1884 HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiWidth", 0, 1920, 8, true); 1823 1885 gs->setLabel(QObject::tr("GUI width (pixels)")); 1824 1886 gs->setValue(0); 1825 1887 gs->setHelpText(QObject::tr("The width of the GUI. Do not make the GUI " … … static HostSpinBox *GuiWidth() 1828 1890 return gs; 1829 1891 } 1830 1892 1831 static HostSpinBox *GuiHeight()1893 static HostSpinBoxSetting *GuiHeight() 1832 1894 { 1833 HostSpinBox *gs = new HostSpinBox("GuiHeight", 0, 1600, 8, true);1895 HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiHeight", 0, 1600, 8, true); 1834 1896 gs->setLabel(QObject::tr("GUI height (pixels)")); 1835 1897 gs->setValue(0); 1836 1898 gs->setHelpText(QObject::tr("The height of the GUI. Do not make the GUI " … … static HostSpinBox *GuiHeight() 1839 1901 return gs; 1840 1902 } 1841 1903 1842 static HostSpinBox *GuiOffsetX()1904 static HostSpinBoxSetting *GuiOffsetX() 1843 1905 { 1844 HostSpinBox *gs = new HostSpinBox("GuiOffsetX", -3840, 3840, 32, true);1906 HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiOffsetX", -3840, 3840, 32, true); 1845 1907 gs->setLabel(QObject::tr("GUI X offset")); 1846 1908 gs->setValue(0); 1847 1909 gs->setHelpText(QObject::tr("The horizontal offset where the GUI will be " … … static HostSpinBox *GuiOffsetX() 1849 1911 return gs; 1850 1912 } 1851 1913 1852 static HostSpinBox *GuiOffsetY()1914 static HostSpinBoxSetting *GuiOffsetY() 1853 1915 { 1854 HostSpinBox *gs = new HostSpinBox("GuiOffsetY", -1600, 1600, 8, true);1916 HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiOffsetY", -1600, 1600, 8, true); 1855 1917 gs->setLabel(QObject::tr("GUI Y offset")); 1856 1918 gs->setValue(0); 1857 1919 gs->setHelpText(QObject::tr("The vertical offset where the GUI will be " … … static HostSpinBox *DisplaySizeHeight() 1883 1945 } 1884 1946 #endif 1885 1947 1886 static HostCheckBox *GuiSizeForTV()1948 static HostCheckBoxSetting *GuiSizeForTV() 1887 1949 { 1888 HostCheckBox *gc = new HostCheckBox("GuiSizeForTV");1950 HostCheckBoxSetting *gc = new HostCheckBoxSetting("GuiSizeForTV"); 1889 1951 gc->setLabel(QObject::tr("Use GUI size for TV playback")); 1890 1952 gc->setValue(true); 1891 1953 gc->setHelpText(QObject::tr("If enabled, use the above size for TV, " … … static HostCheckBox *GuiSizeForTV() 1894 1956 } 1895 1957 1896 1958 #if defined(USING_XRANDR) || CONFIG_DARWIN 1897 static HostCheckBox *UseVideoModes()1898 {1899 HostCheckBox *gc = new HostCheckBox("UseVideoModes");1900 gc->setLabel(QObject::tr("Separate video modes for GUI and TV playback"));1901 gc->setValue(false);1902 gc->setHelpText(QObject::tr("Switch X Window video modes for TV. "1903 "Requires \"xrandr\" support."));1904 return gc;1905 }1906 1959 1907 static HostSpinBox *VidModeWidth(int idx)1960 static HostSpinBoxSetting *VidModeWidth(int idx) 1908 1961 { 1909 HostSpinBox *gs = new HostSpinBox(QString("VidModeWidth%1").arg(idx),1962 HostSpinBoxSetting *gs = new HostSpinBoxSetting(QString("VidModeWidth%1").arg(idx), 1910 1963 0, 1920, 16, true); 1911 1964 gs->setLabel((idx<1) ? QObject::tr("In X"): ""); 1912 gs->setLabelAboveWidget(idx<1);1913 1965 gs->setValue(0); 1914 1966 gs->setHelpText(QObject::tr("Horizontal resolution of video " 1915 1967 "which needs a special output resolution.")); 1916 1968 return gs; 1917 1969 } 1918 1970 1919 static HostSpinBox *VidModeHeight(int idx)1971 static HostSpinBoxSetting *VidModeHeight(int idx) 1920 1972 { 1921 HostSpinBox *gs = new HostSpinBox(QString("VidModeHeight%1").arg(idx),1973 HostSpinBoxSetting *gs = new HostSpinBoxSetting(QString("VidModeHeight%1").arg(idx), 1922 1974 0, 1080, 16, true); 1923 1975 gs->setLabel((idx<1) ? QObject::tr("In Y"): ""); 1924 gs->setLabelAboveWidget(idx<1);1925 1976 gs->setValue(0); 1926 1977 gs->setHelpText(QObject::tr("Vertical resolution of video " 1927 1978 "which needs a special output resolution.")); 1928 1979 return gs; 1929 1980 } 1930 1981 1931 static HostComboBox *GuiVidModeResolution()1982 static HostComboBoxSetting *GuiVidModeResolution() 1932 1983 { 1933 HostComboBox *gc = new HostComboBox("GuiVidModeResolution");1984 HostComboBoxSetting *gc = new HostComboBoxSetting("GuiVidModeResolution"); 1934 1985 gc->setLabel(QObject::tr("GUI")); 1935 gc->setLabelAboveWidget(true);1936 1986 gc->setHelpText(QObject::tr("Resolution of screen " 1937 1987 "when not watching a video.")); 1938 1988 … … static HostComboBox *GuiVidModeResolution() 1961 2011 return gc; 1962 2012 } 1963 2013 1964 static HostComboBox *TVVidModeResolution(int idx=-1)2014 static HostComboBoxSetting *TVVidModeResolution(int idx=-1) 1965 2015 { 1966 2016 QString dhelp = QObject::tr("Default screen resolution " 1967 2017 "when watching a video."); … … static HostComboBox *TVVidModeResolution(int idx=-1) 1970 2020 1971 2021 QString qstr = (idx<0) ? "TVVidModeResolution" : 1972 2022 QString("TVVidModeResolution%1").arg(idx); 1973 HostComboBox *gc = new HostComboBox(qstr);2023 HostComboBoxSetting *gc = new HostComboBoxSetting(qstr); 1974 2024 QString lstr = (idx<0) ? QObject::tr("Video output") : 1975 2025 ((idx<1) ? QObject::tr("Output") : ""); 1976 2026 QString hstr = (idx<0) ? dhelp : ohelp; 1977 2027 1978 2028 gc->setLabel(lstr); 1979 gc->setLabelAboveWidget(idx<1);1980 2029 gc->setHelpText(hstr); 1981 2030 1982 2031 const vector<DisplayResScreen> scr = GetVideoModes(); … … static HostComboBox *TVVidModeResolution(int idx=-1) 1988 2037 return gc; 1989 2038 } 1990 2039 1991 static HostRefreshRateComboBox *TVVidModeRefreshRate(int idx=-1) 2040 2041 void HostRefreshRateComboBoxSetting::ChangeResolution(const QString& resolution) 2042 { 2043 clearSelections(); 2044 2045 const vector<double> list = GetRefreshRates(resolution); 2046 addSelection(QObject::tr("Auto"), "0"); 2047 int hz50 = -1, hz60 = -1; 2048 for (uint i=0; i<list.size(); ++i) 2049 { 2050 QString sel = QString::number((double) list[i],'f', 3); 2051 addSelection(sel+" Hz", sel); 2052 hz50 = (fabs(50.0 - list[i]) < 0.01) ? i : hz50; 2053 hz60 = (fabs(60.0 - list[i]) < 0.01) ? i : hz60; 2054 } 2055 2056 setValue(0); 2057 if ("640x480" == resolution || "720x480" == resolution) 2058 setValue(hz60+1); 2059 if ("640x576" == resolution || "720x576" == resolution) 2060 setValue(hz50+1); 2061 2062 setEnabled(list.size()); 2063 } 2064 2065 const vector<double> HostRefreshRateComboBoxSetting::GetRefreshRates(const QString &res) 2066 { 2067 QStringList slist = res.split("x"); 2068 int w = 0, h = 0; 2069 bool ok0 = false, ok1 = false; 2070 if (2 == slist.size()) 2071 { 2072 w = slist[0].toInt(&ok0); 2073 h = slist[1].toInt(&ok1); 2074 } 2075 2076 DisplayRes *display_res = DisplayRes::GetDisplayRes(); 2077 if (display_res && ok0 && ok1) 2078 return display_res->GetRefreshRates(w, h); 2079 2080 vector<double> list; 2081 return list; 2082 } 2083 2084 2085 static HostRefreshRateComboBoxSetting *TVVidModeRefreshRate(int idx=-1) 1992 2086 { 1993 2087 QString dhelp = QObject::tr("Default refresh rate " 1994 2088 "when watching a video. " … … static HostRefreshRateComboBox *TVVidModeRefreshRate(int idx=-1) 1998 2092 "Leave at \"Auto\" to automatically use the best available"); 1999 2093 QString qstr = (idx<0) ? "TVVidModeRefreshRate" : 2000 2094 QString("TVVidModeRefreshRate%1").arg(idx); 2001 HostRefreshRateComboBox *gc = new HostRefreshRateComboBox(qstr);2095 HostRefreshRateComboBoxSetting *gc = new HostRefreshRateComboBoxSetting(qstr); 2002 2096 QString lstr = (idx<1) ? QObject::tr("Rate") : ""; 2003 2097 QString hstr = (idx<0) ? dhelp : ohelp; 2004 2098 2005 2099 gc->setLabel(lstr); 2006 gc->setLabelAboveWidget(idx<1);2007 2100 gc->setHelpText(hstr); 2008 2101 gc->setEnabled(false); 2009 2102 return gc; 2010 2103 } 2011 2104 2012 static HostComboBox *TVVidModeForceAspect(int idx=-1)2105 static HostComboBoxSetting *TVVidModeForceAspect(int idx=-1) 2013 2106 { 2014 2107 QString dhelp = QObject::tr("Aspect ratio when watching a video."); 2015 2108 QString ohelp = QObject::tr("Aspect ratio when watching a " … … static HostComboBox *TVVidModeForceAspect(int idx=-1) 2017 2110 2018 2111 QString qstr = (idx<0) ? "TVVidModeForceAspect" : 2019 2112 QString("TVVidModeForceAspect%1").arg(idx); 2020 HostComboBox *gc = new HostComboBox(qstr);2113 HostComboBoxSetting *gc = new HostComboBoxSetting(qstr); 2021 2114 gc->setLabel( (idx<1) ? QObject::tr("Aspect") : "" ); 2022 gc->setLabelAboveWidget(idx<1);2023 2115 2024 2116 QString hstr = (idx<0) ? dhelp : ohelp; 2025 2117 gc->setHelpText(hstr+" "+ … … static HostComboBox *TVVidModeForceAspect(int idx=-1) 2032 2124 return gc; 2033 2125 } 2034 2126 2127 2128 2129 class DefaultVideoMode : public GroupSetting 2130 { 2131 public: 2132 DefaultVideoMode():GroupSetting() 2133 { 2134 setLabel(QObject::tr("Video Mode Settings")); 2135 m_res = TVVidModeResolution(); 2136 m_rate = TVVidModeRefreshRate(); 2137 addChild(GuiVidModeResolution()); 2138 addChild(m_res); 2139 addChild(m_rate); 2140 addChild(TVVidModeForceAspect()); 2141 connect(m_res, SIGNAL(valueChanged(const QString&)), 2142 m_rate, SLOT(ChangeResolution(const QString&))); 2143 } 2144 private: 2145 HostComboBoxSetting *m_res; 2146 HostRefreshRateComboBoxSetting *m_rate; 2147 }; 2148 2149 2150 class OverrideVideoMode : public GroupSetting 2151 { 2152 public: 2153 OverrideVideoMode (int idx):GroupSetting() 2154 { 2155 setLabel(QObject::tr("Override video mode #%1").arg(idx)); 2156 // input side 2157 addChild(VidModeWidth(idx)); 2158 addChild(VidModeHeight(idx)); 2159 // output side 2160 addChild(m_res = TVVidModeResolution(idx)); 2161 addChild(m_rate = TVVidModeRefreshRate(idx)); 2162 addChild(TVVidModeForceAspect(idx)); 2163 connect(m_res, SIGNAL(valueChanged(const QString&)), 2164 m_rate, SLOT(ChangeResolution(const QString&))); 2165 } 2166 private: 2167 HostComboBoxSetting *m_res; 2168 HostRefreshRateComboBoxSetting *m_rate; 2169 }; 2170 2171 static HostCheckBoxSetting *UseVideoModes() // replace VideoModeSettings 2172 { 2173 HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseVideoModes"); 2174 gc->setLabel(QObject::tr("Separate video modes for GUI and TV playback")); 2175 gc->setValue(false); 2176 gc->setHelpText(QObject::tr("Switch X Window video modes for TV. " 2177 "Requires \"xrandr\" support.")); 2178 2179 gc->addTargetedChild("1",new DefaultVideoMode()); 2180 2181 for (int idx = 0; idx < 3; ++idx) 2182 { 2183 gc->addTargetedChild("1",new OverrideVideoMode(idx)); 2184 } 2185 return gc; 2186 } 2187 2188 /* 2035 2189 class VideoModeSettings : public TriggeredConfigurationGroup 2036 2190 { 2037 2191 public: … … class VideoModeSettings : public TriggeredConfigurationGroup 2048 2202 ConfigurationGroup* defaultsettings = 2049 2203 new HorizontalConfigurationGroup(false, false); 2050 2204 2051 HostComboBox *res = TVVidModeResolution();2205 HostComboBoxSetting *res = TVVidModeResolution(); 2052 2206 HostRefreshRateComboBox *rate = TVVidModeRefreshRate(); 2053 2207 defaultsettings->addChild(GuiVidModeResolution()); 2054 2208 defaultsettings->addChild(res); … … class VideoModeSettings : public TriggeredConfigurationGroup 2081 2235 addTarget("1", settings); 2082 2236 addTarget("0", new VerticalConfigurationGroup(true)); 2083 2237 } 2084 }; 2238 };*/ 2085 2239 #endif 2086 2240 2087 static HostCheckBox *HideMouseCursor()2241 static HostCheckBoxSetting *HideMouseCursor() 2088 2242 { 2089 HostCheckBox *gc = new HostCheckBox("HideMouseCursor");2243 HostCheckBoxSetting *gc = new HostCheckBoxSetting("HideMouseCursor"); 2090 2244 gc->setLabel(QObject::tr("Hide mouse cursor in MythTV")); 2091 2245 gc->setValue(false); 2092 2246 gc->setHelpText(QObject::tr("Toggles mouse cursor visibility for touchscreens. " … … static HostCheckBox *HideMouseCursor() 2096 2250 }; 2097 2251 2098 2252 2099 static HostCheckBox *RunInWindow()2253 static HostCheckBoxSetting *RunInWindow() 2100 2254 { 2101 HostCheckBox *gc = new HostCheckBox("RunFrontendInWindow");2255 HostCheckBoxSetting *gc = new HostCheckBoxSetting("RunFrontendInWindow"); 2102 2256 gc->setLabel(QObject::tr("Use window border")); 2103 2257 gc->setValue(false); 2104 2258 gc->setHelpText(QObject::tr("Toggles between windowed and " … … static HostCheckBox *RunInWindow() 2106 2260 return gc; 2107 2261 } 2108 2262 2109 static HostCheckBox *UseFixedWindowSize()2263 static HostCheckBoxSetting *UseFixedWindowSize() 2110 2264 { 2111 2265 { 2112 HostCheckBox *gc = new HostCheckBox("UseFixedWindowSize");2266 HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseFixedWindowSize"); 2113 2267 gc->setLabel(QObject::tr("Use fixed window size")); 2114 2268 gc->setValue(true); 2115 2269 gc->setHelpText(QObject::tr( … … static HostCheckBox *UseFixedWindowSize() 2119 2273 } 2120 2274 } 2121 2275 2122 static HostComboBox *MythDateFormatCB()2276 static HostComboBoxSetting *MythDateFormatCB() 2123 2277 { 2124 HostComboBox *gc = new HostComboBox("DateFormat");2278 HostComboBoxSetting *gc = new HostComboBoxSetting("DateFormat"); 2125 2279 gc->setLabel(QObject::tr("Date format")); 2126 2280 2127 2281 QDate sampdate = QDate::currentDate(); … … static HostComboBox *MythDateFormatCB() 2160 2314 return gc; 2161 2315 } 2162 2316 2163 static HostComboBox *MythShortDateFormat()2317 static HostComboBoxSetting *MythShortDateFormat() 2164 2318 { 2165 HostComboBox *gc = new HostComboBox("ShortDateFormat");2319 HostComboBoxSetting *gc = new HostComboBoxSetting("ShortDateFormat"); 2166 2320 gc->setLabel(QObject::tr("Short date format")); 2167 2321 2168 2322 QDate sampdate = QDate::currentDate(); … … static HostComboBox *MythShortDateFormat() 2199 2353 return gc; 2200 2354 } 2201 2355 2202 static HostComboBox *MythTimeFormat()2356 static HostComboBoxSetting *MythTimeFormat() 2203 2357 { 2204 HostComboBox *gc = new HostComboBox("TimeFormat");2358 HostComboBoxSetting *gc = new HostComboBoxSetting("TimeFormat"); 2205 2359 gc->setLabel(QObject::tr("Time format")); 2206 2360 2207 2361 QTime samptime = QTime::currentTime(); … … static HostComboBox *MythTimeFormat() 2219 2373 return gc; 2220 2374 } 2221 2375 2222 static HostComboBox *ChannelFormat()2376 static HostComboBoxSetting *ChannelFormat() 2223 2377 { 2224 HostComboBox *gc = new HostComboBox("ChannelFormat");2378 HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelFormat"); 2225 2379 gc->setLabel(QObject::tr("Channel format")); 2226 2380 gc->addSelection(QObject::tr("number"), "<num>"); 2227 2381 gc->addSelection(QObject::tr("number callsign"), "<num> <sign>"); … … static HostComboBox *ChannelFormat() 2233 2387 return gc; 2234 2388 } 2235 2389 2236 static HostComboBox *LongChannelFormat()2390 static HostComboBoxSetting *LongChannelFormat() 2237 2391 { 2238 HostComboBox *gc = new HostComboBox("LongChannelFormat");2392 HostComboBoxSetting *gc = new HostComboBoxSetting("LongChannelFormat"); 2239 2393 gc->setLabel(QObject::tr("Long channel format")); 2240 2394 gc->addSelection(QObject::tr("number"), "<num>"); 2241 2395 gc->addSelection(QObject::tr("number callsign"), "<num> <sign>"); … … static HostComboBox *LongChannelFormat() 2247 2401 return gc; 2248 2402 } 2249 2403 2250 static GlobalCheckBox *LiveTVPriority()2404 static GlobalCheckBoxSetting *LiveTVPriority() 2251 2405 { 2252 GlobalCheckBox *bc = new GlobalCheckBox("LiveTVPriority");2406 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("LiveTVPriority"); 2253 2407 bc->setLabel(QObject::tr("Allow Live TV to move scheduled shows")); 2254 2408 bc->setValue(false); 2255 2409 bc->setHelpText(QObject::tr("If enabled, scheduled recordings will " … … static GlobalCheckBox *LiveTVPriority() 2258 2412 return bc; 2259 2413 } 2260 2414 2261 static HostCheckBox *ChannelGroupRememberLast()2262 {2263 HostCheckBox *gc = new HostCheckBox("ChannelGroupRememberLast");2264 gc->setLabel(QObject::tr("Remember last channel group"));2265 gc->setHelpText(QObject::tr("If enabled, the EPG will initially display "2266 "only the channels from the last channel group selected. Pressing "2267 "\"4\" will toggle channel group."));2268 gc->setValue(false);2269 return gc;2270 }2271 2415 2272 static HostComboBox *ChannelGroupDefault() 2416 2417 static HostComboBoxSetting *ChannelGroupDefault() 2273 2418 { 2274 HostComboBox *gc = new HostComboBox("ChannelGroupDefault");2419 HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelGroupDefault"); 2275 2420 gc->setLabel(QObject::tr("Default channel group")); 2276 2421 2277 2422 ChannelGroupList changrplist; … … static HostComboBox *ChannelGroupDefault() 2291 2436 return gc; 2292 2437 } 2293 2438 2294 static HostCheckBox *BrowseChannelGroup()2439 static HostCheckBoxSetting *ChannelGroupRememberLast() 2295 2440 { 2296 HostCheckBox *gc = new HostCheckBox("BrowseChannelGroup"); 2441 HostCheckBoxSetting *gc = new HostCheckBoxSetting("ChannelGroupRememberLast"); 2442 gc->setLabel(QObject::tr("Remember last channel group")); 2443 gc->setHelpText(QObject::tr("If enabled, the EPG will initially display " 2444 "only the channels from the last channel group selected. Pressing " 2445 "\"4\" will toggle channel group.")); 2446 gc->setValue(false); 2447 gc->addTargetedChild("0", ChannelGroupDefault()); 2448 return gc; 2449 } 2450 2451 static HostCheckBoxSetting *BrowseChannelGroup() 2452 { 2453 HostCheckBoxSetting *gc = new HostCheckBoxSetting("BrowseChannelGroup"); 2297 2454 gc->setLabel(QObject::tr("Browse/change channels from Channel Group")); 2298 2455 gc->setHelpText(QObject::tr("If enabled, Live TV will browse or change " 2299 2456 "channels from the selected channel group. The \"All " … … static HostCheckBox *BrowseChannelGroup() 2303 2460 return gc; 2304 2461 } 2305 2462 2306 // Channel Group Settings2307 class ChannelGroupSettings : public TriggeredConfigurationGroup2308 {2309 public:2310 ChannelGroupSettings() : TriggeredConfigurationGroup(false, true, false, false)2311 {2312 setLabel(QObject::tr("Remember last channel group"));2313 setUseLabel(false);2314 2315 Setting* RememberChanGrpEnabled = ChannelGroupRememberLast();2316 addChild(RememberChanGrpEnabled);2317 setTrigger(RememberChanGrpEnabled);2318 2319 ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false);2320 settings->addChild(ChannelGroupDefault());2321 addTarget("0", settings);2322 2323 // show nothing if RememberChanGrpEnabled is on2324 addTarget("1", new VerticalConfigurationGroup(true,false));2325 };2326 };2327 2328 2463 // General RecPriorities settings 2329 2464 2330 static GlobalCheckBox *GRSchedMoveHigher()2465 static GlobalCheckBoxSetting *GRSchedMoveHigher() 2331 2466 { 2332 GlobalCheckBox *bc = new GlobalCheckBox("SchedMoveHigher");2467 GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("SchedMoveHigher"); 2333 2468 bc->setLabel(QObject::tr("Reschedule higher priorities")); 2334 2469 bc->setHelpText(QObject::tr("Move higher priority programs to other " 2335 2470 "cards and showings when resolving conflicts. This " … … static GlobalCheckBox *GRSchedMoveHigher() 2340 2475 return bc; 2341 2476 } 2342 2477 2343 static GlobalComboBox *GRSchedOpenEnd()2478 static GlobalComboBoxSetting *GRSchedOpenEnd() 2344 2479 { 2345 GlobalComboBox *bc = new GlobalComboBox("SchedOpenEnd");2480 GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("SchedOpenEnd"); 2346 2481 bc->setLabel(QObject::tr("Avoid back to back recordings")); 2347 2482 bc->setHelpText(QObject::tr("Selects the situations where the scheduler " 2348 2483 "will avoid assigning shows to the same card if their " … … static GlobalComboBox *GRSchedOpenEnd() 2355 2490 return bc; 2356 2491 } 2357 2492 2358 static GlobalSpinBox *GRDefaultStartOffset()2493 static GlobalSpinBoxSetting *GRDefaultStartOffset() 2359 2494 { 2360 GlobalSpinBox *bs = new GlobalSpinBox("DefaultStartOffset",2495 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("DefaultStartOffset", 2361 2496 -10, 30, 5, true); 2362 2497 bs->setLabel(QObject::tr("Default 'Start Early' minutes for new " 2363 2498 "recording rules")); … … static GlobalSpinBox *GRDefaultStartOffset() 2370 2505 return bs; 2371 2506 } 2372 2507 2373 static GlobalSpinBox *GRDefaultEndOffset()2508 static GlobalSpinBoxSetting *GRDefaultEndOffset() 2374 2509 { 2375 GlobalSpinBox *bs = new GlobalSpinBox("DefaultEndOffset",2510 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("DefaultEndOffset", 2376 2511 -10, 30, 5, true); 2377 2512 bs->setLabel(QObject::tr("Default 'End Late' minutes for new " 2378 2513 "recording rules")); … … static GlobalSpinBox *GRDefaultEndOffset() 2385 2520 return bs; 2386 2521 } 2387 2522 2388 static GlobalSpinBox *GRPrefInputRecPriority()2523 static GlobalSpinBoxSetting *GRPrefInputRecPriority() 2389 2524 { 2390 GlobalSpinBox *bs = new GlobalSpinBox("PrefInputPriority", 1, 99, 1);2525 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("PrefInputPriority", 1, 99, 1); 2391 2526 bs->setLabel(QObject::tr("Preferred input priority")); 2392 2527 bs->setHelpText(QObject::tr("Additional priority when a showing " 2393 2528 "matches the preferred input selected in the 'Scheduling " … … static GlobalSpinBox *GRPrefInputRecPriority() 2396 2531 return bs; 2397 2532 } 2398 2533 2399 static GlobalSpinBox *GRHDTVRecPriority()2534 static GlobalSpinBoxSetting *GRHDTVRecPriority() 2400 2535 { 2401 GlobalSpinBox *bs = new GlobalSpinBox("HDTVRecPriority", -99, 99, 1);2536 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("HDTVRecPriority", -99, 99, 1); 2402 2537 bs->setLabel(QObject::tr("HDTV recording priority")); 2403 2538 bs->setHelpText(QObject::tr("Additional priority when a showing " 2404 2539 "is marked as an HDTV broadcast in the TV listings.")); … … static GlobalSpinBox *GRHDTVRecPriority() 2406 2541 return bs; 2407 2542 } 2408 2543 2409 static GlobalSpinBox *GRWSRecPriority()2544 static GlobalSpinBoxSetting *GRWSRecPriority() 2410 2545 { 2411 GlobalSpinBox *bs = new GlobalSpinBox("WSRecPriority", -99, 99, 1);2546 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("WSRecPriority", -99, 99, 1); 2412 2547 bs->setLabel(QObject::tr("Widescreen recording priority")); 2413 2548 bs->setHelpText(QObject::tr("Additional priority when a showing " 2414 2549 "is marked as widescreen in the TV listings.")); … … static GlobalSpinBox *GRWSRecPriority() 2416 2551 return bs; 2417 2552 } 2418 2553 2419 static GlobalSpinBox *GRAutoRecPriority()2554 static GlobalSpinBoxSetting *GRAutoRecPriority() 2420 2555 { 2421 GlobalSpinBox *bs = new GlobalSpinBox("AutoRecPriority", -99, 99, 1);2556 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoRecPriority", -99, 99, 1); 2422 2557 bs->setLabel(QObject::tr("Automatic priority range (+/-)")); 2423 2558 bs->setHelpText(QObject::tr("Up to this number of priority points may " 2424 2559 "be added for titles that are usually watched soon after " … … static GlobalSpinBox *GRAutoRecPriority() 2428 2563 return bs; 2429 2564 } 2430 2565 2431 static GlobalSpinBox *GRSignLangRecPriority()2566 static GlobalSpinBoxSetting *GRSignLangRecPriority() 2432 2567 { 2433 GlobalSpinBox *bs = new GlobalSpinBox("SignLangRecPriority",2568 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("SignLangRecPriority", 2434 2569 -99, 99, 1); 2435 2570 bs->setLabel(QObject::tr("Sign language recording priority")); 2436 2571 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRSignLangRecPriority() 2439 2574 return bs; 2440 2575 } 2441 2576 2442 static GlobalSpinBox *GROnScrSubRecPriority()2577 static GlobalSpinBoxSetting *GROnScrSubRecPriority() 2443 2578 { 2444 GlobalSpinBox *bs = new GlobalSpinBox("OnScrSubRecPriority",2579 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("OnScrSubRecPriority", 2445 2580 -99, 99, 1); 2446 2581 bs->setLabel(QObject::tr("In-vision Subtitles Recording Priority")); 2447 2582 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GROnScrSubRecPriority() 2450 2585 return bs; 2451 2586 } 2452 2587 2453 static GlobalSpinBox *GRCCRecPriority()2588 static GlobalSpinBoxSetting *GRCCRecPriority() 2454 2589 { 2455 GlobalSpinBox *bs = new GlobalSpinBox("CCRecPriority",2590 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("CCRecPriority", 2456 2591 -99, 99, 1); 2457 2592 bs->setLabel(QObject::tr("Subtitles/CC recording priority")); 2458 2593 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRCCRecPriority() 2462 2597 return bs; 2463 2598 } 2464 2599 2465 static GlobalSpinBox *GRHardHearRecPriority()2600 static GlobalSpinBoxSetting *GRHardHearRecPriority() 2466 2601 { 2467 GlobalSpinBox *bs = new GlobalSpinBox("HardHearRecPriority",2602 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("HardHearRecPriority", 2468 2603 -99, 99, 1); 2469 2604 bs->setLabel(QObject::tr("Hard of hearing priority")); 2470 2605 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRHardHearRecPriority() 2474 2609 return bs; 2475 2610 } 2476 2611 2477 static GlobalSpinBox *GRAudioDescRecPriority()2612 static GlobalSpinBoxSetting *GRAudioDescRecPriority() 2478 2613 { 2479 GlobalSpinBox *bs = new GlobalSpinBox("AudioDescRecPriority",2614 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AudioDescRecPriority", 2480 2615 -99, 99, 1); 2481 2616 bs->setLabel(QObject::tr("Audio described priority")); 2482 2617 bs->setHelpText(QObject::tr("Additional priority when a showing " … … static GlobalSpinBox *GRAudioDescRecPriority() 2485 2620 return bs; 2486 2621 } 2487 2622 2488 static GlobalSpinBox *GRSingleRecordRecPriority()2623 static GlobalSpinBoxSetting *GRSingleRecordRecPriority() 2489 2624 { 2490 GlobalSpinBox *bs = new GlobalSpinBox("SingleRecordRecPriority",2625 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("SingleRecordRecPriority", 2491 2626 -99, 99, 1); 2492 2627 bs->setLabel(QObject::tr("Single recordings priority")); 2493 2628 bs->setHelpText(QObject::tr("Single recordings will receive this " … … static GlobalSpinBox *GRSingleRecordRecPriority() 2496 2631 return bs; 2497 2632 } 2498 2633 2499 static GlobalSpinBox *GRWeekslotRecordRecPriority()2634 static GlobalSpinBoxSetting *GRWeekslotRecordRecPriority() 2500 2635 { 2501 GlobalSpinBox *bs = new GlobalSpinBox("WeekslotRecordRecPriority",2636 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("WeekslotRecordRecPriority", 2502 2637 -99, 99, 1); 2503 2638 bs->setLabel(QObject::tr("Weekslot recordings priority")); 2504 2639 bs->setHelpText(QObject::tr("Weekslot recordings will receive this " … … static GlobalSpinBox *GRWeekslotRecordRecPriority() 2507 2642 return bs; 2508 2643 } 2509 2644 2510 static GlobalSpinBox *GRTimeslotRecordRecPriority()2645 static GlobalSpinBoxSetting *GRTimeslotRecordRecPriority() 2511 2646 { 2512 GlobalSpinBox *bs = new GlobalSpinBox("TimeslotRecordRecPriority",2647 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("TimeslotRecordRecPriority", 2513 2648 -99, 99, 1); 2514 2649 bs->setLabel(QObject::tr("Timeslot recordings priority")); 2515 2650 bs->setHelpText(QObject::tr("Timeslot recordings will receive this " … … static GlobalSpinBox *GRTimeslotRecordRecPriority() 2518 2653 return bs; 2519 2654 } 2520 2655 2521 static GlobalSpinBox *GRChannelRecordRecPriority()2656 static GlobalSpinBoxSetting *GRChannelRecordRecPriority() 2522 2657 { 2523 GlobalSpinBox *bs = new GlobalSpinBox("ChannelRecordRecPriority",2658 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("ChannelRecordRecPriority", 2524 2659 -99, 99, 1); 2525 2660 bs->setLabel(QObject::tr("Channel recordings priority")); 2526 2661 bs->setHelpText(QObject::tr("Channel recordings will receive this " … … static GlobalSpinBox *GRChannelRecordRecPriority() 2529 2664 return bs; 2530 2665 } 2531 2666 2532 static GlobalSpinBox *GRAllRecordRecPriority()2667 static GlobalSpinBoxSetting *GRAllRecordRecPriority() 2533 2668 { 2534 GlobalSpinBox *bs = new GlobalSpinBox("AllRecordRecPriority",2669 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AllRecordRecPriority", 2535 2670 -99, 99, 1); 2536 2671 bs->setLabel(QObject::tr("All recordings priority")); 2537 2672 bs->setHelpText(QObject::tr("The 'All' recording type will receive this " … … static GlobalSpinBox *GRAllRecordRecPriority() 2540 2675 return bs; 2541 2676 } 2542 2677 2543 static GlobalSpinBox *GRFindOneRecordRecPriority()2678 static GlobalSpinBoxSetting *GRFindOneRecordRecPriority() 2544 2679 { 2545 GlobalSpinBox *bs = new GlobalSpinBox("FindOneRecordRecPriority",2680 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("FindOneRecordRecPriority", 2546 2681 -99, 99, 1); 2547 2682 bs->setLabel(QObject::tr("Find one recordings priority")); 2548 2683 bs->setHelpText(QObject::tr("Find One, Find Weekly and Find Daily " … … static GlobalSpinBox *GRFindOneRecordRecPriority() 2552 2687 return bs; 2553 2688 } 2554 2689 2555 static GlobalSpinBox *GROverrideRecordRecPriority()2690 static GlobalSpinBoxSetting *GROverrideRecordRecPriority() 2556 2691 { 2557 GlobalSpinBox *bs = new GlobalSpinBox("OverrideRecordRecPriority",2692 GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("OverrideRecordRecPriority", 2558 2693 -99, 99, 1); 2559 2694 bs->setLabel(QObject::tr("Override recordings priority")); 2560 2695 bs->setHelpText(QObject::tr("Override recordings will receive this " … … static GlobalSpinBox *GROverrideRecordRecPriority() 2563 2698 return bs; 2564 2699 } 2565 2700 2566 static Host LineEdit*DefaultTVChannel()2701 static HostTextEditSetting *DefaultTVChannel() 2567 2702 { 2568 Host LineEdit *ge = new HostLineEdit("DefaultTVChannel");2703 HostTextEditSetting *ge = new HostTextEditSetting("DefaultTVChannel"); 2569 2704 ge->setLabel(QObject::tr("Guide starts at channel")); 2570 2705 ge->setValue("3"); 2571 2706 ge->setHelpText(QObject::tr("The program guide starts on this channel if " … … static HostLineEdit *DefaultTVChannel() 2573 2708 return ge; 2574 2709 } 2575 2710 2576 static HostSpinBox *EPGRecThreshold()2711 static HostSpinBoxSetting *EPGRecThreshold() 2577 2712 { 2578 HostSpinBox *gs = new HostSpinBox("SelChangeRecThreshold", 1, 600, 1);2713 HostSpinBoxSetting *gs = new HostSpinBoxSetting("SelChangeRecThreshold", 1, 600, 1); 2579 2714 gs->setLabel(QObject::tr("Record threshold")); 2580 2715 gs->setValue(16); 2581 2716 gs->setHelpText(QObject::tr("Pressing SELECT on a show that is at least " … … static HostSpinBox *EPGRecThreshold() 2584 2719 return gs; 2585 2720 } 2586 2721 2587 static HostComboBox *MythLanguage()2722 static HostComboBoxSetting *MythLanguage() 2588 2723 { 2589 HostComboBox *gc = new HostComboBox("Language");2724 HostComboBoxSetting *gc = new HostComboBoxSetting("Language"); 2590 2725 gc->setLabel(QObject::tr("Language")); 2591 2726 2592 2727 QMap<QString, QString> langMap = MythTranslation::getLanguages(); … … static HostComboBox *MythLanguage() 2608 2743 return gc; 2609 2744 } 2610 2745 2611 static void ISO639_fill_selections( SelectSetting *widget, uint i)2746 static void ISO639_fill_selections(MythUIComboBoxSetting *comboBox, uint i) 2612 2747 { 2613 widget->clearSelections();2748 comboBox->clearSelections(); 2614 2749 QString q = QString("ISO639Language%1").arg(i); 2615 2750 QString lang = gCoreContext->GetSetting(q, "").toLower(); 2616 2751 … … static void ISO639_fill_selections(SelectSetting *widget, uint i) 2631 2766 desc = desc.left(idx); 2632 2767 2633 2768 const QString il = iso639_key_to_str3(it.key()); 2634 widget->addSelection(desc, il, il == lang);2769 comboBox->addSelection(desc, il, il == lang); 2635 2770 } 2636 2771 } 2637 2772 2638 static GlobalComboBox *ISO639PreferredLanguage(uint i)2773 static GlobalComboBoxSetting *ISO639PreferredLanguage(uint i) 2639 2774 { 2640 GlobalComboBox *gc = new GlobalComboBox(QString("ISO639Language%1").arg(i));2775 GlobalComboBoxSetting *gc = new GlobalComboBoxSetting(QString("ISO639Language%1").arg(i)); 2641 2776 gc->setLabel(QObject::tr("Guide language #%1").arg(i+1)); 2642 2777 // We should try to get language from "MythLanguage" 2643 2778 // then use code 2 to code 3 map in iso639.h … … static GlobalComboBox *ISO639PreferredLanguage(uint i) 2648 2783 return gc; 2649 2784 } 2650 2785 2651 static HostCheckBox *NetworkControlEnabled()2652 {2653 HostCheckBox *gc = new HostCheckBox("NetworkControlEnabled");2654 gc->setLabel(QObject::tr("Enable Network Remote Control interface"));2655 gc->setHelpText(QObject::tr("This enables support for controlling "2656 "mythfrontend over the network."));2657 gc->setValue(false);2658 return gc;2659 }2660 2786 2661 static HostSpinBox *NetworkControlPort()2787 static HostSpinBoxSetting *NetworkControlPort() 2662 2788 { 2663 HostSpinBox *gs = new HostSpinBox("NetworkControlPort", 1025, 65535, 1);2789 HostSpinBoxSetting *gs = new HostSpinBoxSetting("NetworkControlPort", 1025, 65535, 1); 2664 2790 gs->setLabel(QObject::tr("Network Remote Control port")); 2665 2791 gs->setValue(6546); 2666 2792 gs->setHelpText(QObject::tr("This specifies what port the network remote " … … static HostSpinBox *NetworkControlPort() 2668 2794 return gs; 2669 2795 } 2670 2796 2671 static Host LineEdit*UDPNotifyPort()2797 static HostTextEditSetting *UDPNotifyPort() 2672 2798 { 2673 Host LineEdit *ge = new HostLineEdit("UDPNotifyPort");2799 HostTextEditSetting *ge = new HostTextEditSetting("UDPNotifyPort"); 2674 2800 ge->setLabel(QObject::tr("UDP notify port")); 2675 2801 ge->setValue("6948"); 2676 2802 ge->setHelpText(QObject::tr("MythTV will listen for " … … static HostLineEdit *UDPNotifyPort() 2680 2806 return ge; 2681 2807 } 2682 2808 2683 static HostCheckBox *RealtimePriority() 2809 static HostCheckBoxSetting *NetworkControlEnabled() 2810 { 2811 HostCheckBoxSetting *gc = new HostCheckBoxSetting("NetworkControlEnabled"); 2812 gc->setLabel(QObject::tr("Enable Network Remote Control interface")); 2813 gc->setHelpText(QObject::tr("This enables support for controlling " 2814 "mythfrontend over the network.")); 2815 gc->setValue(false); 2816 2817 gc->addTargetedChild("1",NetworkControlPort()); 2818 gc->addTargetedChild("1",UDPNotifyPort()); 2819 return gc; 2820 } 2821 2822 static HostCheckBoxSetting *RealtimePriority() 2684 2823 { 2685 HostCheckBox *gc = new HostCheckBox("RealtimePriority");2824 HostCheckBoxSetting *gc = new HostCheckBoxSetting("RealtimePriority"); 2686 2825 gc->setLabel(QObject::tr("Enable realtime priority threads")); 2687 2826 gc->setHelpText(QObject::tr("When running mythfrontend with root " 2688 2827 "privileges, some threads can be given enhanced priority. " … … static HostCheckBox *RealtimePriority() 2692 2831 return gc; 2693 2832 } 2694 2833 2695 static HostCheckBox *EnableMediaMon() 2696 { 2697 HostCheckBox *gc = new HostCheckBox("MonitorDrives"); 2698 gc->setLabel(QObject::tr("Monitor CD/DVD") + 2699 QObject::tr(" (and other removable devices)")); 2700 gc->setHelpText(QObject::tr("This enables support for monitoring " 2701 "your CD/DVD drives for new disks and launching " 2702 "the proper plugin to handle them.")); 2703 gc->setValue(false); 2704 return gc; 2705 } 2706 2707 static HostLineEdit *IgnoreMedia() 2834 static HostTextEditSetting *IgnoreMedia() 2708 2835 { 2709 Host LineEdit *ge = new HostLineEdit("IgnoreDevices");2836 HostTextEditSetting *ge = new HostTextEditSetting("IgnoreDevices"); 2710 2837 ge->setLabel(QObject::tr("Ignore devices")); 2711 2838 ge->setValue(""); 2712 2839 ge->setHelpText(QObject::tr("If there are any devices that you do not want " … … static HostLineEdit *IgnoreMedia() 2715 2842 return ge; 2716 2843 } 2717 2844 2718 class MythMediaSettings : public TriggeredConfigurationGroup 2845 static HostCheckBoxSetting *EnableMediaMon() 2719 2846 { 2720 public: 2721 MythMediaSettings() : 2722 TriggeredConfigurationGroup(false, false, true, true) 2723 { 2724 setLabel(QObject::tr("MythMediaMonitor")); 2725 setUseLabel(false); 2726 2727 Setting* enabled = EnableMediaMon(); 2728 addChild(enabled); 2729 setTrigger(enabled); 2730 2731 ConfigurationGroup* settings = new VerticalConfigurationGroup(false); 2732 settings->addChild(IgnoreMedia()); 2733 addTarget("1", settings); 2734 2735 // show nothing if fillEnabled is off 2736 addTarget("0", new VerticalConfigurationGroup(true)); 2737 }; 2738 }; 2739 2847 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MonitorDrives"); 2848 gc->setLabel(QObject::tr("Monitor CD/DVD") + 2849 QObject::tr(" (and other removable devices)")); 2850 gc->setHelpText(QObject::tr("This enables support for monitoring " 2851 "your CD/DVD drives for new disks and launching " 2852 "the proper plugin to handle them.")); 2853 gc->setValue(false); 2854 gc->addTargetedChild("1", IgnoreMedia()); 2855 return gc; 2856 } 2740 2857 2741 static HostComboBox *DisplayGroupTitleSort()2858 static HostComboBoxSetting *DisplayGroupTitleSort() 2742 2859 { 2743 HostComboBox *gc = new HostComboBox("DisplayGroupTitleSort");2860 HostComboBoxSetting *gc = new HostComboBoxSetting("DisplayGroupTitleSort"); 2744 2861 gc->setLabel(QObject::tr("Sort titles")); 2745 2862 gc->addSelection(QObject::tr("Alphabetically"), 2746 2863 QString::number(PlaybackBox::TitleSortAlphabetical)); … … static HostComboBox *DisplayGroupTitleSort() 2751 2868 return gc; 2752 2869 } 2753 2870 2754 static HostCheckBox *PlaybackWatchList()2871 static HostCheckBoxSetting *PlaybackWLStart() 2755 2872 { 2756 HostCheckBox *gc = new HostCheckBox("PlaybackWatchList"); 2757 gc->setLabel(QObject::tr("Include the 'Watch List' group")); 2758 gc->setValue(true); 2759 gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of " 2760 "recordings sorted to highlight series and " 2761 "shows that need attention in order to " 2762 "keep up to date.")); 2763 return gc; 2764 } 2765 2766 static HostCheckBox *PlaybackWLStart() 2767 { 2768 HostCheckBox *gc = new HostCheckBox("PlaybackWLStart"); 2873 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWLStart"); 2769 2874 gc->setLabel(QObject::tr("Start from the Watch List view")); 2770 2875 gc->setValue(false); 2771 2876 gc->setHelpText(QObject::tr("If enabled, the 'Watch List' will be the " … … static HostCheckBox *PlaybackWLStart() 2774 2879 return gc; 2775 2880 } 2776 2881 2777 static HostCheckBox *PlaybackWLAutoExpire()2882 static HostCheckBoxSetting *PlaybackWLAutoExpire() 2778 2883 { 2779 HostCheckBox *gc = new HostCheckBox("PlaybackWLAutoExpire");2884 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWLAutoExpire"); 2780 2885 gc->setLabel(QObject::tr("Exclude recordings not set for Auto-Expire")); 2781 2886 gc->setValue(false); 2782 2887 gc->setHelpText(QObject::tr("Set this if you turn off Auto-Expire only " … … static HostCheckBox *PlaybackWLAutoExpire() 2786 2891 return gc; 2787 2892 } 2788 2893 2789 static HostSpinBox *PlaybackWLMaxAge()2894 static HostSpinBoxSetting *PlaybackWLMaxAge() 2790 2895 { 2791 HostSpinBox *gs = new HostSpinBox("PlaybackWLMaxAge", 30, 180, 10);2896 HostSpinBoxSetting *gs = new HostSpinBoxSetting("PlaybackWLMaxAge", 30, 180, 10); 2792 2897 gs->setLabel(QObject::tr("Maximum days counted in the score")); 2793 2898 gs->setValue(60); 2794 2899 gs->setHelpText(QObject::tr("The 'Watch List' scores are based on 1 point " … … static HostSpinBox *PlaybackWLMaxAge() 2798 2903 return gs; 2799 2904 } 2800 2905 2801 static HostSpinBox *PlaybackWLBlackOut()2906 static HostSpinBoxSetting *PlaybackWLBlackOut() 2802 2907 { 2803 HostSpinBox *gs = new HostSpinBox("PlaybackWLBlackOut", 0, 5, 1);2908 HostSpinBoxSetting *gs = new HostSpinBoxSetting("PlaybackWLBlackOut", 0, 5, 1); 2804 2909 gs->setLabel(QObject::tr("Days to exclude weekly episodes after delete")); 2805 2910 gs->setValue(2); 2806 2911 gs->setHelpText(QObject::tr("When an episode is deleted or marked as " … … static HostSpinBox *PlaybackWLBlackOut() 2811 2916 return gs; 2812 2917 } 2813 2918 2814 class WatchListSettings : public TriggeredConfigurationGroup 2919 static HostCheckBoxSetting *PlaybackWatchList() 2815 2920 { 2816 public: 2817 WatchListSettings() : 2818 TriggeredConfigurationGroup(false, false, true, true) 2819 { 2820 2821 Setting* watchList = PlaybackWatchList(); 2822 addChild(watchList); 2823 setTrigger(watchList); 2824 2825 ConfigurationGroup* settings = new VerticalConfigurationGroup(false); 2826 settings->addChild(PlaybackWLStart()); 2827 settings->addChild(PlaybackWLAutoExpire()); 2828 settings->addChild(PlaybackWLMaxAge()); 2829 settings->addChild(PlaybackWLBlackOut()); 2830 addTarget("1", settings); 2831 2832 addTarget("0", new VerticalConfigurationGroup(true)); 2833 }; 2834 }; 2921 HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWatchList"); 2922 gc->setLabel(QObject::tr("Include the 'Watch List' group")); 2923 gc->setValue(true); 2924 gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of " 2925 "recordings sorted to highlight series and " 2926 "shows that need attention in order to " 2927 "keep up to date.")); 2928 2929 gc->addTargetedChild("1", PlaybackWLStart()); 2930 gc->addTargetedChild("1", PlaybackWLAutoExpire()); 2931 gc->addTargetedChild("1", PlaybackWLMaxAge()); 2932 gc->addTargetedChild("1", PlaybackWLBlackOut()); 2933 return gc; 2934 } 2835 2935 2836 static HostCheckBox *LCDShowTime()2936 static HostCheckBoxSetting *LCDShowTime() 2837 2937 { 2838 HostCheckBox *gc = new HostCheckBox("LCDShowTime");2938 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowTime"); 2839 2939 gc->setLabel(QObject::tr("Display time")); 2840 2940 gc->setHelpText(QObject::tr("Display current time on idle LCD display. ")); 2841 2941 gc->setValue(true); 2842 2942 return gc; 2843 2943 } 2844 2944 2845 static HostCheckBox *LCDShowRecStatus()2945 static HostCheckBoxSetting *LCDShowRecStatus() 2846 2946 { 2847 HostCheckBox *gc = new HostCheckBox("LCDShowRecStatus");2947 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowRecStatus"); 2848 2948 gc->setLabel(QObject::tr("Display recording status")); 2849 2949 gc->setHelpText(QObject::tr("Display current recordings information on " 2850 2950 "LCD display.")); … … static HostCheckBox *LCDShowRecStatus() 2852 2952 return gc; 2853 2953 } 2854 2954 2855 static HostCheckBox *LCDShowMenu()2955 static HostCheckBoxSetting *LCDShowMenu() 2856 2956 { 2857 HostCheckBox *gc = new HostCheckBox("LCDShowMenu");2957 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowMenu"); 2858 2958 gc->setLabel(QObject::tr("Display menus")); 2859 2959 gc->setHelpText(QObject::tr("Display selected menu on LCD display. ")); 2860 2960 gc->setValue(true); 2861 2961 return gc; 2862 2962 } 2863 2963 2864 static HostSpinBox *LCDPopupTime()2964 static HostSpinBoxSetting *LCDPopupTime() 2865 2965 { 2866 HostSpinBox *gs = new HostSpinBox("LCDPopupTime", 1, 300, 1, true);2966 HostSpinBoxSetting *gs = new HostSpinBoxSetting("LCDPopupTime", 1, 300, 1, true); 2867 2967 gs->setLabel(QObject::tr("Menu pop-up time")); 2868 2968 gs->setHelpText(QObject::tr("How many seconds the menu will " 2869 2969 "remain visible after navigation.")); … … static HostSpinBox *LCDPopupTime() 2871 2971 return gs; 2872 2972 } 2873 2973 2874 static HostCheckBox *LCDShowMusic()2974 static HostCheckBoxSetting *LCDShowMusic() 2875 2975 { 2876 HostCheckBox *gc = new HostCheckBox("LCDShowMusic");2976 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowMusic"); 2877 2977 gc->setLabel(QObject::tr("Display music artist and title")); 2878 2978 gc->setHelpText(QObject::tr("Display playing artist and song title in " 2879 2979 "MythMusic on LCD display.")); … … static HostCheckBox *LCDShowMusic() 2881 2981 return gc; 2882 2982 } 2883 2983 2884 static HostComboBox *LCDShowMusicItems()2984 static HostComboBoxSetting *LCDShowMusicItems() 2885 2985 { 2886 HostComboBox *gc = new HostComboBox("LCDShowMusicItems");2986 HostComboBoxSetting *gc = new HostComboBoxSetting("LCDShowMusicItems"); 2887 2987 gc->setLabel(QObject::tr("Items")); 2888 2988 gc->addSelection(QObject::tr("Artist - Title"), "ArtistTitle"); 2889 2989 gc->addSelection(QObject::tr("Artist [Album] Title"), "ArtistAlbumTitle"); … … static HostComboBox *LCDShowMusicItems() 2891 2991 return gc; 2892 2992 } 2893 2993 2894 static HostCheckBox *LCDShowChannel()2994 static HostCheckBoxSetting *LCDShowChannel() 2895 2995 { 2896 HostCheckBox *gc = new HostCheckBox("LCDShowChannel");2996 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowChannel"); 2897 2997 gc->setLabel(QObject::tr("Display channel information")); 2898 2998 gc->setHelpText(QObject::tr("Display tuned channel information on LCD display.")); 2899 2999 gc->setValue(true); 2900 3000 return gc; 2901 3001 } 2902 3002 2903 static HostCheckBox *LCDShowVolume()3003 static HostCheckBoxSetting *LCDShowVolume() 2904 3004 { 2905 HostCheckBox *gc = new HostCheckBox("LCDShowVolume");3005 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowVolume"); 2906 3006 gc->setLabel(QObject::tr("Display volume information")); 2907 3007 gc->setHelpText(QObject::tr("Display volume level information " 2908 3008 "on LCD display.")); … … static HostCheckBox *LCDShowVolume() 2910 3010 return gc; 2911 3011 } 2912 3012 2913 static HostCheckBox *LCDShowGeneric()3013 static HostCheckBoxSetting *LCDShowGeneric() 2914 3014 { 2915 HostCheckBox *gc = new HostCheckBox("LCDShowGeneric");3015 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowGeneric"); 2916 3016 gc->setLabel(QObject::tr("Display generic information")); 2917 3017 gc->setHelpText(QObject::tr("Display generic information on LCD display.")); 2918 3018 gc->setValue(true); 2919 3019 return gc; 2920 3020 } 2921 3021 2922 static HostCheckBox *LCDBacklightOn()3022 static HostCheckBoxSetting *LCDBacklightOn() 2923 3023 { 2924 HostCheckBox *gc = new HostCheckBox("LCDBacklightOn");3024 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDBacklightOn"); 2925 3025 gc->setLabel(QObject::tr("Backlight always on")); 2926 3026 gc->setHelpText(QObject::tr("Turn on the backlight permanently " 2927 3027 "on the LCD display.")); … … static HostCheckBox *LCDBacklightOn() 2929 3029 return gc; 2930 3030 } 2931 3031 2932 static HostCheckBox *LCDHeartBeatOn()3032 static HostCheckBoxSetting *LCDHeartBeatOn() 2933 3033 { 2934 HostCheckBox *gc = new HostCheckBox("LCDHeartBeatOn");3034 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDHeartBeatOn"); 2935 3035 gc->setLabel(QObject::tr("Heartbeat always on")); 2936 3036 gc->setHelpText(QObject::tr("Turn on the LCD heartbeat.")); 2937 3037 gc->setValue(false); 2938 3038 return gc; 2939 3039 } 2940 3040 2941 static HostCheckBox *LCDBigClock()3041 static HostCheckBoxSetting *LCDBigClock() 2942 3042 { 2943 HostCheckBox *gc = new HostCheckBox("LCDBigClock");3043 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDBigClock"); 2944 3044 gc->setLabel(QObject::tr("Display large clock")); 2945 3045 gc->setHelpText(QObject::tr("On multiline displays try and display the time as large as possible.")); 2946 3046 gc->setValue(false); 2947 3047 return gc; 2948 3048 } 2949 3049 2950 static Host LineEdit*LCDKeyString()3050 static HostTextEditSetting *LCDKeyString() 2951 3051 { 2952 Host LineEdit *ge = new HostLineEdit("LCDKeyString");3052 HostTextEditSetting *ge = new HostTextEditSetting("LCDKeyString"); 2953 3053 ge->setLabel(QObject::tr("LCD key order")); 2954 3054 ge->setValue("ABCDEF"); 2955 3055 ge->setHelpText(QObject::tr("Enter the 6 Keypad Return Codes for your " … … static HostLineEdit *LCDKeyString() 2960 3060 return ge; 2961 3061 } 2962 3062 2963 static HostCheckBox *LCDEnable()3063 static HostCheckBoxSetting *LCDEnable() 2964 3064 { 2965 HostCheckBox *gc = new HostCheckBox("LCDEnable");3065 HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDEnable"); 2966 3066 gc->setLabel(QObject::tr("Enable LCD device")); 2967 3067 gc->setHelpText(QObject::tr("Use an LCD display to view MythTV status " 2968 3068 "information.")); 2969 3069 gc->setValue(false); 3070 gc->addTargetedChild("1",LCDShowTime()); 3071 gc->addTargetedChild("1",LCDShowMenu()); 3072 gc->addTargetedChild("1",LCDShowMusic()); 3073 gc->addTargetedChild("1",LCDShowMusicItems()); 3074 gc->addTargetedChild("1",LCDShowChannel()); 3075 gc->addTargetedChild("1",LCDShowRecStatus()); 3076 gc->addTargetedChild("1",LCDShowVolume()); 3077 gc->addTargetedChild("1",LCDShowGeneric()); 3078 gc->addTargetedChild("1",LCDBacklightOn()); 3079 gc->addTargetedChild("1",LCDHeartBeatOn()); 3080 gc->addTargetedChild("1",LCDBigClock()); 3081 gc->addTargetedChild("1",LCDKeyString()); 3082 gc->addTargetedChild("1",LCDPopupTime()); 2970 3083 return gc; 2971 3084 } 2972 3085 2973 class LcdSettings : public TriggeredConfigurationGroup2974 {2975 public:2976 LcdSettings() : TriggeredConfigurationGroup(false, false, false, false,2977 false, false, false, false)2978 {2979 setLabel(QObject::tr("LCD device display"));2980 setUseLabel(false);2981 2982 Setting* lcd_enable = LCDEnable();2983 addChild(lcd_enable);2984 setTrigger(lcd_enable);2985 2986 ConfigurationGroup *settings =2987 new VerticalConfigurationGroup(false, true, false, false);2988 ConfigurationGroup *setHoriz =2989 new HorizontalConfigurationGroup(false, false, false, false);2990 2991 ConfigurationGroup* setLeft =2992 new VerticalConfigurationGroup(false, false, false, false);2993 ConfigurationGroup* setRight =2994 new VerticalConfigurationGroup(false, false, false, false);2995 2996 setLeft->addChild(LCDShowTime());2997 setLeft->addChild(LCDShowMenu());2998 setLeft->addChild(LCDShowMusic());2999 setLeft->addChild(LCDShowMusicItems());3000 setLeft->addChild(LCDShowChannel());3001 setLeft->addChild(LCDShowRecStatus());3002 setRight->addChild(LCDShowVolume());3003 setRight->addChild(LCDShowGeneric());3004 setRight->addChild(LCDBacklightOn());3005 setRight->addChild(LCDHeartBeatOn());3006 setRight->addChild(LCDBigClock());3007 setRight->addChild(LCDKeyString());3008 setHoriz->addChild(setLeft);3009 setHoriz->addChild(setRight);3010 settings->addChild(setHoriz);3011 settings->addChild(LCDPopupTime());3012 3013 addTarget("1", settings);3014 3015 addTarget("0", new VerticalConfigurationGroup(true));3016 };3017 };3018 3019 3086 3020 3087 #if CONFIG_DARWIN 3021 static HostCheckBox *MacGammaCorrect()3088 static HostCheckBoxSetting *MacGammaCorrect() 3022 3089 { 3023 HostCheckBox *gc = new HostCheckBox("MacGammaCorrect");3090 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacGammaCorrect"); 3024 3091 gc->setLabel(QObject::tr("Enable gamma correction for video")); 3025 3092 gc->setValue(false); 3026 3093 gc->setHelpText(QObject::tr("If enabled, QuickTime will correct the gamma " … … static HostCheckBox *MacGammaCorrect() 3029 3096 return gc; 3030 3097 } 3031 3098 3032 static HostCheckBox *MacScaleUp()3099 static HostCheckBoxSetting *MacScaleUp() 3033 3100 { 3034 HostCheckBox *gc = new HostCheckBox("MacScaleUp");3101 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacScaleUp"); 3035 3102 gc->setLabel(QObject::tr("Scale video as necessary")); 3036 3103 gc->setValue(true); 3037 3104 gc->setHelpText(QObject::tr("If enabled, video will be scaled to fit your " … … static HostCheckBox *MacScaleUp() 3040 3107 return gc; 3041 3108 } 3042 3109 3043 static HostSpinBox *MacFullSkip()3110 static HostSpinBoxSetting *MacFullSkip() 3044 3111 { 3045 HostSpinBox *gs = new HostSpinBox("MacFullSkip", 0, 30, 1, true);3112 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFullSkip", 0, 30, 1, true); 3046 3113 gs->setLabel(QObject::tr("Frames to skip in fullscreen mode")); 3047 3114 gs->setValue(0); 3048 3115 gs->setHelpText(QObject::tr("Video displayed in fullscreen or non-windowed " … … static HostSpinBox *MacFullSkip() 3053 3120 return gs; 3054 3121 } 3055 3122 3056 static HostCheckBox *MacMainEnabled()3057 {3058 HostCheckBox *gc = new HostCheckBox("MacMainEnabled");3059 gc->setLabel(QObject::tr("Video in main window"));3060 gc->setValue(true);3061 gc->setHelpText(QObject::tr("If enabled, video will be displayed in the "3062 "main GUI window. Disable this when you only want video "3063 "on the desktop or in a floating window. Only valid when "3064 "\"Use GUI size for TV playback\" and \"Run the "3065 "frontend in a window\" are checked."));3066 return gc;3067 }3068 3123 3069 static HostSpinBox *MacMainSkip() 3124 3125 static HostSpinBoxSetting *MacMainSkip() 3070 3126 { 3071 HostSpinBox *gs = new HostSpinBox("MacMainSkip", 0, 30, 1, true);3127 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainSkip", 0, 30, 1, true); 3072 3128 gs->setLabel(QObject::tr("Frames to skip")); 3073 3129 gs->setValue(0); 3074 3130 gs->setHelpText(QObject::tr("Video in the main window will skip this many " … … static HostSpinBox *MacMainSkip() 3077 3133 return gs; 3078 3134 } 3079 3135 3080 static HostSpinBox *MacMainOpacity()3136 static HostSpinBoxSetting *MacMainOpacity() 3081 3137 { 3082 HostSpinBox *gs = new HostSpinBox("MacMainOpacity", 0, 100, 5, false);3138 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainOpacity", 0, 100, 5, false); 3083 3139 gs->setLabel(QObject::tr("Opacity")); 3084 3140 gs->setValue(100); 3085 3141 gs->setHelpText(QObject::tr("The opacity of the main window. Set to " … … static HostSpinBox *MacMainOpacity() 3088 3144 return gs; 3089 3145 } 3090 3146 3091 class MacMainSettings : public TriggeredConfigurationGroup 3147 static HostCheckBoxSetting *MacMainEnabled() 3092 3148 { 3093 public: 3094 MacMainSettings() : TriggeredConfigurationGroup(false) 3095 { 3096 setLabel(QObject::tr("Video in main window")); 3097 setUseLabel(false); 3098 Setting *gc = MacMainEnabled(); 3099 addChild(gc); 3100 setTrigger(gc); 3101 3102 VerticalConfigurationGroup *opts = 3103 new VerticalConfigurationGroup(false, false); 3104 opts->addChild(MacMainSkip()); 3105 opts->addChild(MacMainOpacity()); 3106 3107 addTarget("1", opts); 3108 addTarget("0", new VerticalConfigurationGroup(false, false)); 3109 } 3110 }; 3149 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacMainEnabled"); 3150 gc->setLabel(QObject::tr("Video in main window")); 3151 gc->setValue(true); 3152 gc->setHelpText(QObject::tr("If enabled, video will be displayed in the " 3153 "main GUI window. Disable this when you only want video " 3154 "on the desktop or in a floating window. Only valid when " 3155 "\"Use GUI size for TV playback\" and \"Run the " 3156 "frontend in a window\" are checked.")); 3111 3157 3112 static HostCheckBox *MacFloatEnabled() 3113 { 3114 HostCheckBox *gc = new HostCheckBox("MacFloatEnabled"); 3115 gc->setLabel(QObject::tr("Video in floating window")); 3116 gc->setValue(false); 3117 gc->setHelpText(QObject::tr("If enabled, video will be displayed in a " 3118 "floating window. Only valid when \"Use GUI size for TV " 3119 "playback\" and \"Run the frontend in a window\" are " 3120 "checked.")); 3158 gc->addTargetedChild("1", MacMainSkip()); 3159 gc->addTargetedChild("1", MacMainOpacity()); 3121 3160 return gc; 3122 3161 } 3123 3162 3124 static HostSpinBox *MacFloatSkip()3163 static HostSpinBoxSetting *MacFloatSkip() 3125 3164 { 3126 HostSpinBox *gs = new HostSpinBox("MacFloatSkip", 0, 30, 1, true);3165 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatSkip", 0, 30, 1, true); 3127 3166 gs->setLabel(QObject::tr("Frames to skip")); 3128 3167 gs->setValue(0); 3129 3168 gs->setHelpText(QObject::tr("Video in the floating window will skip " … … static HostSpinBox *MacFloatSkip() 3132 3171 return gs; 3133 3172 } 3134 3173 3135 static HostSpinBox *MacFloatOpacity()3174 static HostSpinBoxSetting *MacFloatOpacity() 3136 3175 { 3137 HostSpinBox *gs = new HostSpinBox("MacFloatOpacity", 0, 100, 5, false);3176 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatOpacity", 0, 100, 5, false); 3138 3177 gs->setLabel(QObject::tr("Opacity")); 3139 3178 gs->setValue(100); 3140 3179 gs->setHelpText(QObject::tr("The opacity of the floating window. Set to " … … static HostSpinBox *MacFloatOpacity() 3143 3182 return gs; 3144 3183 } 3145 3184 3146 class MacFloatSettings : public TriggeredConfigurationGroup 3185 static HostCheckBoxSetting *MacFloatEnabled() 3147 3186 { 3148 public: 3149 MacFloatSettings() : TriggeredConfigurationGroup(false) 3150 { 3151 setLabel(QObject::tr("Video in floating window")); 3152 setUseLabel(false); 3153 Setting *gc = MacFloatEnabled(); 3154 addChild(gc); 3155 setTrigger(gc); 3187 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacFloatEnabled"); 3188 gc->setLabel(QObject::tr("Video in floating window")); 3189 gc->setValue(false); 3190 gc->setHelpText(QObject::tr("If enabled, video will be displayed in a " 3191 "floating window. Only valid when \"Use GUI size for TV " 3192 "playback\" and \"Run the frontend in a window\" are " 3193 "checked.")); 3156 3194 3157 VerticalConfigurationGroup *opts =3158 new VerticalConfigurationGroup(false, false);3159 opts->addChild(MacFloatSkip());3160 opts->addChild(MacFloatOpacity()); 3195 gc->addTargetedChild("1", MacFloatSkip()); 3196 gc->addTargetedChild("1", MacFloatOpacity()); 3197 return gc; 3198 } 3161 3199 3162 addTarget("1", opts); 3163 addTarget("0", new VerticalConfigurationGroup(false, false)); 3164 } 3165 }; 3200 static HostSpinBoxSetting *MacDockSkip() 3201 { 3202 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDockSkip", 0, 30, 1, true); 3203 gs->setLabel(QObject::tr("Frames to skip")); 3204 gs->setValue(3); 3205 gs->setHelpText(QObject::tr("Video in the dock icon will skip this many " 3206 "frames for each frame drawn. Set to 0 to show " 3207 "every frame.")); 3208 return gs; 3209 } 3166 3210 3167 static HostCheckBox *MacDockEnabled()3211 static HostCheckBoxSetting *MacDockEnabled() 3168 3212 { 3169 HostCheckBox *gc = new HostCheckBox("MacDockEnabled");3213 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDockEnabled"); 3170 3214 gc->setLabel(QObject::tr("Video in the dock")); 3171 3215 gc->setValue(true); 3172 3216 gc->setHelpText(QObject::tr("If enabled, video will be displayed in the " 3173 3217 "application's dock icon. Only valid when \"Use GUI size " 3174 3218 "for TV playback\" and \"Run the frontend in a window\" " 3175 3219 "are checked.")); 3220 gc->addTargetedChild("1", MacDockSkip()); 3221 3176 3222 return gc; 3177 3223 } 3178 3224 3179 static HostSpinBox *MacDockSkip()3225 static HostSpinBoxSetting *MacDesktopSkip() 3180 3226 { 3181 HostSpinBox *gs = new HostSpinBox("MacDockSkip", 0, 30, 1, true);3227 HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDesktopSkip", 0, 30, 1, true); 3182 3228 gs->setLabel(QObject::tr("Frames to skip")); 3183 gs->setValue( 3);3184 gs->setHelpText(QObject::tr("Video in the dock iconwill skip this many "3229 gs->setValue(0); 3230 gs->setHelpText(QObject::tr("Video on the desktop will skip this many " 3185 3231 "frames for each frame drawn. Set to 0 to show " 3186 3232 "every frame.")); 3187 3233 return gs; 3188 3234 } 3189 3235 3190 class MacDockSettings : public TriggeredConfigurationGroup 3191 { 3192 public: 3193 MacDockSettings() : TriggeredConfigurationGroup(false) 3194 { 3195 setLabel(QObject::tr("Video in the dock")); 3196 setUseLabel(false); 3197 Setting *gc = MacDockEnabled(); 3198 addChild(gc); 3199 setTrigger(gc); 3200 3201 Setting *skip = MacDockSkip(); 3202 addTarget("1", skip); 3203 addTarget("0", new HorizontalConfigurationGroup(false, false)); 3204 } 3205 }; 3206 3207 static HostCheckBox *MacDesktopEnabled() 3236 static HostCheckBoxSetting *MacDesktopEnabled() 3208 3237 { 3209 HostCheckBox *gc = new HostCheckBox("MacDesktopEnabled");3238 HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDesktopEnabled"); 3210 3239 gc->setLabel(QObject::tr("Video on the desktop")); 3211 3240 gc->setValue(false); 3212 3241 gc->setHelpText(QObject::tr("If enabled, video will be displayed on the " 3213 3242 "desktop, behind the Finder icons. Only valid when \"Use " 3214 3243 "GUI size for TV playback\" and \"Run the frontend in a " 3215 3244 "window\" are checked.")); 3216 return gc;3217 }3218 3245 3219 static HostSpinBox *MacDesktopSkip() 3220 { 3221 HostSpinBox *gs = new HostSpinBox("MacDesktopSkip", 0, 30, 1, true); 3222 gs->setLabel(QObject::tr("Frames to skip")); 3223 gs->setValue(0); 3224 gs->setHelpText(QObject::tr("Video on the desktop will skip this many " 3225 "frames for each frame drawn. Set to 0 to show " 3226 "every frame.")); 3227 return gs; 3228 } 3246 gc->addTarget("1", MacDesktopSkip()); 3229 3247 3230 class MacDesktopSettings : public TriggeredConfigurationGroup 3231 { 3232 public: 3233 MacDesktopSettings() : TriggeredConfigurationGroup(false) 3234 { 3235 setLabel(QObject::tr("Video on the desktop")); 3236 setUseLabel(false); 3237 Setting *gc = MacDesktopEnabled(); 3238 addChild(gc); 3239 setTrigger(gc); 3248 return gc; 3249 } 3240 3250 3241 Setting *skip = MacDesktopSkip();3242 addTarget("1", skip);3243 addTarget("0", new HorizontalConfigurationGroup(false, false));3244 }3245 };3246 3251 #endif 3247 3252 3248 static HostCheckBox *WatchTVGuide()3253 static HostCheckBoxSetting *WatchTVGuide() 3249 3254 { 3250 HostCheckBox *gc = new HostCheckBox("WatchTVGuide");3255 HostCheckBoxSetting *gc = new HostCheckBoxSetting("WatchTVGuide"); 3251 3256 gc->setLabel(QObject::tr("Show the program guide when starting Live TV")); 3252 3257 gc->setHelpText(QObject::tr("This starts the program guide immediately " 3253 3258 "upon starting to watch Live TV.")); … … static HostCheckBox *WatchTVGuide() 3255 3260 return gc; 3256 3261 } 3257 3262 3263 3264 /* This code is a duplication the clas DatabaseSettings. As it it also use bymythbackend I rewrote here for the time being */ 3265 3266 class DatabaseGroupSetting : public GroupSetting 3267 { 3268 public: 3269 DatabaseGroupSetting(const QString &DBhostOverride = QString::null):GroupSetting() 3270 { 3271 m_DBhostOverride = DBhostOverride; 3272 3273 setLabel(QObject::tr("Database Configuration")); 3274 3275 MSqlQuery query(MSqlQuery::InitCon()); 3276 if (query.isConnected()) 3277 setHelpText(QObject::tr("All database settings take effect when " 3278 "you restart this program.")); 3279 else 3280 setHelpText(QObject::tr("MythTV could not connect to the database. " 3281 "Please verify your database settings " 3282 "below.")); 3283 3284 dbHostName = new TransTextEditSetting(); 3285 dbHostName->setLabel(QObject::tr("Hostname")); 3286 dbHostName->setHelpText(QObject::tr("The host name or IP address of " 3287 "the machine hosting the database. " 3288 "This information is required.")); 3289 addChild(dbHostName); 3290 3291 dbHostPing = new TransMythUICheckBoxSetting(); 3292 dbHostPing->setLabel(QObject::tr("Ping test server?")); 3293 dbHostPing->setHelpText(QObject::tr("Test basic host connectivity using " 3294 "the ping command. Turn off if your " 3295 "host or network don't support ping " 3296 "(ICMP ECHO) packets")); 3297 addChild(dbHostPing); 3298 3299 dbPort = new TransTextEditSetting(); 3300 dbPort->setLabel(QObject::tr("Port")); 3301 dbPort->setHelpText(QObject::tr("The port number the database is running " 3302 "on. Leave blank if using the default " 3303 "port (3306).")); 3304 addChild(dbPort); 3305 3306 dbName = new TransTextEditSetting(); 3307 dbName->setLabel(QObject::tr("Database name")); 3308 dbName->setHelpText(QObject::tr("The name of the database. " 3309 "This information is required.")); 3310 addChild(dbName); 3311 3312 dbUserName = new TransTextEditSetting(); 3313 dbUserName->setLabel(QObject::tr("User")); 3314 dbUserName->setHelpText(QObject::tr("The user name to use while " 3315 "connecting to the database. " 3316 "This information is required.")); 3317 addChild(dbUserName); 3318 3319 dbPassword = new TransTextEditSetting(); 3320 dbPassword->setLabel(QObject::tr("Password")); 3321 dbPassword->setHelpText(QObject::tr("The password to use while " 3322 "connecting to the database. " 3323 "This information is required.")); 3324 addChild(dbPassword); 3325 3326 localEnabled = new TransMythUICheckBoxSetting(); 3327 localEnabled->setLabel(QObject::tr("Use custom identifier for frontend " 3328 "preferences")); 3329 localEnabled->setHelpText(QObject::tr("If this frontend's host name " 3330 "changes often, check this box " 3331 "and provide a network-unique " 3332 "name to identify it. " 3333 "If unchecked, the frontend " 3334 "machine's local host name will " 3335 "be used to save preferences in " 3336 "the database.")); 3337 addChild(localEnabled); 3338 3339 3340 localHostName = new TransTextEditSetting(); 3341 localHostName->setLabel(QObject::tr("Custom identifier")); 3342 localHostName->setHelpText(QObject::tr("An identifier to use while " 3343 "saving the settings for this " 3344 "frontend.")); 3345 localEnabled->addTargetedChild("1", localHostName); 3346 3347 3348 wolEnabled = new TransMythUICheckBoxSetting(); 3349 wolEnabled->setLabel(QObject::tr("Enable database server wakeup")); 3350 wolEnabled->setHelpText(QObject::tr("If enabled, the frontend will use " 3351 "database wakeup parameters to " 3352 "reconnect to the database server.")); 3353 addChild(wolEnabled); 3354 3355 wolReconnect = new TransMythUISpinBoxSetting(0, 60, 1, true); 3356 wolReconnect->setLabel(QObject::tr("Reconnect time")); 3357 wolReconnect->setHelpText(QObject::tr("The time in seconds to wait for " 3358 "the server to wake up.")); 3359 wolEnabled->addTargetedChild("1",wolReconnect); 3360 3361 wolRetry = new TransMythUISpinBoxSetting(1, 10, 1, true); 3362 wolRetry->setLabel(QObject::tr("Retry attempts")); 3363 wolRetry->setHelpText(QObject::tr("The number of retries to wake the " 3364 "server before the frontend gives " 3365 "up.")); 3366 wolEnabled->addTargetedChild("1",wolRetry); 3367 3368 wolCommand = new TransTextEditSetting(); 3369 wolCommand->setLabel(QObject::tr("Wake command")); 3370 wolCommand->setHelpText(QObject::tr("The command executed on this " 3371 "frontend to wake up the database " 3372 "server (eg. sudo /etc/init.d/mysql " 3373 "restart).")); 3374 wolEnabled->addTargetedChild("1",wolCommand); 3375 } 3376 3377 void Load(void) 3378 { 3379 3380 DatabaseParams params = gContext->GetDatabaseParams(); 3381 3382 if (params.dbHostName.isEmpty() || 3383 params.dbUserName.isEmpty() || 3384 params.dbPassword.isEmpty() || 3385 params.dbName.isEmpty()) 3386 setHelpText(getHelpText() + "\n" + 3387 QObject::tr("Required fields are" 3388 " marked with an asterisk (*).")); 3389 3390 if (params.dbHostName.isEmpty()) 3391 { 3392 dbHostName->setLabel("* " + dbHostName->getLabel()); 3393 dbHostName->setValue(m_DBhostOverride); 3394 } 3395 else 3396 dbHostName->setValue(params.dbHostName); 3397 3398 dbHostPing->setValue(params.dbHostPing); 3399 3400 if (params.dbPort) 3401 dbPort->setValue(QString::number(params.dbPort)); 3402 3403 dbUserName->setValue(params.dbUserName); 3404 if (params.dbUserName.isEmpty()) 3405 dbUserName->setLabel("* " + dbUserName->getLabel()); 3406 dbPassword->setValue(params.dbPassword); 3407 if (params.dbPassword.isEmpty()) 3408 dbPassword->setLabel("* " + dbPassword->getLabel()); 3409 dbName->setValue(params.dbName); 3410 if (params.dbName.isEmpty()) 3411 dbName->setLabel("* " + dbName->getLabel()); 3412 3413 localEnabled->setValue(params.localEnabled); 3414 localHostName->setValue(params.localHostName); 3415 3416 wolEnabled->setValue(params.wolEnabled); 3417 wolReconnect->setValue(params.wolReconnect); 3418 wolRetry->setValue(params.wolRetry); 3419 wolCommand->setValue(params.wolCommand); 3420 //TODO set all the children's m_haveChanged to false 3421 }; 3422 void Save(void) 3423 { 3424 DatabaseParams params = gContext->GetDatabaseParams(); 3425 3426 params.dbHostName = dbHostName->getValue(); 3427 params.dbHostPing = dbHostPing->boolValue(); 3428 params.dbPort = dbPort->getValue().toInt(); 3429 params.dbUserName = dbUserName->getValue(); 3430 params.dbPassword = dbPassword->getValue(); 3431 params.dbName = dbName->getValue(); 3432 params.dbType = "QMYSQL"; 3433 3434 params.localEnabled = localEnabled->boolValue(); 3435 params.localHostName = localHostName->getValue(); 3436 3437 params.wolEnabled = wolEnabled->boolValue(); 3438 params.wolReconnect = wolReconnect->intValue(); 3439 params.wolRetry = wolRetry->intValue(); 3440 params.wolCommand = wolCommand->getValue(); 3441 3442 gContext->SaveDatabaseParams(params); 3443 //TODO set all the children's m_haveChanged to false 3444 }; 3445 3446 protected: 3447 TransTextEditSetting *dbHostName; 3448 TransMythUICheckBoxSetting *dbHostPing; 3449 TransTextEditSetting *dbPort; 3450 TransTextEditSetting *dbName; 3451 TransTextEditSetting *dbUserName; 3452 TransTextEditSetting *dbPassword; 3453 TransMythUICheckBoxSetting *localEnabled; 3454 TransTextEditSetting *localHostName; 3455 TransMythUICheckBoxSetting *wolEnabled; 3456 TransMythUISpinBoxSetting *wolReconnect; 3457 TransMythUISpinBoxSetting *wolRetry; 3458 TransTextEditSetting *wolCommand; 3459 3460 QString m_DBhostOverride; 3461 }; 3462 3463 /* end of duplicated code form DatabaseSettings */ 3464 3258 3465 MainGeneralSettings::MainGeneralSettings() 3259 3466 { 3260 DatabaseSettings::addDatabaseSettings(this); 3467 //DatabaseSettings::addDatabaseSettings(this); 3468 setLabel(QObject::tr("Main Settings")); 3469 3470 addChild(new DatabaseGroupSetting()); 3261 3471 3262 VerticalConfigurationGroup *pin = 3263 new VerticalConfigurationGroup(false, true, false, false); 3472 GroupSetting *pin = new GroupSetting(); 3264 3473 pin->setLabel(QObject::tr("Settings Access")); 3265 3474 pin->addChild(SetupPinCodeRequired()); 3266 3475 pin->addChild(SetupPinCode()); 3267 3476 addChild(pin); 3268 3477 3269 VerticalConfigurationGroup *general = 3270 new VerticalConfigurationGroup(false, true, false, false); 3478 GroupSetting *general = new GroupSetting(); 3271 3479 general->setLabel(QObject::tr("General")); 3272 3480 general->addChild(UseVirtualKeyboard()); 3273 3481 general->addChild(ScreenShotPath()); 3274 3482 addChild(general); 3275 3483 3276 VerticalConfigurationGroup *media = 3277 new VerticalConfigurationGroup(false, true, false, false); 3484 GroupSetting *media = new GroupSetting(); 3278 3485 media->setLabel(QObject::tr("Media Monitor")); 3279 MythMediaSettings *mediaMon = new MythMediaSettings(); 3280 media->addChild(mediaMon); 3486 media->addChild(EnableMediaMon()); 3281 3487 addChild(media); 3282 3488 3283 VerticalConfigurationGroup *shutdownSettings = 3284 new VerticalConfigurationGroup(true, true, false, false); 3489 GroupSetting *shutdownSettings = new GroupSetting(); 3285 3490 shutdownSettings->setLabel(QObject::tr("Shutdown/Reboot Settings")); 3286 3491 shutdownSettings->addChild(OverrideExitMenu()); 3287 3492 shutdownSettings->addChild(HaltCommand()); 3288 3493 shutdownSettings->addChild(RebootCommand()); 3289 3494 addChild(shutdownSettings); 3290 3495 3291 VerticalConfigurationGroup *remotecontrol = 3292 new VerticalConfigurationGroup(false, true, false, false); 3496 GroupSetting *remotecontrol = new GroupSetting(); 3293 3497 remotecontrol->setLabel(QObject::tr("Remote Control")); 3294 3498 remotecontrol->addChild(LircDaemonDevice()); 3295 3499 remotecontrol->addChild(NetworkControlEnabled()); 3296 remotecontrol->addChild(NetworkControlPort());3297 remotecontrol->addChild(UDPNotifyPort());3298 3500 addChild(remotecontrol); 3299 3501 } 3300 3502 3301 PlaybackSettings::PlaybackSettings()3503 void MainGeneralSettings::applyChange() 3302 3504 { 3303 uint i = 0, total = 8; 3304 #if CONFIG_DARWIN 3305 total += 2; 3306 #endif // USING_DARWIN 3307 3308 3309 VerticalConfigurationGroup* general1 = 3310 new VerticalConfigurationGroup(false); 3311 general1->setLabel(QObject::tr("General Playback") + 3312 QString(" (%1/%2)").arg(++i).arg(total)); 3313 3314 HorizontalConfigurationGroup *columns = 3315 new HorizontalConfigurationGroup(false, false, true, true); 3316 3317 VerticalConfigurationGroup *column1 = 3318 new VerticalConfigurationGroup(false, false, true, true); 3319 column1->addChild(RealtimePriority()); 3320 column1->addChild(DecodeExtraAudio()); 3321 column1->addChild(JumpToProgramOSD()); 3322 columns->addChild(column1); 3505 QStringList strlist( QString("REFRESH_BACKEND") ); 3506 gCoreContext->SendReceiveStringList(strlist); 3507 } 3323 3508 3324 VerticalConfigurationGroup *column2 = 3325 new VerticalConfigurationGroup(false, false, true, true); 3326 column2->addChild(ClearSavedPosition()); 3327 column2->addChild(AltClearSavedPosition()); 3328 column2->addChild(AutomaticSetWatched()); 3329 column2->addChild(ContinueEmbeddedTVPlay()); 3330 columns->addChild(column2); 3331 3332 general1->addChild(columns); 3333 general1->addChild(LiveTVIdleTimeout()); 3334 addChild(general1); 3335 3336 VerticalConfigurationGroup* general2 = 3337 new VerticalConfigurationGroup(false); 3338 general2->setLabel(QObject::tr("General Playback") + 3339 QString(" (%1/%2)").arg(++i).arg(total)); 3340 3341 HorizontalConfigurationGroup* oscan = 3342 new HorizontalConfigurationGroup(false, false, true, true); 3343 VerticalConfigurationGroup *ocol1 = 3344 new VerticalConfigurationGroup(false, false, true, true); 3345 VerticalConfigurationGroup *ocol2 = 3346 new VerticalConfigurationGroup(false, false, true, true); 3347 ocol1->addChild(VertScanPercentage()); 3348 ocol1->addChild(YScanDisplacement()); 3349 ocol2->addChild(HorizScanPercentage()); 3350 ocol2->addChild(XScanDisplacement()); 3351 oscan->addChild(ocol1); 3352 oscan->addChild(ocol2); 3353 3354 HorizontalConfigurationGroup* aspect_fill = 3355 new HorizontalConfigurationGroup(false, false, true, true); 3509 PlaybackSettings::PlaybackSettings() 3510 { 3511 setLabel(QObject::tr("Playback settings")); 3512 3513 GroupSetting* general = new GroupSetting(); 3514 general->setLabel(QObject::tr("General Playback")); 3515 general->addChild(RealtimePriority()); 3516 general->addChild(DecodeExtraAudio()); 3517 general->addChild(JumpToProgramOSD()); 3518 general->addChild(ClearSavedPosition()); 3519 general->addChild(AltClearSavedPosition()); 3520 general->addChild(AutomaticSetWatched()); 3521 general->addChild(ContinueEmbeddedTVPlay()); 3522 general->addChild(LiveTVIdleTimeout()); 3523 3524 GroupSetting* oscan = new GroupSetting(); 3525 oscan->setLabel(QObject::tr("Scaling")); 3526 oscan->addChild(VertScanPercentage()); 3527 oscan->addChild(YScanDisplacement()); 3528 oscan->addChild(HorizScanPercentage()); 3529 oscan->addChild(XScanDisplacement()); 3530 general->addChild(oscan); 3531 3532 GroupSetting* aspect_fill = new GroupSetting(); 3533 aspect_fill->setLabel(QObject::tr("Aspect ratio & Zoom")); 3356 3534 aspect_fill->addChild(AspectOverride()); 3357 3535 aspect_fill->addChild(AdjustFill()); 3358 3536 3359 general2->addChild(oscan); 3360 general2->addChild(aspect_fill); 3361 general2->addChild(LetterboxingColour()); 3362 general2->addChild(PIPLocationComboBox()); 3363 general2->addChild(PlaybackExitPrompt()); 3364 general2->addChild(EndOfRecordingExitPrompt()); 3365 addChild(general2); 3366 3537 general->addChild(aspect_fill); 3538 general->addChild(LetterboxingColour()); 3539 general->addChild(PIPLocationComboBox()); 3540 general->addChild(PlaybackExitPrompt()); 3541 general->addChild(EndOfRecordingExitPrompt()); 3542 addChild(general); 3543 /*TODO 3367 3544 QString tmp = QString(" (%1/%2)").arg(++i).arg(total); 3368 3545 addChild(new PlaybackProfileConfigs(tmp)); 3546 */ 3547 3548 //addChild(new PlaybackProfileConfigsButton()); 3369 3549 3370 VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false); 3371 pbox->setLabel(QObject::tr("View Recordings") +3372 QString(" (%1/%2)").arg(++i).arg(total));3550 3551 GroupSetting* pbox = new GroupSetting(); 3552 pbox->setLabel(QObject::tr("View Recordings")); 3373 3553 pbox->addChild(PlayBoxOrdering()); 3374 3554 pbox->addChild(PlayBoxEpisodeSort()); 3375 3555 // Disabled until we re-enable live previews 3376 3556 // pbox->addChild(PlaybackPreview()); 3377 3557 // pbox->addChild(HWAccelPlaybackPreview()); 3378 3558 pbox->addChild(PBBStartInTitle()); 3379 addChild(pbox);3380 3559 3381 VerticalConfigurationGroup* pbox2 = new VerticalConfigurationGroup(false); 3382 pbox2->setLabel(QObject::tr("Recording Groups") +3383 QString(" (%1/%2)").arg(++i).arg(total));3560 3561 GroupSetting* pbox2 = new GroupSetting(); 3562 pbox2->setLabel(QObject::tr("Recording Groups")); 3384 3563 pbox2->addChild(DisplayRecGroup()); 3385 3564 pbox2->addChild(QueryInitialFilter()); 3386 3565 pbox2->addChild(RememberRecGroup()); 3387 3566 pbox2->addChild(UseGroupNameAsAllPrograms()); 3388 addChild(pbox2); 3389 3390 VerticalConfigurationGroup* pbox3 = new VerticalConfigurationGroup(false); 3391 pbox3->setLabel(QObject::tr("View Recordings") + 3392 QString(" (%1/%2)").arg(++i).arg(total)); 3393 pbox3->addChild(DisplayGroupTitleSort()); 3394 pbox3->addChild(new WatchListSettings()); 3395 addChild(pbox3); 3396 3397 VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false); 3398 seek->setLabel(QObject::tr("Seeking") + 3399 QString(" (%1/%2)").arg(++i).arg(total)); 3567 pbox->addChild(pbox2); 3568 3569 pbox->addChild(DisplayGroupTitleSort()); 3570 pbox->addChild(PlaybackWatchList()); 3571 addChild(pbox); 3572 3573 GroupSetting* seek = new GroupSetting(); 3574 seek->setLabel(QObject::tr("Seeking")); 3400 3575 seek->addChild(SmartForward()); 3401 3576 seek->addChild(FFRewReposTime()); 3402 3577 seek->addChild(FFRewReverse()); 3403 3578 seek->addChild(ExactSeeking()); 3404 3579 addChild(seek); 3405 3580 3406 VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false); 3407 comms->setLabel(QObject::tr("Commercial Skip") + 3408 QString(" (%1/%2)").arg(++i).arg(total)); 3581 3582 3583 GroupSetting* comms = new GroupSetting(); 3584 comms->setLabel(QObject::tr("Commercial Skip")); 3409 3585 comms->addChild(AutoCommercialSkip()); 3410 3586 comms->addChild(CommRewindAmount()); 3411 3587 comms->addChild(CommNotifyAmount()); 3588 //TODO mixing Host setting with Gloabal setting, not very clear for the user 3412 3589 comms->addChild(MaximumCommercialSkip()); 3413 3590 comms->addChild(MergeShortCommBreaks()); 3414 3591 addChild(comms); 3415 3592 3416 3593 #if CONFIG_DARWIN 3417 VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false); 3418 mac1->setLabel(QObject::tr("Mac OS X Video Settings") + 3419 QString(" (%1/%2)").arg(++i).arg(total)); 3420 mac1->addChild(MacGammaCorrect()); 3421 mac1->addChild(MacScaleUp()); 3422 mac1->addChild(MacFullSkip()); 3423 addChild(mac1); 3424 3425 VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false); 3426 mac2->setLabel(QObject::tr("Mac OS X Video Settings") + 3427 QString(" (%1/%2)").arg(++i).arg(total)); 3428 mac2->addChild(new MacMainSettings()); 3429 mac2->addChild(new MacFloatSettings()); 3430 3431 HorizontalConfigurationGroup *row = 3432 new HorizontalConfigurationGroup(false, false, true, true); 3433 row->addChild(new MacDockSettings()); 3434 row->addChild(new MacDesktopSettings()); 3435 mac2->addChild(row); 3436 3437 addChild(mac2); 3594 GroupSetting* ma1 = new GroupSetting(false); 3595 mac->setLabel(QObject::tr("Mac OS X Video Settings")); 3596 mac->addChild(MacGammaCorrect()); 3597 mac->addChild(MacScaleUp()); 3598 mac->addChild(MacFullSkip()); 3599 3600 mac->addChild(MacMainEnabled()); 3601 mac->addChild(MacFloatEnabled()); 3602 mac->addChild(MacDockEnabled()); 3603 mac->addChild(MacDesktopEnabled()); 3604 mac->addChild(row); 3605 3606 addChild(mac); 3438 3607 #endif 3439 3608 } 3440 3609 3441 3610 OSDSettings::OSDSettings() 3442 3611 { 3443 VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false); 3444 osd->setLabel(QObject::tr("On-screen Display")); 3612 setLabel(QObject::tr("On-screen Display")); 3445 3613 3446 osd->addChild(EnableMHEG()); 3447 osd->addChild(PersistentBrowseMode()); 3448 osd->addChild(BrowseAllTuners()); 3449 osd->addChild(CCBackground()); 3450 osd->addChild(DefaultCCMode()); 3451 osd->addChild(PreferCC708()); 3452 osd->addChild(SubtitleFont()); 3453 osd->addChild(OSDCC708TextZoomPercentage()); 3454 osd->addChild(SubtitleCodec()); 3455 addChild(osd); 3614 addChild(EnableMHEG()); 3615 addChild(PersistentBrowseMode()); 3616 addChild(BrowseAllTuners()); 3617 addChild(CCBackground()); 3618 addChild(DefaultCCMode()); 3619 addChild(PreferCC708()); 3620 addChild(SubtitleFont()); 3621 addChild(OSDCC708TextZoomPercentage()); 3622 addChild(SubtitleCodec()); 3456 3623 3457 3624 //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false); 3458 3625 //cc->setLabel(QObject::tr("Closed Captions")); … … OSDSettings::OSDSettings() 3467 3634 3468 3635 GeneralSettings::GeneralSettings() 3469 3636 { 3470 VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false);3637 GroupSetting* general = new GroupSetting(); 3471 3638 general->setLabel(QObject::tr("General (Basic)")); 3472 3639 general->addChild(ChannelOrdering()); 3473 3640 general->addChild(ChannelFormat()); 3474 3641 general->addChild(LongChannelFormat()); 3642 //LiveTVPriority (backend setting) should probably not be mixed with frontend settings 3475 3643 general->addChild(LiveTVPriority()); 3476 3644 addChild(general); 3477 3645 3478 VerticalConfigurationGroup* autoexp = new VerticalConfigurationGroup(false);3646 GroupSetting* autoexp = new GroupSetting(); 3479 3647 autoexp->setLabel(QObject::tr("General (Auto-Expire)")); 3480 3648 autoexp->addChild(AutoExpireMethod()); 3481 3482 VerticalConfigurationGroup *expgrp0 = 3483 new VerticalConfigurationGroup(false, false, true, true); 3484 expgrp0->addChild(AutoExpireDefault()); 3485 expgrp0->addChild(RerecordWatched()); 3486 expgrp0->addChild(AutoExpireWatchedPriority()); 3487 3488 VerticalConfigurationGroup *expgrp1 = 3489 new VerticalConfigurationGroup(false, false, true, true); 3490 expgrp1->addChild(AutoExpireLiveTVMaxAge()); 3491 expgrp1->addChild(AutoExpireDayPriority()); 3492 expgrp1->addChild(AutoExpireExtraSpace()); 3493 3494 HorizontalConfigurationGroup *expgrp = 3495 new HorizontalConfigurationGroup(false, false, true, true); 3496 expgrp->addChild(expgrp0); 3497 expgrp->addChild(expgrp1); 3498 3499 autoexp->addChild(expgrp); 3500 autoexp->addChild(new DeletedExpireOptions()); 3501 3649 autoexp->addChild(AutoExpireDefault()); 3650 autoexp->addChild(RerecordWatched()); 3651 autoexp->addChild(AutoExpireWatchedPriority()); 3652 autoexp->addChild(AutoExpireLiveTVMaxAge()); 3653 autoexp->addChild(AutoExpireDayPriority()); 3654 autoexp->addChild(AutoExpireExtraSpace()); 3655 autoexp->addChild(AutoExpireInsteadOfDelete()); 3502 3656 addChild(autoexp); 3503 3657 3504 VerticalConfigurationGroup* jobs = new VerticalConfigurationGroup(false);3658 GroupSetting* jobs = new GroupSetting(); 3505 3659 jobs->setLabel(QObject::tr("General (Jobs)")); 3506 3660 jobs->addChild(CommercialSkipMethod()); 3507 3661 jobs->addChild(CommFlagFast()); … … GeneralSettings::GeneralSettings() 3509 3663 jobs->addChild(DefaultTranscoder()); 3510 3664 jobs->addChild(DeferAutoTranscodeDays()); 3511 3665 3512 VerticalConfigurationGroup* autogrp0 = 3513 new VerticalConfigurationGroup(false, false, true, true); 3514 autogrp0->addChild(AutoMetadataLookup()); 3515 autogrp0->addChild(AutoCommercialFlag()); 3516 autogrp0->addChild(AutoTranscode()); 3517 3518 VerticalConfigurationGroup* autogrp1 = 3519 new VerticalConfigurationGroup(false, false, true, true); 3520 autogrp0->addChild(AutoRunUserJob(1)); 3521 autogrp1->addChild(AutoRunUserJob(2)); 3522 autogrp1->addChild(AutoRunUserJob(3)); 3523 autogrp1->addChild(AutoRunUserJob(4)); 3524 3525 HorizontalConfigurationGroup *autogrp = 3526 new HorizontalConfigurationGroup(true, true, false, true); 3666 GroupSetting *autogrp = new GroupSetting(); 3527 3667 autogrp->setLabel( 3528 3668 QObject::tr("Default Job Queue Settings for New Scheduled Recordings")); 3529 autogrp->addChild(autogrp0); 3530 autogrp->addChild(autogrp1); 3669 autogrp->addChild(AutoMetadataLookup()); 3670 autogrp->addChild(AutoCommercialFlag()); 3671 autogrp->addChild(AutoTranscode()); 3672 autogrp->addChild(AutoRunUserJob(1)); 3673 autogrp->addChild(AutoRunUserJob(2)); 3674 autogrp->addChild(AutoRunUserJob(3)); 3675 autogrp->addChild(AutoRunUserJob(4)); 3676 3531 3677 jobs->addChild(autogrp); 3532 3678 3533 3679 addChild(jobs); 3534 3680 3535 VerticalConfigurationGroup* general2 = new VerticalConfigurationGroup(false);3681 GroupSetting* general2 = new GroupSetting(); 3536 3682 general2->setLabel(QObject::tr("General (Advanced)")); 3537 3683 general2->addChild(RecordPreRoll()); 3538 3684 general2->addChild(RecordOverTime()); 3539 3685 general2->addChild(CategoryOverTimeSettings()); 3540 3686 addChild(general2); 3541 3687 3542 VerticalConfigurationGroup* changrp = new VerticalConfigurationGroup(false);3688 GroupSetting* changrp = new GroupSetting(); 3543 3689 changrp->setLabel(QObject::tr("General (Channel Groups)")); 3544 ChannelGroupSettings *changroupsettings = new ChannelGroupSettings(); 3545 changrp->addChild(changroupsettings); 3690 changrp->addChild(ChannelGroupRememberLast()); 3546 3691 changrp->addChild(BrowseChannelGroup()); 3547 3692 addChild(changrp); 3548 3693 } 3549 3694 3550 3695 EPGSettings::EPGSettings() 3551 3696 { 3552 VerticalConfigurationGroup* epg = new VerticalConfigurationGroup(false); 3553 epg->setLabel(QObject::tr("Program Guide") + " 1/1"); 3554 epg->addChild(WatchTVGuide()); 3555 epg->addChild(DefaultTVChannel()); 3556 epg->addChild(EPGRecThreshold()); 3557 addChild(epg); 3697 setLabel(QObject::tr("Program Guide")); 3698 addChild(WatchTVGuide()); 3699 addChild(DefaultTVChannel()); 3700 addChild(EPGRecThreshold()); 3558 3701 } 3559 3702 3560 3703 GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3561 3704 { 3562 VerticalConfigurationGroup* sched = new VerticalConfigurationGroup(false);3705 GroupSetting* sched = new GroupSetting(); 3563 3706 sched->setLabel(QObject::tr("Scheduler Options")); 3564 3707 3565 3708 sched->addChild(GRSchedMoveHigher()); … … GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3572 3715 sched->addChild(GRAutoRecPriority()); 3573 3716 addChild(sched); 3574 3717 3575 VerticalConfigurationGroup* access = new VerticalConfigurationGroup(false);3718 GroupSetting* access = new GroupSetting(); 3576 3719 access->setLabel(QObject::tr("Accessibility Options")); 3577 3720 3578 3721 access->addChild(GRSignLangRecPriority()); … … GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3582 3725 access->addChild(GRAudioDescRecPriority()); 3583 3726 addChild(access); 3584 3727 3585 VerticalConfigurationGroup* rtype = new VerticalConfigurationGroup(false);3728 GroupSetting* rtype = new GroupSetting(); 3586 3729 rtype->setLabel(QObject::tr("Recording Type Priority Settings")); 3587 3730 3588 3731 rtype->addChild(GRSingleRecordRecPriority()); … … GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings() 3597 3740 3598 3741 AppearanceSettings::AppearanceSettings() 3599 3742 { 3600 VerticalConfigurationGroup* screen = new VerticalConfigurationGroup(false);3743 GroupSetting* screen = new GroupSetting(); 3601 3744 screen->setLabel(QObject::tr("Theme") + " / " + QObject::tr("Screen Settings")); 3745 addChild(screen); 3602 3746 3603 3747 screen->addChild(MenuTheme()); 3604 3748 … … AppearanceSettings::AppearanceSettings() 3611 3755 // screen->addChild(DisplaySizeHeight()); 3612 3756 // screen->addChild(DisplaySizeWidth()); 3613 3757 3614 VerticalConfigurationGroup *column1 = 3615 new VerticalConfigurationGroup(false, false, false, false); 3616 3617 column1->addChild(GuiWidth()); 3618 column1->addChild(GuiHeight()); 3619 column1->addChild(GuiOffsetX()); 3620 column1->addChild(GuiOffsetY()); 3621 3622 VerticalConfigurationGroup *column2 = 3623 new VerticalConfigurationGroup(false, false, false, false); 3624 3625 column2->addChild(GuiSizeForTV()); 3626 column2->addChild(HideMouseCursor()); 3627 column2->addChild(RunInWindow()); 3628 column2->addChild(UseFixedWindowSize()); 3629 3630 HorizontalConfigurationGroup *columns = 3631 new HorizontalConfigurationGroup(false, false, false, false); 3758 GroupSetting *guiDimension = 3759 new GroupSetting(); 3760 guiDimension->setLabel(QObject::tr("Gui dimension")); 3761 //TODO display an helpfull value such as 640x480+10+2 3632 3762 3633 columns->addChild(column1); 3634 columns->addChild(column2); 3763 guiDimension->addChild(GuiWidth()); 3764 guiDimension->addChild(GuiHeight()); 3765 guiDimension->addChild(GuiOffsetX()); 3766 guiDimension->addChild(GuiOffsetY()); 3767 screen->addChild(guiDimension); 3635 3768 3636 screen->addChild(columns); 3637 3638 addChild(screen); 3769 screen->addChild(GuiSizeForTV()); 3770 screen->addChild(HideMouseCursor()); 3771 screen->addChild(RunInWindow()); 3772 screen->addChild(UseFixedWindowSize()); 3639 3773 3640 3774 #if defined(USING_XRANDR) || CONFIG_DARWIN 3641 3775 const vector<DisplayResScreen> scr = GetVideoModes(); 3642 3776 if (!scr.empty()) 3643 addChild( new VideoModeSettings());3777 addChild(UseVideoModes()); 3644 3778 #endif 3645 VerticalConfigurationGroup* dates = new VerticalConfigurationGroup(false);3779 GroupSetting* dates = new GroupSetting(); 3646 3780 dates->setLabel(QObject::tr("Localization")); 3647 3781 dates->addChild(MythLanguage()); 3648 3782 dates->addChild(ISO639PreferredLanguage(0)); … … AppearanceSettings::AppearanceSettings() 3652 3786 dates->addChild(MythTimeFormat()); 3653 3787 addChild(dates); 3654 3788 3655 addChild(new LcdSettings()); 3789 addChild(LCDEnable()); 3790 } 3791 3792 void AppearanceSettings::applyChange() 3793 { 3794 qApp->processEvents(); 3795 GetMythMainWindow()->JumpTo("Reload Theme"); 3656 3796 } 3657 3797 3658 3798 // vim:set sw=4 ts=4 expandtab: -
mythtv/programs/mythfrontend/globalsettings.h
diff --git a/mythtv/programs/mythfrontend/globalsettings.h b/mythtv/programs/mythfrontend/globalsettings.h index 93e774a..68736f7 100644
a b 7 7 #include "settings.h" 8 8 #include "mythcontext.h" 9 9 #include "videodisplayprofile.h" 10 #include "standardsettings.h" 10 11 11 12 #include <QMutex> 12 13 13 14 class QFileInfo; 14 15 15 class PlaybackSettings : public ConfigurationWizard16 class PlaybackSettings : public GroupSetting //ConfigurationWizard 16 17 { 17 18 public: 18 19 PlaybackSettings(); 19 20 }; 20 21 21 class OSDSettings: virtual public ConfigurationWizard 22 //TODO check the purpose of virtual here 23 //class OSDSettings: virtual public ConfigurationWizard 24 class OSDSettings: public GroupSetting 22 25 { 23 26 public: 24 27 OSDSettings(); 25 28 }; 26 29 27 class GeneralSettings : public ConfigurationWizard30 class GeneralSettings : public GroupSetting 28 31 { 29 32 public: 30 33 GeneralSettings(); 31 34 }; 32 35 33 class EPGSettings : public ConfigurationWizard36 class EPGSettings : public GroupSetting 34 37 { 35 38 public: 36 39 EPGSettings(); 37 40 }; 38 41 39 class AppearanceSettings : public ConfigurationWizard42 class AppearanceSettings : public GroupSetting 40 43 { 41 44 public: 42 45 AppearanceSettings(); 46 virtual void applyChange(); 43 47 }; 44 48 45 class MainGeneralSettings : public ConfigurationWizard 49 class HostRefreshRateComboBoxSetting : public HostComboBoxSetting 50 { 51 Q_OBJECT 52 public: 53 HostRefreshRateComboBoxSetting(const QString &name) : 54 HostComboBoxSetting(name) { } 55 virtual ~HostRefreshRateComboBoxSetting() { ; } 56 57 public slots: 58 virtual void ChangeResolution(const QString& resolution); 59 60 private: 61 static const vector<double> GetRefreshRates(const QString &resolution); 62 }; 63 64 65 class MainGeneralSettings : public GroupSetting 46 66 { 47 67 public: 48 68 MainGeneralSettings(); 69 virtual void applyChange(); 49 70 }; 50 71 51 class GeneralRecPrioritiesSettings : public ConfigurationWizard72 class GeneralRecPrioritiesSettings : public GroupSetting 52 73 { 53 74 public: 54 75 GeneralRecPrioritiesSettings(); -
mythtv/programs/mythfrontend/main.cpp
diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp index 259e020..9a1ec90 100644
a b 1 #include <unistd.h>2 1 #include <fcntl.h> 3 2 #include <signal.h> 4 3 #include <cerrno> … … using namespace std; 74 73 #include "themechooser.h" 75 74 #include "mythversion.h" 76 75 #include "taskqueue.h" 76 #include "standardsettings.h" 77 77 78 78 // Video 79 79 #include "cleanup.h" … … namespace 138 138 139 139 if (passwordValid) 140 140 { 141 VideoGeneralSettings settings; 142 settings.exec(); 141 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 142 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 143 144 if (ssd->Create()) 145 { 146 ssd->loadSettings(new VideoGeneralSettings()); 147 mainStack->AddScreen(ssd); 148 } 149 else 150 delete ssd; 143 151 } 144 152 else 145 153 { … … static void TVMenuCallback(void *data, QString &selection) 838 846 startPrevious(); 839 847 else if (sel == "settings appearance") 840 848 { 841 AppearanceSettings *settings = new AppearanceSettings(); 842 DialogCode res = settings->exec(); 843 delete settings; 849 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 850 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 844 851 845 if ( kDialogCodeRejected != res)852 if (ssd->Create()) 846 853 { 847 qApp->processEvents();848 GetMythMainWindow()->JumpTo("Reload Theme");854 ssd->loadSettings(new AppearanceSettings()); 855 mainStack->AddScreen(ssd); 849 856 } 857 else 858 delete ssd; 850 859 } 851 860 else if (sel == "settings themechooser") 852 861 { … … static void TVMenuCallback(void *data, QString &selection) 898 907 } 899 908 else if (sel == "settings general") 900 909 { 901 GeneralSettings settings; 902 settings.exec(); 910 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 911 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 912 913 if (ssd->Create()) 914 { 915 ssd->loadSettings(new GeneralSettings()); 916 mainStack->AddScreen(ssd); 917 } 918 else 919 delete ssd; 903 920 } 904 921 else if (sel == "settings audiogeneral") 905 922 { 906 AudioGeneralSettings audiosettings; 907 audiosettings.exec(); 923 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 924 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 925 926 if (ssd->Create()) 927 { 928 ssd->loadSettings(new AudioConfigSettings()); 929 mainStack->AddScreen(ssd); 930 } 931 else 932 delete ssd; 908 933 } 909 934 else if (sel == "settings maingeneral") 910 935 { 911 MainGeneralSettings mainsettings; 912 mainsettings.exec(); 913 QStringList strlist( QString("REFRESH_BACKEND") ); 914 gCoreContext->SendReceiveStringList(strlist); 936 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 937 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 938 939 if (ssd->Create()) 940 { 941 ssd->loadSettings(new MainGeneralSettings()); 942 mainStack->AddScreen(ssd); 943 } 944 else 945 delete ssd; 915 946 } 916 947 else if (sel == "settings playback") 917 948 { 918 PlaybackSettings settings; 919 settings.exec(); 949 /* PlaybackSettings settings; 950 settings.exec();*/ 951 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 952 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 953 954 if (ssd->Create()) 955 { 956 ssd->loadSettings(new PlaybackSettings()); 957 mainStack->AddScreen(ssd); 958 } 959 else 960 delete ssd; 920 961 } 921 962 else if (sel == "settings osd") 922 963 { 923 OSDSettings settings; 924 settings.exec(); 964 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 965 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 966 967 if (ssd->Create()) 968 { 969 ssd->loadSettings(new OSDSettings()); 970 mainStack->AddScreen(ssd); 971 } 972 else 973 delete ssd; 925 974 } 926 975 else if (sel == "settings epg") 927 976 { 928 EPGSettings settings; 929 settings.exec(); 977 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 978 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 979 980 if (ssd->Create()) 981 { 982 ssd->loadSettings(new EPGSettings()); 983 mainStack->AddScreen(ssd); 984 } 985 else 986 delete ssd; 930 987 } 931 988 else if (sel == "settings channelgroups") 932 989 { … … static void TVMenuCallback(void *data, QString &selection) 935 992 } 936 993 else if (sel == "settings generalrecpriorities") 937 994 { 938 GeneralRecPrioritiesSettings settings; 939 settings.exec(); 995 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 996 StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "videogeneralsettings"); 997 998 if (ssd->Create()) 999 { 1000 ssd->loadSettings(new GeneralRecPrioritiesSettings()); 1001 mainStack->AddScreen(ssd); 1002 } 1003 else 1004 delete ssd; 940 1005 } 941 1006 else if (sel == "settings channelrecpriorities") 942 1007 { -
mythtv/programs/mythfrontend/mythfrontend.pro
diff --git a/mythtv/programs/mythfrontend/mythfrontend.pro b/mythtv/programs/mythfrontend/mythfrontend.pro index 7c71469..dde9b2d 100644
a b HEADERS += videoplayercommand.h videopopups.h 39 39 HEADERS += videofilter.h videolist.h 40 40 HEADERS += videoplayersettings.h videodlg.h 41 41 HEADERS += videoglobalsettings.h upnpscanner.h 42 HEADERS += commandlineparser.h 42 HEADERS += commandlineparser.h standardsettings.h 43 43 44 44 SOURCES += main.cpp playbackbox.cpp viewscheduled.cpp audiogeneralsettings.cpp 45 45 SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp … … SOURCES += videoplayercommand.cpp videopopups.cpp 60 60 SOURCES += videofilter.cpp videolist.cpp 61 61 SOURCES += videoplayersettings.cpp videodlg.cpp 62 62 SOURCES += videoglobalsettings.cpp upnpscanner.cpp 63 SOURCES += commandlineparser.cpp 63 SOURCES += commandlineparser.cpp standardsettings.cpp 64 64 65 65 HEADERS += serviceHosts/frontendServiceHost.h 66 66 HEADERS += services/frontend.h -
new file mythtv/programs/mythfrontend/standardsettings.cpp
diff --git a/mythtv/programs/mythfrontend/standardsettings.cpp b/mythtv/programs/mythfrontend/standardsettings.cpp new file mode 100755 index 0000000..901f121
- + 1 #include "standardsettings.h" 2 #include <QCoreApplication> 3 4 #include <mythcontext.h> 5 #include <mythmainwindow.h> 6 #include <mythdialogbox.h> 7 #include <mythuispinbox.h> 8 #include <mythuitext.h> 9 #include <mythuibutton.h> 10 #include "mythlogging.h" 11 12 void MythUIButtonListItemSetting::ShouldUpdate(StandardSetting *setting) 13 { 14 setting->updateButton(this); 15 } 16 17 StandardSetting::StandardSetting(Storage *_storage) : 18 NewConfigurable(_storage), 19 m_haveChanged(false), 20 m_parent(0) 21 22 { 23 } 24 25 StandardSetting::~StandardSetting() 26 { 27 QList<StandardSetting *>::const_iterator i; 28 for (i = m_children.constBegin(); i != m_children.constEnd(); ++i) 29 delete *i; 30 m_children.clear(); 31 32 QMap<QString, QList<StandardSetting *> >::const_iterator iMap; 33 for (iMap = m_targets.constBegin(); iMap != m_targets.constEnd(); ++iMap) 34 { 35 for (i = (*iMap).constBegin(); i != (*iMap).constEnd(); ++i) 36 delete *i; 37 } 38 m_targets.clear(); 39 } 40 41 MythUIButtonListItem * StandardSetting::createButton(MythUIButtonList * list) 42 { 43 MythUIButtonListItemSetting *item = new MythUIButtonListItemSetting(list, label); 44 item->SetData(qVariantFromValue(this)); 45 connect(this, SIGNAL(ShouldRedraw(StandardSetting *)), item, SLOT(ShouldUpdate(StandardSetting *))); 46 updateButton(item); 47 return item; 48 } 49 50 void StandardSetting::setEnabled(bool b) 51 { 52 LOG(VB_GENERAL, LOG_ERR, QString("StandardSetting::setEnabled(%1) for %2") 53 .arg(b) 54 .arg(getLabel())); 55 NewConfigurable::setEnabled(b); 56 emit ShouldRedraw(this); 57 } 58 59 void StandardSetting::setParent(StandardSetting *parent) 60 { 61 m_parent = parent; 62 } 63 64 StandardSetting * StandardSetting::getParent() 65 { 66 return m_parent; 67 } 68 69 void StandardSetting::addChild(StandardSetting *child) 70 { 71 if (!child)return; 72 m_children.append(child); 73 child->setParent(this); 74 } 75 76 void StandardSetting::updateButton(MythUIButtonListItem *item) 77 { 78 item->setEnabled(isEnabled()); 79 item->SetText(label); 80 item->SetText(settingValue,"value"); 81 item->SetText(getHelpText(),"description"); 82 item->setDrawArrow (haveSubSettings()); 83 84 } 85 86 void StandardSetting::addTargetedChild(const QString &value, StandardSetting * setting) 87 { 88 m_targets[value].append(setting); 89 setting->setParent(this); 90 } 91 92 93 QList<StandardSetting *> *StandardSetting::getSubSettings() 94 { 95 if (m_targets.contains(settingValue) && m_targets[settingValue].size()>0) 96 return &m_targets[settingValue]; 97 return &m_children; 98 } 99 100 bool StandardSetting::haveSubSettings() 101 { 102 QList<StandardSetting *> * subSettings=getSubSettings(); 103 return (subSettings!=NULL && subSettings->size()>0); 104 } 105 106 void StandardSetting::setValue(const QString &newValue) 107 { 108 settingValue = newValue; 109 emit valueChanged(settingValue); 110 emit ShouldRedraw(this); 111 } 112 113 bool StandardSetting::haveChanged() 114 { 115 if (m_haveChanged) return true; 116 117 //we check only the relevant children 118 QList<StandardSetting *> *children = getSubSettings(); 119 if (children==NULL) return false; 120 QList<StandardSetting *>::const_iterator i; 121 bool haveChanged = false; 122 for (i = children->constBegin(); !haveChanged && i != children->constEnd(); ++i) 123 haveChanged=(*i)->haveChanged(); 124 125 return haveChanged; 126 } 127 128 void StandardSetting::Load(void) 129 { 130 131 /* Storage *s = GetStorage(); 132 if (s)s->Load();*/ 133 134 m_haveChanged=false; 135 136 LoadChildren(); 137 } 138 139 void StandardSetting::LoadChildren(void) 140 { 141 QList<StandardSetting *>::const_iterator i; 142 for (i = m_children.constBegin(); i != m_children.constEnd(); ++i) 143 (*i)->Load(); 144 145 QMap<QString, QList<StandardSetting *> >::const_iterator iMap; 146 for (iMap = m_targets.constBegin(); iMap != m_targets.constEnd(); ++iMap) 147 { 148 for (i = (*iMap).constBegin(); i != (*iMap).constEnd(); ++i) 149 (*i)->Load(); 150 } 151 152 } 153 void StandardSetting::Save(void) 154 { 155 /* 156 Storage *s = GetStorage(); 157 if (s)s->Save();*/ 158 159 m_haveChanged=false; 160 161 SaveChildren(); 162 } 163 164 void StandardSetting::SaveChildren(void) 165 { 166 //we save only the relevant children 167 QList<StandardSetting *> *children = getSubSettings(); 168 if (children==NULL) return; 169 QList<StandardSetting *>::const_iterator i; 170 for (i = children->constBegin(); i != children->constEnd(); ++i) 171 (*i)->Save(); 172 } 173 174 /******************************************************************************* 175 Group Setting 176 ********************************************************************************/ 177 GroupSetting::GroupSetting(): 178 StandardSetting(this), TransientStorage() 179 { 180 } 181 182 void GroupSetting::edit(MythScreenType * screen) 183 { 184 if (!isEnabled())return; 185 DialogCompletionEvent *dce = 186 new DialogCompletionEvent("leveldown", 0, "", ""); 187 QCoreApplication::postEvent(screen, dce); 188 } 189 190 void GroupSetting::updateButton(MythUIButtonListItem *item) 191 { 192 item->setEnabled(isEnabled()); 193 item->SetText(label); 194 item->SetText(settingValue,"value"); 195 item->SetText(getHelpText(),"description"); 196 item->setDrawArrow (haveSubSettings()); 197 } 198 199 200 /******************************************************************************* 201 Text Setting 202 ********************************************************************************/ 203 204 MythUITextEditSetting::MythUITextEditSetting(Storage *_storage): 205 StandardSetting(_storage) 206 { 207 } 208 209 void MythUITextEditSetting::edit(MythScreenType * screen) 210 { 211 if (!isEnabled())return; 212 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); 213 214 MythTextInputDialog *settingdialog = 215 new MythTextInputDialog(popupStack, 216 getLabel(),FilterNone, false,settingValue); 217 218 if (settingdialog->Create()) 219 { 220 settingdialog->SetReturnEvent(screen, "editsetting"); 221 popupStack->AddScreen(settingdialog); 222 } 223 }; 224 225 void MythUITextEditSetting::resultEdit(DialogCompletionEvent *dce) 226 { 227 if (settingValue!=dce->GetResultText()) 228 { 229 setValue(dce->GetResultText()); 230 m_haveChanged=true; 231 } 232 } 233 234 /******************************************************************************* 235 ComboBoxSetting 236 ********************************************************************************/ 237 //TODO do something when rw=true 238 MythUIComboBoxSetting::MythUIComboBoxSetting(Storage *_storage, bool rw): 239 StandardSetting(_storage) 240 { 241 } 242 243 MythUIComboBoxSetting::~MythUIComboBoxSetting() 244 { 245 m_labels.clear(); 246 m_values.clear(); 247 } 248 249 void MythUIComboBoxSetting::setValue(int value) 250 { 251 if (value>=0 && value < m_values.size()) 252 //Why does the polymorphism does not work here 253 StandardSetting::setValue(m_values.at(value)); 254 } 255 256 void MythUIComboBoxSetting::addSelection(const QString &label, QString value, 257 bool select) 258 { 259 value = (value.isEmpty()) ? label : value; 260 m_labels.push_back(label); 261 m_values.push_back(value); 262 263 if (select || !m_isSet) 264 { 265 //Why does the polymorphism does not work here 266 StandardSetting::setValue(value); 267 if (!m_isSet) m_isSet = true; 268 } 269 } 270 271 void MythUIComboBoxSetting::clearSelections() 272 { 273 m_labels.clear(); 274 m_values.clear(); 275 } 276 277 void MythUIComboBoxSetting::updateButton(MythUIButtonListItem *item) 278 { 279 item->setEnabled(isEnabled()); 280 item->SetText(label); 281 int indexValue = m_values.indexOf(settingValue); 282 if (indexValue >=0) 283 item->SetText(m_labels.value(indexValue),"value"); 284 else 285 item->SetText("","value"); 286 item->SetText(getHelpText(),"description"); 287 item->setDrawArrow (haveSubSettings()); 288 } 289 290 void MythUIComboBoxSetting::edit(MythScreenType * screen) 291 { 292 if (!isEnabled())return; 293 MythScreenStack *popupStack = 294 GetMythMainWindow()->GetStack("popup stack"); 295 296 MythDialogBox * m_menuPopup = 297 new MythDialogBox(getLabel(), popupStack, "optionmenu"); 298 299 if (m_menuPopup->Create()) 300 popupStack->AddScreen(m_menuPopup); 301 302 m_menuPopup->SetReturnEvent(screen, "editsetting"); 303 304 for (int i = 0; i < m_labels.size() && m_values.size(); ++i) 305 { 306 QString value = m_values.at(i); 307 m_menuPopup->AddButton(m_labels.at(i),value,false,value==settingValue); 308 } 309 } 310 311 void MythUIComboBoxSetting::resultEdit(DialogCompletionEvent *dce) 312 { 313 if (dce->GetResult()!=-1 && settingValue!=dce->GetData().toString()) 314 { 315 //Why does the polymorphism does not work here 316 StandardSetting::setValue(dce->GetData().toString()); 317 m_haveChanged=true; 318 } 319 } 320 321 322 /******************************************************************************* 323 SpinBox Setting 324 ********************************************************************************/ 325 326 MythUISpinBoxSetting::MythUISpinBoxSetting(Storage *_storage, int min, int max, int step, bool allow_single_step): 327 StandardSetting(_storage), 328 m_min(min), 329 m_max(max), 330 m_step(step), 331 m_allow_single_step(allow_single_step) 332 { 333 } 334 335 void MythUISpinBoxSetting::setValue(int value) 336 { 337 StandardSetting::setValue(QString::number(value)); 338 } 339 340 int MythUISpinBoxSetting::intValue() 341 { 342 return settingValue.toInt(); 343 } 344 345 void MythUISpinBoxSetting::edit(MythScreenType * screen) 346 { 347 if (!isEnabled())return; 348 //TODO use a correct dialog with a spin box 349 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); 350 351 MythTextInputDialog *settingdialog = 352 new MythTextInputDialog(popupStack, 353 getLabel(),FilterNone, false,settingValue); 354 355 356 if (settingdialog->Create()) 357 { 358 settingdialog->SetReturnEvent(screen, "editsetting"); 359 popupStack->AddScreen(settingdialog); 360 } 361 }; 362 363 void MythUISpinBoxSetting::resultEdit(DialogCompletionEvent *dce) 364 { 365 if (settingValue!=dce->GetResultText()) 366 { 367 bool ok; 368 int value = dce->GetResultText().toInt(&ok); 369 ok = ok && (value>=m_min) && (value<=m_max); 370 if (ok && !m_allow_single_step && m_step>0) 371 { 372 ok = ((value-m_min)%m_step)==0; 373 } 374 if (ok) //TODO give user some feedback 375 { 376 StandardSetting::setValue(dce->GetResultText()); 377 m_haveChanged=true; 378 } 379 } 380 } 381 382 /******************************************************************************* 383 MythUICheckBoxSetting 384 ********************************************************************************/ 385 386 MythUICheckBoxSetting::MythUICheckBoxSetting(Storage *_storage): 387 StandardSetting(_storage) 388 { 389 } 390 391 bool MythUICheckBoxSetting::boolValue() 392 { 393 return settingValue=="1"; 394 } 395 396 397 void MythUICheckBoxSetting::setValue(bool value) 398 { 399 //Why does the polymorphism does not work here 400 StandardSetting::setValue(value?"1":"0"); 401 } 402 403 void MythUICheckBoxSetting::updateButton(MythUIButtonListItem *item) 404 { 405 item->SetText(label); 406 item->setCheckable (true); 407 item->setEnabled(isEnabled()); 408 item->SetText("","value"); 409 item->SetText(getHelpText(),"description"); 410 if (settingValue=="1") 411 item->setChecked(MythUIButtonListItem::FullChecked); 412 else 413 item->setChecked(MythUIButtonListItem::NotChecked); 414 item->setDrawArrow(haveSubSettings()); 415 } 416 417 void MythUICheckBoxSetting::edit(MythScreenType * screen) 418 { 419 if (!isEnabled())return; 420 DialogCompletionEvent *dce = 421 new DialogCompletionEvent("editsetting", 0, "", ""); 422 QCoreApplication::postEvent(screen, dce); 423 } 424 425 void MythUICheckBoxSetting::resultEdit(DialogCompletionEvent *dce) 426 { 427 setValue(!boolValue()); 428 m_haveChanged=true; 429 } 430 431 /******************************************************************************* 432 Standard setting dialog 433 ********************************************************************************/ 434 435 StandardSettingDialog::StandardSettingDialog(MythScreenStack *parent, const char *name) : 436 MythScreenType(parent, name), 437 m_buttonList(0), 438 m_title(0), 439 m_groupHelp(0), 440 m_selectedSettingHelp(0), 441 m_menuPopup(0), 442 m_settingsTree(0), 443 m_currentGroupSetting(0) 444 { 445 } 446 447 StandardSettingDialog::~StandardSettingDialog() 448 { 449 LOG(VB_GENERAL, LOG_ERR, "StandardSettingDialog::~StandardSettingDialog()"); 450 if (m_settingsTree!=0) 451 m_settingsTree->deleteLater(); 452 } 453 454 bool StandardSettingDialog::Create(void) 455 { 456 if (!LoadWindowFromXML("standardsetting-ui.xml", "settingssetup", this)) 457 return false; 458 459 bool error=false; 460 UIUtilE::Assign(this, m_title, "title",&error); 461 UIUtilW::Assign(this, m_groupHelp, "grouphelp",&error); 462 UIUtilE::Assign(this, m_buttonList,"settingslist",&error); 463 464 UIUtilW::Assign(this, m_selectedSettingHelp, "selectedsettinghelp"); 465 466 connect(m_buttonList,SIGNAL(itemSelected(MythUIButtonListItem*)), 467 this,SLOT(settingSelected(MythUIButtonListItem*))); 468 connect(m_buttonList,SIGNAL(itemClicked(MythUIButtonListItem*)), 469 this,SLOT(settingClicked(MythUIButtonListItem*))); 470 471 if (error) 472 { 473 LOG(VB_GENERAL, LOG_ERR, "error."); 474 return false; 475 } 476 BuildFocusList(); 477 478 return true; 479 } 480 481 void StandardSettingDialog::settingSelected(MythUIButtonListItem *item) 482 { 483 if (!item)return; 484 485 StandardSetting * setting = qVariantValue<StandardSetting*>(item->GetData()); 486 if (setting) 487 { 488 if (m_selectedSettingHelp) 489 m_selectedSettingHelp->SetText(setting->getHelpText()); 490 } 491 } 492 493 void StandardSettingDialog::settingClicked(MythUIButtonListItem *item) 494 { 495 StandardSetting* setting = item->GetData().value<StandardSetting*>(); 496 if (setting) 497 { 498 setting->edit(this); 499 } 500 } 501 502 void StandardSettingDialog::customEvent(QEvent *event) 503 { 504 if (event->type() == DialogCompletionEvent::kEventType) 505 { 506 DialogCompletionEvent *dce = (DialogCompletionEvent*)(event); 507 QString resultid = dce->GetId(); 508 509 if (resultid == "leveldown") 510 { 511 //a GroupSetting have been clicked 512 LevelDown(); 513 } 514 else if (resultid == "editsetting") 515 { 516 MythUIButtonListItem * item = m_buttonList->GetItemCurrent(); 517 if (item) 518 { 519 StandardSetting * ss = item->GetData().value<StandardSetting*>(); 520 if (ss) 521 { 522 ss->resultEdit(dce); 523 } 524 } 525 } 526 else if (resultid == "exit") 527 { 528 int buttonnum = dce->GetResult(); 529 if (buttonnum == 0) 530 { 531 Save(); 532 MythScreenType::Close(); 533 if (m_settingsTree) 534 m_settingsTree->applyChange(); 535 } 536 else if (buttonnum == 1) 537 MythScreenType::Close(); 538 } 539 } 540 } 541 542 void StandardSettingDialog::loadSettings(GroupSetting * groupSettings) 543 { 544 545 m_settingsTree=groupSettings; 546 if (m_settingsTree) 547 m_settingsTree->Load(); 548 549 setCurrentGroupSetting(m_settingsTree); 550 } 551 552 void StandardSettingDialog::setCurrentGroupSetting(StandardSetting * groupSettings, 553 StandardSetting * selectedSetting ) 554 { 555 if (!groupSettings) return; 556 557 m_currentGroupSetting=groupSettings; 558 m_buttonList->Reset(); 559 560 m_title->SetText(m_currentGroupSetting->getLabel()); 561 if (m_groupHelp) m_groupHelp->SetText(m_currentGroupSetting->getHelpText()); 562 if (!m_currentGroupSetting->haveSubSettings())return; 563 QList<StandardSetting *> * settings = m_currentGroupSetting->getSubSettings(); 564 if (settings==NULL ) return; 565 QList<StandardSetting *>::const_iterator i; 566 MythUIButtonListItem *selectedItem=0; 567 for (i = settings->constBegin(); i != settings->constEnd(); ++i) 568 { 569 if (selectedSetting == (*i)) 570 selectedItem =(*i)->createButton(m_buttonList); 571 else 572 (*i)->createButton(m_buttonList); 573 } 574 if (selectedItem) 575 m_buttonList->SetItemCurrent(selectedItem); 576 settingSelected(m_buttonList->GetItemCurrent()); 577 578 } 579 580 void StandardSettingDialog::Save() 581 { 582 if (m_settingsTree) 583 m_settingsTree->Save(); 584 } 585 586 void StandardSettingDialog::LevelUp() 587 { 588 if (!m_currentGroupSetting) return; 589 if (m_currentGroupSetting->getParent()) 590 { 591 setCurrentGroupSetting(m_currentGroupSetting->getParent(), 592 m_currentGroupSetting); 593 } 594 } 595 596 void StandardSettingDialog::LevelDown() 597 { 598 MythUIButtonListItem * item = m_buttonList->GetItemCurrent(); 599 if (item) 600 { 601 StandardSetting * ss = item->GetData().value<StandardSetting*>(); 602 if (ss && ss->haveSubSettings() && ss->isEnabled()) 603 setCurrentGroupSetting(ss); 604 } 605 } 606 607 void StandardSettingDialog::Close(void) 608 { 609 if (m_settingsTree->haveChanged()) 610 { 611 QString label = tr("Exit ?"); 612 613 MythScreenStack *popupStack = 614 GetMythMainWindow()->GetStack("popup stack"); 615 616 MythDialogBox * m_menuPopup = 617 new MythDialogBox(label, popupStack, "exitmenu"); 618 619 if (m_menuPopup->Create()) 620 popupStack->AddScreen(m_menuPopup); 621 622 m_menuPopup->SetReturnEvent(this, "exit"); 623 624 m_menuPopup->AddButton(tr("Save then Exit")); 625 m_menuPopup->AddButton(tr("Exit without saving changes")); 626 m_menuPopup->AddButton(tr("Cancel")); 627 } 628 else 629 MythScreenType::Close(); 630 } 631 632 633 bool StandardSettingDialog::keyPressEvent(QKeyEvent *e) 634 { 635 QStringList actions; 636 bool handled = m_buttonList->keyPressEvent(e); 637 if (handled) return true; 638 handled = GetMythMainWindow()->TranslateKeyPress("Global", e, actions); 639 640 for (int i = 0; i < actions.size() && !handled; i++) 641 { 642 QString action = actions[i]; 643 handled = true; 644 645 if (action == "LEFT") 646 { 647 if (m_currentGroupSetting 648 && m_currentGroupSetting==m_settingsTree) 649 Close(); 650 else 651 LevelUp(); 652 } 653 else if (action == "RIGHT") 654 LevelDown(); 655 else 656 handled = MythScreenType::keyPressEvent(e); 657 } 658 659 return handled; 660 } 661 662 663 664 665 -
new file mythtv/programs/mythfrontend/standardsettings.h
diff --git a/mythtv/programs/mythfrontend/standardsettings.h b/mythtv/programs/mythfrontend/standardsettings.h new file mode 100755 index 0000000..005274b
- + 1 #ifndef STANDARDSETTINGS_H_ 2 #define STANDARDSETTINGS_H_ 3 4 #include "mythuibuttonlist.h" 5 #include <mythdialogbox.h> 6 #include <mythuibuttontree.h> 7 #include <mythgenerictree.h> 8 #include <QMap> 9 #include "settings.h" 10 11 #include "mythlogging.h" 12 13 class StandardSetting; 14 15 class MythUIButtonListItemSetting : public QObject, public MythUIButtonListItem 16 { 17 Q_OBJECT 18 public: 19 MythUIButtonListItemSetting (MythUIButtonList *lbtype, const QString &text) 20 :MythUIButtonListItem(lbtype,text){} 21 public slots: 22 void ShouldUpdate(StandardSetting *setting); 23 }; 24 25 class MPUBLIC NewConfigurable : public QObject 26 { 27 Q_OBJECT 28 29 public: 30 31 virtual void updateButton(MythUIButtonListItem *item)=0; 32 33 // A label displayed to the user 34 virtual void setLabel(QString str) { label = str; } 35 QString getLabel(void) const { return label; } 36 37 virtual void setHelpText(const QString &str) 38 { helptext = str; } 39 QString getHelpText(void) const { return helptext; } 40 41 void setVisible(bool b) { m_visible = b; }; 42 bool isVisible(void) const { return m_visible; }; 43 44 virtual void setEnabled(bool b) { m_enabled = b; } 45 bool isEnabled() { return m_enabled; } 46 47 Storage *GetStorage(void) { return storage; } 48 49 protected: 50 NewConfigurable(Storage *_storage) : 51 m_enabled(true), storage(_storage), 52 label(""), helptext(""), m_visible(true) { } 53 virtual ~NewConfigurable() { } 54 55 protected: 56 bool m_enabled; 57 Storage *storage; 58 QString configName; 59 QString label; 60 QString helptext; 61 bool m_visible; 62 }; 63 64 //Copy of Setting class 65 class MPUBLIC StandardSetting : public NewConfigurable, public StorageUser 66 { 67 Q_OBJECT 68 69 public: 70 // Gets 71 virtual QString getValue(void) const 72 {return settingValue;} 73 74 virtual void updateButton(MythUIButtonListItem *item); 75 76 // StorageUser 77 void SetDBValue(const QString &val) { setValue(val); } 78 QString GetDBValue(void) const { return getValue(); } 79 80 //added by xavier 81 virtual void setEnabled(bool b); 82 MythUIButtonListItem * createButton(MythUIButtonList * list); 83 //subsettings 84 void addChild(StandardSetting *child); 85 virtual QList<StandardSetting *> *getSubSettings(); 86 virtual bool haveSubSettings(); 87 88 StandardSetting * getParent(); 89 virtual void edit(MythScreenType * screen)=0; 90 virtual void resultEdit(DialogCompletionEvent *dce)=0; 91 //must be a better way 92 virtual void Load(void); 93 virtual void Save(void); 94 95 96 void addTargetedChild(const QString &value, StandardSetting * setting); 97 bool haveChanged(); 98 //added by xavier end 99 public slots: 100 virtual void setValue(const QString &newValue); 101 102 signals: 103 void valueChanged(const QString&); 104 void ShouldRedraw(StandardSetting *); 105 106 protected: 107 StandardSetting(Storage *_storage); 108 virtual ~StandardSetting(); 109 110 protected: 111 void setParent(StandardSetting *parent); 112 QString settingValue; 113 void LoadChildren(void); 114 void SaveChildren(void); 115 bool m_haveChanged; 116 private: 117 StandardSetting * m_parent; 118 QList<StandardSetting *> m_children; 119 QMap<QString, QList<StandardSetting *> > m_targets; 120 }; 121 122 123 /******************************************************************************* 124 * TextEdit Setting * 125 *******************************************************************************/ 126 127 128 class MPUBLIC MythUITextEditSetting : public StandardSetting 129 { 130 public: 131 virtual void resultEdit(DialogCompletionEvent *dce); 132 virtual void edit(MythScreenType * screen); 133 protected: 134 MythUITextEditSetting (Storage *_storage); 135 136 }; 137 138 139 class MPUBLIC TransTextEditSetting: public MythUITextEditSetting, public TransientStorage 140 { 141 public: 142 TransTextEditSetting() : 143 MythUITextEditSetting(this), TransientStorage() { } 144 145 //Don't want to have to do that but cannont think of a work around 146 virtual void Load(){MythUITextEditSetting::Load();} 147 virtual void Save(){MythUITextEditSetting::Save();} 148 }; 149 150 151 class MPUBLIC HostTextEditSetting: public MythUITextEditSetting, public HostDBStorage 152 { 153 public: 154 HostTextEditSetting(const QString &name) : 155 MythUITextEditSetting(this), HostDBStorage(this, name) { } 156 157 //Don't want to have to do that but cannont think of a work around 158 virtual void Load(){MythUITextEditSetting::Load();HostDBStorage::Load();} 159 virtual void Save(){MythUITextEditSetting::Save();HostDBStorage::Save();} 160 }; 161 162 163 /******************************************************************************* 164 * ComboBox Setting * 165 *******************************************************************************/ 166 //TODO implement rw=true 167 class MPUBLIC MythUIComboBoxSetting : public StandardSetting 168 { 169 public: 170 void setValue(int value); 171 virtual void resultEdit(DialogCompletionEvent *dce); 172 virtual void edit(MythScreenType * screen); 173 void addSelection(const QString &label, QString value = QString::null, bool select = false); 174 void clearSelections(); 175 virtual void updateButton(MythUIButtonListItem *item); 176 protected: 177 MythUIComboBoxSetting (Storage *_storage, bool rw = false); 178 ~MythUIComboBoxSetting(); 179 180 private: 181 QVector<QString> m_labels; 182 QVector<QString> m_values; 183 bool m_isSet; 184 185 }; 186 187 class MPUBLIC HostComboBoxSetting: public MythUIComboBoxSetting, public HostDBStorage 188 { 189 public: 190 HostComboBoxSetting(const QString &name, bool rw = false) : 191 MythUIComboBoxSetting(this, rw), HostDBStorage(this, name) { } 192 193 //Don't want to have to do that but cannot think of a work around 194 virtual void Load(){MythUIComboBoxSetting::Load();HostDBStorage::Load();} 195 virtual void Save(){MythUIComboBoxSetting::Save();HostDBStorage::Save();} 196 }; 197 198 199 class MPUBLIC GlobalComboBoxSetting: public MythUIComboBoxSetting, public GlobalDBStorage 200 { 201 public: 202 GlobalComboBoxSetting(const QString &name, bool rw = false) : 203 MythUIComboBoxSetting(this, rw), GlobalDBStorage(this, name) { } 204 205 //Don't want to have to do that but cannot think of a work around 206 virtual void Load(){MythUIComboBoxSetting::Load();GlobalDBStorage::Load();} 207 virtual void Save(){MythUIComboBoxSetting::Save();GlobalDBStorage::Save();} 208 }; 209 210 /******************************************************************************* 211 * SpinBox Setting * 212 *******************************************************************************/ 213 214 215 class MPUBLIC MythUISpinBoxSetting : public StandardSetting 216 { 217 public: 218 void setValue(int value); 219 int intValue(); 220 virtual void resultEdit(DialogCompletionEvent *dce); 221 virtual void edit(MythScreenType * screen); 222 protected: 223 MythUISpinBoxSetting (Storage *_storage, int min, int max, int step, bool allow_single_step); 224 private: 225 int m_min; 226 int m_max; 227 int m_step; 228 bool m_allow_single_step; 229 230 }; 231 232 class MPUBLIC TransMythUISpinBoxSetting: public MythUISpinBoxSetting, public TransientStorage 233 { 234 public: 235 TransMythUISpinBoxSetting(int min, int max, int step, bool allow_single_step=false) : 236 MythUISpinBoxSetting(this, min, max, step, allow_single_step), TransientStorage() { } 237 238 //Don't want to have to do that but cannont think of a work around 239 virtual void Load(){MythUISpinBoxSetting::Load();} 240 virtual void Save(){MythUISpinBoxSetting::Save();} 241 }; 242 243 class MPUBLIC HostSpinBoxSetting: public MythUISpinBoxSetting, public HostDBStorage 244 { 245 public: 246 HostSpinBoxSetting(const QString &name, int min, int max, int step, bool allow_single_step=false) : 247 MythUISpinBoxSetting(this, min, max, step, allow_single_step), HostDBStorage(this, name) { } 248 249 //Don't want to have to do that but cannont think of a work around 250 virtual void Load(){MythUISpinBoxSetting::Load();HostDBStorage::Load();} 251 virtual void Save(){MythUISpinBoxSetting::Save();HostDBStorage::Save();} 252 }; 253 254 class MPUBLIC GlobalSpinBoxSetting: public MythUISpinBoxSetting, public GlobalDBStorage 255 { 256 public: 257 GlobalSpinBoxSetting(const QString &name, int min, int max, int step, bool allow_single_step=false) : 258 MythUISpinBoxSetting(this, min, max, step, allow_single_step), GlobalDBStorage(this, name) { } 259 260 //Don't want to have to do that but cannont think of a work around 261 virtual void Load(){MythUISpinBoxSetting::Load();GlobalDBStorage::Load();} 262 virtual void Save(){MythUISpinBoxSetting::Save();GlobalDBStorage::Save();} 263 }; 264 265 /******************************************************************************* 266 * CheckBox Setting * 267 *******************************************************************************/ 268 269 class MPUBLIC MythUICheckBoxSetting : public StandardSetting 270 { 271 public: 272 virtual void resultEdit(DialogCompletionEvent *dce); 273 virtual void edit(MythScreenType * screen); 274 virtual void updateButton(MythUIButtonListItem *item); 275 void setValue(bool value); 276 bool boolValue(); 277 protected: 278 MythUICheckBoxSetting (Storage *_storage); 279 280 }; 281 282 class MPUBLIC TransMythUICheckBoxSetting: public MythUICheckBoxSetting, public TransientStorage 283 { 284 public: 285 TransMythUICheckBoxSetting() : 286 MythUICheckBoxSetting(this), TransientStorage() { } 287 //Don't want to have to do that but cannont think of a work around 288 /*virtual void Load(){MythUICheckBoxSetting::Load();HostDBStorage::Load();} 289 virtual void Save(){MythUICheckBoxSetting::Save();HostDBStorage::Save();}*/ 290 }; 291 292 class MPUBLIC HostCheckBoxSetting: public MythUICheckBoxSetting, public HostDBStorage 293 { 294 public: 295 HostCheckBoxSetting(const QString &name, bool rw = true) : 296 MythUICheckBoxSetting(this), HostDBStorage(this, name) { } 297 //Don't want to have to do that but cannont think of a work around 298 virtual void Load(){MythUICheckBoxSetting::Load();HostDBStorage::Load();} 299 virtual void Save(){MythUICheckBoxSetting::Save();HostDBStorage::Save();} 300 }; 301 302 class MPUBLIC GlobalCheckBoxSetting: public MythUICheckBoxSetting, public GlobalDBStorage 303 { 304 public: 305 GlobalCheckBoxSetting(const QString &name, bool rw = true) : 306 MythUICheckBoxSetting(this), GlobalDBStorage(this, name) { } 307 //Don't want to have to do that but cannont think of a work around 308 virtual void Load(){MythUICheckBoxSetting::Load();GlobalDBStorage::Load();} 309 virtual void Save(){MythUICheckBoxSetting::Save();GlobalDBStorage::Save();} 310 }; 311 312 /******************************************************************************* 313 * Group Setting * 314 *******************************************************************************/ 315 316 class GroupSetting : public StandardSetting, public TransientStorage 317 { 318 public: 319 GroupSetting(); 320 321 virtual void Load(void){StandardSetting::Load();}; 322 virtual void Save(void){StandardSetting::Save();}; 323 virtual void edit(MythScreenType * screen); 324 virtual void resultEdit(DialogCompletionEvent *dce){}; 325 virtual void applyChange(){}; 326 virtual void updateButton(MythUIButtonListItem *item); 327 }; 328 329 /******************************************************************************* 330 * Standard Dialog Setting * 331 *******************************************************************************/ 332 333 class StandardSettingDialog : public MythScreenType 334 { 335 Q_OBJECT 336 337 public: 338 339 StandardSettingDialog(MythScreenStack *parent, const char *name); 340 virtual ~StandardSettingDialog(); 341 bool Create(void); 342 void loadSettings(GroupSetting * groupSettings); 343 virtual void customEvent(QEvent *event); 344 virtual bool keyPressEvent(QKeyEvent *); 345 public slots: 346 void Close(void); 347 protected: 348 349 MythUIButtonList *m_buttonList; 350 private slots: 351 void settingSelected(MythUIButtonListItem *item); 352 void settingClicked(MythUIButtonListItem *item); 353 private: 354 void LevelUp(); 355 void LevelDown(); 356 void setCurrentGroupSetting(StandardSetting * groupSettings,StandardSetting * selectedSetting=0); 357 void Save(); 358 MythUIText *m_title; 359 MythUIText *m_groupHelp; 360 MythUIText *m_selectedSettingHelp; 361 MythDialogBox *m_menuPopup; 362 GroupSetting *m_settingsTree; 363 StandardSetting *m_currentGroupSetting; 364 bool m_loaded; 365 }; 366 367 Q_DECLARE_METATYPE(StandardSetting *); 368 369 370 #endif -
mythtv/programs/mythfrontend/videoglobalsettings.cpp
diff --git a/mythtv/programs/mythfrontend/videoglobalsettings.cpp b/mythtv/programs/mythfrontend/videoglobalsettings.cpp index 0365bfc..55bd18d 100644
a b 9 9 #include "videodlg.h" 10 10 #include "videoglobalsettings.h" 11 11 12 #include "mythlogging.h" 13 12 14 namespace 13 15 { 14 16 // General Settings 15 HostComboBox *VideoDefaultParentalLevel()17 HostComboBoxSetting *VideoDefaultParentalLevel() 16 18 { 17 HostComboBox *gc = new HostComboBox("VideoDefaultParentalLevel");19 HostComboBoxSetting *gc = new HostComboBoxSetting("VideoDefaultParentalLevel"); 18 20 gc->setLabel(QObject::tr("Starting Parental Level")); 19 21 gc->addSelection(QObject::tr("4 - Highest"), 20 22 QString::number(ParentalLevel::plHigh)); … … const char *password_clue = 33 35 QT_TRANSLATE_NOOP("QObject", "Setting this value to all numbers will make your life " 34 36 "much easier."); 35 37 36 Host LineEdit*VideoAdminPassword()38 HostTextEditSetting *VideoAdminPassword() 37 39 { 38 Host LineEdit *gc = new HostLineEdit("VideoAdminPassword");40 HostTextEditSetting *gc = new HostTextEditSetting("VideoAdminPassword"); 39 41 gc->setLabel(QObject::tr("Parental Level 4 PIN")); 40 42 gc->setHelpText(QString("%1 %2") 41 43 .arg(QObject::tr("This PIN is used to enter Parental Control " … … HostLineEdit *VideoAdminPassword() 44 46 return gc; 45 47 } 46 48 47 Host LineEdit*VideoAdminPasswordThree()49 HostTextEditSetting *VideoAdminPasswordThree() 48 50 { 49 Host LineEdit *gc = new HostLineEdit("VideoAdminPasswordThree");51 HostTextEditSetting *gc = new HostTextEditSetting("VideoAdminPasswordThree"); 50 52 gc->setLabel(QObject::tr("Parental Level 3 PIN")); 51 53 gc->setHelpText(QString("%1 %2") 52 54 .arg(QObject::tr("This PIN is used to enter Parental Control Level 3.")) … … HostLineEdit *VideoAdminPasswordThree() 54 56 return gc; 55 57 } 56 58 57 Host LineEdit*VideoAdminPasswordTwo()59 HostTextEditSetting *VideoAdminPasswordTwo() 58 60 { 59 Host LineEdit *gc = new HostLineEdit("VideoAdminPasswordTwo");61 HostTextEditSetting *gc = new HostTextEditSetting("VideoAdminPasswordTwo"); 60 62 gc->setLabel(QObject::tr("Parental Level 2 PIN")); 61 63 gc->setHelpText(QString("%1 %2") 62 64 .arg(QObject::tr("This PIN is used to enter Parental Control Level 2.")) … … HostLineEdit *VideoAdminPasswordTwo() 64 66 return gc; 65 67 } 66 68 67 HostCheckBox *VideoAggressivePC()69 HostCheckBoxSetting *VideoAggressivePC() 68 70 { 69 HostCheckBox *gc = new HostCheckBox("VideoAggressivePC");71 HostCheckBoxSetting *gc = new HostCheckBoxSetting("VideoAggressivePC"); 70 72 gc->setLabel(QObject::tr("Aggressive Parental Control")); 71 73 gc->setValue(false); 72 74 gc->setHelpText(QObject::tr("If set, you will not be able to return " … … HostCheckBox *VideoAggressivePC() 76 78 return gc; 77 79 } 78 80 79 Host LineEdit*VideoStartupDirectory()81 HostTextEditSetting *VideoStartupDirectory() 80 82 { 81 Host LineEdit *gc = new HostLineEdit("VideoStartupDir");83 HostTextEditSetting *gc = new HostTextEditSetting("VideoStartupDir"); 82 84 gc->setLabel(QObject::tr("Directories that hold videos")); 83 85 gc->setValue(DEFAULT_VIDEOSTARTUP_DIR); 84 86 gc->setHelpText(QObject::tr("Multiple directories can be separated by ':'. " … … HostLineEdit *VideoStartupDirectory() 87 89 return gc; 88 90 } 89 91 90 Host LineEdit*VideoArtworkDirectory()92 HostTextEditSetting *VideoArtworkDirectory() 91 93 { 92 Host LineEdit *gc = new HostLineEdit("VideoArtworkDir");94 HostTextEditSetting *gc = new HostTextEditSetting("VideoArtworkDir"); 93 95 gc->setLabel(QObject::tr("Directory that holds movie posters")); 94 96 gc->setValue(GetConfDir() + "/Video/Artwork"); 95 97 gc->setHelpText(QObject::tr("This directory must exist, and the user " … … HostLineEdit *VideoArtworkDirectory() 98 100 return gc; 99 101 } 100 102 101 Host LineEdit*VideoScreenshotDirectory()103 HostTextEditSetting *VideoScreenshotDirectory() 102 104 { 103 Host LineEdit *gc = new HostLineEdit("mythvideo.screenshotDir");105 HostTextEditSetting *gc = new HostTextEditSetting("mythvideo.screenshotDir"); 104 106 gc->setLabel(QObject::tr("Directory that holds movie screenshots")); 105 107 gc->setValue(GetConfDir() + "/Video/Screenshots"); 106 108 gc->setHelpText(QObject::tr("This directory must exist, and the user " … … HostLineEdit *VideoScreenshotDirectory() 109 111 return gc; 110 112 } 111 113 112 Host LineEdit*VideoBannerDirectory()114 HostTextEditSetting *VideoBannerDirectory() 113 115 { 114 Host LineEdit *gc = new HostLineEdit("mythvideo.bannerDir");116 HostTextEditSetting *gc = new HostTextEditSetting("mythvideo.bannerDir"); 115 117 gc->setLabel(QObject::tr("Directory that holds movie/TV Banners")); 116 118 gc->setValue(GetConfDir() + "/Video/Banners"); 117 119 gc->setHelpText(QObject::tr("This directory must exist, and the user " … … HostLineEdit *VideoBannerDirectory() 120 122 return gc; 121 123 } 122 124 123 Host LineEdit*VideoFanartDirectory()125 HostTextEditSetting *VideoFanartDirectory() 124 126 { 125 Host LineEdit *gc = new HostLineEdit("mythvideo.fanartDir");127 HostTextEditSetting *gc = new HostTextEditSetting("mythvideo.fanartDir"); 126 128 gc->setLabel(QObject::tr("Directory that holds movie fanart")); 127 129 gc->setValue(GetConfDir() + "/Video/Fanart"); 128 130 gc->setHelpText(QObject::tr("This directory must exist, and the user " … … HostLineEdit *VideoFanartDirectory() 131 133 return gc; 132 134 } 133 135 134 Host LineEdit*TrailerDirectory()136 HostTextEditSetting *TrailerDirectory() 135 137 { 136 Host LineEdit *gc = new HostLineEdit("mythvideo.TrailersDir");138 HostTextEditSetting *gc = new HostTextEditSetting("mythvideo.TrailersDir"); 137 139 gc->setLabel(QObject::tr("Directory that holds movie trailers")); 138 140 gc->setValue(GetConfDir() + "/Video/Trailers"); 139 141 gc->setHelpText(QObject::tr("This directory must exist, and the user " … … HostLineEdit *TrailerDirectory() 148 150 149 151 // General Settings 150 152 151 HostComboBox *SetOnInsertDVD()153 HostComboBoxSetting *SetOnInsertDVD() 152 154 { 153 HostComboBox *gc = new HostComboBox("DVDOnInsertDVD");155 HostComboBoxSetting *gc = new HostComboBoxSetting("DVDOnInsertDVD"); 154 156 gc->setLabel(QObject::tr("On DVD insertion")); 155 157 gc->addSelection(QObject::tr("Display mythdvd menu"),"1"); 156 158 gc->addSelection(QObject::tr("Do nothing"),"0"); … … HostComboBox *SetOnInsertDVD() 160 162 return gc; 161 163 } 162 164 163 HostCheckBox *VideoTreeRemember()165 HostCheckBoxSetting *VideoTreeRemember() 164 166 { 165 HostCheckBox *gc = new HostCheckBox("mythvideo.VideoTreeRemember");167 HostCheckBoxSetting *gc = new HostCheckBoxSetting("mythvideo.VideoTreeRemember"); 166 168 gc->setLabel(QObject::tr("Video Tree remembers last selected position")); 167 169 gc->setValue(false); 168 170 gc->setHelpText(QObject::tr("If set, the current position in the Video " … … HostCheckBox *VideoTreeRemember() 170 172 return gc; 171 173 } 172 174 173 struct ConfigPage174 {175 typedef std::vector<ConfigurationGroup *> PageList;176 177 protected:178 ConfigPage(PageList &pl) : m_pl(pl)179 {180 }181 182 void Add(ConfigurationGroup *page)183 {184 m_pl.push_back(page);185 }186 187 private:188 ConfigPage(const ConfigPage &);189 ConfigPage &operator=(const ConfigPage &);190 191 private:192 PageList &m_pl;193 };194 195 struct VConfigPage : public ConfigPage196 {197 VConfigPage(PageList &pl, bool luselabel = true, bool luseframe = true,198 bool lzeroMargin = false, bool lzeroSpace = false) :199 ConfigPage(pl)200 {201 m_vc_page = new VerticalConfigurationGroup(luselabel, luseframe,202 lzeroMargin, lzeroSpace);203 Add(m_vc_page);204 }205 175 206 VerticalConfigurationGroup *operator->()207 {208 return m_vc_page;209 }210 176 211 private:212 VerticalConfigurationGroup *m_vc_page;213 };214 177 215 class RatingsToPL : public TriggeredConfigurationGroup 178 HostCheckBoxSetting *RatingsToPL() 216 179 { 217 public: 218 RatingsToPL() : TriggeredConfigurationGroup(false) 180 HostCheckBoxSetting *r2pl = 181 new HostCheckBoxSetting("mythvideo.ParentalLevelFromRating"); 182 r2pl->setLabel(QObject::tr("Enable automatic Parental Level from " 183 "rating")); 184 r2pl->setValue(false); 185 r2pl->setHelpText(QObject::tr("If enabled, searches will automatically " 186 "set the Parental Level to the one " 187 "matching the rating below.")); 188 189 typedef std::map<ParentalLevel::Level, QString> r2pl_map; 190 r2pl_map r2pl_defaults; 191 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLowest, 192 QObject::tr("G", "PL 1 default search string."))); 193 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLow, 194 QObject::tr("PG", "PL 2 default search string."))); 195 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plMedium, 196 QObject::tr("PG-13", "PL3 default search string."))); 197 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plHigh, 198 QObject::tr("R:NC-17", "PL4 default search string."))); 199 200 for (ParentalLevel pl(ParentalLevel::plLowest); 201 pl.GetLevel() <= ParentalLevel::plHigh && pl.good(); ++pl) 219 202 { 220 HostCheckBox *r2pl = 221 new HostCheckBox("mythvideo.ParentalLevelFromRating"); 222 r2pl->setLabel(QObject::tr("Enable automatic Parental Level from " 223 "rating")); 224 r2pl->setValue(false); 225 r2pl->setHelpText(QObject::tr("If enabled, searches will automatically " 226 "set the Parental Level to the one " 227 "matching the rating below.")); 228 addChild(r2pl); 229 setTrigger(r2pl); 230 231 typedef std::map<ParentalLevel::Level, QString> r2pl_map; 232 r2pl_map r2pl_defaults; 233 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLowest, 234 tr("G", "PL 1 default search string."))); 235 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLow, 236 tr("PG", "PL 2 default search string."))); 237 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plMedium, 238 tr("PG-13", "PL3 default search string."))); 239 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plHigh, 240 tr("R:NC-17", "PL4 default search string."))); 241 242 VerticalConfigurationGroup *vcg = new VerticalConfigurationGroup(true); 243 244 for (ParentalLevel pl(ParentalLevel::plLowest); 245 pl.GetLevel() <= ParentalLevel::plHigh && pl.good(); ++pl) 203 HostTextEditSetting *hle = new HostTextEditSetting(QString("mythvideo.AutoR2PL%1") 204 .arg(pl.GetLevel())); 205 hle->setLabel(QObject::tr("Level %1").arg(pl.GetLevel())); 206 hle->setHelpText(QObject::tr("Ratings containing these strings " 207 "(separated by :) will be assigned " 208 "to Parental Level %1.") 209 .arg(pl.GetLevel())); 210 211 r2pl_map::const_iterator def_setting = 212 r2pl_defaults.find(pl.GetLevel()); 213 if (def_setting != r2pl_defaults.end()) 246 214 { 247 HostLineEdit *hle = new HostLineEdit(QString("mythvideo.AutoR2PL%1") 248 .arg(pl.GetLevel())); 249 hle->setLabel(QObject::tr("Level %1").arg(pl.GetLevel())); 250 hle->setHelpText(QObject::tr("Ratings containing these strings " 251 "(separated by :) will be assigned " 252 "to Parental Level %1.") 253 .arg(pl.GetLevel())); 254 255 r2pl_map::const_iterator def_setting = 256 r2pl_defaults.find(pl.GetLevel()); 257 if (def_setting != r2pl_defaults.end()) 258 { 259 hle->setValue(def_setting->second); 260 } 261 262 vcg->addChild(hle); 215 hle->setValue(def_setting->second); 263 216 } 264 217 265 addTarget("0", new VerticalConfigurationGroup(true)); 266 addTarget("1", vcg); 218 r2pl->addTargetedChild("1", hle); 267 219 } 268 };269 220 270 } // namespace 221 return r2pl; 222 } 223 224 } 271 225 272 226 VideoGeneralSettings::VideoGeneralSettings() 227 :GroupSetting() 273 228 { 274 ConfigPage::PageList pages;275 276 VConfigPage page1(pages, false);277 page1->addChild(VideoStartupDirectory());278 page1->addChild(TrailerDirectory()); 279 page1->addChild(VideoArtworkDirectory());280 page1->addChild(VideoScreenshotDirectory());281 page1->addChild(VideoBannerDirectory());282 page1->addChild(VideoFanartDirectory());283 284 VConfigPage page2(pages, false);285 page2->addChild(SetOnInsertDVD()); 286 page2->addChild(VideoTreeRemember());287 288 // page 3 289 VerticalConfigurationGroup*pctrl =290 new VerticalConfigurationGroup(true, false);229 setLabel(QObject::tr("General settings")); 230 231 setHelpText(QObject::tr("TODO add a descrition for this group of settings")); 232 233 234 addChild(VideoStartupDirectory()); 235 addChild(TrailerDirectory()); 236 addChild(VideoArtworkDirectory()); 237 addChild(VideoScreenshotDirectory()); 238 addChild(VideoBannerDirectory()); 239 addChild(VideoFanartDirectory()); 240 241 addChild(SetOnInsertDVD()); 242 addChild(VideoTreeRemember()); 243 244 GroupSetting *pctrl = 245 new GroupSetting(); 291 246 pctrl->setLabel(QObject::tr("Parental Control Settings")); 247 248 pctrl->setHelpText(QObject::tr("TODO add a description for this group of setting")); 292 249 pctrl->addChild(VideoDefaultParentalLevel()); 293 250 pctrl->addChild(VideoAdminPassword()); 294 251 pctrl->addChild(VideoAdminPasswordThree()); 295 252 pctrl->addChild(VideoAdminPasswordTwo()); 296 253 pctrl->addChild(VideoAggressivePC()); 297 VConfigPage page3(pages, false);298 page3->addChild(pctrl);299 254 300 VConfigPage page4(pages, false); 301 page4->addChild(new RatingsToPL()); 255 addChild(pctrl); 256 257 addChild(RatingsToPL()); 302 258 303 int page_num = 1;304 for (ConfigPage::PageList::const_iterator p = pages.begin();305 p != pages.end(); ++p, ++page_num)306 {307 (*p)->setLabel(QObject::tr("General Settings (%1/%2)").arg(page_num)308 .arg(pages.size()));309 addChild(*p);310 }311 259 } 260 -
mythtv/programs/mythfrontend/videoglobalsettings.h
diff --git a/mythtv/programs/mythfrontend/videoglobalsettings.h b/mythtv/programs/mythfrontend/videoglobalsettings.h index 9f621e6..de155db 100644
a b 3 3 4 4 #include "settings.h" 5 5 6 class VideoGeneralSettings : public ConfigurationWizard 6 #include "standardsettings.h" 7 8 class VideoGeneralSettings : public GroupSetting 7 9 { 8 10 public: 9 11 VideoGeneralSettings(); -
new file mythtv/themes/default-wide/standardsetting-ui.xml
diff --git a/mythtv/themes/default-wide/standardsetting-ui.xml b/mythtv/themes/default-wide/standardsetting-ui.xml new file mode 100644 index 0000000..03bc4e8
- + 1 <?xml version="1.0" encoding="utf-8"?> 2 <!DOCTYPE mythuitheme SYSTEM "http://www.mythtv.org/schema/mythuitheme.dtd"> 3 4 <!-- theme.xml for the MythCenter theme - by Jeroen Brosens --> 5 <mythuitheme> 6 <window name="settingssetup"> 7 8 <textarea name="title" from="basetextarea"> 9 <area>30,15,100%-30,30</area> 10 <font>baselarge</font> 11 <align>hcenter</align> 12 </textarea> 13 14 <shape name="GroupHelpBackground"> 15 <area>15,80,100%-15,80</area> 16 <type>roundbox</type> 17 <cornerradius>10</cornerradius> 18 <fill color="#FFFFFF" alpha="30" /> 19 </shape> 20 21 <!-- optionnal, display the help for the current group of settings --> 22 <textarea name="grouphelp" from="basetextarea"> 23 <area>30,90-120,100%-30,60</area> 24 <font>basesmall</font> 25 <align>lefthcenter</align> 26 <multiline>yes</multiline> 27 </textarea> 28 29 <buttonlist name="settingslist" from="basebuttonlist"> 30 <area>100,200,100%-100,100%-160</area> 31 <layout>grid</layout> 32 <spacing>4</spacing> 33 <wrapstyle>selection</wrapstyle> 34 <arrange>stack</arrange> 35 <statetype name="buttonitem"> 36 <area>0,0,100%,30</area> 37 <state name="active"> 38 <area>0,0,100%,30</area> 39 <shape name="buttonbackground"> 40 <area>0,0,100%,100%</area> 41 <fill style="gradient"> 42 <gradient start="#505050" end="#000000" alpha="200" direction="vertical" /> 43 </fill> 44 </shape> 45 <!--shape name="buttonbackgroundvalue"> 46 <area>50%,0,100%-23,100%</area> 47 <type>roundbox</type> 48 <cornerradius>10</cornerradius> 49 </shape--> 50 <textarea name="buttontext"> 51 <area>5,0,50%-10,30</area> 52 <font>basesmall</font> 53 <cutdown>yes</cutdown> 54 <align>left,vcenter</align> 55 </textarea> 56 <textarea name="value"> 57 <area>50%+5,0,100%-30,30</area> 58 <font>basesmall</font> 59 <cutdown>yes</cutdown> 60 <align>right,vcenter</align> 61 </textarea> 62 <!--textarea name="description"> 63 <area>5,50%,100%-40,100%</area> 64 <font>basesmall</font> 65 <cutdown>yes</cutdown> 66 <multiline>yes</multiline> 67 </textarea--> 68 <statetype name="buttoncheck"> 69 <position>100%-46,5</position> 70 <state type="off"> 71 <imagetype name="checkoff"> 72 <filename>lb-check-empty.png</filename> 73 </imagetype> 74 </state> 75 <state type="half"> 76 <imagetype name="checkhalf"> 77 <filename>lb-check-half.png</filename> 78 </imagetype> 79 </state> 80 <state type="full"> 81 <imagetype name="checkfull"> 82 <filename>lb-check-full.png</filename> 83 </imagetype> 84 </state> 85 </statetype> 86 <imagetype name="buttonarrow"> 87 <position>100%-23,7</position> 88 <filename>lb-arrow.png</filename> 89 </imagetype> 90 </state> 91 <state name="selectedactive" from="active"> 92 <shape name="buttonbackground"> 93 <fill style="gradient"> 94 <gradient start="#52CA38" end="#349838" alpha="255" /> 95 </fill> 96 </shape> 97 </state> 98 <state name="disabledactive" from="selectedactive"> 99 <!--area>0,0,0,0</area--> 100 <shape name="buttonbackground"> 101 <fill style="gradient"> 102 <gradient start="#888888" end="#777777" alpha="255" /> 103 </fill> 104 </shape> 105 <statetype name="buttoncheck"> 106 <state type="off"> 107 <imagetype name="checkoff"> 108 <grayscale>true</grayscale> 109 <filename>lb-check-empty-grey.png</filename> 110 </imagetype> 111 </state> 112 <state type="half"> 113 <imagetype name="checkhalf"> 114 <grayscale>true</grayscale> 115 <filename>lb-check-half.png</filename> 116 </imagetype> 117 </state> 118 <state type="full"> 119 <imagetype name="checkfull"> 120 <grayscale>true</grayscale> 121 <filename>lb-check-half.png</filename> 122 </imagetype> 123 </state> 124 </statetype> 125 </state> 126 <state name="disabledinactive" from="disabledactive"> 127 </state> 128 <state name="selectedinactive" from="active"> 129 </state> 130 </statetype> 131 </buttonlist> 132 133 <shape name="HelpBackground"> 134 <!--area>15,600,100%-30,100</area--> 135 <area>15,100%-140,100%-15,80</area> 136 <type>roundbox</type> 137 <cornerradius>10</cornerradius> 138 <fill color="#000000" alpha="30" /> 139 </shape> 140 141 <!-- optionnal, display the help for the currently selected setting --> 142 <textarea name="selectedsettinghelp" from="basetextarea"> 143 <area>30,100%-120,100%-30,60</area> 144 <font>basesmall</font> 145 <multiline>yes</multiline> 146 </textarea> 147 </window> 148 </mythuitheme>
