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