Ticket #10092: mythfrontendsetup-14-02-2012.diff

File mythfrontendsetup-14-02-2012.diff, 222.8 KB (added by Xavier Hervy <xavier.hervy@…>, 15 years ago)

Nearly all settings are converted now: selection of play back profile have been removed (working on 2 != computers) I will put it back later. Audio setting mostly done, I need to add the test button + advanced settings. Also Channel groups and Recording profils have not been touch yet

  • mythtv/programs/mythfrontend/audiogeneralsettings.cpp

    diff --git a/mythtv/programs/mythfrontend/audiogeneralsettings.cpp b/mythtv/programs/mythfrontend/audiogeneralsettings.cpp
    index 1115c27..d41df4f 100644
    a b class TriggeredItem : public TriggeredConfigurationGroup  
    4848};
    4949
    5050AudioDeviceComboBox::AudioDeviceComboBox(AudioConfigSettings *parent) :
    51     HostComboBox("AudioOutputDevice", true), m_parent(parent)
     51    HostComboBoxSetting("AudioOutputDevice", true), m_parent(parent)
    5252{
    5353    setLabel(QObject::tr("Audio output device"));
    5454#ifdef USING_ALSA
    AudioDeviceComboBox::AudioDeviceComboBox(AudioConfigSettings *parent) :  
    7070            this, SLOT(AudioDescriptionHelp(const QString&)));
    7171}
    7272
     73void AudioDeviceComboBox::edit(MythScreenType * screen)
     74{
     75    AudioRescan();
     76    HostComboBoxSetting::edit(screen);
     77}
     78
    7379void AudioDeviceComboBox::AudioRescan()
    7480{
     81    LOG(VB_GENERAL, LOG_ERR,
     82        QString("AudioDeviceComboBox::AudioRescan()"));
    7583    AudioOutput::ADCVect &vect = m_parent->AudioDeviceVect();
    7684    AudioOutput::ADCVect::const_iterator it;
    7785
    void AudioDeviceComboBox::AudioRescan()  
    8088
    8189    QString value = getValue();
    8290    clearSelections();
    83     resetMaxCount(vect.size());
     91//TODO    resetMaxCount(vect.size());
    8492
    8593    bool found = false;
    8694    for (it = vect.begin(); it != vect.end(); ++it)
    void AudioDeviceComboBox::AudioRescan()  
    8896                     value == it->name ? (found = true) : false);
    8997    if (!found)
    9098    {
    91         resetMaxCount(vect.size()+1);
     99//TODO        resetMaxCount(vect.size()+1);
    92100        addSelection(value, value, true);
    93101    }
    94102        // For some reason, it adds an empty entry, remove it
    95     removeSelection(QString::null);
     103//TODO    removeSelection(QString::null);
    96104}
    97105
    98106void AudioDeviceComboBox::AudioDescriptionHelp(const QString &device)
    void AudioDeviceComboBox::AudioDescriptionHelp(const QString &device)  
    101109    setHelpText(desc);
    102110}
    103111
    104 AudioConfigSettings::AudioConfigSettings(ConfigurationWizard *parent) :
    105     VerticalConfigurationGroup(false, true, false, false),
     112AudioConfigSettings::AudioConfigSettings() :
     113    GroupSetting(),
    106114    m_OutputDevice(NULL),   m_MaxAudioChannels(NULL),
    107115    m_AudioUpmix(NULL),     m_AudioUpmixType(NULL),
    108116    m_AC3PassThrough(NULL), m_DTSPassThrough(NULL),
    109     m_EAC3PassThrough(NULL),m_TrueHDPassThrough(NULL), m_DTSHDPassThrough(NULL),
    110     m_parent(parent)
     117    m_EAC3PassThrough(NULL),m_TrueHDPassThrough(NULL), m_DTSHDPassThrough(NULL)
    111118{
    112119    setLabel(QObject::tr("Audio System"));
    113     setUseLabel(false);
    114 
    115     ConfigurationGroup *devicegroup = new HorizontalConfigurationGroup(false,
    116                                                                        false);
    117     devicegroup->addChild((m_OutputDevice = new AudioDeviceComboBox(this)));
    118         // Rescan button
    119     TransButtonSetting *rescan = new TransButtonSetting("rescan");
    120     rescan->setLabel(QObject::tr("Rescan"));
    121     rescan->setHelpText(QObject::tr("Rescan for available audio devices. "
    122                                     "Current entry will be checked and "
    123                                     "capability entries populated."));
    124     devicegroup->addChild(rescan);
    125     connect(rescan, SIGNAL(pressed()), this, SLOT(AudioRescan()));
    126     addChild(devicegroup);
     120
     121    this->addChild((m_OutputDevice = new AudioDeviceComboBox(this)));
    127122
    128123    QString name = m_OutputDevice->getValue();
    129124    AudioOutput::AudioDeviceConfig *adc =
    AudioConfigSettings::AudioConfigSettings(ConfigurationWizard *parent) :  
    139134
    140135    delete adc;
    141136
    142     ConfigurationGroup *maingroup = new VerticalConfigurationGroup(false,
    143                                                                    false);
    144     addChild(maingroup);
    145137
    146     m_triggerDigital = new TransCheckBoxSetting();
     138    m_triggerDigital = new GroupSetting();
     139
    147140    m_AC3PassThrough = AC3PassThrough();
    148141    m_DTSPassThrough = DTSPassThrough();
    149142    m_EAC3PassThrough = EAC3PassThrough();
    150143    m_TrueHDPassThrough = TrueHDPassThrough();
    151144    m_DTSHDPassThrough = DTSHDPassThrough();
    152145
    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);
    160146
    161     TriggeredItem *sub1 = new TriggeredItem(m_triggerDigital, m_cgsettings);
     147    //m_cgsettings = new GroupSetting();
     148    m_triggerDigital->setLabel(QObject::tr("Digital Audio Capabilities"));
     149    m_triggerDigital->addChild(m_AC3PassThrough);
     150    m_triggerDigital->addChild(m_DTSPassThrough);
     151    m_triggerDigital->addChild(m_EAC3PassThrough);
     152    m_triggerDigital->addChild(m_TrueHDPassThrough);
     153    m_triggerDigital->addChild(m_DTSHDPassThrough);
     154    addChild(m_triggerDigital);
    162155
    163     maingroup->addChild(sub1);
     156    /*TriggeredItem *sub1 = new TriggeredItem(m_triggerDigital, m_cgsettings);
    164157
    165     maingroup->addChild((m_MaxAudioChannels = MaxAudioChannels()));
    166     maingroup->addChild((m_AudioUpmix = AudioUpmix()));
    167     maingroup->addChild((m_AudioUpmixType = AudioUpmixType()));
     158    maingroup->addChild(sub1);*/
    168159
    169     TransButtonSetting *test = new TransButtonSetting("test");
     160    addChild((m_MaxAudioChannels = MaxAudioChannels()));
     161    addChild((m_AudioUpmix = AudioUpmix()));
     162    addChild((m_AudioUpmixType = AudioUpmixType()));
     163    addChild(MythControlsVolume());
     164
     165
     166    GroupSetting *test = new GroupSetting(/*"test"*/);
    170167    test->setLabel(QObject::tr("Test"));
    171168    test->setHelpText(QObject::tr("Will play a test pattern on all configured "
    172169                                  "speakers"));
    173     connect(test, SIGNAL(pressed()), this, SLOT(StartAudioTest()));
     170    //connect(test, SIGNAL(pressed()), this, SLOT(StartAudioTest()));
    174171    addChild(test);
    175172
    176     TransButtonSetting *advanced = new TransButtonSetting("advanced");
    177     advanced->setLabel(QObject::tr("Advanced Audio Settings"));
     173   // GroupSetting *advanced = new AudioAdvancedSettings(/*"advanced"*/);
     174    /*advanced->setLabel(QObject::tr("Advanced Audio Settings"));
    178175    advanced->setHelpText(QObject::tr("Enable extra audio settings. Under most "
    179176                                  "usage all options should be left alone"));
    180     connect(advanced, SIGNAL(pressed()), this, SLOT(AudioAdvanced()));
    181     addChild(advanced);
     177    //connect(advanced, SIGNAL(pressed()), this, SLOT(AudioAdvanced()));
     178    addChild(advanced);*/
    182179
    183180        // Set slots
    184181    connect(m_MaxAudioChannels, SIGNAL(valueChanged(const QString&)),
    AudioConfigSettings::AudioConfigSettings(ConfigurationWizard *parent) :  
    200197
    201198void AudioConfigSettings::AudioRescan()
    202199{
     200
     201        LOG(VB_GENERAL, LOG_ERR,
     202            QString("AudioConfigSettings::AudioRescan()"));
    203203    if (!slotlock.tryLock())
    204204        return;
    205205
    void AudioConfigSettings::UpdateVisibility(const QString &device)  
    260260AudioOutputSettings AudioConfigSettings::UpdateCapabilities(
    261261    const QString &device)
    262262{
     263        LOG(VB_GENERAL, LOG_ERR,
     264            QString("AudioConfigSettings::UpdateCapabilities"));
    263265    int max_speakers = 8;
    264266    int realmax_speakers = 8;
    265267
    AudioOutputSettings AudioConfigSettings::UpdateCapabilities(  
    271273        !m_AC3PassThrough  || !m_DTSPassThrough     ||
    272274        !m_EAC3PassThrough || !m_TrueHDPassThrough  || !m_DTSHDPassThrough)
    273275        return settings;
     276        LOG(VB_GENERAL, LOG_ERR,
     277            QString("AudioConfigSettings::UpdateCapabilities 2"));
    274278
    275279    if (!slotlock.tryLock()) // Doing a rescan of channels
    276280        return settings;
    277281
     282        LOG(VB_GENERAL, LOG_ERR,
     283            QString("AudioConfigSettings::UpdateCapabilities 3"));
     284
    278285    bool bAC3 = true;
    279286    bool bDTS = true;
    280287    bool bLPCM = true;
    AudioOutputSettings AudioConfigSettings::UpdateCapabilities(  
    290297    }
    291298    else
    292299    {
     300
     301        LOG(VB_GENERAL, LOG_ERR,
     302            QString("AudioConfigSettings::UpdateCapabilities 4"));
    293303        bool bForceDigital =
    294304            gCoreContext->GetNumSetting("PassThruDeviceOverride", false);
    295305
    AudioOutputSettings AudioConfigSettings::UpdateCapabilities(  
    320330            max_speakers = 6;
    321331    }
    322332
    323     m_triggerDigital->setValue(invalid || settingsdigital.canFeature(
     333    m_triggerDigital->setEnabled(invalid || settingsdigital.canFeature(
    324334                                   FEATURE_AC3 | FEATURE_DTS | FEATURE_EAC3 |
    325335                                   FEATURE_TRUEHD | FEATURE_DTSHD));
     336   
    326337    m_EAC3PassThrough->setEnabled(bEAC3);
    327338    m_TrueHDPassThrough->setEnabled(bTRUEHD);
    328339    m_DTSHDPassThrough->setEnabled(bDTSHD);
    AudioOutputSettings AudioConfigSettings::UpdateCapabilities(  
    337348
    338349        // Remove everything and re-add available channels
    339350    m_MaxAudioChannels->clearSelections();
    340     m_MaxAudioChannels->resetMaxCount(3);
     351//TODO    m_MaxAudioChannels->resetMaxCount(3);
    341352    for (int i = 1; i <= max_speakers; i++)
    342353    {
    343354        if (invalid || settings.IsSupportedChannels(i))
    void AudioConfigSettings::AudioAdvanced()  
    399410    }
    400411}
    401412
    402 HostComboBox *AudioConfigSettings::MaxAudioChannels()
     413HostComboBoxSetting *AudioConfigSettings::MaxAudioChannels()
    403414{
    404415    QString name = "MaxChannels";
    405     HostComboBox *gc = new HostComboBox(name, false);
     416    HostComboBoxSetting *gc = new HostComboBoxSetting(name, false);
    406417    gc->setLabel(QObject::tr("Speaker configuration"));
    407418    gc->addSelection(QObject::tr("Stereo"), "2", true); // default
    408419    gc->setHelpText(QObject::tr("Select the maximum number of audio "
    HostComboBox *AudioConfigSettings::MaxAudioChannels()  
    411422    return gc;
    412423}
    413424
    414 HostCheckBox *AudioConfigSettings::AudioUpmix()
     425HostCheckBoxSetting *AudioConfigSettings::AudioUpmix()
    415426{
    416     HostCheckBox *gc = new HostCheckBox("AudioDefaultUpmix");
     427    HostCheckBoxSetting *gc = new HostCheckBoxSetting("AudioDefaultUpmix");
    417428    gc->setLabel(QObject::tr("Upconvert stereo to 5.1 surround"));
    418429    gc->setValue(true);
    419430    gc->setHelpText(QObject::tr("If enabled, MythTV will upconvert stereo "
    HostCheckBox *AudioConfigSettings::AudioUpmix()  
    422433    return gc;
    423434}
    424435
    425 HostComboBox *AudioConfigSettings::AudioUpmixType()
     436HostComboBoxSetting *AudioConfigSettings::AudioUpmixType()
    426437{
    427     HostComboBox *gc = new HostComboBox("AudioUpmixType",false);
     438    HostComboBoxSetting *gc = new HostComboBoxSetting("AudioUpmixType",false);
    428439    gc->setLabel(QObject::tr("Upmix Quality"));
    429440    gc->addSelection(QObject::tr("Good"), "1");
    430441    gc->addSelection(QObject::tr("Best"), "2", true);  // default
    HostComboBox *AudioConfigSettings::AudioUpmixType()  
    432443    return gc;
    433444}
    434445
    435 HostCheckBox *AudioConfigSettings::AC3PassThrough()
     446HostCheckBoxSetting *AudioConfigSettings::AC3PassThrough()
    436447{
    437     HostCheckBox *gc = new HostCheckBox("AC3PassThru");
     448    HostCheckBoxSetting *gc = new HostCheckBoxSetting("AC3PassThru");
    438449    gc->setLabel(QObject::tr("Dolby Digital"));
    439450    gc->setValue(false);
    440451    gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder "
    HostCheckBox *AudioConfigSettings::AC3PassThrough()  
    443454    return gc;
    444455}
    445456
    446 HostCheckBox *AudioConfigSettings::DTSPassThrough()
     457HostCheckBoxSetting *AudioConfigSettings::DTSPassThrough()
    447458{
    448     HostCheckBox *gc = new HostCheckBox("DTSPassThru");
     459    HostCheckBoxSetting *gc = new HostCheckBoxSetting("DTSPassThru");
    449460    gc->setLabel(QObject::tr("DTS"));
    450461    gc->setValue(false);
    451462    gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder "
    HostCheckBox *AudioConfigSettings::DTSPassThrough()  
    454465    return gc;
    455466}
    456467
    457 HostCheckBox *AudioConfigSettings::EAC3PassThrough()
     468HostCheckBoxSetting *AudioConfigSettings::EAC3PassThrough()
    458469{
    459     HostCheckBox *gc = new HostCheckBox("EAC3PassThru");
     470    HostCheckBoxSetting *gc = new HostCheckBoxSetting("EAC3PassThru");
    460471    gc->setLabel(QObject::tr("E-AC3"));
    461472    gc->setValue(false);
    462473    gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder "
    HostCheckBox *AudioConfigSettings::EAC3PassThrough()  
    464475    return gc;
    465476}
    466477
    467 HostCheckBox *AudioConfigSettings::TrueHDPassThrough()
     478HostCheckBoxSetting *AudioConfigSettings::TrueHDPassThrough()
    468479{
    469     HostCheckBox *gc = new HostCheckBox("TrueHDPassThru");
     480    HostCheckBoxSetting *gc = new HostCheckBoxSetting("TrueHDPassThru");
    470481    gc->setLabel(QObject::tr("TrueHD"));
    471482    gc->setValue(false);
    472483    gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder "
    HostCheckBox *AudioConfigSettings::TrueHDPassThrough()  
    474485    return gc;
    475486}
    476487
    477 HostCheckBox *AudioConfigSettings::DTSHDPassThrough()
     488HostCheckBoxSetting *AudioConfigSettings::DTSHDPassThrough()
    478489{
    479     HostCheckBox *gc = new HostCheckBox("DTSHDPassThru");
     490    HostCheckBoxSetting *gc = new HostCheckBoxSetting("DTSHDPassThru");
    480491    gc->setLabel(QObject::tr("DTS-HD"));
    481492    gc->setValue(false);
    482493    gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder "
    bool AudioConfigSettings::CheckPassthrough()  
    508519    return ok;
    509520}
    510521
     522//TODO create a interface instead
     523void fillSelectionsFromDir(HostComboBoxSetting *comboBox, const QDir& dir, bool absPath = true)
     524
     525{
     526    QFileInfoList il = dir.entryInfoList();
     527
     528    for (QFileInfoList::Iterator it = il.begin();
     529                                 it != il.end();
     530                                ++it )
     531    {
     532         QFileInfo &fi = *it;
     533
     534        if (absPath)
     535            comboBox->addSelection( fi.absoluteFilePath() );
     536        else
     537            comboBox->addSelection( fi.fileName() );
     538    }
     539}
     540
     541HostComboBoxSetting *AudioConfigSettings::MixerDevice()
     542{
     543    HostComboBoxSetting *gc = new HostComboBoxSetting("MixerDevice", true);
     544    gc->setLabel(QObject::tr("Mixer device"));
     545
     546#ifdef USING_OSS
     547    QDir dev("/dev", "mixer*", QDir::Name, QDir::System);
     548    fillSelectionsFromDir(gc, dev);
     549
     550    dev.setPath("/dev/sound");
     551    if (dev.exists())
     552    {
     553        fillSelectionsFromDir(gc, dev);
     554    }
     555#endif
     556#ifdef USING_ALSA
     557    gc->addSelection("ALSA:default", "ALSA:default");
     558#endif
     559#ifdef USING_MINGW
     560    gc->addSelection("DirectX:", "DirectX:");
     561    gc->addSelection("Windows:", "Windows:");
     562#endif
     563#if !defined(USING_MINGW)
     564    gc->addSelection("software", "software");
     565    gc->setHelpText(QObject::tr("Setting the mixer device to \"software\" "
     566                    "lets MythTV control the volume of all audio at the "
     567                    "expense of a slight quality loss."));
     568#endif
     569
     570    return gc;
     571}
     572
     573static const char* MixerControlControls[] = { "PCM",
     574                                              "Master" };
     575
     576HostComboBoxSetting *AudioConfigSettings::MixerControl()
     577{
     578    HostComboBoxSetting *gc = new HostComboBoxSetting("MixerControl", true);
     579    gc->setLabel(QObject::tr("Mixer controls"));
     580    for (unsigned int i = 0; i < sizeof(MixerControlControls) / sizeof(char*);
     581         ++i)
     582    {
     583        gc->addSelection(QObject::tr(MixerControlControls[i]),
     584                         MixerControlControls[i]);
     585    }
     586
     587    gc->setHelpText(QObject::tr("Changing the volume adjusts the selected mixer."));
     588    return gc;
     589}
     590
     591
     592//TODO was a slider
     593HostSpinBoxSetting *AudioConfigSettings::MixerVolume()
     594{
     595    HostSpinBoxSetting *gs = new HostSpinBoxSetting("MasterMixerVolume", 0, 100, 1);
     596    gs->setLabel(QObject::tr("Master mixer volume"));
     597    gs->setValue(70);
     598    gs->setHelpText(QObject::tr("Initial volume for the Master mixer. "
     599                    "This affects all sound created by the audio device. "
     600                    "Note: Do not set this too low."));
     601    return gs;
     602}
     603
     604//TODO was a slider
     605HostSpinBoxSetting *AudioConfigSettings::PCMVolume()
     606{
     607    HostSpinBoxSetting *gs = new HostSpinBoxSetting("PCMMixerVolume", 0, 100, 1);
     608    gs->setLabel(QObject::tr("PCM mixer volume"));
     609    gs->setValue(70);
     610    gs->setHelpText(QObject::tr("Initial volume for PCM output. Using the "
     611                    "volume keys in MythTV will adjust this parameter."));
     612    return gs;
     613}
     614
     615
     616HostCheckBoxSetting *AudioConfigSettings::MythControlsVolume()
     617{
     618    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MythControlsVolume");
     619    gc->setLabel(QObject::tr("Use internal volume controls"));
     620    gc->setValue(true);
     621    gc->setHelpText(QObject::tr("If enabled, MythTV will control the PCM and "
     622                    "master mixer volume. Disable this option if you prefer "
     623                    "to control the volume externally (for example, using "
     624                    "your amplifier) or if you use an external mixer program."));
     625
     626    gc->addTargetedChild("1",MixerDevice());
     627    gc->addTargetedChild("1",MixerControl());
     628    gc->addTargetedChild("1",MixerVolume());
     629    gc->addTargetedChild("1",PCMVolume());
     630    return gc;
     631}
     632
    511633void AudioConfigSettings::StartAudioTest()
    512634{
    513635    AudioOutputSettings settings = UpdateCapabilities(QString::null);
    AudioTestGroup::AudioTestGroup(QString main, QString passthrough,  
    9461068    addChild(new AudioTest(main, passthrough, channels, settings));
    9471069}
    9481070
    949 HostCheckBox *AudioMixerSettings::MythControlsVolume()
     1071HostCheckBoxSetting *AudioAdvancedSettings::MPCM()
    9501072{
    951     HostCheckBox *gc = new HostCheckBox("MythControlsVolume");
    952     gc->setLabel(QObject::tr("Use internal volume controls"));
    953     gc->setValue(true);
    954     gc->setHelpText(QObject::tr("If enabled, MythTV will control the PCM and "
    955                     "master mixer volume. Disable this option if you prefer "
    956                     "to control the volume externally (for example, using "
    957                     "your amplifier) or if you use an external mixer program."));
    958     return gc;
    959 }
    960 
    961 HostComboBox *AudioMixerSettings::MixerDevice()
    962 {
    963     HostComboBox *gc = new HostComboBox("MixerDevice", true);
    964     gc->setLabel(QObject::tr("Mixer device"));
    965 
    966 #ifdef USING_OSS
    967     QDir dev("/dev", "mixer*", QDir::Name, QDir::System);
    968     gc->fillSelectionsFromDir(dev);
    969 
    970     dev.setPath("/dev/sound");
    971     if (dev.exists())
    972     {
    973         gc->fillSelectionsFromDir(dev);
    974     }
    975 #endif
    976 #ifdef USING_ALSA
    977     gc->addSelection("ALSA:default", "ALSA:default");
    978 #endif
    979 #ifdef USING_MINGW
    980     gc->addSelection("DirectX:", "DirectX:");
    981     gc->addSelection("Windows:", "Windows:");
    982 #endif
    983 #if !defined(USING_MINGW)
    984     gc->addSelection("software", "software");
    985     gc->setHelpText(QObject::tr("Setting the mixer device to \"software\" "
    986                     "lets MythTV control the volume of all audio at the "
    987                     "expense of a slight quality loss."));
    988 #endif
    989 
    990     return gc;
    991 }
    992 
    993 const char* AudioMixerSettings::MixerControlControls[] = { "PCM",
    994                                                            "Master" };
    995 
    996 HostComboBox *AudioMixerSettings::MixerControl()
    997 {
    998     HostComboBox *gc = new HostComboBox("MixerControl", true);
    999     gc->setLabel(QObject::tr("Mixer controls"));
    1000     for (unsigned int i = 0; i < sizeof(MixerControlControls) / sizeof(char*);
    1001          ++i)
    1002     {
    1003         gc->addSelection(QObject::tr(MixerControlControls[i]),
    1004                          MixerControlControls[i]);
    1005     }
    1006 
    1007     gc->setHelpText(QObject::tr("Changing the volume adjusts the selected mixer."));
    1008     return gc;
    1009 }
    1010 
    1011 HostSlider *AudioMixerSettings::MixerVolume()
    1012 {
    1013     HostSlider *gs = new HostSlider("MasterMixerVolume", 0, 100, 1);
    1014     gs->setLabel(QObject::tr("Master mixer volume"));
    1015     gs->setValue(70);
    1016     gs->setHelpText(QObject::tr("Initial volume for the Master mixer. "
    1017                     "This affects all sound created by the audio device. "
    1018                     "Note: Do not set this too low."));
    1019     return gs;
    1020 }
    1021 
    1022 HostSlider *AudioMixerSettings::PCMVolume()
    1023 {
    1024     HostSlider *gs = new HostSlider("PCMMixerVolume", 0, 100, 1);
    1025     gs->setLabel(QObject::tr("PCM mixer volume"));
    1026     gs->setValue(70);
    1027     gs->setHelpText(QObject::tr("Initial volume for PCM output. Using the "
    1028                     "volume keys in MythTV will adjust this parameter."));
    1029     return gs;
    1030 }
    1031 
    1032 AudioMixerSettings::AudioMixerSettings() :
    1033     TriggeredConfigurationGroup(false, true, false, false)
    1034 {
    1035     setLabel(QObject::tr("Audio Mixer"));
    1036     setUseLabel(false);
    1037 
    1038     Setting *volumeControl = MythControlsVolume();
    1039     addChild(volumeControl);
    1040 
    1041         // Mixer settings
    1042     ConfigurationGroup *settings =
    1043         new VerticalConfigurationGroup(false, true, false, false);
    1044     settings->addChild(MixerDevice());
    1045     settings->addChild(MixerControl());
    1046     settings->addChild(MixerVolume());
    1047     settings->addChild(PCMVolume());
    1048 
    1049     ConfigurationGroup *dummy =
    1050         new VerticalConfigurationGroup(false, true, false, false);
    1051 
    1052         // Show Mixer config only if internal volume controls enabled
    1053     setTrigger(volumeControl);
    1054     addTarget("0", dummy);
    1055     addTarget("1", settings);
    1056 }
    1057 
    1058 AudioGeneralSettings::AudioGeneralSettings()
    1059 {
    1060     addChild(new AudioConfigSettings(this));
    1061     addChild(new AudioMixerSettings());
    1062 }
    1063 
    1064 HostCheckBox *AudioAdvancedSettings::MPCM()
    1065 {
    1066     HostCheckBox *gc = new HostCheckBox("StereoPCM");
     1073    HostCheckBoxSetting *gc = new HostCheckBoxSetting("StereoPCM");
    10671074    gc->setLabel(QObject::tr("Stereo PCM Only"));
    10681075    gc->setValue(false);
    10691076    gc->setHelpText(QObject::tr("Enable if your amplifier or sound decoder "
    HostCheckBox *AudioAdvancedSettings::MPCM()  
    10731080    return gc;
    10741081}
    10751082
    1076 HostCheckBox *AudioAdvancedSettings::SRCQualityOverride()
     1083HostCheckBoxSetting *AudioAdvancedSettings::SRCQualityOverride()
    10771084{
    1078     HostCheckBox *gc = new HostCheckBox("SRCQualityOverride");
     1085    HostCheckBoxSetting *gc = new HostCheckBoxSetting("SRCQualityOverride");
    10791086    gc->setLabel(QObject::tr("Override SRC quality"));
    10801087    gc->setValue(false);
    10811088    gc->setHelpText(QObject::tr("Enable to override audio sample rate "
    HostCheckBox *AudioAdvancedSettings::SRCQualityOverride()  
    10831090    return gc;
    10841091}
    10851092
    1086 HostComboBox *AudioAdvancedSettings::SRCQuality()
     1093HostComboBoxSetting *AudioAdvancedSettings::SRCQuality()
    10871094{
    1088     HostComboBox *gc = new HostComboBox("SRCQuality", false);
     1095    HostComboBoxSetting *gc = new HostComboBoxSetting("SRCQuality", false);
    10891096    gc->setLabel(QObject::tr("Sample rate conversion"));
    10901097    gc->addSelection(QObject::tr("Disabled"), "-1");
    10911098    gc->addSelection(QObject::tr("Fastest"), "0");
    HostComboBox *AudioAdvancedSettings::SRCQuality()  
    10981105    return gc;
    10991106}
    11001107
    1101 HostCheckBox *AudioAdvancedSettings::Audio48kOverride()
     1108HostCheckBoxSetting *AudioAdvancedSettings::Audio48kOverride()
    11021109{
    1103     HostCheckBox *gc = new HostCheckBox("Audio48kOverride");
     1110    HostCheckBoxSetting *gc = new HostCheckBoxSetting("Audio48kOverride");
    11041111    gc->setLabel(QObject::tr("Force audio device output to 48kHz"));
    11051112    gc->setValue(false);
    11061113    gc->setHelpText(QObject::tr("Force audio sample rate to 48kHz. "
    HostCheckBox *AudioAdvancedSettings::Audio48kOverride()  
    11091116    return gc;
    11101117}
    11111118
    1112 HostCheckBox *AudioAdvancedSettings::PassThroughOverride()
     1119HostCheckBoxSetting *AudioAdvancedSettings::PassThroughOverride()
    11131120{
    1114     HostCheckBox *gc = new HostCheckBox("PassThruDeviceOverride");
     1121    HostCheckBoxSetting *gc = new HostCheckBoxSetting("PassThruDeviceOverride");
    11151122    gc->setLabel(QObject::tr("Separate digital output device"));
    11161123    gc->setValue(false);
    11171124    gc->setHelpText(QObject::tr("Use a distinct digital output device from "
    HostCheckBox *AudioAdvancedSettings::PassThroughOverride()  
    11201127    return gc;
    11211128}
    11221129
    1123 HostComboBox *AudioAdvancedSettings::PassThroughOutputDevice()
     1130HostComboBoxSetting *AudioAdvancedSettings::PassThroughOutputDevice()
    11241131{
    1125     HostComboBox *gc = new HostComboBox("PassThruOutputDevice", true);
     1132    HostComboBoxSetting *gc = new HostComboBoxSetting("PassThruOutputDevice", true);
    11261133
    11271134    gc->setLabel(QObject::tr("Digital output device"));
    11281135    gc->addSelection(QObject::tr("Default"), "Default");
    HostComboBox *AudioAdvancedSettings::PassThroughOutputDevice()  
    11411148    return gc;
    11421149}
    11431150
    1144 HostCheckBox *AudioAdvancedSettings::SPDIFRateOverride()
     1151HostCheckBoxSetting *AudioAdvancedSettings::SPDIFRateOverride()
    11451152{
    1146     HostCheckBox *gc = new HostCheckBox("SPDIFRateOverride");
     1153    HostCheckBoxSetting *gc = new HostCheckBoxSetting("SPDIFRateOverride");
    11471154    gc->setLabel(QObject::tr("SPDIF 48k rate override"));
    11481155    gc->setValue(false);
    11491156    gc->setHelpText(QObject::tr("ALSA only. By default, let ALSA determine "
    HostCheckBox *AudioAdvancedSettings::SPDIFRateOverride()  
    11531160    return gc;
    11541161}
    11551162
    1156 HostCheckBox *AudioAdvancedSettings::HBRPassthrough()
     1163HostCheckBoxSetting *AudioAdvancedSettings::HBRPassthrough()
    11571164{
    1158     HostCheckBox *gc = new HostCheckBox("HBRPassthru");
     1165    HostCheckBoxSetting *gc = new HostCheckBoxSetting("HBRPassthru");
    11591166    gc->setLabel(QObject::tr("HBR passthrough support"));
    11601167    gc->setValue(true);
    11611168    gc->setHelpText(QObject::tr("HBR support is required for TrueHD and DTS-HD "
    HostCheckBox *AudioAdvancedSettings::HBRPassthrough()  
    11691176
    11701177AudioAdvancedSettings::AudioAdvancedSettings(bool mpcm)
    11711178{
    1172     ConfigurationGroup *settings3 =
    1173         new HorizontalConfigurationGroup(false, false);
    11741179
    11751180    m_PassThroughOverride = PassThroughOverride();
    1176     TriggeredItem *sub3 =
    1177         new TriggeredItem(m_PassThroughOverride, PassThroughOutputDevice());
    1178     settings3->addChild(m_PassThroughOverride);
    1179     settings3->addChild(sub3);
    1180 
    1181     ConfigurationGroup *settings4 =
    1182         new HorizontalConfigurationGroup(false, false);
    1183     Setting *srcqualityoverride = SRCQualityOverride();
    1184     TriggeredItem *sub4 =
    1185         new TriggeredItem(srcqualityoverride, SRCQuality());
    1186     settings4->addChild(srcqualityoverride);
    1187     settings4->addChild(sub4);
    1188 
    1189     ConfigurationGroup *settings5 =
    1190         new HorizontalConfigurationGroup(false, false);
    1191     settings5->addChild(Audio48kOverride());
    1192 #if USING_ALSA
    1193     settings5->addChild(SPDIFRateOverride());
    1194 #endif
     1181    m_PassThroughOverride->addTargetedChild("1",PassThroughOutputDevice());
     1182    addChild(m_PassThroughOverride);
    11951183
    1196     ConfigurationGroup *settings6 =
    1197         new HorizontalConfigurationGroup(false, false);
    1198     settings6->addChild(HBRPassthrough());
     1184    StandardSetting *srcqualityoverride = SRCQualityOverride();
     1185    srcqualityoverride->addTargetedChild("1",SRCQuality());
    11991186
    1200     addChild(settings4);
    1201     addChild(settings5);
    1202     addChild(settings3);
    1203     addChild(settings6);
     1187    addChild(Audio48kOverride());
     1188#if USING_ALSA
     1189    addChild(SPDIFRateOverride());
     1190#endif
    12041191
    1205     if (mpcm)
    1206     {
    1207         ConfigurationGroup *settings7;
    1208         settings7 = new HorizontalConfigurationGroup(false, false);
    1209         settings7->addChild(MPCM());
    1210         addChild(settings7);
    1211     }
     1192    addChild(HBRPassthrough());
     1193    StandardSetting * setting = MPCM();
     1194    addChild(setting);
     1195    setting->setEnabled(mpcm);
    12121196}
    12131197
    12141198AudioAdvancedSettingsGroup::AudioAdvancedSettingsGroup(bool mpcm)
    12151199{
    1216     addChild(new AudioAdvancedSettings(mpcm));
     1200//    addChild(new AudioAdvancedSettings(mpcm));
    12171201}
    12181202// vim:set sw=4 ts=4 expandtab:
  • mythtv/programs/mythfrontend/audiogeneralsettings.h

    diff --git a/mythtv/programs/mythfrontend/audiogeneralsettings.h b/mythtv/programs/mythfrontend/audiogeneralsettings.h
    index fe31bd8..b7221d6 100644
    a b  
    1212#include "audiooutput.h"
    1313#include "mythcontext.h"
    1414#include "settings.h"
     15#include "standardsettings.h"
    1516#include "mthread.h"
    1617
    1718class AudioDeviceComboBox;
    1819
    19 class AudioConfigSettings : public VerticalConfigurationGroup
     20class AudioConfigSettings : public GroupSetting
    2021{
    2122    Q_OBJECT
    2223
    2324  public:
    24     AudioConfigSettings(ConfigurationWizard *);
     25    AudioConfigSettings();
    2526
    2627    typedef QMap<QString,AudioOutput::AudioDeviceConfig> ADCMap;
    2728
    class AudioConfigSettings : public VerticalConfigurationGroup  
    3738
    3839  private:
    3940    AudioDeviceComboBox *OutputDevice();
    40     HostComboBox        *MaxAudioChannels();
    41     HostCheckBox        *AudioUpmix();
    42     HostComboBox        *AudioUpmixType();
    43     HostCheckBox        *AC3PassThrough();
    44     HostCheckBox        *DTSPassThrough();
    45     HostCheckBox        *EAC3PassThrough();
    46     HostCheckBox        *TrueHDPassThrough();
    47     HostCheckBox        *DTSHDPassThrough();
     41    HostComboBoxSetting        *MaxAudioChannels();
     42    HostCheckBoxSetting        *AudioUpmix();
     43    HostComboBoxSetting        *AudioUpmixType();
     44    HostCheckBoxSetting        *AC3PassThrough();
     45    HostCheckBoxSetting        *DTSPassThrough();
     46    HostCheckBoxSetting        *EAC3PassThrough();
     47    HostCheckBoxSetting        *TrueHDPassThrough();
     48    HostCheckBoxSetting        *DTSHDPassThrough();
     49    HostCheckBoxSetting        *MythControlsVolume();
     50    HostComboBoxSetting        *MixerDevice();
     51    HostComboBoxSetting        *MixerControl();
     52    HostSpinBoxSetting         *MixerVolume();
     53    HostSpinBoxSetting         *PCMVolume();
    4854    bool                 CheckPassthrough();
    4955
    50     ConfigurationGroup  *m_cgsettings;
     56    GroupSetting  *m_cgsettings;
    5157    AudioDeviceComboBox *m_OutputDevice;
    52     HostComboBox        *m_MaxAudioChannels;
    53     HostCheckBox        *m_AudioUpmix;
    54     HostComboBox        *m_AudioUpmixType;
    55     CheckBoxSetting     *m_triggerDigital;
    56     HostCheckBox        *m_AC3PassThrough;
    57     HostCheckBox        *m_DTSPassThrough;
    58     HostCheckBox        *m_EAC3PassThrough;
    59     HostCheckBox        *m_TrueHDPassThrough;
    60     HostCheckBox        *m_DTSHDPassThrough;
     58    HostComboBoxSetting        *m_MaxAudioChannels;
     59    HostCheckBoxSetting        *m_AudioUpmix;
     60    HostComboBoxSetting        *m_AudioUpmixType;
     61    GroupSetting     *m_triggerDigital;
     62    HostCheckBoxSetting        *m_AC3PassThrough;
     63    HostCheckBoxSetting        *m_DTSPassThrough;
     64    HostCheckBoxSetting        *m_EAC3PassThrough;
     65    HostCheckBoxSetting        *m_TrueHDPassThrough;
     66    HostCheckBoxSetting        *m_DTSHDPassThrough;
    6167    ADCMap               audiodevs;
    6268    AudioOutput::ADCVect devices;
    6369    QMutex               slotlock;
    64     ConfigurationWizard *m_parent;
     70    GroupSetting *m_parent;
    6571};
    6672
    67 class AudioDeviceComboBox : public HostComboBox
     73class AudioDeviceComboBox : public HostComboBoxSetting
    6874{
    6975    Q_OBJECT
    7076  public:
    7177    AudioDeviceComboBox(AudioConfigSettings*);
    7278    void AudioRescan();
    7379
     80    virtual void edit(MythScreenType * screen);
     81
    7482  private slots:
    7583    void AudioDescriptionHelp(const QString&);
    7684
    class AudioDeviceComboBox : public HostComboBox  
    7886    AudioConfigSettings *m_parent;
    7987};
    8088
    81 class AudioMixerSettings : public TriggeredConfigurationGroup
     89class AudioMixerSettings : public GroupSetting
    8290{
    8391  public:
    8492    AudioMixerSettings();
    8593  private:
    86     HostCheckBox       *MythControlsVolume();
    87     HostComboBox       *MixerDevice();
    88     HostComboBox       *MixerControl();
    89     HostSlider         *MixerVolume();
    90     HostSlider         *PCMVolume();
    91     static const char  *MixerControlControls[];
    92 };
    93 
    94 class AudioGeneralSettings : public ConfigurationWizard
    95 {
    96   public:
    97     AudioGeneralSettings();
     94    HostCheckBoxSetting *MythControlsVolume();
     95    HostComboBoxSetting *MixerDevice();
     96    HostComboBoxSetting *MixerControl();
     97    HostSpinBoxSetting  *MixerVolume();
     98    HostSpinBoxSetting  *PCMVolume();
     99    static const char   *MixerControlControls[];
    98100};
    99101
    100 class AudioAdvancedSettings : public VerticalConfigurationGroup
     102class AudioAdvancedSettings : public GroupSetting
    101103{
    102104  public:
    103105    AudioAdvancedSettings(bool mpcm);
    104106
    105     HostCheckBox       *MPCM();
    106     HostCheckBox       *SRCQualityOverride();
    107     HostComboBox       *SRCQuality();
    108     HostCheckBox       *Audio48kOverride();
    109     HostCheckBox       *PassThroughOverride();
    110     HostComboBox       *PassThroughOutputDevice();
    111     HostCheckBox       *SPDIFRateOverride();
    112     HostCheckBox       *HBRPassthrough();
    113 
    114     CheckBoxSetting    *m_triggerMPCM;
    115     HostCheckBox       *m_MPCM;
    116     HostCheckBox       *m_PassThroughOverride;
     107    HostCheckBoxSetting       *MPCM();
     108    HostCheckBoxSetting       *SRCQualityOverride();
     109    HostComboBoxSetting       *SRCQuality();
     110    HostCheckBoxSetting       *Audio48kOverride();
     111    HostCheckBoxSetting       *PassThroughOverride();
     112    HostComboBoxSetting       *PassThroughOutputDevice();
     113    HostCheckBoxSetting       *SPDIFRateOverride();
     114    HostCheckBoxSetting       *HBRPassthrough();
     115
     116    CheckBoxSetting           *m_triggerMPCM;
     117    HostCheckBoxSetting       *m_MPCM;
     118    HostCheckBoxSetting       *m_PassThroughOverride;
    117119};
    118120
    119121class AudioAdvancedSettingsGroup : public ConfigurationWizard
  • mythtv/programs/mythfrontend/globalsettings.cpp

    diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
    index 7e6fad3..c8062bf 100644
    a b  
    33
    44// Standard UNIX C headers
    55#include <unistd.h>
     6#include <cmath>
    67#include <fcntl.h>
    78#include <sys/types.h>
    89#include <sys/stat.h>
     
    3940#include "mythdirs.h"
    4041#include "mythuihelper.h"
    4142
    42 static HostCheckBox *DecodeExtraAudio()
     43static HostCheckBoxSetting *DecodeExtraAudio()
    4344{
    44     HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
     45    HostCheckBoxSetting *gc = new HostCheckBoxSetting("DecodeExtraAudio");
    4546    gc->setLabel(QObject::tr("Extra audio buffering"));
    4647    gc->setValue(true);
    4748    gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
    static HostCheckBox *DecodeExtraAudio()  
    5354    return gc;
    5455}
    5556
    56 static HostComboBox *PIPLocationComboBox()
     57static HostComboBoxSetting *PIPLocationComboBox()
    5758{
    58     HostComboBox *gc = new HostComboBox("PIPLocation");
     59    HostComboBoxSetting *gc = new HostComboBoxSetting("PIPLocation");
    5960    gc->setLabel(QObject::tr("PIP video location"));
    6061    for (uint loc = 0; loc < kPIP_END; ++loc)
    6162        gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
    static HostComboBox *PIPLocationComboBox()  
    6364    return gc;
    6465}
    6566
    66 static HostComboBox *DisplayRecGroup()
     67static HostComboBoxSetting *DisplayRecGroup()
    6768{
    68     HostComboBox *gc = new HostComboBox("DisplayRecGroup");
     69    HostComboBoxSetting *gc = new HostComboBoxSetting("DisplayRecGroup");
    6970    gc->setLabel(QObject::tr("Default group filter to apply"));
    7071
    7172    gc->addSelection(QObject::tr("All Programs"), QString("All Programs"));
    static HostComboBox *DisplayRecGroup()  
    102103    return gc;
    103104}
    104105
    105 static HostCheckBox *QueryInitialFilter()
     106static HostCheckBoxSetting *QueryInitialFilter()
    106107{
    107     HostCheckBox *gc = new HostCheckBox("QueryInitialFilter");
     108    HostCheckBoxSetting *gc = new HostCheckBoxSetting("QueryInitialFilter");
    108109    gc->setLabel(QObject::tr("Always prompt for initial group filter"));
    109110    gc->setValue(false);
    110111    gc->setHelpText(QObject::tr("If enabled, always prompt the user for the "
    static HostCheckBox *QueryInitialFilter()  
    113114    return gc;
    114115}
    115116
    116 static HostCheckBox *RememberRecGroup()
     117static HostCheckBoxSetting *RememberRecGroup()
    117118{
    118     HostCheckBox *gc = new HostCheckBox("RememberRecGroup");
     119    HostCheckBoxSetting *gc = new HostCheckBoxSetting("RememberRecGroup");
    119120    gc->setLabel(QObject::tr("Save current group filter when changed"));
    120121    gc->setValue(true);
    121122    gc->setHelpText(QObject::tr("If enabled, remember the last selected filter "
    static HostCheckBox *RememberRecGroup()  
    124125    return gc;
    125126}
    126127
    127 static HostCheckBox *UseGroupNameAsAllPrograms()
     128static HostCheckBoxSetting *UseGroupNameAsAllPrograms()
    128129{
    129     HostCheckBox *gc = new HostCheckBox("DispRecGroupAsAllProg");
     130    HostCheckBoxSetting *gc = new HostCheckBoxSetting("DispRecGroupAsAllProg");
    130131    gc->setLabel(QObject::tr("Show filter name instead of \"All Programs\""));
    131132    gc->setValue(false);
    132133    gc->setHelpText(QObject::tr("If enabled, use the name of the display "
    static HostCheckBox *UseGroupNameAsAllPrograms()  
    135136    return gc;
    136137}
    137138
    138 static HostCheckBox *PBBStartInTitle()
     139static HostCheckBoxSetting *PBBStartInTitle()
    139140{
    140     HostCheckBox *gc = new HostCheckBox("PlaybackBoxStartInTitle");
     141    HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackBoxStartInTitle");
    141142    gc->setLabel(QObject::tr("Start in group list"));
    142143    gc->setValue(true);
    143144    gc->setHelpText(QObject::tr("If enabled, the focus will "
    static HostCheckBox *PBBStartInTitle()  
    146147    return gc;
    147148}
    148149
    149 static HostCheckBox *SmartForward()
     150static HostCheckBoxSetting *SmartForward()
    150151{
    151     HostCheckBox *gc = new HostCheckBox("SmartForward");
     152    HostCheckBoxSetting *gc = new HostCheckBoxSetting("SmartForward");
    152153    gc->setLabel(QObject::tr("Smart fast forwarding"));
    153154    gc->setValue(false);
    154155    gc->setHelpText(QObject::tr("If enabled, then immediately after "
    static HostCheckBox *SmartForward()  
    157158    return gc;
    158159}
    159160
    160 static HostCheckBox *ExactSeeking()
     161static HostCheckBoxSetting *ExactSeeking()
    161162{
    162     HostCheckBox *gc = new HostCheckBox("ExactSeeking");
     163    HostCheckBoxSetting *gc = new HostCheckBoxSetting("ExactSeeking");
    163164    gc->setLabel(QObject::tr("Seek to exact frame"));
    164165    gc->setValue(false);
    165166    gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
    static HostCheckBox *ExactSeeking()  
    167168    return gc;
    168169}
    169170
    170 static GlobalComboBox *CommercialSkipMethod()
     171static GlobalComboBoxSetting *CommercialSkipMethod()
    171172{
    172     GlobalComboBox *bc = new GlobalComboBox("CommercialSkipMethod");
     173    GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("CommercialSkipMethod");
    173174    bc->setLabel(QObject::tr("Commercial detection method"));
    174175    bc->setHelpText(QObject::tr(
    175176                        "This determines the method used by MythTV to "
    static GlobalComboBox *CommercialSkipMethod()  
    182183    return bc;
    183184}
    184185
    185 static GlobalCheckBox *CommFlagFast()
     186static GlobalCheckBoxSetting *CommFlagFast()
    186187{
    187     GlobalCheckBox *gc = new GlobalCheckBox("CommFlagFast");
     188    GlobalCheckBoxSetting *gc = new GlobalCheckBoxSetting("CommFlagFast");
    188189    gc->setLabel(QObject::tr("Enable experimental speedup of commercial detection"));
    189190    gc->setValue(false);
    190191    gc->setHelpText(QObject::tr("If enabled, experimental commercial detection "
    static GlobalCheckBox *CommFlagFast()  
    192193    return gc;
    193194}
    194195
    195 static HostComboBox *AutoCommercialSkip()
     196static HostComboBoxSetting *AutoCommercialSkip()
    196197{
    197     HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
     198    HostComboBoxSetting *gc = new HostComboBoxSetting("AutoCommercialSkip");
    198199    gc->setLabel(QObject::tr("Automatically skip commercials"));
    199200    gc->addSelection(QObject::tr("Off"), "0");
    200201    gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
    static HostComboBox *AutoCommercialSkip()  
    206207    return gc;
    207208}
    208209
    209 static GlobalCheckBox *AutoMetadataLookup()
     210static GlobalCheckBoxSetting *AutoMetadataLookup()
    210211{
    211     GlobalCheckBox *bc = new GlobalCheckBox("AutoMetadataLookup");
     212    GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoMetadataLookup");
    212213    bc->setLabel(QObject::tr("Run metadata lookup"));
    213214    bc->setValue(true);
    214215    bc->setHelpText(QObject::tr("This is the default value used for the "
    static GlobalCheckBox *AutoMetadataLookup()  
    217218    return bc;
    218219}
    219220
    220 static GlobalCheckBox *AutoCommercialFlag()
     221static GlobalCheckBoxSetting *AutoCommercialFlag()
    221222{
    222     GlobalCheckBox *bc = new GlobalCheckBox("AutoCommercialFlag");
     223    GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoCommercialFlag");
    223224    bc->setLabel(QObject::tr("Run commercial detection"));
    224225    bc->setValue(true);
    225226    bc->setHelpText(QObject::tr("This is the default value used for the "
    static GlobalCheckBox *AutoCommercialFlag()  
    228229    return bc;
    229230}
    230231
    231 static GlobalCheckBox *AutoTranscode()
     232static GlobalCheckBoxSetting *AutoTranscode()
    232233{
    233     GlobalCheckBox *bc = new GlobalCheckBox("AutoTranscode");
     234    GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoTranscode");
    234235    bc->setLabel(QObject::tr("Run transcoder"));
    235236    bc->setValue(false);
    236237    bc->setHelpText(QObject::tr("This is the default value used for the "
    static GlobalCheckBox *AutoTranscode()  
    239240    return bc;
    240241}
    241242
    242 static GlobalComboBox *DefaultTranscoder()
     243/*TODO This function is borrowed from RecordingProfile::fillSelections and sligthly modified
     244I will need to change the original to use a pure abstract class instead of SelectSetting
     245*/
     246void RecordingProfile_fillSelections(MythUIComboBoxSetting *setting, int group,
     247                                      bool foldautodetect)
    243248{
    244     GlobalComboBox *bc = new GlobalComboBox("DefaultTranscoder");
     249    if (!group)
     250    {
     251       for (uint i = 0; !availProfiles[i].isEmpty(); i++)
     252           setting->addSelection(availProfiles[i], availProfiles[i]);
     253       return;
     254    }
     255
     256    MSqlQuery result(MSqlQuery::InitCon());
     257    result.prepare(
     258        "SELECT name, id "
     259        "FROM recordingprofiles "
     260        "WHERE profilegroup = :GROUP "
     261        "ORDER BY id");
     262    result.bindValue(":GROUP", group);
     263
     264    if (!result.exec())
     265    {
     266        MythDB::DBError("RecordingProfile::fillSelections 1", result);
     267        return;
     268    }
     269    else if (!result.next())
     270    {
     271        return;
     272    }
     273
     274    if (group == RecordingProfile::TranscoderGroup && foldautodetect)
     275    {
     276        QString id = QString::number(RecordingProfile::TranscoderAutodetect);
     277        setting->addSelection(QObject::tr("Autodetect"), id);
     278    }
     279
     280    do
     281    {
     282        QString name = result.value(0).toString();
     283        QString id   = result.value(1).toString();
     284
     285        if (group == RecordingProfile::TranscoderGroup)
     286        {
     287            if (name == "RTjpeg/MPEG4" || name == "MPEG2")
     288            {
     289                if (!foldautodetect)
     290                {
     291                    setting->addSelection(
     292                        QObject::tr("Autodetect from %1").arg(name), id);
     293                }
     294            }
     295            else
     296            {
     297                setting->addSelection(name, id);
     298            }
     299            continue;
     300        }
     301
     302        setting->addSelection(name, id);
     303    }
     304    while (result.next());
     305}
     306
     307static GlobalComboBoxSetting *DefaultTranscoder()
     308{
     309    GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("DefaultTranscoder");
    245310    bc->setLabel(QObject::tr("Default transcoder"));
    246     RecordingProfile::fillSelections(bc, RecordingProfile::TranscoderGroup,
     311    RecordingProfile_fillSelections(bc, RecordingProfile::TranscoderGroup,
    247312                                     true);
     313
    248314    bc->setHelpText(QObject::tr("This is the default value used for the "
    249315                    "transcoder setting when a new scheduled "
    250316                    "recording is created."));
    251317    return bc;
    252318}
    253319
    254 static GlobalSpinBox *DeferAutoTranscodeDays()
     320static GlobalSpinBoxSetting *DeferAutoTranscodeDays()
    255321{
    256     GlobalSpinBox *gs = new GlobalSpinBox("DeferAutoTranscodeDays", 0, 365, 1);
     322    GlobalSpinBoxSetting *gs = new GlobalSpinBoxSetting("DeferAutoTranscodeDays", 0, 365, 1);
    257323    gs->setLabel(QObject::tr("Deferral days for auto transcode jobs"));
    258324    gs->setHelpText(QObject::tr("If non-zero, automatic transcode jobs will "
    259325                    "be scheduled to run this many days after a recording "
    static GlobalSpinBox *DeferAutoTranscodeDays()  
    262328    return gs;
    263329}
    264330
    265 static GlobalCheckBox *AutoRunUserJob(uint job_num)
     331static GlobalCheckBoxSetting *AutoRunUserJob(uint job_num)
    266332{
    267333    QString dbStr = QString("AutoRunUserJob%1").arg(job_num);
    268334    QString label = QObject::tr("Run user job #%1")
    269335        .arg(job_num);
    270     GlobalCheckBox *bc = new GlobalCheckBox(dbStr);
     336    GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting(dbStr);
    271337    bc->setLabel(label);
    272338    bc->setValue(false);
    273339    bc->setHelpText(QObject::tr("This is the default value used for the "
    static GlobalCheckBox *AutoRunUserJob(uint job_num)  
    278344    return bc;
    279345}
    280346
    281 static GlobalCheckBox *AggressiveCommDetect()
     347static GlobalCheckBoxSetting *AggressiveCommDetect()
    282348{
    283     GlobalCheckBox *bc = new GlobalCheckBox("AggressiveCommDetect");
     349    GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AggressiveCommDetect");
    284350    bc->setLabel(QObject::tr("Strict commercial detection"));
    285351    bc->setValue(true);
    286352    bc->setHelpText(QObject::tr("Enable stricter commercial detection code. "
    static GlobalCheckBox *AggressiveCommDetect()  
    288354    return bc;
    289355}
    290356
    291 static HostSpinBox *CommRewindAmount()
     357static HostSpinBoxSetting *CommRewindAmount()
    292358{
    293     HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
     359    HostSpinBoxSetting *gs = new HostSpinBoxSetting("CommRewindAmount", 0, 10, 1);
    294360    gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)"));
    295361    gs->setHelpText(QObject::tr("MythTV will automatically rewind "
    296362                    "this many seconds after performing a commercial skip."));
    static HostSpinBox *CommRewindAmount()  
    298364    return gs;
    299365}
    300366
    301 static HostSpinBox *CommNotifyAmount()
     367static HostSpinBoxSetting *CommNotifyAmount()
    302368{
    303     HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
     369    HostSpinBoxSetting *gs = new HostSpinBoxSetting("CommNotifyAmount", 0, 10, 1);
    304370    gs->setLabel(QObject::tr("Commercial skip notify amount (secs)"));
    305371    gs->setHelpText(QObject::tr("MythTV will act like a commercial "
    306372                    "begins this many seconds early. This can be useful "
    static HostSpinBox *CommNotifyAmount()  
    310376    return gs;
    311377}
    312378
    313 static GlobalSpinBox *MaximumCommercialSkip()
     379static GlobalSpinBoxSetting *MaximumCommercialSkip()
    314380{
    315     GlobalSpinBox *bs = new GlobalSpinBox("MaximumCommercialSkip", 0, 3600, 10);
     381    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("MaximumCommercialSkip", 0, 3600, 10);
    316382    bs->setLabel(QObject::tr("Maximum commercial skip (secs)"));
    317383    bs->setHelpText(QObject::tr("MythTV will discourage long manual commercial "
    318384                    "skips. Skips which are longer than this will require the "
    static GlobalSpinBox *MaximumCommercialSkip()  
    322388    return bs;
    323389}
    324390
    325 static GlobalSpinBox *MergeShortCommBreaks()
     391static GlobalSpinBoxSetting *MergeShortCommBreaks()
    326392{
    327     GlobalSpinBox *bs = new GlobalSpinBox("MergeShortCommBreaks", 0, 3600, 5);
     393    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("MergeShortCommBreaks", 0, 3600, 5);
    328394    bs->setLabel(QObject::tr("Merge short commercial breaks (secs)"));
    329395    bs->setHelpText(QObject::tr("Treat consecutive commercial breaks shorter "
    330396                    "than this as one break when skipping forward. Useful if "
    static GlobalSpinBox *MergeShortCommBreaks()  
    334400    return bs;
    335401}
    336402
    337 static GlobalSpinBox *AutoExpireExtraSpace()
     403static GlobalSpinBoxSetting *AutoExpireExtraSpace()
    338404{
    339     GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireExtraSpace", 0, 200, 1);
     405    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireExtraSpace", 0, 200, 1);
    340406    bs->setLabel(QObject::tr("Extra disk space (GB)"));
    341407    bs->setHelpText(QObject::tr("Extra disk space (in gigabytes) beyond what "
    342408                    "MythTV requires that you want to keep free on the "
    static GlobalSpinBox *AutoExpireExtraSpace()  
    345411    return bs;
    346412};
    347413
    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()
     414static GlobalSpinBoxSetting *DeletedMaxAge()
    360415{
    361     GlobalSpinBox *bs = new GlobalSpinBox("DeletedMaxAge", 0, 365, 1);
     416    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("DeletedMaxAge", 0, 365, 1);
    362417    bs->setLabel(QObject::tr("Deleted max age (days)"));
    363418    bs->setHelpText(QObject::tr("When set to a number greater than zero, "
    364419                    "Auto-Expire will force expiration of Deleted recordings "
    static GlobalSpinBox *DeletedMaxAge()  
    367422    return bs;
    368423};
    369424
    370 static GlobalCheckBox *DeletedFifoOrder()
     425static GlobalCheckBoxSetting *DeletedFifoOrder()
    371426{
    372     GlobalCheckBox *cb = new GlobalCheckBox("DeletedFifoOrder");
     427    GlobalCheckBoxSetting *cb = new GlobalCheckBoxSetting("DeletedFifoOrder");
    373428    cb->setLabel(QObject::tr("Expire in deleted order"));
    374429    cb->setValue(false);
    375430    cb->setHelpText(QObject::tr(
    static GlobalCheckBox *DeletedFifoOrder()  
    378433    return cb;
    379434};
    380435
    381 class DeletedExpireOptions : public TriggeredConfigurationGroup
    382 {
    383     public:
    384      DeletedExpireOptions() :
    385          TriggeredConfigurationGroup(false, false, false, false)
    386          {
    387              setLabel(QObject::tr("DeletedExpireOptions"));
    388              Setting* enabled = AutoExpireInsteadOfDelete();
    389              addChild(enabled);
    390              setTrigger(enabled);
    391 
    392              HorizontalConfigurationGroup* settings =
    393                  new HorizontalConfigurationGroup(false);
    394              settings->addChild(DeletedFifoOrder());
    395              settings->addChild(DeletedMaxAge());
    396              addTarget("1", settings);
    397 
    398              // show nothing if fillEnabled is off
    399              addTarget("0", new HorizontalConfigurationGroup(true));
    400          };
    401 };
     436static GlobalCheckBoxSetting *AutoExpireInsteadOfDelete()
     437{
     438    GlobalCheckBoxSetting *cb = new GlobalCheckBoxSetting("AutoExpireInsteadOfDelete");
     439    cb->setLabel(QObject::tr("Auto-Expire instead of delete recording"));
     440    cb->setValue(false);
     441    cb->setHelpText(QObject::tr("If enabled, move deleted recordings to the "
     442                    "'Deleted' recgroup and turn on autoexpire "
     443                    "instead of deleting immediately."));
    402444
    403 static GlobalComboBox *AutoExpireMethod()
     445    cb->addTargetedChild("1",DeletedFifoOrder());
     446    cb->addTargetedChild("1",DeletedMaxAge());
     447    return cb;
     448}
     449
     450static GlobalComboBoxSetting *AutoExpireMethod()
    404451{
    405     GlobalComboBox *bc = new GlobalComboBox("AutoExpireMethod");
     452    GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("AutoExpireMethod");
    406453    bc->setLabel(QObject::tr("Auto-Expire method"));
    407454    bc->addSelection(QObject::tr("Oldest show first"), "1");
    408455    bc->addSelection(QObject::tr("Lowest priority first"), "2");
    static GlobalComboBox *AutoExpireMethod()  
    414461    return bc;
    415462}
    416463
    417 static GlobalCheckBox *AutoExpireWatchedPriority()
     464static GlobalCheckBoxSetting *AutoExpireWatchedPriority()
    418465{
    419     GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireWatchedPriority");
     466    GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoExpireWatchedPriority");
    420467    bc->setLabel(QObject::tr("Watched before unwatched"));
    421468    bc->setValue(false);
    422469    bc->setHelpText(QObject::tr("If enabled, programs that have been marked as "
    static GlobalCheckBox *AutoExpireWatchedPriority()  
    425472    return bc;
    426473}
    427474
    428 static GlobalSpinBox *AutoExpireDayPriority()
     475static GlobalSpinBoxSetting *AutoExpireDayPriority()
    429476{
    430     GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireDayPriority", 1, 400, 1);
     477    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireDayPriority", 1, 400, 1);
    431478    bs->setLabel(QObject::tr("Priority weight"));
    432479    bs->setHelpText(QObject::tr("The number of days bonus a program gets for "
    433480                    "each priority point. This is only used when the Weighted "
    static GlobalSpinBox *AutoExpireDayPriority()  
    436483    return bs;
    437484};
    438485
    439 static GlobalCheckBox *AutoExpireDefault()
     486static GlobalCheckBoxSetting *AutoExpireDefault()
    440487{
    441     GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireDefault");
     488    GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("AutoExpireDefault");
    442489    bc->setLabel(QObject::tr("Auto-Expire default"));
    443490    bc->setValue(true);
    444491    bc->setHelpText(QObject::tr("If enabled, any new recording schedules "
    static GlobalCheckBox *AutoExpireDefault()  
    447494    return bc;
    448495}
    449496
    450 static GlobalSpinBox *AutoExpireLiveTVMaxAge()
     497static GlobalSpinBoxSetting *AutoExpireLiveTVMaxAge()
    451498{
    452     GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireLiveTVMaxAge", 1, 365, 1);
     499    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoExpireLiveTVMaxAge", 1, 365, 1);
    453500    bs->setLabel(QObject::tr("Live TV max age (days)"));
    454501    bs->setHelpText(QObject::tr("Auto-Expire will force expiration of Live "
    455502                    "TV recordings when they are this many days old. Live TV "
    456503                    "recordings may also be expired early if necessary to "
    457504                    "free up disk space."));
    458     bs->setValue(1);
     505    bs->setValue((int)1);
    459506    return bs;
    460507};
    461508
    static GlobalSpinBox *MinRecordDiskThreshold()  
    474521}
    475522#endif
    476523
    477 static GlobalCheckBox *RerecordWatched()
     524static GlobalCheckBoxSetting *RerecordWatched()
    478525{
    479     GlobalCheckBox *bc = new GlobalCheckBox("RerecordWatched");
     526    GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("RerecordWatched");
    480527    bc->setLabel(QObject::tr("Re-record watched"));
    481528    bc->setValue(false);
    482529    bc->setHelpText(QObject::tr("If enabled, programs that have been marked as "
    static GlobalCheckBox *RerecordWatched()  
    485532    return bc;
    486533}
    487534
    488 static GlobalSpinBox *RecordPreRoll()
     535static GlobalSpinBoxSetting *RecordPreRoll()
    489536{
    490     GlobalSpinBox *bs = new GlobalSpinBox("RecordPreRoll", 0, 600, 60, true);
     537    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("RecordPreRoll", 0, 600, 60, true);
    491538    bs->setLabel(QObject::tr("Time to record before start of show "
    492539                 "(secs)"));
    493540    bs->setHelpText(QObject::tr("This global setting allows the recorder "
    static GlobalSpinBox *RecordPreRoll()  
    498545    return bs;
    499546}
    500547
    501 static GlobalSpinBox *RecordOverTime()
     548static GlobalSpinBoxSetting *RecordOverTime()
    502549{
    503     GlobalSpinBox *bs = new GlobalSpinBox("RecordOverTime", 0, 1800, 60, true);
     550    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("RecordOverTime", 0, 1800, 60, true);
    504551    bs->setLabel(QObject::tr("Time to record past end of show (secs)"));
    505552    bs->setValue(0);
    506553    bs->setHelpText(QObject::tr("This global setting allows the recorder "
    static GlobalSpinBox *RecordOverTime()  
    510557    return bs;
    511558}
    512559
    513 static GlobalComboBox *OverTimeCategory()
     560static GlobalComboBoxSetting *OverTimeCategory()
    514561{
    515     GlobalComboBox *gc = new GlobalComboBox("OverTimeCategory");
     562    GlobalComboBoxSetting *gc = new GlobalComboBoxSetting("OverTimeCategory");
    516563    gc->setLabel(QObject::tr("Category of shows to be extended"));
    517564    gc->setHelpText(QObject::tr("For a special category (e.g. "
    518565                    "\"Sports event\"), request that shows be autoextended. "
    519566                    "Only works if a show's category can be determined."));
    520567
    521568    MSqlQuery query(MSqlQuery::InitCon());
     569    //TODO We should not have any SQL here
    522570    query.prepare("SELECT DISTINCT category FROM program GROUP BY category;");
    523571
    524572    gc->addSelection("", "");
     573
    525574    if (query.exec())
    526575    {
    527576        while (query.next())
    static GlobalComboBox *OverTimeCategory()  
    535584    return gc;
    536585}
    537586
    538 static GlobalSpinBox *CategoryOverTime()
     587static GlobalSpinBoxSetting *CategoryOverTime()
    539588{
    540     GlobalSpinBox *bs = new GlobalSpinBox("CategoryOverTime",
     589    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("CategoryOverTime",
    541590                                          0, 180, 60, true);
    542591    bs->setLabel(QObject::tr("Record past end of show (mins)"));
    543592    bs->setValue(30);
    static GlobalSpinBox *CategoryOverTime()  
    548597    return bs;
    549598}
    550599
    551 static VerticalConfigurationGroup *CategoryOverTimeSettings()
     600static GroupSetting *CategoryOverTimeSettings()
    552601{
    553     VerticalConfigurationGroup *vcg =
    554         new VerticalConfigurationGroup(false, false);
    555 
     602    GroupSetting *vcg = new GroupSetting();
    556603    vcg->setLabel(QObject::tr("Category record over-time"));
    557     vcg->setUseLabel(true);
    558604    vcg->addChild(OverTimeCategory());
    559605    vcg->addChild(CategoryOverTime());
    560606    return vcg;
    void PlaybackProfileConfigs::triggerChanged(const QString &trig)  
    12481294{
    12491295    TriggeredConfigurationGroup::triggerChanged(trig);
    12501296}
     1297/*
     1298class PlaybackProfileConfigsButton : public StandardSetting, public TransientStorage
     1299{
     1300  public:
     1301    PlaybackProfileConfigsButton():StandardSetting(),TransientStorage()
     1302    {
     1303        setLabel()
     1304       
     1305    };
    12511306
    1252 static HostComboBox *PlayBoxOrdering()
     1307    virtual void Load(void){StandardSetting::Load();};
     1308    virtual void Save(void){StandardSetting::Save();};
     1309    virtual bool edit(MythScreenType * screen);
     1310    virtual void resultEdit(DialogCompletionEvent *dce, MythUIButtonListItem *item){};
     1311    virtual void applyChange(){};
     1312};*/
     1313
     1314static HostComboBoxSetting *PlayBoxOrdering()
    12531315{
    12541316    QString str[4] =
    12551317    {
    static HostComboBox *PlayBoxOrdering()  
    12641326        "refers to sections (e.g. \"All Programs\") which list "
    12651327        "multiple titles. Sections in parentheses are not affected.");
    12661328
    1267     HostComboBox *gc = new HostComboBox("PlayBoxOrdering");
     1329    HostComboBoxSetting *gc = new HostComboBoxSetting("PlayBoxOrdering");
    12681330    gc->setLabel(QObject::tr("Episode sort orderings"));
    12691331
    12701332    for (int i = 0; i < 4; ++i)
    static HostComboBox *PlayBoxOrdering()  
    12761338    return gc;
    12771339}
    12781340
    1279 static HostComboBox *PlayBoxEpisodeSort()
     1341static HostComboBoxSetting *PlayBoxEpisodeSort()
    12801342{
    1281     HostComboBox *gc = new HostComboBox("PlayBoxEpisodeSort");
     1343    HostComboBoxSetting *gc = new HostComboBoxSetting("PlayBoxEpisodeSort");
    12821344    gc->setLabel(QObject::tr("Sort episodes"));
    12831345    gc->addSelection(QObject::tr("Record date"), "Date");
    12841346    gc->addSelection(QObject::tr("Season/Episode"), "Season");
    static HostComboBox *PlayBoxEpisodeSort()  
    12881350    return gc;
    12891351}
    12901352
    1291 static HostSpinBox *FFRewReposTime()
     1353static HostSpinBoxSetting *FFRewReposTime()
    12921354{
    1293     HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
     1355    HostSpinBoxSetting *gs = new HostSpinBoxSetting("FFRewReposTime", 0, 200, 5);
    12941356    gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
    12951357    gs->setValue(100);
    12961358    gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
    static HostSpinBox *FFRewReposTime()  
    13011363    return gs;
    13021364}
    13031365
    1304 static HostCheckBox *FFRewReverse()
     1366static HostCheckBoxSetting *FFRewReverse()
    13051367{
    1306     HostCheckBox *gc = new HostCheckBox("FFRewReverse");
     1368    HostCheckBoxSetting *gc = new HostCheckBoxSetting("FFRewReverse");
    13071369    gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
    13081370    gc->setValue(true);
    13091371    gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
    static HostCheckBox *FFRewReverse()  
    13141376    return gc;
    13151377}
    13161378
    1317 static HostComboBox *MenuTheme()
     1379static HostComboBoxSetting *MenuTheme()
    13181380{
    1319     HostComboBox *gc = new HostComboBox("MenuTheme");
     1381    HostComboBoxSetting *gc = new HostComboBoxSetting("MenuTheme");
    13201382    gc->setLabel(QObject::tr("Menu theme"));
    13211383
    13221384    QList<ThemeInfo> themelist = GetMythUI()->GetThemes(THEME_MENU);
    static HostComboBox MUNUSED *DecodeVBIFormat()  
    13481410    return gc;
    13491411}
    13501412
    1351 static HostSpinBox *OSDCC708TextZoomPercentage(void)
     1413static HostSpinBoxSetting *OSDCC708TextZoomPercentage(void)
    13521414{
    1353     HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
     1415    HostSpinBoxSetting *gs = new HostSpinBoxSetting("OSDCC708TextZoom", 50, 200, 5);
    13541416    gs->setLabel(QObject::tr("Subtitle text zoom percentage"));
    13551417    gs->setValue(100);
    13561418    gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles."));
    static HostSpinBox *OSDCC708TextZoomPercentage(void)  
    13581420    return gs;
    13591421}
    13601422
    1361 static HostComboBox *SubtitleFont()
     1423static HostComboBoxSetting *SubtitleFont()
    13621424{
    1363     HostComboBox *hcb = new HostComboBox("OSDSubFont");
     1425    HostComboBoxSetting *hcb = new HostComboBoxSetting("OSDSubFont");
    13641426    QFontDatabase db;
    13651427    QStringList fonts = db.families();
    13661428    QStringList hide  = db.families(QFontDatabase::Symbol);
    static HostComboBox *SubtitleFont()  
    13751437    return hcb;
    13761438}
    13771439
    1378 static HostComboBox *SubtitleCodec()
     1440static HostComboBoxSetting *SubtitleCodec()
    13791441{
    1380     HostComboBox *gc = new HostComboBox("SubtitleCodec");
     1442    HostComboBoxSetting *gc = new HostComboBoxSetting("SubtitleCodec");
    13811443
    13821444    gc->setLabel(QObject::tr("Subtitle Codec"));
    13831445    QList<QByteArray> list = QTextCodec::availableCodecs();
    static HostComboBox *SubtitleCodec()  
    13901452    return gc;
    13911453}
    13921454
    1393 static HostComboBox *ChannelOrdering()
     1455static HostComboBoxSetting *ChannelOrdering()
    13941456{
    1395     HostComboBox *gc = new HostComboBox("ChannelOrdering");
     1457    HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelOrdering");
    13961458    gc->setLabel(QObject::tr("Channel ordering"));
    13971459    gc->addSelection(QObject::tr("channel number"), "channum");
    13981460    gc->addSelection(QObject::tr("callsign"),       "callsign");
    13991461    return gc;
    14001462}
    14011463
    1402 static HostSpinBox *VertScanPercentage()
     1464static HostSpinBoxSetting *VertScanPercentage()
    14031465{
    1404     HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
     1466    HostSpinBoxSetting *gs = new HostSpinBoxSetting("VertScanPercentage", -100, 100, 1);
    14051467    gs->setLabel(QObject::tr("Vertical scaling"));
    14061468    gs->setValue(0);
    14071469    gs->setHelpText(QObject::tr(
    static HostSpinBox *VertScanPercentage()  
    14101472    return gs;
    14111473}
    14121474
    1413 static HostSpinBox *HorizScanPercentage()
     1475static HostSpinBoxSetting *HorizScanPercentage()
    14141476{
    1415     HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
     1477    HostSpinBoxSetting *gs = new HostSpinBoxSetting("HorizScanPercentage", -100, 100, 1);
    14161478    gs->setLabel(QObject::tr("Horizontal scaling"));
    14171479    gs->setValue(0);
    14181480    gs->setHelpText(QObject::tr(
    static HostSpinBox *HorizScanPercentage()  
    14211483    return gs;
    14221484};
    14231485
    1424 static HostSpinBox *XScanDisplacement()
     1486static HostSpinBoxSetting *XScanDisplacement()
    14251487{
    1426     HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
     1488    HostSpinBoxSetting *gs = new HostSpinBoxSetting("XScanDisplacement", -50, 50, 1);
    14271489    gs->setLabel(QObject::tr("Scan displacement (X)"));
    14281490    gs->setValue(0);
    14291491    gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
    14301492    return gs;
    14311493}
    14321494
    1433 static HostSpinBox *YScanDisplacement()
     1495static HostSpinBoxSetting *YScanDisplacement()
    14341496{
    1435     HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
     1497    HostSpinBoxSetting *gs = new HostSpinBoxSetting("YScanDisplacement", -50, 50, 1);
    14361498    gs->setLabel(QObject::tr("Scan displacement (Y)"));
    14371499    gs->setValue(0);
    14381500    gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
    14391501    return gs;
    14401502};
    14411503
    1442 static HostCheckBox *CCBackground()
     1504static HostCheckBoxSetting *CCBackground()
    14431505{
    1444     HostCheckBox *gc = new HostCheckBox("CCBackground");
     1506    HostCheckBoxSetting *gc = new HostCheckBoxSetting("CCBackground");
    14451507    gc->setLabel(QObject::tr("Black background for closed captioning"));
    14461508    gc->setValue(false);
    14471509    gc->setHelpText(QObject::tr(
    static HostCheckBox *CCBackground()  
    14511513    return gc;
    14521514}
    14531515
    1454 static HostCheckBox *DefaultCCMode()
     1516static HostCheckBoxSetting *DefaultCCMode()
    14551517{
    1456     HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
     1518    HostCheckBoxSetting *gc = new HostCheckBoxSetting("DefaultCCMode");
    14571519    gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
    14581520    gc->setValue(false);
    14591521    gc->setHelpText(QObject::tr(
    static HostCheckBox *DefaultCCMode()  
    14641526    return gc;
    14651527}
    14661528
    1467 static HostCheckBox *PreferCC708()
     1529static HostCheckBoxSetting *PreferCC708()
    14681530{
    1469     HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
     1531    HostCheckBoxSetting *gc = new HostCheckBoxSetting("Prefer708Captions");
    14701532    gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
    14711533    gc->setValue(true);
    14721534    gc->setHelpText(
    static HostCheckBox *PreferCC708()  
    14771539    return gc;
    14781540}
    14791541
    1480 static HostCheckBox *EnableMHEG()
     1542static HostCheckBoxSetting *EnableMHEG()
    14811543{
    1482     HostCheckBox *gc = new HostCheckBox("EnableMHEG");
     1544    HostCheckBoxSetting *gc = new HostCheckBoxSetting("EnableMHEG");
    14831545    gc->setLabel(QObject::tr("Enable interactive TV"));
    14841546    gc->setValue(false);
    14851547    gc->setHelpText(QObject::tr(
    static HostCheckBox *EnableMHEG()  
    14891551    return gc;
    14901552}
    14911553
    1492 static HostCheckBox *PersistentBrowseMode()
     1554static HostCheckBoxSetting *PersistentBrowseMode()
    14931555{
    1494     HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
     1556    HostCheckBoxSetting *gc = new HostCheckBoxSetting("PersistentBrowseMode");
    14951557    gc->setLabel(QObject::tr("Always use browse mode in Live TV"));
    14961558    gc->setValue(true);
    14971559    gc->setHelpText(
    static HostCheckBox *PersistentBrowseMode()  
    15011563    return gc;
    15021564}
    15031565
    1504 static HostCheckBox *BrowseAllTuners()
     1566static HostCheckBoxSetting *BrowseAllTuners()
    15051567{
    1506     HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
     1568    HostCheckBoxSetting *gc = new HostCheckBoxSetting("BrowseAllTuners");
    15071569    gc->setLabel(QObject::tr("Browse all channels"));
    15081570    gc->setValue(false);
    15091571    gc->setHelpText(
    static HostCheckBox *BrowseAllTuners()  
    15141576    return gc;
    15151577}
    15161578
    1517 static HostCheckBox *ClearSavedPosition()
     1579static HostCheckBoxSetting *ClearSavedPosition()
    15181580{
    1519     HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
     1581    HostCheckBoxSetting *gc = new HostCheckBoxSetting("ClearSavedPosition");
    15201582    gc->setLabel(QObject::tr("Clear bookmark on playback"));
    15211583    gc->setValue(true);
    15221584    gc->setHelpText(QObject::tr("If enabled, automatically clear the "
    static HostCheckBox *ClearSavedPosition()  
    15261588    return gc;
    15271589}
    15281590
    1529 static HostCheckBox *AltClearSavedPosition()
     1591static HostCheckBoxSetting *AltClearSavedPosition()
    15301592{
    1531     HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
     1593    HostCheckBoxSetting *gc = new HostCheckBoxSetting("AltClearSavedPosition");
    15321594    gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
    15331595    gc->setValue(true);
    15341596    gc->setHelpText(QObject::tr("During playback the SELECT key "
    static HostCheckBox *AltClearSavedPosition()  
    15391601    return gc;
    15401602}
    15411603
    1542 static HostComboBox *PlaybackExitPrompt()
     1604static HostComboBoxSetting *PlaybackExitPrompt()
    15431605{
    1544     HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
     1606    HostComboBoxSetting *gc = new HostComboBoxSetting("PlaybackExitPrompt");
    15451607    gc->setLabel(QObject::tr("Action on playback exit"));
    15461608    gc->addSelection(QObject::tr("Just exit"), "0");
    15471609    gc->addSelection(QObject::tr("Save position and exit"), "2");
    static HostComboBox *PlaybackExitPrompt()  
    15551617    return gc;
    15561618}
    15571619
    1558 static HostCheckBox *EndOfRecordingExitPrompt()
     1620static HostCheckBoxSetting *EndOfRecordingExitPrompt()
    15591621{
    1560     HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
     1622    HostCheckBoxSetting *gc = new HostCheckBoxSetting("EndOfRecordingExitPrompt");
    15611623    gc->setLabel(QObject::tr("Prompt at end of recording"));
    15621624    gc->setValue(false);
    15631625    gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing "
    static HostCheckBox *EndOfRecordingExitPrompt()  
    15661628    return gc;
    15671629}
    15681630
    1569 static HostCheckBox *JumpToProgramOSD()
     1631static HostCheckBoxSetting *JumpToProgramOSD()
    15701632{
    1571     HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
     1633    HostCheckBoxSetting *gc = new HostCheckBoxSetting("JumpToProgramOSD");
    15721634    gc->setLabel(QObject::tr("Jump to program OSD"));
    15731635    gc->setValue(true);
    15741636    gc->setHelpText(QObject::tr(
    static HostCheckBox *JumpToProgramOSD()  
    15801642    return gc;
    15811643}
    15821644
    1583 static HostCheckBox *ContinueEmbeddedTVPlay()
     1645static HostCheckBoxSetting *ContinueEmbeddedTVPlay()
    15841646{
    1585     HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
     1647    HostCheckBoxSetting *gc = new HostCheckBoxSetting("ContinueEmbeddedTVPlay");
    15861648    gc->setLabel(QObject::tr("Continue playback when embedded"));
    15871649    gc->setValue(false);
    15881650    gc->setHelpText(QObject::tr(
    static HostCheckBox *ContinueEmbeddedTVPlay()  
    15931655    return gc;
    15941656}
    15951657
    1596 static HostCheckBox *AutomaticSetWatched()
     1658static HostCheckBoxSetting *AutomaticSetWatched()
    15971659{
    1598     HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
     1660    HostCheckBoxSetting *gc = new HostCheckBoxSetting("AutomaticSetWatched");
    15991661    gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
    16001662    gc->setValue(false);
    16011663    gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a "
    static HostCheckBox *AutomaticSetWatched()  
    16061668    return gc;
    16071669}
    16081670
    1609 static HostSpinBox *LiveTVIdleTimeout()
     1671static HostSpinBoxSetting *LiveTVIdleTimeout()
    16101672{
    1611     HostSpinBox *gs = new HostSpinBox("LiveTVIdleTimeout", 0, 3600, 1);
     1673    HostSpinBoxSetting *gs = new HostSpinBoxSetting("LiveTVIdleTimeout", 0, 3600, 1);
    16121674    gs->setLabel(QObject::tr("Live TV idle timeout (mins)"));
    16131675    gs->setValue(0);
    16141676    gs->setHelpText(QObject::tr(
    static HostSpinBox *LiveTVIdleTimeout()  
    16431705//     return gc;
    16441706// }
    16451707
    1646 static HostCheckBox *UseVirtualKeyboard()
     1708static HostCheckBoxSetting *UseVirtualKeyboard()
    16471709{
    1648     HostCheckBox *gc = new HostCheckBox("UseVirtualKeyboard");
     1710    HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseVirtualKeyboard");
    16491711    gc->setLabel(QObject::tr("Use line edit virtual keyboards"));
    16501712    gc->setValue(true);
    16511713    gc->setHelpText(QObject::tr("If enabled, you can use a virtual keyboard "
    static HostCheckBox *UseVirtualKeyboard()  
    16541716    return gc;
    16551717}
    16561718
    1657 static HostComboBox *OverrideExitMenu()
     1719static HostComboBoxSetting *OverrideExitMenu()
    16581720{
    1659     HostComboBox *gc = new HostComboBox("OverrideExitMenu");
     1721    HostComboBoxSetting *gc = new HostComboBoxSetting("OverrideExitMenu");
    16601722    gc->setLabel(QObject::tr("Customize exit menu options"));
    16611723    gc->addSelection(QObject::tr("Default"), "0");
    16621724    gc->addSelection(QObject::tr("Show quit"), "1");
    static HostComboBox *OverrideExitMenu()  
    16711733    return gc;
    16721734}
    16731735
    1674 static HostLineEdit *RebootCommand()
     1736static HostTextEditSetting *RebootCommand()
    16751737{
    1676     HostLineEdit *ge = new HostLineEdit("RebootCommand");
     1738    HostTextEditSetting *ge = new HostTextEditSetting("RebootCommand");
    16771739    ge->setLabel(QObject::tr("Reboot command"));
    16781740    ge->setValue("");
    16791741    ge->setHelpText(QObject::tr("Optional. Script to run if you select "
    static HostLineEdit *RebootCommand()  
    16831745    return ge;
    16841746}
    16851747
    1686 static HostLineEdit *HaltCommand()
     1748static HostTextEditSetting *HaltCommand()
    16871749{
    1688     HostLineEdit *ge = new HostLineEdit("HaltCommand");
     1750    HostTextEditSetting *ge = new HostTextEditSetting("HaltCommand");
    16891751    ge->setLabel(QObject::tr("Halt command"));
    16901752    ge->setValue("");
    16911753    ge->setHelpText(QObject::tr("Optional. Script to run if you select "
    static HostLineEdit *HaltCommand()  
    16951757    return ge;
    16961758}
    16971759
    1698 static HostLineEdit *LircDaemonDevice()
     1760static HostTextEditSetting *LircDaemonDevice()
    16991761{
    1700     HostLineEdit *ge = new HostLineEdit("LircSocket");
     1762    HostTextEditSetting *ge = new HostTextEditSetting("LircSocket");
    17011763    ge->setLabel(QObject::tr("LIRC daemon socket"));
    17021764
    17031765    /* lircd socket moved from /dev/ to /var/run/lirc/ in lirc 0.8.6 */
    static HostLineEdit *LircDaemonDevice()  
    17121774    return ge;
    17131775}
    17141776
    1715 static HostLineEdit *ScreenShotPath()
     1777static HostTextEditSetting *ScreenShotPath()
    17161778{
    1717     HostLineEdit *ge = new HostLineEdit("ScreenShotPath");
     1779    HostTextEditSetting *ge = new HostTextEditSetting("ScreenShotPath");
    17181780    ge->setLabel(QObject::tr("Screen shot path"));
    17191781    ge->setValue("/tmp/");
    17201782    ge->setHelpText(QObject::tr("Path to screenshot storage location. Should be writable by the frontend"));
    17211783    return ge;
    17221784}
    17231785
    1724 static HostLineEdit *SetupPinCode()
     1786static HostTextEditSetting *SetupPinCode()
    17251787{
    1726     HostLineEdit *ge = new HostLineEdit("SetupPinCode");
     1788    HostTextEditSetting *ge = new HostTextEditSetting("SetupPinCode");
    17271789    ge->setLabel(QObject::tr("Setup PIN code"));
    17281790    ge->setHelpText(QObject::tr("This PIN is used to control access to the "
    17291791                    "setup menus. If you want to use this feature, then "
    static HostLineEdit *SetupPinCode()  
    17321794    return ge;
    17331795}
    17341796
    1735 static HostCheckBox *SetupPinCodeRequired()
     1797static HostCheckBoxSetting *SetupPinCodeRequired()
    17361798{
    1737     HostCheckBox *gc = new HostCheckBox("SetupPinCodeRequired");
     1799    HostCheckBoxSetting *gc = new HostCheckBoxSetting("SetupPinCodeRequired");
    17381800    gc->setLabel(QObject::tr("Require setup PIN") + "    ");
    17391801    gc->setValue(false);
    17401802    gc->setHelpText(QObject::tr("If enabled, you will not be able to return "
    static HostCheckBox *SetupPinCodeRequired()  
    17431805    return gc;
    17441806}
    17451807
    1746 static HostComboBox *XineramaScreen()
     1808static HostComboBoxSetting *XineramaScreen()
    17471809{
    1748     HostComboBox *gc = new HostComboBox("XineramaScreen", false);
     1810    HostComboBoxSetting *gc = new HostComboBoxSetting("XineramaScreen");
    17491811    int num = MythDisplay::GetNumberXineramaScreens();
    17501812    for (int i=0; i<num; ++i)
    17511813        gc->addSelection(QString::number(i), QString::number(i));
    static HostComboBox *XineramaScreen()  
    17581820}
    17591821
    17601822
    1761 static HostComboBox *XineramaMonitorAspectRatio()
     1823static HostComboBoxSetting *XineramaMonitorAspectRatio()
    17621824{
    1763     HostComboBox *gc = new HostComboBox("XineramaMonitorAspectRatio");
     1825    HostComboBoxSetting *gc = new HostComboBoxSetting("XineramaMonitorAspectRatio");
    17641826    gc->setLabel(QObject::tr("Monitor aspect ratio"));
    17651827    gc->addSelection(QObject::tr("4:3"),   "1.3333");
    17661828    gc->addSelection(QObject::tr("16:9"),  "1.7777");
    static HostComboBox *XineramaMonitorAspectRatio()  
    17711833    return gc;
    17721834}
    17731835
    1774 static HostComboBox *LetterboxingColour()
     1836static HostComboBoxSetting *LetterboxingColour()
    17751837{
    1776     HostComboBox *gc = new HostComboBox("LetterboxColour");
     1838    HostComboBoxSetting *gc = new HostComboBoxSetting("LetterboxColour");
    17771839    gc->setLabel(QObject::tr("Letterboxing color"));
    17781840    for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
    17791841        gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
    static HostComboBox *LetterboxingColour()  
    17861848    return gc;
    17871849}
    17881850
    1789 static HostComboBox *AspectOverride()
     1851static HostComboBoxSetting *AspectOverride()
    17901852{
    1791     HostComboBox *gc = new HostComboBox("AspectOverride");
     1853    HostComboBoxSetting *gc = new HostComboBoxSetting("AspectOverride");
    17921854    gc->setLabel(QObject::tr("Video aspect override"));
    17931855    for (int m = kAspect_Off; m < kAspect_END; ++m)
    17941856        gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
    static HostComboBox *AspectOverride()  
    17991861    return gc;
    18001862}
    18011863
    1802 static HostComboBox *AdjustFill()
     1864static HostComboBoxSetting *AdjustFill()
    18031865{
    1804     HostComboBox *gc = new HostComboBox("AdjustFill");
     1866    HostComboBoxSetting *gc = new HostComboBoxSetting("AdjustFill");
    18051867    gc->setLabel(QObject::tr("Zoom"));
    18061868    for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m)
    18071869        gc->addSelection(toString((AdjustFillMode)m), QString::number(m));
    static HostComboBox *AdjustFill()  
    18171879
    18181880// Theme settings
    18191881
    1820 static HostSpinBox *GuiWidth()
     1882static HostSpinBoxSetting *GuiWidth()
    18211883{
    1822     HostSpinBox *gs = new HostSpinBox("GuiWidth", 0, 1920, 8, true);
     1884    HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiWidth", 0, 1920, 8, true);
    18231885    gs->setLabel(QObject::tr("GUI width (pixels)"));
    18241886    gs->setValue(0);
    18251887    gs->setHelpText(QObject::tr("The width of the GUI. Do not make the GUI "
    static HostSpinBox *GuiWidth()  
    18281890    return gs;
    18291891}
    18301892
    1831 static HostSpinBox *GuiHeight()
     1893static HostSpinBoxSetting *GuiHeight()
    18321894{
    1833     HostSpinBox *gs = new HostSpinBox("GuiHeight", 0, 1600, 8, true);
     1895    HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiHeight", 0, 1600, 8, true);
    18341896    gs->setLabel(QObject::tr("GUI height (pixels)"));
    18351897    gs->setValue(0);
    18361898    gs->setHelpText(QObject::tr("The height of the GUI. Do not make the GUI "
    static HostSpinBox *GuiHeight()  
    18391901    return gs;
    18401902}
    18411903
    1842 static HostSpinBox *GuiOffsetX()
     1904static HostSpinBoxSetting *GuiOffsetX()
    18431905{
    1844     HostSpinBox *gs = new HostSpinBox("GuiOffsetX", -3840, 3840, 32, true);
     1906    HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiOffsetX", -3840, 3840, 32, true);
    18451907    gs->setLabel(QObject::tr("GUI X offset"));
    18461908    gs->setValue(0);
    18471909    gs->setHelpText(QObject::tr("The horizontal offset where the GUI will be "
    static HostSpinBox *GuiOffsetX()  
    18491911    return gs;
    18501912}
    18511913
    1852 static HostSpinBox *GuiOffsetY()
     1914static HostSpinBoxSetting *GuiOffsetY()
    18531915{
    1854     HostSpinBox *gs = new HostSpinBox("GuiOffsetY", -1600, 1600, 8, true);
     1916    HostSpinBoxSetting *gs = new HostSpinBoxSetting("GuiOffsetY", -1600, 1600, 8, true);
    18551917    gs->setLabel(QObject::tr("GUI Y offset"));
    18561918    gs->setValue(0);
    18571919    gs->setHelpText(QObject::tr("The vertical offset where the GUI will be "
    static HostSpinBox *DisplaySizeHeight()  
    18831945}
    18841946#endif
    18851947
    1886 static HostCheckBox *GuiSizeForTV()
     1948static HostCheckBoxSetting *GuiSizeForTV()
    18871949{
    1888     HostCheckBox *gc = new HostCheckBox("GuiSizeForTV");
     1950    HostCheckBoxSetting *gc = new HostCheckBoxSetting("GuiSizeForTV");
    18891951    gc->setLabel(QObject::tr("Use GUI size for TV playback"));
    18901952    gc->setValue(true);
    18911953    gc->setHelpText(QObject::tr("If enabled, use the above size for TV, "
    static HostCheckBox *GuiSizeForTV()  
    18941956}
    18951957
    18961958#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 }
    19061959
    1907 static HostSpinBox *VidModeWidth(int idx)
     1960static HostSpinBoxSetting *VidModeWidth(int idx)
    19081961{
    1909     HostSpinBox *gs = new HostSpinBox(QString("VidModeWidth%1").arg(idx),
     1962    HostSpinBoxSetting *gs = new HostSpinBoxSetting(QString("VidModeWidth%1").arg(idx),
    19101963                                            0, 1920, 16, true);
    19111964    gs->setLabel((idx<1) ? QObject::tr("In X"): "");
    1912     gs->setLabelAboveWidget(idx<1);
    19131965    gs->setValue(0);
    19141966    gs->setHelpText(QObject::tr("Horizontal resolution of video "
    19151967                    "which needs a special output resolution."));
    19161968    return gs;
    19171969}
    19181970
    1919 static HostSpinBox *VidModeHeight(int idx)
     1971static HostSpinBoxSetting *VidModeHeight(int idx)
    19201972{
    1921     HostSpinBox *gs = new HostSpinBox(QString("VidModeHeight%1").arg(idx),
     1973    HostSpinBoxSetting *gs = new HostSpinBoxSetting(QString("VidModeHeight%1").arg(idx),
    19221974                                            0, 1080, 16, true);
    19231975    gs->setLabel((idx<1) ? QObject::tr("In Y"): "");
    1924     gs->setLabelAboveWidget(idx<1);
    19251976    gs->setValue(0);
    19261977    gs->setHelpText(QObject::tr("Vertical resolution of video "
    19271978                    "which needs a special output resolution."));
    19281979    return gs;
    19291980}
    19301981
    1931 static HostComboBox *GuiVidModeResolution()
     1982static HostComboBoxSetting *GuiVidModeResolution()
    19321983{
    1933     HostComboBox *gc = new HostComboBox("GuiVidModeResolution");
     1984    HostComboBoxSetting *gc = new HostComboBoxSetting("GuiVidModeResolution");
    19341985    gc->setLabel(QObject::tr("GUI"));
    1935     gc->setLabelAboveWidget(true);
    19361986    gc->setHelpText(QObject::tr("Resolution of screen "
    19371987                    "when not watching a video."));
    19381988
    static HostComboBox *GuiVidModeResolution()  
    19612011    return gc;
    19622012}
    19632013
    1964 static HostComboBox *TVVidModeResolution(int idx=-1)
     2014static HostComboBoxSetting *TVVidModeResolution(int idx=-1)
    19652015{
    19662016    QString dhelp = QObject::tr("Default screen resolution "
    19672017                                "when watching a video.");
    static HostComboBox *TVVidModeResolution(int idx=-1)  
    19702020
    19712021    QString qstr = (idx<0) ? "TVVidModeResolution" :
    19722022        QString("TVVidModeResolution%1").arg(idx);
    1973     HostComboBox *gc = new HostComboBox(qstr);
     2023    HostComboBoxSetting *gc = new HostComboBoxSetting(qstr);
    19742024    QString lstr = (idx<0) ? QObject::tr("Video output") :
    19752025        ((idx<1) ? QObject::tr("Output") : "");
    19762026    QString hstr = (idx<0) ? dhelp : ohelp;
    19772027
    19782028    gc->setLabel(lstr);
    1979     gc->setLabelAboveWidget(idx<1);
    19802029    gc->setHelpText(hstr);
    19812030
    19822031    const vector<DisplayResScreen> scr = GetVideoModes();
    static HostComboBox *TVVidModeResolution(int idx=-1)  
    19882037    return gc;
    19892038}
    19902039
    1991 static HostRefreshRateComboBox *TVVidModeRefreshRate(int idx=-1)
     2040
     2041void HostRefreshRateComboBoxSetting::ChangeResolution(const QString& resolution)
     2042{
     2043    clearSelections();
     2044
     2045    const vector<double> list = GetRefreshRates(resolution);
     2046    addSelection(QObject::tr("Auto"), "0");
     2047    int hz50 = -1, hz60 = -1;
     2048    for (uint i=0; i<list.size(); ++i)
     2049    {
     2050        QString sel = QString::number((double) list[i],'f', 3);
     2051        addSelection(sel+" Hz", sel);
     2052        hz50 = (fabs(50.0 - list[i]) < 0.01) ? i : hz50;
     2053        hz60 = (fabs(60.0 - list[i]) < 0.01) ? i : hz60;
     2054    }
     2055
     2056    setValue(0);
     2057    if ("640x480" == resolution || "720x480" == resolution)
     2058        setValue(hz60+1);
     2059    if ("640x576" == resolution || "720x576" == resolution)
     2060        setValue(hz50+1);
     2061
     2062    setEnabled(list.size());
     2063}
     2064
     2065const vector<double> HostRefreshRateComboBoxSetting::GetRefreshRates(const QString &res)
     2066{
     2067    QStringList slist = res.split("x");
     2068    int w = 0, h = 0;
     2069    bool ok0 = false, ok1 = false;
     2070    if (2 == slist.size())
     2071    {
     2072        w = slist[0].toInt(&ok0);
     2073        h = slist[1].toInt(&ok1);
     2074    }
     2075
     2076    DisplayRes *display_res = DisplayRes::GetDisplayRes();
     2077    if (display_res && ok0 && ok1)
     2078        return display_res->GetRefreshRates(w, h);
     2079
     2080    vector<double> list;
     2081    return list;
     2082}
     2083
     2084
     2085static HostRefreshRateComboBoxSetting *TVVidModeRefreshRate(int idx=-1)
    19922086{
    19932087    QString dhelp = QObject::tr("Default refresh rate "
    19942088                                "when watching a video. "
    static HostRefreshRateComboBox *TVVidModeRefreshRate(int idx=-1)  
    19982092                                "Leave at \"Auto\" to automatically use the best available");
    19992093    QString qstr = (idx<0) ? "TVVidModeRefreshRate" :
    20002094        QString("TVVidModeRefreshRate%1").arg(idx);
    2001     HostRefreshRateComboBox *gc = new HostRefreshRateComboBox(qstr);
     2095    HostRefreshRateComboBoxSetting *gc = new HostRefreshRateComboBoxSetting(qstr);
    20022096    QString lstr = (idx<1) ? QObject::tr("Rate") : "";
    20032097    QString hstr = (idx<0) ? dhelp : ohelp;
    20042098
    20052099    gc->setLabel(lstr);
    2006     gc->setLabelAboveWidget(idx<1);
    20072100    gc->setHelpText(hstr);
    20082101    gc->setEnabled(false);
    20092102    return gc;
    20102103}
    20112104
    2012 static HostComboBox *TVVidModeForceAspect(int idx=-1)
     2105static HostComboBoxSetting *TVVidModeForceAspect(int idx=-1)
    20132106{
    20142107    QString dhelp = QObject::tr("Aspect ratio when watching a video.");
    20152108    QString ohelp = QObject::tr("Aspect ratio when watching a "
    static HostComboBox *TVVidModeForceAspect(int idx=-1)  
    20172110
    20182111    QString qstr = (idx<0) ? "TVVidModeForceAspect" :
    20192112        QString("TVVidModeForceAspect%1").arg(idx);
    2020     HostComboBox *gc = new HostComboBox(qstr);
     2113    HostComboBoxSetting *gc = new HostComboBoxSetting(qstr);
    20212114    gc->setLabel( (idx<1) ? QObject::tr("Aspect") : "" );
    2022     gc->setLabelAboveWidget(idx<1);
    20232115
    20242116    QString hstr = (idx<0) ? dhelp : ohelp;
    20252117    gc->setHelpText(hstr+"  "+
    static HostComboBox *TVVidModeForceAspect(int idx=-1)  
    20322124    return gc;
    20332125}
    20342126
     2127
     2128
     2129class DefaultVideoMode : public GroupSetting
     2130{
     2131  public:
     2132    DefaultVideoMode():GroupSetting()
     2133    {
     2134        setLabel(QObject::tr("Video Mode Settings"));
     2135        m_res = TVVidModeResolution();
     2136        m_rate = TVVidModeRefreshRate();
     2137        addChild(GuiVidModeResolution());
     2138        addChild(m_res);
     2139        addChild(m_rate);
     2140        addChild(TVVidModeForceAspect());
     2141        connect(m_res, SIGNAL(valueChanged(const QString&)),
     2142                m_rate, SLOT(ChangeResolution(const QString&)));
     2143   }
     2144  private:
     2145    HostComboBoxSetting *m_res;
     2146    HostRefreshRateComboBoxSetting *m_rate;
     2147};
     2148
     2149
     2150class OverrideVideoMode : public GroupSetting
     2151{
     2152  public:
     2153    OverrideVideoMode (int idx):GroupSetting()
     2154    {
     2155        setLabel(QObject::tr("Override video mode #%1").arg(idx));
     2156        // input side
     2157        addChild(VidModeWidth(idx));
     2158        addChild(VidModeHeight(idx));
     2159        // output side
     2160        addChild(m_res = TVVidModeResolution(idx));
     2161        addChild(m_rate = TVVidModeRefreshRate(idx));
     2162        addChild(TVVidModeForceAspect(idx));
     2163                connect(m_res, SIGNAL(valueChanged(const QString&)),
     2164                        m_rate, SLOT(ChangeResolution(const QString&)));
     2165    }
     2166  private:
     2167    HostComboBoxSetting *m_res;
     2168    HostRefreshRateComboBoxSetting *m_rate;
     2169};
     2170
     2171static HostCheckBoxSetting *UseVideoModes() // replace VideoModeSettings
     2172{
     2173    HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseVideoModes");
     2174    gc->setLabel(QObject::tr("Separate video modes for GUI and TV playback"));
     2175    gc->setValue(false);
     2176    gc->setHelpText(QObject::tr("Switch X Window video modes for TV. "
     2177                    "Requires \"xrandr\" support."));
     2178
     2179    gc->addTargetedChild("1",new DefaultVideoMode());
     2180
     2181    for (int idx = 0; idx < 3; ++idx)
     2182    {
     2183        gc->addTargetedChild("1",new OverrideVideoMode(idx));
     2184    }
     2185    return gc;
     2186}
     2187
     2188/*
    20352189class VideoModeSettings : public TriggeredConfigurationGroup
    20362190{
    20372191  public:
    class VideoModeSettings : public TriggeredConfigurationGroup  
    20482202        ConfigurationGroup* defaultsettings =
    20492203            new HorizontalConfigurationGroup(false, false);
    20502204
    2051         HostComboBox *res = TVVidModeResolution();
     2205        HostComboBoxSetting *res = TVVidModeResolution();
    20522206        HostRefreshRateComboBox *rate = TVVidModeRefreshRate();
    20532207        defaultsettings->addChild(GuiVidModeResolution());
    20542208        defaultsettings->addChild(res);
    class VideoModeSettings : public TriggeredConfigurationGroup  
    20812235        addTarget("1", settings);
    20822236        addTarget("0", new VerticalConfigurationGroup(true));
    20832237    }
    2084 };
     2238};*/
    20852239#endif
    20862240
    2087 static HostCheckBox *HideMouseCursor()
     2241static HostCheckBoxSetting *HideMouseCursor()
    20882242{
    2089     HostCheckBox *gc = new HostCheckBox("HideMouseCursor");
     2243    HostCheckBoxSetting *gc = new HostCheckBoxSetting("HideMouseCursor");
    20902244    gc->setLabel(QObject::tr("Hide mouse cursor in MythTV"));
    20912245    gc->setValue(false);
    20922246    gc->setHelpText(QObject::tr("Toggles mouse cursor visibility for touchscreens. "
    static HostCheckBox *HideMouseCursor()  
    20962250};
    20972251
    20982252
    2099 static HostCheckBox *RunInWindow()
     2253static HostCheckBoxSetting *RunInWindow()
    21002254{
    2101     HostCheckBox *gc = new HostCheckBox("RunFrontendInWindow");
     2255    HostCheckBoxSetting *gc = new HostCheckBoxSetting("RunFrontendInWindow");
    21022256    gc->setLabel(QObject::tr("Use window border"));
    21032257    gc->setValue(false);
    21042258    gc->setHelpText(QObject::tr("Toggles between windowed and "
    static HostCheckBox *RunInWindow()  
    21062260    return gc;
    21072261}
    21082262
    2109 static HostCheckBox *UseFixedWindowSize()
     2263static HostCheckBoxSetting *UseFixedWindowSize()
    21102264{
    21112265{
    2112     HostCheckBox *gc = new HostCheckBox("UseFixedWindowSize");
     2266    HostCheckBoxSetting *gc = new HostCheckBoxSetting("UseFixedWindowSize");
    21132267    gc->setLabel(QObject::tr("Use fixed window size"));
    21142268    gc->setValue(true);
    21152269    gc->setHelpText(QObject::tr(
    static HostCheckBox *UseFixedWindowSize()  
    21192273}
    21202274}
    21212275
    2122 static HostComboBox *MythDateFormatCB()
     2276static HostComboBoxSetting *MythDateFormatCB()
    21232277{
    2124     HostComboBox *gc = new HostComboBox("DateFormat");
     2278    HostComboBoxSetting *gc = new HostComboBoxSetting("DateFormat");
    21252279    gc->setLabel(QObject::tr("Date format"));
    21262280
    21272281    QDate sampdate = QDate::currentDate();
    static HostComboBox *MythDateFormatCB()  
    21602314    return gc;
    21612315}
    21622316
    2163 static HostComboBox *MythShortDateFormat()
     2317static HostComboBoxSetting *MythShortDateFormat()
    21642318{
    2165     HostComboBox *gc = new HostComboBox("ShortDateFormat");
     2319    HostComboBoxSetting *gc = new HostComboBoxSetting("ShortDateFormat");
    21662320    gc->setLabel(QObject::tr("Short date format"));
    21672321
    21682322    QDate sampdate = QDate::currentDate();
    static HostComboBox *MythShortDateFormat()  
    21992353    return gc;
    22002354}
    22012355
    2202 static HostComboBox *MythTimeFormat()
     2356static HostComboBoxSetting *MythTimeFormat()
    22032357{
    2204     HostComboBox *gc = new HostComboBox("TimeFormat");
     2358    HostComboBoxSetting *gc = new HostComboBoxSetting("TimeFormat");
    22052359    gc->setLabel(QObject::tr("Time format"));
    22062360
    22072361    QTime samptime = QTime::currentTime();
    static HostComboBox *MythTimeFormat()  
    22192373    return gc;
    22202374}
    22212375
    2222 static HostComboBox *ChannelFormat()
     2376static HostComboBoxSetting *ChannelFormat()
    22232377{
    2224     HostComboBox *gc = new HostComboBox("ChannelFormat");
     2378    HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelFormat");
    22252379    gc->setLabel(QObject::tr("Channel format"));
    22262380    gc->addSelection(QObject::tr("number"), "<num>");
    22272381    gc->addSelection(QObject::tr("number callsign"), "<num> <sign>");
    static HostComboBox *ChannelFormat()  
    22332387    return gc;
    22342388}
    22352389
    2236 static HostComboBox *LongChannelFormat()
     2390static HostComboBoxSetting *LongChannelFormat()
    22372391{
    2238     HostComboBox *gc = new HostComboBox("LongChannelFormat");
     2392    HostComboBoxSetting *gc = new HostComboBoxSetting("LongChannelFormat");
    22392393    gc->setLabel(QObject::tr("Long channel format"));
    22402394    gc->addSelection(QObject::tr("number"), "<num>");
    22412395    gc->addSelection(QObject::tr("number callsign"), "<num> <sign>");
    static HostComboBox *LongChannelFormat()  
    22472401    return gc;
    22482402}
    22492403
    2250 static GlobalCheckBox *LiveTVPriority()
     2404static GlobalCheckBoxSetting *LiveTVPriority()
    22512405{
    2252     GlobalCheckBox *bc = new GlobalCheckBox("LiveTVPriority");
     2406    GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("LiveTVPriority");
    22532407    bc->setLabel(QObject::tr("Allow Live TV to move scheduled shows"));
    22542408    bc->setValue(false);
    22552409    bc->setHelpText(QObject::tr("If enabled, scheduled recordings will "
    static GlobalCheckBox *LiveTVPriority()  
    22582412    return bc;
    22592413}
    22602414
    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 }
    22712415
    2272 static HostComboBox *ChannelGroupDefault()
     2416
     2417static HostComboBoxSetting *ChannelGroupDefault()
    22732418{
    2274     HostComboBox *gc = new HostComboBox("ChannelGroupDefault");
     2419    HostComboBoxSetting *gc = new HostComboBoxSetting("ChannelGroupDefault");
    22752420    gc->setLabel(QObject::tr("Default channel group"));
    22762421
    22772422    ChannelGroupList changrplist;
    static HostComboBox *ChannelGroupDefault()  
    22912436    return gc;
    22922437}
    22932438
    2294 static HostCheckBox *BrowseChannelGroup()
     2439static HostCheckBoxSetting *ChannelGroupRememberLast()
    22952440{
    2296     HostCheckBox *gc = new HostCheckBox("BrowseChannelGroup");
     2441    HostCheckBoxSetting *gc = new HostCheckBoxSetting("ChannelGroupRememberLast");
     2442    gc->setLabel(QObject::tr("Remember last channel group"));
     2443    gc->setHelpText(QObject::tr("If enabled, the EPG will initially display "
     2444                    "only the channels from the last channel group selected. Pressing "
     2445                    "\"4\" will toggle channel group."));
     2446    gc->setValue(false);
     2447    gc->addTargetedChild("0", ChannelGroupDefault());
     2448    return gc;
     2449}
     2450
     2451static HostCheckBoxSetting *BrowseChannelGroup()
     2452{
     2453    HostCheckBoxSetting *gc = new HostCheckBoxSetting("BrowseChannelGroup");
    22972454    gc->setLabel(QObject::tr("Browse/change channels from Channel Group"));
    22982455    gc->setHelpText(QObject::tr("If enabled, Live TV will browse or change "
    22992456                    "channels from the selected channel group. The \"All "
    static HostCheckBox *BrowseChannelGroup()  
    23032460    return gc;
    23042461}
    23052462
    2306 // Channel Group Settings
    2307 class ChannelGroupSettings : public TriggeredConfigurationGroup
    2308 {
    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 on
    2324          addTarget("1", new VerticalConfigurationGroup(true,false));
    2325      };
    2326 };
    2327 
    23282463// General RecPriorities settings
    23292464
    2330 static GlobalCheckBox *GRSchedMoveHigher()
     2465static GlobalCheckBoxSetting *GRSchedMoveHigher()
    23312466{
    2332     GlobalCheckBox *bc = new GlobalCheckBox("SchedMoveHigher");
     2467    GlobalCheckBoxSetting *bc = new GlobalCheckBoxSetting("SchedMoveHigher");
    23332468    bc->setLabel(QObject::tr("Reschedule higher priorities"));
    23342469    bc->setHelpText(QObject::tr("Move higher priority programs to other "
    23352470                    "cards and showings when resolving conflicts. This "
    static GlobalCheckBox *GRSchedMoveHigher()  
    23402475    return bc;
    23412476}
    23422477
    2343 static GlobalComboBox *GRSchedOpenEnd()
     2478static GlobalComboBoxSetting *GRSchedOpenEnd()
    23442479{
    2345     GlobalComboBox *bc = new GlobalComboBox("SchedOpenEnd");
     2480    GlobalComboBoxSetting *bc = new GlobalComboBoxSetting("SchedOpenEnd");
    23462481    bc->setLabel(QObject::tr("Avoid back to back recordings"));
    23472482    bc->setHelpText(QObject::tr("Selects the situations where the scheduler "
    23482483                    "will avoid assigning shows to the same card if their "
    static GlobalComboBox *GRSchedOpenEnd()  
    23552490    return bc;
    23562491}
    23572492
    2358 static GlobalSpinBox *GRDefaultStartOffset()
     2493static GlobalSpinBoxSetting *GRDefaultStartOffset()
    23592494{
    2360     GlobalSpinBox *bs = new GlobalSpinBox("DefaultStartOffset",
     2495    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("DefaultStartOffset",
    23612496                                          -10, 30, 5, true);
    23622497    bs->setLabel(QObject::tr("Default 'Start Early' minutes for new "
    23632498                             "recording rules"));
    static GlobalSpinBox *GRDefaultStartOffset()  
    23702505    return bs;
    23712506}
    23722507
    2373 static GlobalSpinBox *GRDefaultEndOffset()
     2508static GlobalSpinBoxSetting *GRDefaultEndOffset()
    23742509{
    2375     GlobalSpinBox *bs = new GlobalSpinBox("DefaultEndOffset",
     2510    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("DefaultEndOffset",
    23762511                                          -10, 30, 5, true);
    23772512    bs->setLabel(QObject::tr("Default 'End Late' minutes for new "
    23782513                             "recording rules"));
    static GlobalSpinBox *GRDefaultEndOffset()  
    23852520    return bs;
    23862521}
    23872522
    2388 static GlobalSpinBox *GRPrefInputRecPriority()
     2523static GlobalSpinBoxSetting *GRPrefInputRecPriority()
    23892524{
    2390     GlobalSpinBox *bs = new GlobalSpinBox("PrefInputPriority", 1, 99, 1);
     2525    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("PrefInputPriority", 1, 99, 1);
    23912526    bs->setLabel(QObject::tr("Preferred input priority"));
    23922527    bs->setHelpText(QObject::tr("Additional priority when a showing "
    23932528                    "matches the preferred input selected in the 'Scheduling "
    static GlobalSpinBox *GRPrefInputRecPriority()  
    23962531    return bs;
    23972532}
    23982533
    2399 static GlobalSpinBox *GRHDTVRecPriority()
     2534static GlobalSpinBoxSetting *GRHDTVRecPriority()
    24002535{
    2401     GlobalSpinBox *bs = new GlobalSpinBox("HDTVRecPriority", -99, 99, 1);
     2536    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("HDTVRecPriority", -99, 99, 1);
    24022537    bs->setLabel(QObject::tr("HDTV recording priority"));
    24032538    bs->setHelpText(QObject::tr("Additional priority when a showing "
    24042539                    "is marked as an HDTV broadcast in the TV listings."));
    static GlobalSpinBox *GRHDTVRecPriority()  
    24062541    return bs;
    24072542}
    24082543
    2409 static GlobalSpinBox *GRWSRecPriority()
     2544static GlobalSpinBoxSetting *GRWSRecPriority()
    24102545{
    2411     GlobalSpinBox *bs = new GlobalSpinBox("WSRecPriority", -99, 99, 1);
     2546    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("WSRecPriority", -99, 99, 1);
    24122547    bs->setLabel(QObject::tr("Widescreen recording priority"));
    24132548    bs->setHelpText(QObject::tr("Additional priority when a showing "
    24142549                    "is marked as widescreen in the TV listings."));
    static GlobalSpinBox *GRWSRecPriority()  
    24162551    return bs;
    24172552}
    24182553
    2419 static GlobalSpinBox *GRAutoRecPriority()
     2554static GlobalSpinBoxSetting *GRAutoRecPriority()
    24202555{
    2421     GlobalSpinBox *bs = new GlobalSpinBox("AutoRecPriority", -99, 99, 1);
     2556    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AutoRecPriority", -99, 99, 1);
    24222557    bs->setLabel(QObject::tr("Automatic priority range (+/-)"));
    24232558    bs->setHelpText(QObject::tr("Up to this number of priority points may "
    24242559                    "be added for titles that are usually watched soon after "
    static GlobalSpinBox *GRAutoRecPriority()  
    24282563    return bs;
    24292564}
    24302565
    2431 static GlobalSpinBox *GRSignLangRecPriority()
     2566static GlobalSpinBoxSetting *GRSignLangRecPriority()
    24322567{
    2433     GlobalSpinBox *bs = new GlobalSpinBox("SignLangRecPriority",
     2568    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("SignLangRecPriority",
    24342569                                            -99, 99, 1);
    24352570    bs->setLabel(QObject::tr("Sign language recording priority"));
    24362571    bs->setHelpText(QObject::tr("Additional priority when a showing "
    static GlobalSpinBox *GRSignLangRecPriority()  
    24392574    return bs;
    24402575}
    24412576
    2442 static GlobalSpinBox *GROnScrSubRecPriority()
     2577static GlobalSpinBoxSetting *GROnScrSubRecPriority()
    24432578{
    2444     GlobalSpinBox *bs = new GlobalSpinBox("OnScrSubRecPriority",
     2579    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("OnScrSubRecPriority",
    24452580                                            -99, 99, 1);
    24462581    bs->setLabel(QObject::tr("In-vision Subtitles Recording Priority"));
    24472582    bs->setHelpText(QObject::tr("Additional priority when a showing "
    static GlobalSpinBox *GROnScrSubRecPriority()  
    24502585    return bs;
    24512586}
    24522587
    2453 static GlobalSpinBox *GRCCRecPriority()
     2588static GlobalSpinBoxSetting *GRCCRecPriority()
    24542589{
    2455     GlobalSpinBox *bs = new GlobalSpinBox("CCRecPriority",
     2590    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("CCRecPriority",
    24562591                                            -99, 99, 1);
    24572592    bs->setLabel(QObject::tr("Subtitles/CC recording priority"));
    24582593    bs->setHelpText(QObject::tr("Additional priority when a showing "
    static GlobalSpinBox *GRCCRecPriority()  
    24622597    return bs;
    24632598}
    24642599
    2465 static GlobalSpinBox *GRHardHearRecPriority()
     2600static GlobalSpinBoxSetting *GRHardHearRecPriority()
    24662601{
    2467     GlobalSpinBox *bs = new GlobalSpinBox("HardHearRecPriority",
     2602    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("HardHearRecPriority",
    24682603                                            -99, 99, 1);
    24692604    bs->setLabel(QObject::tr("Hard of hearing priority"));
    24702605    bs->setHelpText(QObject::tr("Additional priority when a showing "
    static GlobalSpinBox *GRHardHearRecPriority()  
    24742609    return bs;
    24752610}
    24762611
    2477 static GlobalSpinBox *GRAudioDescRecPriority()
     2612static GlobalSpinBoxSetting *GRAudioDescRecPriority()
    24782613{
    2479     GlobalSpinBox *bs = new GlobalSpinBox("AudioDescRecPriority",
     2614    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AudioDescRecPriority",
    24802615                                            -99, 99, 1);
    24812616    bs->setLabel(QObject::tr("Audio described priority"));
    24822617    bs->setHelpText(QObject::tr("Additional priority when a showing "
    static GlobalSpinBox *GRAudioDescRecPriority()  
    24852620    return bs;
    24862621}
    24872622
    2488 static GlobalSpinBox *GRSingleRecordRecPriority()
     2623static GlobalSpinBoxSetting *GRSingleRecordRecPriority()
    24892624{
    2490     GlobalSpinBox *bs = new GlobalSpinBox("SingleRecordRecPriority",
     2625    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("SingleRecordRecPriority",
    24912626                                            -99, 99, 1);
    24922627    bs->setLabel(QObject::tr("Single recordings priority"));
    24932628    bs->setHelpText(QObject::tr("Single recordings will receive this "
    static GlobalSpinBox *GRSingleRecordRecPriority()  
    24962631    return bs;
    24972632}
    24982633
    2499 static GlobalSpinBox *GRWeekslotRecordRecPriority()
     2634static GlobalSpinBoxSetting *GRWeekslotRecordRecPriority()
    25002635{
    2501     GlobalSpinBox *bs = new GlobalSpinBox("WeekslotRecordRecPriority",
     2636    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("WeekslotRecordRecPriority",
    25022637                                            -99, 99, 1);
    25032638    bs->setLabel(QObject::tr("Weekslot recordings priority"));
    25042639    bs->setHelpText(QObject::tr("Weekslot recordings will receive this "
    static GlobalSpinBox *GRWeekslotRecordRecPriority()  
    25072642    return bs;
    25082643}
    25092644
    2510 static GlobalSpinBox *GRTimeslotRecordRecPriority()
     2645static GlobalSpinBoxSetting *GRTimeslotRecordRecPriority()
    25112646{
    2512     GlobalSpinBox *bs = new GlobalSpinBox("TimeslotRecordRecPriority",
     2647    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("TimeslotRecordRecPriority",
    25132648                                            -99, 99, 1);
    25142649    bs->setLabel(QObject::tr("Timeslot recordings priority"));
    25152650    bs->setHelpText(QObject::tr("Timeslot recordings will receive this "
    static GlobalSpinBox *GRTimeslotRecordRecPriority()  
    25182653    return bs;
    25192654}
    25202655
    2521 static GlobalSpinBox *GRChannelRecordRecPriority()
     2656static GlobalSpinBoxSetting *GRChannelRecordRecPriority()
    25222657{
    2523     GlobalSpinBox *bs = new GlobalSpinBox("ChannelRecordRecPriority",
     2658    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("ChannelRecordRecPriority",
    25242659                                            -99, 99, 1);
    25252660    bs->setLabel(QObject::tr("Channel recordings priority"));
    25262661    bs->setHelpText(QObject::tr("Channel recordings will receive this "
    static GlobalSpinBox *GRChannelRecordRecPriority()  
    25292664    return bs;
    25302665}
    25312666
    2532 static GlobalSpinBox *GRAllRecordRecPriority()
     2667static GlobalSpinBoxSetting *GRAllRecordRecPriority()
    25332668{
    2534     GlobalSpinBox *bs = new GlobalSpinBox("AllRecordRecPriority",
     2669    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("AllRecordRecPriority",
    25352670                                            -99, 99, 1);
    25362671    bs->setLabel(QObject::tr("All recordings priority"));
    25372672    bs->setHelpText(QObject::tr("The 'All' recording type will receive this "
    static GlobalSpinBox *GRAllRecordRecPriority()  
    25402675    return bs;
    25412676}
    25422677
    2543 static GlobalSpinBox *GRFindOneRecordRecPriority()
     2678static GlobalSpinBoxSetting *GRFindOneRecordRecPriority()
    25442679{
    2545     GlobalSpinBox *bs = new GlobalSpinBox("FindOneRecordRecPriority",
     2680    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("FindOneRecordRecPriority",
    25462681                                            -99, 99, 1);
    25472682    bs->setLabel(QObject::tr("Find one recordings priority"));
    25482683    bs->setHelpText(QObject::tr("Find One, Find Weekly and Find Daily "
    static GlobalSpinBox *GRFindOneRecordRecPriority()  
    25522687    return bs;
    25532688}
    25542689
    2555 static GlobalSpinBox *GROverrideRecordRecPriority()
     2690static GlobalSpinBoxSetting *GROverrideRecordRecPriority()
    25562691{
    2557     GlobalSpinBox *bs = new GlobalSpinBox("OverrideRecordRecPriority",
     2692    GlobalSpinBoxSetting *bs = new GlobalSpinBoxSetting("OverrideRecordRecPriority",
    25582693                                            -99, 99, 1);
    25592694    bs->setLabel(QObject::tr("Override recordings priority"));
    25602695    bs->setHelpText(QObject::tr("Override recordings will receive this "
    static GlobalSpinBox *GROverrideRecordRecPriority()  
    25632698    return bs;
    25642699}
    25652700
    2566 static HostLineEdit *DefaultTVChannel()
     2701static HostTextEditSetting *DefaultTVChannel()
    25672702{
    2568     HostLineEdit *ge = new HostLineEdit("DefaultTVChannel");
     2703    HostTextEditSetting *ge = new HostTextEditSetting("DefaultTVChannel");
    25692704    ge->setLabel(QObject::tr("Guide starts at channel"));
    25702705    ge->setValue("3");
    25712706    ge->setHelpText(QObject::tr("The program guide starts on this channel if "
    static HostLineEdit *DefaultTVChannel()  
    25732708    return ge;
    25742709}
    25752710
    2576 static HostSpinBox *EPGRecThreshold()
     2711static HostSpinBoxSetting *EPGRecThreshold()
    25772712{
    2578     HostSpinBox *gs = new HostSpinBox("SelChangeRecThreshold", 1, 600, 1);
     2713    HostSpinBoxSetting *gs = new HostSpinBoxSetting("SelChangeRecThreshold", 1, 600, 1);
    25792714    gs->setLabel(QObject::tr("Record threshold"));
    25802715    gs->setValue(16);
    25812716    gs->setHelpText(QObject::tr("Pressing SELECT on a show that is at least "
    static HostSpinBox *EPGRecThreshold()  
    25842719    return gs;
    25852720}
    25862721
    2587 static HostComboBox *MythLanguage()
     2722static HostComboBoxSetting *MythLanguage()
    25882723{
    2589     HostComboBox *gc = new HostComboBox("Language");
     2724    HostComboBoxSetting *gc = new HostComboBoxSetting("Language");
    25902725    gc->setLabel(QObject::tr("Language"));
    25912726
    25922727    QMap<QString, QString> langMap = MythTranslation::getLanguages();
    static HostComboBox *MythLanguage()  
    26082743    return gc;
    26092744}
    26102745
    2611 static void ISO639_fill_selections(SelectSetting *widget, uint i)
     2746static void ISO639_fill_selections(MythUIComboBoxSetting *comboBox, uint i)
    26122747{
    2613     widget->clearSelections();
     2748    comboBox->clearSelections();
    26142749    QString q = QString("ISO639Language%1").arg(i);
    26152750    QString lang = gCoreContext->GetSetting(q, "").toLower();
    26162751
    static void ISO639_fill_selections(SelectSetting *widget, uint i)  
    26312766            desc = desc.left(idx);
    26322767
    26332768        const QString il = iso639_key_to_str3(it.key());
    2634         widget->addSelection(desc, il, il == lang);
     2769        comboBox->addSelection(desc, il, il == lang);
    26352770    }
    26362771}
    26372772
    2638 static GlobalComboBox *ISO639PreferredLanguage(uint i)
     2773static GlobalComboBoxSetting *ISO639PreferredLanguage(uint i)
    26392774{
    2640     GlobalComboBox *gc = new GlobalComboBox(QString("ISO639Language%1").arg(i));
     2775    GlobalComboBoxSetting *gc = new GlobalComboBoxSetting(QString("ISO639Language%1").arg(i));
    26412776    gc->setLabel(QObject::tr("Guide language #%1").arg(i+1));
    26422777    // We should try to get language from "MythLanguage"
    26432778    // then use code 2 to code 3 map in iso639.h
    static GlobalComboBox *ISO639PreferredLanguage(uint i)  
    26482783    return gc;
    26492784}
    26502785
    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 }
    26602786
    2661 static HostSpinBox *NetworkControlPort()
     2787static HostSpinBoxSetting *NetworkControlPort()
    26622788{
    2663     HostSpinBox *gs = new HostSpinBox("NetworkControlPort", 1025, 65535, 1);
     2789    HostSpinBoxSetting *gs = new HostSpinBoxSetting("NetworkControlPort", 1025, 65535, 1);
    26642790    gs->setLabel(QObject::tr("Network Remote Control port"));
    26652791    gs->setValue(6546);
    26662792    gs->setHelpText(QObject::tr("This specifies what port the network remote "
    static HostSpinBox *NetworkControlPort()  
    26682794    return gs;
    26692795}
    26702796
    2671 static HostLineEdit *UDPNotifyPort()
     2797static HostTextEditSetting *UDPNotifyPort()
    26722798{
    2673     HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
     2799    HostTextEditSetting *ge = new HostTextEditSetting("UDPNotifyPort");
    26742800    ge->setLabel(QObject::tr("UDP notify port"));
    26752801    ge->setValue("6948");
    26762802    ge->setHelpText(QObject::tr("MythTV will listen for "
    static HostLineEdit *UDPNotifyPort()  
    26802806    return ge;
    26812807}
    26822808
    2683 static HostCheckBox *RealtimePriority()
     2809static HostCheckBoxSetting *NetworkControlEnabled()
     2810{
     2811    HostCheckBoxSetting *gc = new HostCheckBoxSetting("NetworkControlEnabled");
     2812    gc->setLabel(QObject::tr("Enable Network Remote Control interface"));
     2813    gc->setHelpText(QObject::tr("This enables support for controlling "
     2814                    "mythfrontend over the network."));
     2815    gc->setValue(false);
     2816
     2817    gc->addTargetedChild("1",NetworkControlPort());
     2818    gc->addTargetedChild("1",UDPNotifyPort());
     2819    return gc;
     2820}
     2821
     2822static HostCheckBoxSetting *RealtimePriority()
    26842823{
    2685     HostCheckBox *gc = new HostCheckBox("RealtimePriority");
     2824    HostCheckBoxSetting *gc = new HostCheckBoxSetting("RealtimePriority");
    26862825    gc->setLabel(QObject::tr("Enable realtime priority threads"));
    26872826    gc->setHelpText(QObject::tr("When running mythfrontend with root "
    26882827                    "privileges, some threads can be given enhanced priority. "
    static HostCheckBox *RealtimePriority()  
    26922831    return gc;
    26932832}
    26942833
    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()
     2834static HostTextEditSetting *IgnoreMedia()
    27082835{
    2709     HostLineEdit *ge = new HostLineEdit("IgnoreDevices");
     2836    HostTextEditSetting *ge = new HostTextEditSetting("IgnoreDevices");
    27102837    ge->setLabel(QObject::tr("Ignore devices"));
    27112838    ge->setValue("");
    27122839    ge->setHelpText(QObject::tr("If there are any devices that you do not want "
    static HostLineEdit *IgnoreMedia()  
    27152842    return ge;
    27162843}
    27172844
    2718 class MythMediaSettings : public TriggeredConfigurationGroup
     2845static HostCheckBoxSetting *EnableMediaMon()
    27192846{
    2720   public:
    2721      MythMediaSettings() :
    2722          TriggeredConfigurationGroup(false, false, true, true)
    2723      {
    2724          setLabel(QObject::tr("MythMediaMonitor"));
    2725          setUseLabel(false);
    2726 
    2727          Setting* enabled = EnableMediaMon();
    2728          addChild(enabled);
    2729          setTrigger(enabled);
    2730 
    2731          ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
    2732          settings->addChild(IgnoreMedia());
    2733          addTarget("1", settings);
    2734 
    2735          // show nothing if fillEnabled is off
    2736          addTarget("0", new VerticalConfigurationGroup(true));
    2737      };
    2738 };
    2739 
     2847    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MonitorDrives");
     2848    gc->setLabel(QObject::tr("Monitor CD/DVD") +
     2849                 QObject::tr(" (and other removable devices)"));
     2850    gc->setHelpText(QObject::tr("This enables support for monitoring "
     2851                    "your CD/DVD drives for new disks and launching "
     2852                    "the proper plugin to handle them."));
     2853    gc->setValue(false);
     2854    gc->addTargetedChild("1", IgnoreMedia());
     2855    return gc;
     2856}
    27402857
    2741 static HostComboBox *DisplayGroupTitleSort()
     2858static HostComboBoxSetting *DisplayGroupTitleSort()
    27422859{
    2743     HostComboBox *gc = new HostComboBox("DisplayGroupTitleSort");
     2860    HostComboBoxSetting *gc = new HostComboBoxSetting("DisplayGroupTitleSort");
    27442861    gc->setLabel(QObject::tr("Sort titles"));
    27452862    gc->addSelection(QObject::tr("Alphabetically"),
    27462863            QString::number(PlaybackBox::TitleSortAlphabetical));
    static HostComboBox *DisplayGroupTitleSort()  
    27512868    return gc;
    27522869}
    27532870
    2754 static HostCheckBox *PlaybackWatchList()
     2871static HostCheckBoxSetting *PlaybackWLStart()
    27552872{
    2756     HostCheckBox *gc = new HostCheckBox("PlaybackWatchList");
    2757     gc->setLabel(QObject::tr("Include the 'Watch List' group"));
    2758     gc->setValue(true);
    2759     gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of "
    2760                                 "recordings sorted to highlight series and "
    2761                                 "shows that need attention in order to "
    2762                                 "keep up to date."));
    2763     return gc;
    2764 }
    2765 
    2766 static HostCheckBox *PlaybackWLStart()
    2767 {
    2768     HostCheckBox *gc = new HostCheckBox("PlaybackWLStart");
     2873    HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWLStart");
    27692874    gc->setLabel(QObject::tr("Start from the Watch List view"));
    27702875    gc->setValue(false);
    27712876    gc->setHelpText(QObject::tr("If enabled, the 'Watch List' will be the "
    static HostCheckBox *PlaybackWLStart()  
    27742879    return gc;
    27752880}
    27762881
    2777 static HostCheckBox *PlaybackWLAutoExpire()
     2882static HostCheckBoxSetting *PlaybackWLAutoExpire()
    27782883{
    2779     HostCheckBox *gc = new HostCheckBox("PlaybackWLAutoExpire");
     2884    HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWLAutoExpire");
    27802885    gc->setLabel(QObject::tr("Exclude recordings not set for Auto-Expire"));
    27812886    gc->setValue(false);
    27822887    gc->setHelpText(QObject::tr("Set this if you turn off Auto-Expire only "
    static HostCheckBox *PlaybackWLAutoExpire()  
    27862891    return gc;
    27872892}
    27882893
    2789 static HostSpinBox *PlaybackWLMaxAge()
     2894static HostSpinBoxSetting *PlaybackWLMaxAge()
    27902895{
    2791     HostSpinBox *gs = new HostSpinBox("PlaybackWLMaxAge", 30, 180, 10);
     2896    HostSpinBoxSetting *gs = new HostSpinBoxSetting("PlaybackWLMaxAge", 30, 180, 10);
    27922897    gs->setLabel(QObject::tr("Maximum days counted in the score"));
    27932898    gs->setValue(60);
    27942899    gs->setHelpText(QObject::tr("The 'Watch List' scores are based on 1 point "
    static HostSpinBox *PlaybackWLMaxAge()  
    27982903    return gs;
    27992904}
    28002905
    2801 static HostSpinBox *PlaybackWLBlackOut()
     2906static HostSpinBoxSetting *PlaybackWLBlackOut()
    28022907{
    2803     HostSpinBox *gs = new HostSpinBox("PlaybackWLBlackOut", 0, 5, 1);
     2908    HostSpinBoxSetting *gs = new HostSpinBoxSetting("PlaybackWLBlackOut", 0, 5, 1);
    28042909    gs->setLabel(QObject::tr("Days to exclude weekly episodes after delete"));
    28052910    gs->setValue(2);
    28062911    gs->setHelpText(QObject::tr("When an episode is deleted or marked as "
    static HostSpinBox *PlaybackWLBlackOut()  
    28112916    return gs;
    28122917}
    28132918
    2814 class WatchListSettings : public TriggeredConfigurationGroup
     2919static HostCheckBoxSetting *PlaybackWatchList()
    28152920{
    2816   public:
    2817      WatchListSettings() :
    2818          TriggeredConfigurationGroup(false, false, true, true)
    2819      {
    2820 
    2821          Setting* watchList = PlaybackWatchList();
    2822          addChild(watchList);
    2823          setTrigger(watchList);
    2824 
    2825          ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
    2826          settings->addChild(PlaybackWLStart());
    2827          settings->addChild(PlaybackWLAutoExpire());
    2828          settings->addChild(PlaybackWLMaxAge());
    2829          settings->addChild(PlaybackWLBlackOut());
    2830          addTarget("1", settings);
    2831 
    2832          addTarget("0", new VerticalConfigurationGroup(true));
    2833     };
    2834 };
     2921    HostCheckBoxSetting *gc = new HostCheckBoxSetting("PlaybackWatchList");
     2922    gc->setLabel(QObject::tr("Include the 'Watch List' group"));
     2923    gc->setValue(true);
     2924    gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of "
     2925                                "recordings sorted to highlight series and "
     2926                                "shows that need attention in order to "
     2927                                "keep up to date."));
     2928
     2929    gc->addTargetedChild("1", PlaybackWLStart());
     2930    gc->addTargetedChild("1", PlaybackWLAutoExpire());
     2931    gc->addTargetedChild("1", PlaybackWLMaxAge());
     2932    gc->addTargetedChild("1", PlaybackWLBlackOut());
     2933    return gc;
     2934}
    28352935
    2836 static HostCheckBox *LCDShowTime()
     2936static HostCheckBoxSetting *LCDShowTime()
    28372937{
    2838     HostCheckBox *gc = new HostCheckBox("LCDShowTime");
     2938    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowTime");
    28392939    gc->setLabel(QObject::tr("Display time"));
    28402940    gc->setHelpText(QObject::tr("Display current time on idle LCD display. "));
    28412941    gc->setValue(true);
    28422942    return gc;
    28432943}
    28442944
    2845 static HostCheckBox *LCDShowRecStatus()
     2945static HostCheckBoxSetting *LCDShowRecStatus()
    28462946{
    2847     HostCheckBox *gc = new HostCheckBox("LCDShowRecStatus");
     2947    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowRecStatus");
    28482948    gc->setLabel(QObject::tr("Display recording status"));
    28492949    gc->setHelpText(QObject::tr("Display current recordings information on "
    28502950                                "LCD display."));
    static HostCheckBox *LCDShowRecStatus()  
    28522952    return gc;
    28532953}
    28542954
    2855 static HostCheckBox *LCDShowMenu()
     2955static HostCheckBoxSetting *LCDShowMenu()
    28562956{
    2857     HostCheckBox *gc = new HostCheckBox("LCDShowMenu");
     2957    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowMenu");
    28582958    gc->setLabel(QObject::tr("Display menus"));
    28592959    gc->setHelpText(QObject::tr("Display selected menu on LCD display. "));
    28602960    gc->setValue(true);
    28612961    return gc;
    28622962}
    28632963
    2864 static HostSpinBox *LCDPopupTime()
     2964static HostSpinBoxSetting *LCDPopupTime()
    28652965{
    2866     HostSpinBox *gs = new HostSpinBox("LCDPopupTime", 1, 300, 1, true);
     2966    HostSpinBoxSetting *gs = new HostSpinBoxSetting("LCDPopupTime", 1, 300, 1, true);
    28672967    gs->setLabel(QObject::tr("Menu pop-up time"));
    28682968    gs->setHelpText(QObject::tr("How many seconds the menu will "
    28692969                    "remain visible after navigation."));
    static HostSpinBox *LCDPopupTime()  
    28712971    return gs;
    28722972}
    28732973
    2874 static HostCheckBox *LCDShowMusic()
     2974static HostCheckBoxSetting *LCDShowMusic()
    28752975{
    2876     HostCheckBox *gc = new HostCheckBox("LCDShowMusic");
     2976    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowMusic");
    28772977    gc->setLabel(QObject::tr("Display music artist and title"));
    28782978    gc->setHelpText(QObject::tr("Display playing artist and song title in "
    28792979                    "MythMusic on LCD display."));
    static HostCheckBox *LCDShowMusic()  
    28812981    return gc;
    28822982}
    28832983
    2884 static HostComboBox *LCDShowMusicItems()
     2984static HostComboBoxSetting *LCDShowMusicItems()
    28852985{
    2886     HostComboBox *gc = new HostComboBox("LCDShowMusicItems");
     2986    HostComboBoxSetting *gc = new HostComboBoxSetting("LCDShowMusicItems");
    28872987    gc->setLabel(QObject::tr("Items"));
    28882988    gc->addSelection(QObject::tr("Artist - Title"), "ArtistTitle");
    28892989    gc->addSelection(QObject::tr("Artist [Album] Title"), "ArtistAlbumTitle");
    static HostComboBox *LCDShowMusicItems()  
    28912991    return gc;
    28922992}
    28932993
    2894 static HostCheckBox *LCDShowChannel()
     2994static HostCheckBoxSetting *LCDShowChannel()
    28952995{
    2896     HostCheckBox *gc = new HostCheckBox("LCDShowChannel");
     2996    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowChannel");
    28972997    gc->setLabel(QObject::tr("Display channel information"));
    28982998    gc->setHelpText(QObject::tr("Display tuned channel information on LCD display."));
    28992999    gc->setValue(true);
    29003000    return gc;
    29013001}
    29023002
    2903 static HostCheckBox *LCDShowVolume()
     3003static HostCheckBoxSetting *LCDShowVolume()
    29043004{
    2905     HostCheckBox *gc = new HostCheckBox("LCDShowVolume");
     3005    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowVolume");
    29063006    gc->setLabel(QObject::tr("Display volume information"));
    29073007    gc->setHelpText(QObject::tr("Display volume level information "
    29083008                                "on LCD display."));
    static HostCheckBox *LCDShowVolume()  
    29103010    return gc;
    29113011}
    29123012
    2913 static HostCheckBox *LCDShowGeneric()
     3013static HostCheckBoxSetting *LCDShowGeneric()
    29143014{
    2915     HostCheckBox *gc = new HostCheckBox("LCDShowGeneric");
     3015    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDShowGeneric");
    29163016    gc->setLabel(QObject::tr("Display generic information"));
    29173017    gc->setHelpText(QObject::tr("Display generic information on LCD display."));
    29183018    gc->setValue(true);
    29193019    return gc;
    29203020}
    29213021
    2922 static HostCheckBox *LCDBacklightOn()
     3022static HostCheckBoxSetting *LCDBacklightOn()
    29233023{
    2924     HostCheckBox *gc = new HostCheckBox("LCDBacklightOn");
     3024    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDBacklightOn");
    29253025    gc->setLabel(QObject::tr("Backlight always on"));
    29263026    gc->setHelpText(QObject::tr("Turn on the backlight permanently "
    29273027                                "on the LCD display."));
    static HostCheckBox *LCDBacklightOn()  
    29293029    return gc;
    29303030}
    29313031
    2932 static HostCheckBox *LCDHeartBeatOn()
     3032static HostCheckBoxSetting *LCDHeartBeatOn()
    29333033{
    2934     HostCheckBox *gc = new HostCheckBox("LCDHeartBeatOn");
     3034    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDHeartBeatOn");
    29353035    gc->setLabel(QObject::tr("Heartbeat always on"));
    29363036    gc->setHelpText(QObject::tr("Turn on the LCD heartbeat."));
    29373037    gc->setValue(false);
    29383038    return gc;
    29393039}
    29403040
    2941 static HostCheckBox *LCDBigClock()
     3041static HostCheckBoxSetting *LCDBigClock()
    29423042{
    2943     HostCheckBox *gc = new HostCheckBox("LCDBigClock");
     3043    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDBigClock");
    29443044    gc->setLabel(QObject::tr("Display large clock"));
    29453045    gc->setHelpText(QObject::tr("On multiline displays try and display the time as large as possible."));
    29463046    gc->setValue(false);
    29473047    return gc;
    29483048}
    29493049
    2950 static HostLineEdit *LCDKeyString()
     3050static HostTextEditSetting *LCDKeyString()
    29513051{
    2952     HostLineEdit *ge = new HostLineEdit("LCDKeyString");
     3052    HostTextEditSetting *ge = new HostTextEditSetting("LCDKeyString");
    29533053    ge->setLabel(QObject::tr("LCD key order"));
    29543054    ge->setValue("ABCDEF");
    29553055    ge->setHelpText(QObject::tr("Enter the 6 Keypad Return Codes for your "
    static HostLineEdit *LCDKeyString()  
    29603060    return ge;
    29613061}
    29623062
    2963 static HostCheckBox *LCDEnable()
     3063static HostCheckBoxSetting *LCDEnable()
    29643064{
    2965     HostCheckBox *gc = new HostCheckBox("LCDEnable");
     3065    HostCheckBoxSetting *gc = new HostCheckBoxSetting("LCDEnable");
    29663066    gc->setLabel(QObject::tr("Enable LCD device"));
    29673067    gc->setHelpText(QObject::tr("Use an LCD display to view MythTV status "
    29683068                    "information."));
    29693069    gc->setValue(false);
     3070    gc->addTargetedChild("1",LCDShowTime());
     3071    gc->addTargetedChild("1",LCDShowMenu());
     3072    gc->addTargetedChild("1",LCDShowMusic());
     3073    gc->addTargetedChild("1",LCDShowMusicItems());
     3074    gc->addTargetedChild("1",LCDShowChannel());
     3075    gc->addTargetedChild("1",LCDShowRecStatus());
     3076    gc->addTargetedChild("1",LCDShowVolume());
     3077    gc->addTargetedChild("1",LCDShowGeneric());
     3078    gc->addTargetedChild("1",LCDBacklightOn());
     3079    gc->addTargetedChild("1",LCDHeartBeatOn());
     3080    gc->addTargetedChild("1",LCDBigClock());
     3081    gc->addTargetedChild("1",LCDKeyString());
     3082    gc->addTargetedChild("1",LCDPopupTime());
    29703083    return gc;
    29713084}
    29723085
    2973 class LcdSettings : public TriggeredConfigurationGroup
    2974 {
    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 
    30193086
    30203087#if CONFIG_DARWIN
    3021 static HostCheckBox *MacGammaCorrect()
     3088static HostCheckBoxSetting *MacGammaCorrect()
    30223089{
    3023     HostCheckBox *gc = new HostCheckBox("MacGammaCorrect");
     3090    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacGammaCorrect");
    30243091    gc->setLabel(QObject::tr("Enable gamma correction for video"));
    30253092    gc->setValue(false);
    30263093    gc->setHelpText(QObject::tr("If enabled, QuickTime will correct the gamma "
    static HostCheckBox *MacGammaCorrect()  
    30293096    return gc;
    30303097}
    30313098
    3032 static HostCheckBox *MacScaleUp()
     3099static HostCheckBoxSetting *MacScaleUp()
    30333100{
    3034     HostCheckBox *gc = new HostCheckBox("MacScaleUp");
     3101    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacScaleUp");
    30353102    gc->setLabel(QObject::tr("Scale video as necessary"));
    30363103    gc->setValue(true);
    30373104    gc->setHelpText(QObject::tr("If enabled, video will be scaled to fit your "
    static HostCheckBox *MacScaleUp()  
    30403107    return gc;
    30413108}
    30423109
    3043 static HostSpinBox *MacFullSkip()
     3110static HostSpinBoxSetting *MacFullSkip()
    30443111{
    3045     HostSpinBox *gs = new HostSpinBox("MacFullSkip", 0, 30, 1, true);
     3112    HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFullSkip", 0, 30, 1, true);
    30463113    gs->setLabel(QObject::tr("Frames to skip in fullscreen mode"));
    30473114    gs->setValue(0);
    30483115    gs->setHelpText(QObject::tr("Video displayed in fullscreen or non-windowed "
    static HostSpinBox *MacFullSkip()  
    30533120    return gs;
    30543121}
    30553122
    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 }
    30683123
    3069 static HostSpinBox *MacMainSkip()
     3124
     3125static HostSpinBoxSetting *MacMainSkip()
    30703126{
    3071     HostSpinBox *gs = new HostSpinBox("MacMainSkip", 0, 30, 1, true);
     3127    HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainSkip", 0, 30, 1, true);
    30723128    gs->setLabel(QObject::tr("Frames to skip"));
    30733129    gs->setValue(0);
    30743130    gs->setHelpText(QObject::tr("Video in the main window will skip this many "
    static HostSpinBox *MacMainSkip()  
    30773133    return gs;
    30783134}
    30793135
    3080 static HostSpinBox *MacMainOpacity()
     3136static HostSpinBoxSetting *MacMainOpacity()
    30813137{
    3082     HostSpinBox *gs = new HostSpinBox("MacMainOpacity", 0, 100, 5, false);
     3138    HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacMainOpacity", 0, 100, 5, false);
    30833139    gs->setLabel(QObject::tr("Opacity"));
    30843140    gs->setValue(100);
    30853141    gs->setHelpText(QObject::tr("The opacity of the main window. Set to "
    static HostSpinBox *MacMainOpacity()  
    30883144    return gs;
    30893145}
    30903146
    3091 class MacMainSettings : public TriggeredConfigurationGroup
     3147static HostCheckBoxSetting *MacMainEnabled()
    30923148{
    3093   public:
    3094     MacMainSettings() : TriggeredConfigurationGroup(false)
    3095     {
    3096         setLabel(QObject::tr("Video in main window"));
    3097         setUseLabel(false);
    3098         Setting *gc = MacMainEnabled();
    3099         addChild(gc);
    3100         setTrigger(gc);
    3101 
    3102         VerticalConfigurationGroup *opts =
    3103             new VerticalConfigurationGroup(false, false);
    3104         opts->addChild(MacMainSkip());
    3105         opts->addChild(MacMainOpacity());
    3106 
    3107         addTarget("1", opts);
    3108         addTarget("0", new VerticalConfigurationGroup(false, false));
    3109     }
    3110 };
     3149    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacMainEnabled");
     3150    gc->setLabel(QObject::tr("Video in main window"));
     3151    gc->setValue(true);
     3152    gc->setHelpText(QObject::tr("If enabled, video will be displayed in the "
     3153                    "main GUI window. Disable this when you only want video "
     3154                    "on the desktop or in a floating window. Only valid when "
     3155                    "\"Use GUI size for TV playback\" and \"Run the "
     3156                    "frontend in a window\" are checked."));
    31113157
    3112 static HostCheckBox *MacFloatEnabled()
    3113 {
    3114     HostCheckBox *gc = new HostCheckBox("MacFloatEnabled");
    3115     gc->setLabel(QObject::tr("Video in floating window"));
    3116     gc->setValue(false);
    3117     gc->setHelpText(QObject::tr("If enabled, video will be displayed in a "
    3118                     "floating window. Only valid when \"Use GUI size for TV "
    3119                     "playback\" and \"Run the frontend in a window\" are "
    3120                     "checked."));
     3158    gc->addTargetedChild("1", MacMainSkip());
     3159    gc->addTargetedChild("1", MacMainOpacity());
    31213160    return gc;
    31223161}
    31233162
    3124 static HostSpinBox *MacFloatSkip()
     3163static HostSpinBoxSetting *MacFloatSkip()
    31253164{
    3126     HostSpinBox *gs = new HostSpinBox("MacFloatSkip", 0, 30, 1, true);
     3165    HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatSkip", 0, 30, 1, true);
    31273166    gs->setLabel(QObject::tr("Frames to skip"));
    31283167    gs->setValue(0);
    31293168    gs->setHelpText(QObject::tr("Video in the floating window will skip "
    static HostSpinBox *MacFloatSkip()  
    31323171    return gs;
    31333172}
    31343173
    3135 static HostSpinBox *MacFloatOpacity()
     3174static HostSpinBoxSetting *MacFloatOpacity()
    31363175{
    3137     HostSpinBox *gs = new HostSpinBox("MacFloatOpacity", 0, 100, 5, false);
     3176    HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacFloatOpacity", 0, 100, 5, false);
    31383177    gs->setLabel(QObject::tr("Opacity"));
    31393178    gs->setValue(100);
    31403179    gs->setHelpText(QObject::tr("The opacity of the floating window. Set to "
    static HostSpinBox *MacFloatOpacity()  
    31433182    return gs;
    31443183}
    31453184
    3146 class MacFloatSettings : public TriggeredConfigurationGroup
     3185static HostCheckBoxSetting *MacFloatEnabled()
    31473186{
    3148   public:
    3149     MacFloatSettings() : TriggeredConfigurationGroup(false)
    3150     {
    3151         setLabel(QObject::tr("Video in floating window"));
    3152         setUseLabel(false);
    3153         Setting *gc = MacFloatEnabled();
    3154         addChild(gc);
    3155         setTrigger(gc);
     3187    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacFloatEnabled");
     3188    gc->setLabel(QObject::tr("Video in floating window"));
     3189    gc->setValue(false);
     3190    gc->setHelpText(QObject::tr("If enabled, video will be displayed in a "
     3191                    "floating window. Only valid when \"Use GUI size for TV "
     3192                    "playback\" and \"Run the frontend in a window\" are "
     3193                    "checked."));
    31563194
    3157         VerticalConfigurationGroup *opts =
    3158             new VerticalConfigurationGroup(false, false);
    3159         opts->addChild(MacFloatSkip());
    3160         opts->addChild(MacFloatOpacity());
     3195    gc->addTargetedChild("1", MacFloatSkip());
     3196    gc->addTargetedChild("1", MacFloatOpacity());
     3197    return gc;
     3198}
    31613199
    3162         addTarget("1", opts);
    3163         addTarget("0", new VerticalConfigurationGroup(false, false));
    3164     }
    3165 };
     3200static HostSpinBoxSetting *MacDockSkip()
     3201{
     3202    HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDockSkip", 0, 30, 1, true);
     3203    gs->setLabel(QObject::tr("Frames to skip"));
     3204    gs->setValue(3);
     3205    gs->setHelpText(QObject::tr("Video in the dock icon will skip this many "
     3206                    "frames for each frame drawn. Set to 0 to show "
     3207                    "every frame."));
     3208    return gs;
     3209}
    31663210
    3167 static HostCheckBox *MacDockEnabled()
     3211static HostCheckBoxSetting *MacDockEnabled()
    31683212{
    3169     HostCheckBox *gc = new HostCheckBox("MacDockEnabled");
     3213    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDockEnabled");
    31703214    gc->setLabel(QObject::tr("Video in the dock"));
    31713215    gc->setValue(true);
    31723216    gc->setHelpText(QObject::tr("If enabled, video will be displayed in the "
    31733217                    "application's dock icon. Only valid when \"Use GUI size "
    31743218                    "for TV playback\" and \"Run the frontend in a window\" "
    31753219                    "are checked."));
     3220    gc->addTargetedChild("1", MacDockSkip());
     3221   
    31763222    return gc;
    31773223}
    31783224
    3179 static HostSpinBox *MacDockSkip()
     3225static HostSpinBoxSetting *MacDesktopSkip()
    31803226{
    3181     HostSpinBox *gs = new HostSpinBox("MacDockSkip", 0, 30, 1, true);
     3227    HostSpinBoxSetting *gs = new HostSpinBoxSetting("MacDesktopSkip", 0, 30, 1, true);
    31823228    gs->setLabel(QObject::tr("Frames to skip"));
    3183     gs->setValue(3);
    3184     gs->setHelpText(QObject::tr("Video in the dock icon will skip this many "
     3229    gs->setValue(0);
     3230    gs->setHelpText(QObject::tr("Video on the desktop will skip this many "
    31853231                    "frames for each frame drawn. Set to 0 to show "
    31863232                    "every frame."));
    31873233    return gs;
    31883234}
    31893235
    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()
     3236static HostCheckBoxSetting *MacDesktopEnabled()
    32083237{
    3209     HostCheckBox *gc = new HostCheckBox("MacDesktopEnabled");
     3238    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MacDesktopEnabled");
    32103239    gc->setLabel(QObject::tr("Video on the desktop"));
    32113240    gc->setValue(false);
    32123241    gc->setHelpText(QObject::tr("If enabled, video will be displayed on the "
    32133242                    "desktop, behind the Finder icons. Only valid when \"Use "
    32143243                    "GUI size for TV playback\" and \"Run the frontend in a "
    32153244                    "window\" are checked."));
    3216     return gc;
    3217 }
    32183245
    3219 static HostSpinBox *MacDesktopSkip()
    3220 {
    3221     HostSpinBox *gs = new HostSpinBox("MacDesktopSkip", 0, 30, 1, true);
    3222     gs->setLabel(QObject::tr("Frames to skip"));
    3223     gs->setValue(0);
    3224     gs->setHelpText(QObject::tr("Video on the desktop will skip this many "
    3225                     "frames for each frame drawn. Set to 0 to show "
    3226                     "every frame."));
    3227     return gs;
    3228 }
     3246    gc->addTarget("1", MacDesktopSkip());
    32293247
    3230 class MacDesktopSettings : public TriggeredConfigurationGroup
    3231 {
    3232   public:
    3233     MacDesktopSettings() : TriggeredConfigurationGroup(false)
    3234     {
    3235         setLabel(QObject::tr("Video on the desktop"));
    3236         setUseLabel(false);
    3237         Setting *gc = MacDesktopEnabled();
    3238         addChild(gc);
    3239         setTrigger(gc);
     3248    return gc;
     3249}
    32403250
    3241         Setting *skip = MacDesktopSkip();
    3242         addTarget("1", skip);
    3243         addTarget("0", new HorizontalConfigurationGroup(false, false));
    3244     }
    3245 };
    32463251#endif
    32473252
    3248 static HostCheckBox *WatchTVGuide()
     3253static HostCheckBoxSetting *WatchTVGuide()
    32493254{
    3250     HostCheckBox *gc = new HostCheckBox("WatchTVGuide");
     3255    HostCheckBoxSetting *gc = new HostCheckBoxSetting("WatchTVGuide");
    32513256    gc->setLabel(QObject::tr("Show the program guide when starting Live TV"));
    32523257    gc->setHelpText(QObject::tr("This starts the program guide immediately "
    32533258             "upon starting to watch Live TV."));
    static HostCheckBox *WatchTVGuide()  
    32553260    return gc;
    32563261}
    32573262
     3263
     3264/* This code is a duplication the clas DatabaseSettings. As it it also use bymythbackend I rewrote here for the time being */
     3265
     3266class DatabaseGroupSetting : public GroupSetting
     3267{
     3268  public:
     3269    DatabaseGroupSetting(const QString &DBhostOverride = QString::null):GroupSetting()
     3270    {
     3271        m_DBhostOverride = DBhostOverride;
     3272
     3273        setLabel(QObject::tr("Database Configuration"));
     3274
     3275        MSqlQuery query(MSqlQuery::InitCon());
     3276        if (query.isConnected())
     3277            setHelpText(QObject::tr("All database settings take effect when "
     3278                                       "you restart this program."));
     3279        else
     3280            setHelpText(QObject::tr("MythTV could not connect to the database. "
     3281                                       "Please verify your database settings "
     3282                                       "below."));
     3283
     3284        dbHostName = new TransTextEditSetting();
     3285        dbHostName->setLabel(QObject::tr("Hostname"));
     3286        dbHostName->setHelpText(QObject::tr("The host name or IP address of "
     3287                                        "the machine hosting the database. "
     3288                                        "This information is required."));
     3289        addChild(dbHostName);
     3290
     3291        dbHostPing = new TransMythUICheckBoxSetting();
     3292        dbHostPing->setLabel(QObject::tr("Ping test server?"));
     3293        dbHostPing->setHelpText(QObject::tr("Test basic host connectivity using "
     3294                                            "the ping command. Turn off if your "
     3295                                            "host or network don't support ping "
     3296                                            "(ICMP ECHO) packets"));
     3297        addChild(dbHostPing);
     3298
     3299        dbPort = new TransTextEditSetting();
     3300        dbPort->setLabel(QObject::tr("Port"));
     3301        dbPort->setHelpText(QObject::tr("The port number the database is running "
     3302                                        "on.  Leave blank if using the default "
     3303                                        "port (3306)."));
     3304        addChild(dbPort);
     3305
     3306        dbName = new TransTextEditSetting();
     3307        dbName->setLabel(QObject::tr("Database name"));
     3308        dbName->setHelpText(QObject::tr("The name of the database. "
     3309                                        "This information is required."));
     3310        addChild(dbName);
     3311
     3312        dbUserName = new TransTextEditSetting();
     3313        dbUserName->setLabel(QObject::tr("User"));
     3314        dbUserName->setHelpText(QObject::tr("The user name to use while "
     3315                                            "connecting to the database. "
     3316                                            "This information is required."));
     3317        addChild(dbUserName);
     3318
     3319        dbPassword = new TransTextEditSetting();
     3320        dbPassword->setLabel(QObject::tr("Password"));
     3321        dbPassword->setHelpText(QObject::tr("The password to use while "
     3322                                            "connecting to the database. "
     3323                                            "This information is required."));
     3324        addChild(dbPassword);
     3325
     3326        localEnabled = new TransMythUICheckBoxSetting();
     3327        localEnabled->setLabel(QObject::tr("Use custom identifier for frontend "
     3328                                           "preferences"));
     3329        localEnabled->setHelpText(QObject::tr("If this frontend's host name "
     3330                                              "changes often, check this box "
     3331                                              "and provide a network-unique "
     3332                                              "name to identify it. "
     3333                                              "If unchecked, the frontend "
     3334                                              "machine's local host name will "
     3335                                              "be used to save preferences in "
     3336                                              "the database."));
     3337        addChild(localEnabled);
     3338
     3339
     3340        localHostName = new TransTextEditSetting();
     3341        localHostName->setLabel(QObject::tr("Custom identifier"));
     3342        localHostName->setHelpText(QObject::tr("An identifier to use while "
     3343                                               "saving the settings for this "
     3344                                               "frontend."));
     3345        localEnabled->addTargetedChild("1", localHostName);
     3346
     3347
     3348        wolEnabled = new TransMythUICheckBoxSetting();
     3349        wolEnabled->setLabel(QObject::tr("Enable database server wakeup"));
     3350        wolEnabled->setHelpText(QObject::tr("If enabled, the frontend will use "
     3351                                            "database wakeup parameters to "
     3352                                            "reconnect to the database server."));
     3353        addChild(wolEnabled);
     3354
     3355        wolReconnect = new TransMythUISpinBoxSetting(0, 60, 1, true);
     3356        wolReconnect->setLabel(QObject::tr("Reconnect time"));
     3357        wolReconnect->setHelpText(QObject::tr("The time in seconds to wait for "
     3358                                          "the server to wake up."));
     3359        wolEnabled->addTargetedChild("1",wolReconnect);
     3360
     3361        wolRetry = new TransMythUISpinBoxSetting(1, 10, 1, true);
     3362        wolRetry->setLabel(QObject::tr("Retry attempts"));
     3363        wolRetry->setHelpText(QObject::tr("The number of retries to wake the "
     3364                                      "server before the frontend gives "
     3365                                      "up."));
     3366        wolEnabled->addTargetedChild("1",wolRetry);
     3367
     3368        wolCommand = new TransTextEditSetting();
     3369        wolCommand->setLabel(QObject::tr("Wake command"));
     3370        wolCommand->setHelpText(QObject::tr("The command executed on this "
     3371                                        "frontend to wake up the database "
     3372                                        "server (eg. sudo /etc/init.d/mysql "
     3373                                        "restart)."));
     3374        wolEnabled->addTargetedChild("1",wolCommand);
     3375    }
     3376
     3377    void Load(void)
     3378    {
     3379
     3380        DatabaseParams params = gContext->GetDatabaseParams();
     3381
     3382        if (params.dbHostName.isEmpty() ||
     3383            params.dbUserName.isEmpty() ||
     3384            params.dbPassword.isEmpty() ||
     3385            params.dbName.isEmpty())
     3386            setHelpText(getHelpText() + "\n" +
     3387                           QObject::tr("Required fields are"
     3388                                       " marked with an asterisk (*)."));
     3389
     3390        if (params.dbHostName.isEmpty())
     3391        {
     3392            dbHostName->setLabel("* " + dbHostName->getLabel());
     3393            dbHostName->setValue(m_DBhostOverride);
     3394        }
     3395        else
     3396            dbHostName->setValue(params.dbHostName);
     3397
     3398        dbHostPing->setValue(params.dbHostPing);
     3399
     3400        if (params.dbPort)
     3401            dbPort->setValue(QString::number(params.dbPort));
     3402
     3403        dbUserName->setValue(params.dbUserName);
     3404        if (params.dbUserName.isEmpty())
     3405            dbUserName->setLabel("* " + dbUserName->getLabel());
     3406        dbPassword->setValue(params.dbPassword);
     3407        if (params.dbPassword.isEmpty())
     3408            dbPassword->setLabel("* " + dbPassword->getLabel());
     3409        dbName->setValue(params.dbName);
     3410        if (params.dbName.isEmpty())
     3411            dbName->setLabel("* " + dbName->getLabel());
     3412
     3413        localEnabled->setValue(params.localEnabled);
     3414        localHostName->setValue(params.localHostName);
     3415
     3416        wolEnabled->setValue(params.wolEnabled);
     3417        wolReconnect->setValue(params.wolReconnect);
     3418        wolRetry->setValue(params.wolRetry);
     3419        wolCommand->setValue(params.wolCommand);
     3420        //TODO set all the children's m_haveChanged to false
     3421    };
     3422    void Save(void)
     3423    {
     3424        DatabaseParams params = gContext->GetDatabaseParams();
     3425
     3426        params.dbHostName    = dbHostName->getValue();
     3427        params.dbHostPing    = dbHostPing->boolValue();
     3428        params.dbPort        = dbPort->getValue().toInt();
     3429        params.dbUserName    = dbUserName->getValue();
     3430        params.dbPassword    = dbPassword->getValue();
     3431        params.dbName        = dbName->getValue();
     3432        params.dbType        = "QMYSQL";
     3433
     3434        params.localEnabled  = localEnabled->boolValue();
     3435        params.localHostName = localHostName->getValue();
     3436
     3437        params.wolEnabled    = wolEnabled->boolValue();
     3438        params.wolReconnect  = wolReconnect->intValue();
     3439        params.wolRetry      = wolRetry->intValue();
     3440        params.wolCommand    = wolCommand->getValue();
     3441
     3442        gContext->SaveDatabaseParams(params);
     3443        //TODO set all the children's m_haveChanged to false
     3444    };
     3445
     3446  protected:
     3447    TransTextEditSetting       *dbHostName;
     3448    TransMythUICheckBoxSetting *dbHostPing;
     3449    TransTextEditSetting       *dbPort;
     3450    TransTextEditSetting       *dbName;
     3451    TransTextEditSetting       *dbUserName;
     3452    TransTextEditSetting       *dbPassword;
     3453    TransMythUICheckBoxSetting *localEnabled;
     3454    TransTextEditSetting       *localHostName;
     3455    TransMythUICheckBoxSetting *wolEnabled;
     3456    TransMythUISpinBoxSetting  *wolReconnect;
     3457    TransMythUISpinBoxSetting  *wolRetry;
     3458    TransTextEditSetting       *wolCommand;
     3459
     3460    QString              m_DBhostOverride;
     3461};
     3462
     3463/* end of duplicated code form DatabaseSettings */
     3464
    32583465MainGeneralSettings::MainGeneralSettings()
    32593466{
    3260     DatabaseSettings::addDatabaseSettings(this);
     3467    //DatabaseSettings::addDatabaseSettings(this);
     3468    setLabel(QObject::tr("Main Settings"));
     3469
     3470    addChild(new DatabaseGroupSetting());
    32613471
    3262     VerticalConfigurationGroup *pin =
    3263         new VerticalConfigurationGroup(false, true, false, false);
     3472    GroupSetting *pin = new GroupSetting();
    32643473    pin->setLabel(QObject::tr("Settings Access"));
    32653474    pin->addChild(SetupPinCodeRequired());
    32663475    pin->addChild(SetupPinCode());
    32673476    addChild(pin);
    32683477
    3269     VerticalConfigurationGroup *general =
    3270         new VerticalConfigurationGroup(false, true, false, false);
     3478    GroupSetting *general = new GroupSetting();
    32713479    general->setLabel(QObject::tr("General"));
    32723480    general->addChild(UseVirtualKeyboard());
    32733481    general->addChild(ScreenShotPath());
    32743482    addChild(general);
    32753483
    3276     VerticalConfigurationGroup *media =
    3277         new VerticalConfigurationGroup(false, true, false, false);
     3484    GroupSetting *media = new GroupSetting();
    32783485    media->setLabel(QObject::tr("Media Monitor"));
    3279     MythMediaSettings *mediaMon = new MythMediaSettings();
    3280     media->addChild(mediaMon);
     3486    media->addChild(EnableMediaMon());
    32813487    addChild(media);
    32823488
    3283     VerticalConfigurationGroup *shutdownSettings =
    3284         new VerticalConfigurationGroup(true, true, false, false);
     3489    GroupSetting *shutdownSettings = new GroupSetting();
    32853490    shutdownSettings->setLabel(QObject::tr("Shutdown/Reboot Settings"));
    32863491    shutdownSettings->addChild(OverrideExitMenu());
    32873492    shutdownSettings->addChild(HaltCommand());
    32883493    shutdownSettings->addChild(RebootCommand());
    32893494    addChild(shutdownSettings);
    32903495
    3291     VerticalConfigurationGroup *remotecontrol =
    3292         new VerticalConfigurationGroup(false, true, false, false);
     3496    GroupSetting *remotecontrol = new GroupSetting();
    32933497    remotecontrol->setLabel(QObject::tr("Remote Control"));
    32943498    remotecontrol->addChild(LircDaemonDevice());
    32953499    remotecontrol->addChild(NetworkControlEnabled());
    3296     remotecontrol->addChild(NetworkControlPort());
    3297     remotecontrol->addChild(UDPNotifyPort());
    32983500    addChild(remotecontrol);
    32993501}
    33003502
    3301 PlaybackSettings::PlaybackSettings()
     3503void MainGeneralSettings::applyChange()
    33023504{
    3303     uint i = 0, total = 8;
    3304 #if CONFIG_DARWIN
    3305     total += 2;
    3306 #endif // USING_DARWIN
    3307 
    3308 
    3309     VerticalConfigurationGroup* general1 =
    3310         new VerticalConfigurationGroup(false);
    3311     general1->setLabel(QObject::tr("General Playback") +
    3312                       QString(" (%1/%2)").arg(++i).arg(total));
    3313 
    3314     HorizontalConfigurationGroup *columns =
    3315         new HorizontalConfigurationGroup(false, false, true, true);
    3316 
    3317     VerticalConfigurationGroup *column1 =
    3318         new VerticalConfigurationGroup(false, false, true, true);
    3319     column1->addChild(RealtimePriority());
    3320     column1->addChild(DecodeExtraAudio());
    3321     column1->addChild(JumpToProgramOSD());
    3322     columns->addChild(column1);
     3505    QStringList strlist( QString("REFRESH_BACKEND") );
     3506    gCoreContext->SendReceiveStringList(strlist);
     3507}
    33233508
    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);
     3509PlaybackSettings::PlaybackSettings()
     3510{
     3511    setLabel(QObject::tr("Playback settings"));
     3512
     3513    GroupSetting* general = new GroupSetting();
     3514    general->setLabel(QObject::tr("General Playback"));
     3515    general->addChild(RealtimePriority());
     3516    general->addChild(DecodeExtraAudio());
     3517    general->addChild(JumpToProgramOSD());
     3518    general->addChild(ClearSavedPosition());
     3519    general->addChild(AltClearSavedPosition());
     3520    general->addChild(AutomaticSetWatched());
     3521    general->addChild(ContinueEmbeddedTVPlay());
     3522    general->addChild(LiveTVIdleTimeout());
     3523
     3524    GroupSetting* oscan = new GroupSetting();
     3525    oscan->setLabel(QObject::tr("Scaling"));
     3526    oscan->addChild(VertScanPercentage());
     3527    oscan->addChild(YScanDisplacement());
     3528    oscan->addChild(HorizScanPercentage());
     3529    oscan->addChild(XScanDisplacement());
     3530    general->addChild(oscan);
     3531
     3532    GroupSetting* aspect_fill = new GroupSetting();
     3533    aspect_fill->setLabel(QObject::tr("Aspect ratio & Zoom"));
    33563534    aspect_fill->addChild(AspectOverride());
    33573535    aspect_fill->addChild(AdjustFill());
    33583536
    3359     general2->addChild(oscan);
    3360     general2->addChild(aspect_fill);
    3361     general2->addChild(LetterboxingColour());
    3362     general2->addChild(PIPLocationComboBox());
    3363     general2->addChild(PlaybackExitPrompt());
    3364     general2->addChild(EndOfRecordingExitPrompt());
    3365     addChild(general2);
    3366 
     3537    general->addChild(aspect_fill);
     3538    general->addChild(LetterboxingColour());
     3539    general->addChild(PIPLocationComboBox());
     3540    general->addChild(PlaybackExitPrompt());
     3541    general->addChild(EndOfRecordingExitPrompt());
     3542    addChild(general);
     3543/*TODO
    33673544    QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
    33683545    addChild(new PlaybackProfileConfigs(tmp));
     3546*/
     3547
     3548    //addChild(new PlaybackProfileConfigsButton());
    33693549
    3370     VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    3371     pbox->setLabel(QObject::tr("View Recordings") +
    3372                    QString(" (%1/%2)").arg(++i).arg(total));
     3550
     3551    GroupSetting* pbox = new GroupSetting();
     3552    pbox->setLabel(QObject::tr("View Recordings"));
    33733553    pbox->addChild(PlayBoxOrdering());
    33743554    pbox->addChild(PlayBoxEpisodeSort());
    33753555    // Disabled until we re-enable live previews
    33763556    // pbox->addChild(PlaybackPreview());
    33773557    // pbox->addChild(HWAccelPlaybackPreview());
    33783558    pbox->addChild(PBBStartInTitle());
    3379     addChild(pbox);
    33803559
    3381     VerticalConfigurationGroup* pbox2 = new VerticalConfigurationGroup(false);
    3382     pbox2->setLabel(QObject::tr("Recording Groups") +
    3383                     QString(" (%1/%2)").arg(++i).arg(total));
     3560
     3561    GroupSetting* pbox2 = new GroupSetting();
     3562    pbox2->setLabel(QObject::tr("Recording Groups"));
    33843563    pbox2->addChild(DisplayRecGroup());
    33853564    pbox2->addChild(QueryInitialFilter());
    33863565    pbox2->addChild(RememberRecGroup());
    33873566    pbox2->addChild(UseGroupNameAsAllPrograms());
    3388     addChild(pbox2);
    3389 
    3390     VerticalConfigurationGroup* pbox3 = new VerticalConfigurationGroup(false);
    3391     pbox3->setLabel(QObject::tr("View Recordings") +
    3392                     QString(" (%1/%2)").arg(++i).arg(total));
    3393     pbox3->addChild(DisplayGroupTitleSort());
    3394     pbox3->addChild(new WatchListSettings());
    3395     addChild(pbox3);
    3396 
    3397     VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
    3398     seek->setLabel(QObject::tr("Seeking") +
    3399                    QString(" (%1/%2)").arg(++i).arg(total));
     3567    pbox->addChild(pbox2);
     3568
     3569    pbox->addChild(DisplayGroupTitleSort());
     3570    pbox->addChild(PlaybackWatchList());
     3571    addChild(pbox);
     3572
     3573    GroupSetting* seek = new GroupSetting();
     3574    seek->setLabel(QObject::tr("Seeking"));
    34003575    seek->addChild(SmartForward());
    34013576    seek->addChild(FFRewReposTime());
    34023577    seek->addChild(FFRewReverse());
    34033578    seek->addChild(ExactSeeking());
    34043579    addChild(seek);
    34053580
    3406     VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
    3407     comms->setLabel(QObject::tr("Commercial Skip") +
    3408                     QString(" (%1/%2)").arg(++i).arg(total));
     3581
     3582
     3583    GroupSetting* comms = new GroupSetting();
     3584    comms->setLabel(QObject::tr("Commercial Skip"));
    34093585    comms->addChild(AutoCommercialSkip());
    34103586    comms->addChild(CommRewindAmount());
    34113587    comms->addChild(CommNotifyAmount());
     3588    //TODO mixing Host setting with Gloabal setting, not very clear for the user
    34123589    comms->addChild(MaximumCommercialSkip());
    34133590    comms->addChild(MergeShortCommBreaks());
    34143591    addChild(comms);
    34153592
    34163593#if CONFIG_DARWIN
    3417     VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
    3418     mac1->setLabel(QObject::tr("Mac OS X Video Settings") +
    3419                    QString(" (%1/%2)").arg(++i).arg(total));
    3420     mac1->addChild(MacGammaCorrect());
    3421     mac1->addChild(MacScaleUp());
    3422     mac1->addChild(MacFullSkip());
    3423     addChild(mac1);
    3424 
    3425     VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
    3426     mac2->setLabel(QObject::tr("Mac OS X Video Settings") +
    3427                    QString(" (%1/%2)").arg(++i).arg(total));
    3428     mac2->addChild(new MacMainSettings());
    3429     mac2->addChild(new MacFloatSettings());
    3430 
    3431     HorizontalConfigurationGroup *row =
    3432         new HorizontalConfigurationGroup(false, false, true, true);
    3433     row->addChild(new MacDockSettings());
    3434     row->addChild(new MacDesktopSettings());
    3435     mac2->addChild(row);
    3436 
    3437     addChild(mac2);
     3594    GroupSetting* ma1 = new GroupSetting(false);
     3595    mac->setLabel(QObject::tr("Mac OS X Video Settings"));
     3596    mac->addChild(MacGammaCorrect());
     3597    mac->addChild(MacScaleUp());
     3598    mac->addChild(MacFullSkip());
     3599
     3600    mac->addChild(MacMainEnabled());
     3601    mac->addChild(MacFloatEnabled());
     3602    mac->addChild(MacDockEnabled());
     3603    mac->addChild(MacDesktopEnabled());
     3604    mac->addChild(row);
     3605
     3606    addChild(mac);
    34383607#endif
    34393608}
    34403609
    34413610OSDSettings::OSDSettings()
    34423611{
    3443     VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
    3444     osd->setLabel(QObject::tr("On-screen Display"));
     3612    setLabel(QObject::tr("On-screen Display"));
    34453613
    3446     osd->addChild(EnableMHEG());
    3447     osd->addChild(PersistentBrowseMode());
    3448     osd->addChild(BrowseAllTuners());
    3449     osd->addChild(CCBackground());
    3450     osd->addChild(DefaultCCMode());
    3451     osd->addChild(PreferCC708());
    3452     osd->addChild(SubtitleFont());
    3453     osd->addChild(OSDCC708TextZoomPercentage());
    3454     osd->addChild(SubtitleCodec());
    3455     addChild(osd);
     3614    addChild(EnableMHEG());
     3615    addChild(PersistentBrowseMode());
     3616    addChild(BrowseAllTuners());
     3617    addChild(CCBackground());
     3618    addChild(DefaultCCMode());
     3619    addChild(PreferCC708());
     3620    addChild(SubtitleFont());
     3621    addChild(OSDCC708TextZoomPercentage());
     3622    addChild(SubtitleCodec());
    34563623
    34573624    //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
    34583625    //cc->setLabel(QObject::tr("Closed Captions"));
    OSDSettings::OSDSettings()  
    34673634
    34683635GeneralSettings::GeneralSettings()
    34693636{
    3470     VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false);
     3637    GroupSetting* general = new GroupSetting();
    34713638    general->setLabel(QObject::tr("General (Basic)"));
    34723639    general->addChild(ChannelOrdering());
    34733640    general->addChild(ChannelFormat());
    34743641    general->addChild(LongChannelFormat());
     3642    //LiveTVPriority (backend setting) should probably not be mixed with frontend settings
    34753643    general->addChild(LiveTVPriority());
    34763644    addChild(general);
    34773645
    3478     VerticalConfigurationGroup* autoexp = new VerticalConfigurationGroup(false);
     3646    GroupSetting* autoexp = new GroupSetting();
    34793647    autoexp->setLabel(QObject::tr("General (Auto-Expire)"));
    34803648    autoexp->addChild(AutoExpireMethod());
    3481 
    3482     VerticalConfigurationGroup *expgrp0 =
    3483         new VerticalConfigurationGroup(false, false, true, true);
    3484     expgrp0->addChild(AutoExpireDefault());
    3485     expgrp0->addChild(RerecordWatched());
    3486     expgrp0->addChild(AutoExpireWatchedPriority());
    3487 
    3488     VerticalConfigurationGroup *expgrp1 =
    3489         new VerticalConfigurationGroup(false, false, true, true);
    3490     expgrp1->addChild(AutoExpireLiveTVMaxAge());
    3491     expgrp1->addChild(AutoExpireDayPriority());
    3492     expgrp1->addChild(AutoExpireExtraSpace());
    3493 
    3494     HorizontalConfigurationGroup *expgrp =
    3495         new HorizontalConfigurationGroup(false, false, true, true);
    3496     expgrp->addChild(expgrp0);
    3497     expgrp->addChild(expgrp1);
    3498 
    3499     autoexp->addChild(expgrp);
    3500     autoexp->addChild(new DeletedExpireOptions());
    3501 
     3649    autoexp->addChild(AutoExpireDefault());
     3650    autoexp->addChild(RerecordWatched());
     3651    autoexp->addChild(AutoExpireWatchedPriority());
     3652    autoexp->addChild(AutoExpireLiveTVMaxAge());
     3653    autoexp->addChild(AutoExpireDayPriority());
     3654    autoexp->addChild(AutoExpireExtraSpace());
     3655    autoexp->addChild(AutoExpireInsteadOfDelete());
    35023656    addChild(autoexp);
    35033657
    3504     VerticalConfigurationGroup* jobs = new VerticalConfigurationGroup(false);
     3658    GroupSetting* jobs = new GroupSetting();
    35053659    jobs->setLabel(QObject::tr("General (Jobs)"));
    35063660    jobs->addChild(CommercialSkipMethod());
    35073661    jobs->addChild(CommFlagFast());
    GeneralSettings::GeneralSettings()  
    35093663    jobs->addChild(DefaultTranscoder());
    35103664    jobs->addChild(DeferAutoTranscodeDays());
    35113665
    3512     VerticalConfigurationGroup* autogrp0 =
    3513         new VerticalConfigurationGroup(false, false, true, true);
    3514     autogrp0->addChild(AutoMetadataLookup());
    3515     autogrp0->addChild(AutoCommercialFlag());
    3516     autogrp0->addChild(AutoTranscode());
    3517 
    3518     VerticalConfigurationGroup* autogrp1 =
    3519         new VerticalConfigurationGroup(false, false, true, true);
    3520     autogrp0->addChild(AutoRunUserJob(1));
    3521     autogrp1->addChild(AutoRunUserJob(2));
    3522     autogrp1->addChild(AutoRunUserJob(3));
    3523     autogrp1->addChild(AutoRunUserJob(4));
    3524 
    3525     HorizontalConfigurationGroup *autogrp =
    3526         new HorizontalConfigurationGroup(true, true, false, true);
     3666    GroupSetting *autogrp = new GroupSetting();
    35273667    autogrp->setLabel(
    35283668        QObject::tr("Default Job Queue Settings for New Scheduled Recordings"));
    3529     autogrp->addChild(autogrp0);
    3530     autogrp->addChild(autogrp1);
     3669    autogrp->addChild(AutoMetadataLookup());
     3670    autogrp->addChild(AutoCommercialFlag());
     3671    autogrp->addChild(AutoTranscode());
     3672    autogrp->addChild(AutoRunUserJob(1));
     3673    autogrp->addChild(AutoRunUserJob(2));
     3674    autogrp->addChild(AutoRunUserJob(3));
     3675    autogrp->addChild(AutoRunUserJob(4));
     3676
    35313677    jobs->addChild(autogrp);
    35323678
    35333679    addChild(jobs);
    35343680
    3535     VerticalConfigurationGroup* general2 = new VerticalConfigurationGroup(false);
     3681    GroupSetting* general2 = new GroupSetting();
    35363682    general2->setLabel(QObject::tr("General (Advanced)"));
    35373683    general2->addChild(RecordPreRoll());
    35383684    general2->addChild(RecordOverTime());
    35393685    general2->addChild(CategoryOverTimeSettings());
    35403686    addChild(general2);
    35413687
    3542     VerticalConfigurationGroup* changrp = new VerticalConfigurationGroup(false);
     3688    GroupSetting* changrp = new GroupSetting();
    35433689    changrp->setLabel(QObject::tr("General (Channel Groups)"));
    3544     ChannelGroupSettings *changroupsettings = new ChannelGroupSettings();
    3545     changrp->addChild(changroupsettings);
     3690    changrp->addChild(ChannelGroupRememberLast());
    35463691    changrp->addChild(BrowseChannelGroup());
    35473692    addChild(changrp);
    35483693}
    35493694
    35503695EPGSettings::EPGSettings()
    35513696{
    3552     VerticalConfigurationGroup* epg = new VerticalConfigurationGroup(false);
    3553     epg->setLabel(QObject::tr("Program Guide") + " 1/1");
    3554     epg->addChild(WatchTVGuide());
    3555     epg->addChild(DefaultTVChannel());
    3556     epg->addChild(EPGRecThreshold());
    3557     addChild(epg);
     3697    setLabel(QObject::tr("Program Guide"));
     3698    addChild(WatchTVGuide());
     3699    addChild(DefaultTVChannel());
     3700    addChild(EPGRecThreshold());
    35583701}
    35593702
    35603703GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()
    35613704{
    3562     VerticalConfigurationGroup* sched = new VerticalConfigurationGroup(false);
     3705    GroupSetting* sched = new GroupSetting();
    35633706    sched->setLabel(QObject::tr("Scheduler Options"));
    35643707
    35653708    sched->addChild(GRSchedMoveHigher());
    GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()  
    35723715    sched->addChild(GRAutoRecPriority());
    35733716    addChild(sched);
    35743717
    3575     VerticalConfigurationGroup* access = new VerticalConfigurationGroup(false);
     3718    GroupSetting* access = new GroupSetting();
    35763719    access->setLabel(QObject::tr("Accessibility Options"));
    35773720
    35783721    access->addChild(GRSignLangRecPriority());
    GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()  
    35823725    access->addChild(GRAudioDescRecPriority());
    35833726    addChild(access);
    35843727
    3585     VerticalConfigurationGroup* rtype = new VerticalConfigurationGroup(false);
     3728    GroupSetting* rtype = new GroupSetting();
    35863729    rtype->setLabel(QObject::tr("Recording Type Priority Settings"));
    35873730
    35883731    rtype->addChild(GRSingleRecordRecPriority());
    GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()  
    35973740
    35983741AppearanceSettings::AppearanceSettings()
    35993742{
    3600     VerticalConfigurationGroup* screen = new VerticalConfigurationGroup(false);
     3743    GroupSetting* screen = new GroupSetting();
    36013744    screen->setLabel(QObject::tr("Theme") + " / " + QObject::tr("Screen Settings"));
     3745    addChild(screen);
    36023746
    36033747    screen->addChild(MenuTheme());
    36043748
    AppearanceSettings::AppearanceSettings()  
    36113755//    screen->addChild(DisplaySizeHeight());
    36123756//    screen->addChild(DisplaySizeWidth());
    36133757
    3614     VerticalConfigurationGroup *column1 =
    3615         new VerticalConfigurationGroup(false, false, false, false);
    3616 
    3617     column1->addChild(GuiWidth());
    3618     column1->addChild(GuiHeight());
    3619     column1->addChild(GuiOffsetX());
    3620     column1->addChild(GuiOffsetY());
    3621 
    3622     VerticalConfigurationGroup *column2 =
    3623         new VerticalConfigurationGroup(false, false, false, false);
    3624 
    3625     column2->addChild(GuiSizeForTV());
    3626     column2->addChild(HideMouseCursor());
    3627     column2->addChild(RunInWindow());
    3628     column2->addChild(UseFixedWindowSize());
    3629 
    3630     HorizontalConfigurationGroup *columns =
    3631         new HorizontalConfigurationGroup(false, false, false, false);
     3758    GroupSetting *guiDimension =
     3759        new GroupSetting();
     3760    guiDimension->setLabel(QObject::tr("Gui dimension"));
     3761    //TODO display an helpfull value such as 640x480+10+2
    36323762
    3633     columns->addChild(column1);
    3634     columns->addChild(column2);
     3763    guiDimension->addChild(GuiWidth());
     3764    guiDimension->addChild(GuiHeight());
     3765    guiDimension->addChild(GuiOffsetX());
     3766    guiDimension->addChild(GuiOffsetY());
     3767    screen->addChild(guiDimension);
    36353768
    3636     screen->addChild(columns);
    3637 
    3638     addChild(screen);
     3769    screen->addChild(GuiSizeForTV());
     3770    screen->addChild(HideMouseCursor());
     3771    screen->addChild(RunInWindow());
     3772    screen->addChild(UseFixedWindowSize());
    36393773
    36403774#if defined(USING_XRANDR) || CONFIG_DARWIN
    36413775    const vector<DisplayResScreen> scr = GetVideoModes();
    36423776    if (!scr.empty())
    3643         addChild(new VideoModeSettings());
     3777        addChild(UseVideoModes());
    36443778#endif
    3645     VerticalConfigurationGroup* dates = new VerticalConfigurationGroup(false);
     3779    GroupSetting* dates = new GroupSetting();
    36463780    dates->setLabel(QObject::tr("Localization"));
    36473781    dates->addChild(MythLanguage());
    36483782    dates->addChild(ISO639PreferredLanguage(0));
    AppearanceSettings::AppearanceSettings()  
    36523786    dates->addChild(MythTimeFormat());
    36533787    addChild(dates);
    36543788
    3655     addChild(new LcdSettings());
     3789    addChild(LCDEnable());
     3790}
     3791
     3792void AppearanceSettings::applyChange()
     3793{
     3794    qApp->processEvents();
     3795    GetMythMainWindow()->JumpTo("Reload Theme");
    36563796}
    36573797
    36583798// vim:set sw=4 ts=4 expandtab:
  • mythtv/programs/mythfrontend/globalsettings.h

    diff --git a/mythtv/programs/mythfrontend/globalsettings.h b/mythtv/programs/mythfrontend/globalsettings.h
    index 93e774a..68736f7 100644
    a b  
    77#include "settings.h"
    88#include "mythcontext.h"
    99#include "videodisplayprofile.h"
     10#include "standardsettings.h"
    1011
    1112#include <QMutex>
    1213
    1314class QFileInfo;
    1415
    15 class PlaybackSettings : public ConfigurationWizard
     16class PlaybackSettings : public GroupSetting //ConfigurationWizard
    1617{
    1718  public:
    1819    PlaybackSettings();
    1920};
    2021
    21 class OSDSettings: virtual public ConfigurationWizard
     22//TODO check the purpose of virtual here
     23//class OSDSettings: virtual public ConfigurationWizard
     24class OSDSettings: public GroupSetting
    2225{
    2326  public:
    2427    OSDSettings();
    2528};
    2629
    27 class GeneralSettings : public ConfigurationWizard
     30class GeneralSettings : public GroupSetting
    2831{
    2932  public:
    3033    GeneralSettings();
    3134};
    3235
    33 class EPGSettings : public ConfigurationWizard
     36class EPGSettings : public GroupSetting
    3437{
    3538  public:
    3639    EPGSettings();
    3740};
    3841
    39 class AppearanceSettings : public ConfigurationWizard
     42class AppearanceSettings : public GroupSetting
    4043{
    4144  public:
    4245    AppearanceSettings();
     46    virtual void applyChange();
    4347};
    4448
    45 class MainGeneralSettings : public ConfigurationWizard
     49class HostRefreshRateComboBoxSetting : public HostComboBoxSetting
     50{
     51    Q_OBJECT
     52  public:
     53    HostRefreshRateComboBoxSetting(const QString &name) :
     54        HostComboBoxSetting(name) { }
     55    virtual ~HostRefreshRateComboBoxSetting() { ; }
     56
     57  public slots:
     58    virtual void ChangeResolution(const QString& resolution);
     59
     60  private:
     61    static const vector<double> GetRefreshRates(const QString &resolution);
     62};
     63
     64
     65class MainGeneralSettings : public GroupSetting
    4666{
    4767  public:
    4868    MainGeneralSettings();
     69    virtual void applyChange();
    4970};
    5071
    51 class GeneralRecPrioritiesSettings : public ConfigurationWizard
     72class GeneralRecPrioritiesSettings : public GroupSetting
    5273{
    5374  public:
    5475    GeneralRecPrioritiesSettings();
  • mythtv/programs/mythfrontend/main.cpp

    diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp
    index 259e020..9a1ec90 100644
    a b  
    1 #include <unistd.h>
    21#include <fcntl.h>
    32#include <signal.h>
    43#include <cerrno>
    using namespace std;  
    7473#include "themechooser.h"
    7574#include "mythversion.h"
    7675#include "taskqueue.h"
     76#include "standardsettings.h"
    7777
    7878// Video
    7979#include "cleanup.h"
    namespace  
    138138
    139139            if (passwordValid)
    140140            {
    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;
    143151            }
    144152            else
    145153            {
    static void TVMenuCallback(void *data, QString &selection)  
    838846        startPrevious();
    839847    else if (sel == "settings appearance")
    840848    {
    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");
    844851
    845         if (kDialogCodeRejected != res)
     852        if (ssd->Create())
    846853        {
    847             qApp->processEvents();
    848             GetMythMainWindow()->JumpTo("Reload Theme");
     854            ssd->loadSettings(new AppearanceSettings());
     855            mainStack->AddScreen(ssd);
    849856        }
     857        else
     858            delete ssd;
    850859    }
    851860    else if (sel == "settings themechooser")
    852861    {
    static void TVMenuCallback(void *data, QString &selection)  
    898907    }
    899908    else if (sel == "settings general")
    900909    {
    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;
    903920    }
    904921    else if (sel == "settings audiogeneral")
    905922    {
    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;
    908933    }
    909934    else if (sel == "settings maingeneral")
    910935    {
    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;
    915946    }
    916947    else if (sel == "settings playback")
    917948    {
    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;
    920961    }
    921962    else if (sel == "settings osd")
    922963    {
    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;
    925974    }
    926975    else if (sel == "settings epg")
    927976    {
    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;
    930987    }
    931988    else if (sel == "settings channelgroups")
    932989    {
    static void TVMenuCallback(void *data, QString &selection)  
    935992    }
    936993    else if (sel == "settings generalrecpriorities")
    937994    {
    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;
    9401005    }
    9411006    else if (sel == "settings channelrecpriorities")
    9421007    {
  • 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  
    3939HEADERS += videofilter.h                videolist.h
    4040HEADERS += videoplayersettings.h        videodlg.h
    4141HEADERS += videoglobalsettings.h        upnpscanner.h
    42 HEADERS += commandlineparser.h
     42HEADERS += commandlineparser.h          standardsettings.h
    4343
    4444SOURCES += main.cpp playbackbox.cpp viewscheduled.cpp audiogeneralsettings.cpp
    4545SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp
    SOURCES += videoplayercommand.cpp videopopups.cpp  
    6060SOURCES += videofilter.cpp              videolist.cpp
    6161SOURCES += videoplayersettings.cpp      videodlg.cpp
    6262SOURCES += videoglobalsettings.cpp      upnpscanner.cpp
    63 SOURCES += commandlineparser.cpp
     63SOURCES += commandlineparser.cpp        standardsettings.cpp
    6464
    6565HEADERS += serviceHosts/frontendServiceHost.h
    6666HEADERS += services/frontend.h
  • new file mythtv/programs/mythfrontend/standardsettings.cpp

    diff --git a/mythtv/programs/mythfrontend/standardsettings.cpp b/mythtv/programs/mythfrontend/standardsettings.cpp
    new file mode 100755
    index 0000000..901f121
    - +  
     1#include "standardsettings.h"
     2#include <QCoreApplication>
     3
     4#include <mythcontext.h>
     5#include <mythmainwindow.h>
     6#include <mythdialogbox.h>
     7#include <mythuispinbox.h>
     8#include <mythuitext.h>
     9#include <mythuibutton.h>
     10#include "mythlogging.h"
     11
     12void MythUIButtonListItemSetting::ShouldUpdate(StandardSetting *setting)
     13{
     14    setting->updateButton(this);
     15}
     16
     17StandardSetting::StandardSetting(Storage *_storage) :
     18    NewConfigurable(_storage),
     19    m_haveChanged(false),
     20    m_parent(0)
     21
     22{
     23}
     24
     25StandardSetting::~StandardSetting()
     26{   
     27    QList<StandardSetting *>::const_iterator i;
     28    for (i = m_children.constBegin(); i != m_children.constEnd(); ++i)
     29        delete *i;
     30    m_children.clear();
     31
     32    QMap<QString, QList<StandardSetting *> >::const_iterator iMap;
     33    for (iMap = m_targets.constBegin(); iMap != m_targets.constEnd(); ++iMap)
     34    {
     35        for (i = (*iMap).constBegin(); i != (*iMap).constEnd(); ++i)
     36            delete *i;
     37    }
     38    m_targets.clear();
     39}
     40
     41MythUIButtonListItem * StandardSetting::createButton(MythUIButtonList * list)
     42{
     43    MythUIButtonListItemSetting *item = new MythUIButtonListItemSetting(list, label);
     44    item->SetData(qVariantFromValue(this));
     45    connect(this, SIGNAL(ShouldRedraw(StandardSetting *)), item, SLOT(ShouldUpdate(StandardSetting *)));
     46    updateButton(item);
     47    return item;
     48}
     49
     50void StandardSetting::setEnabled(bool b)
     51{
     52    LOG(VB_GENERAL, LOG_ERR, QString("StandardSetting::setEnabled(%1) for %2")
     53        .arg(b)
     54        .arg(getLabel()));
     55    NewConfigurable::setEnabled(b);
     56    emit ShouldRedraw(this);
     57}
     58
     59void StandardSetting::setParent(StandardSetting *parent)
     60{
     61    m_parent = parent;
     62}
     63
     64StandardSetting * StandardSetting::getParent()
     65{
     66    return m_parent;
     67}
     68
     69void StandardSetting::addChild(StandardSetting *child)
     70{
     71    if (!child)return;
     72    m_children.append(child);
     73    child->setParent(this);
     74}
     75
     76void StandardSetting::updateButton(MythUIButtonListItem *item)
     77{
     78    item->setEnabled(isEnabled());
     79    item->SetText(label);
     80    item->SetText(settingValue,"value");
     81    item->SetText(getHelpText(),"description");
     82    item->setDrawArrow (haveSubSettings());
     83
     84}
     85
     86void StandardSetting::addTargetedChild(const QString &value, StandardSetting * setting)
     87{
     88    m_targets[value].append(setting);
     89    setting->setParent(this);
     90}
     91
     92
     93QList<StandardSetting *> *StandardSetting::getSubSettings()
     94{
     95    if (m_targets.contains(settingValue) && m_targets[settingValue].size()>0)
     96            return &m_targets[settingValue];
     97    return &m_children;
     98}
     99
     100bool StandardSetting::haveSubSettings()
     101{
     102    QList<StandardSetting *> * subSettings=getSubSettings();
     103    return (subSettings!=NULL && subSettings->size()>0);
     104}
     105
     106void StandardSetting::setValue(const QString &newValue)
     107{
     108    settingValue = newValue;
     109    emit valueChanged(settingValue);
     110    emit ShouldRedraw(this);
     111}
     112
     113bool StandardSetting::haveChanged()
     114{
     115    if (m_haveChanged) return true;
     116
     117    //we check only the relevant children
     118    QList<StandardSetting *> *children = getSubSettings();
     119    if (children==NULL) return false;
     120    QList<StandardSetting *>::const_iterator i;
     121    bool haveChanged = false;
     122    for (i = children->constBegin(); !haveChanged && i != children->constEnd(); ++i)
     123        haveChanged=(*i)->haveChanged();
     124
     125    return haveChanged;
     126}
     127
     128void StandardSetting::Load(void)
     129{
     130
     131/*    Storage *s = GetStorage();
     132    if (s)s->Load();*/
     133
     134    m_haveChanged=false;
     135
     136    LoadChildren();
     137}
     138
     139void StandardSetting::LoadChildren(void)
     140{
     141    QList<StandardSetting *>::const_iterator i;
     142    for (i = m_children.constBegin(); i != m_children.constEnd(); ++i)
     143        (*i)->Load();
     144
     145    QMap<QString, QList<StandardSetting *> >::const_iterator iMap;
     146    for (iMap = m_targets.constBegin(); iMap != m_targets.constEnd(); ++iMap)
     147    {
     148        for (i = (*iMap).constBegin(); i != (*iMap).constEnd(); ++i)
     149            (*i)->Load();
     150    }
     151   
     152}
     153void StandardSetting::Save(void)
     154{
     155/*
     156    Storage *s = GetStorage();
     157    if (s)s->Save();*/
     158
     159    m_haveChanged=false;
     160
     161    SaveChildren();
     162}
     163
     164void StandardSetting::SaveChildren(void)
     165{
     166    //we save only the relevant children
     167    QList<StandardSetting *> *children = getSubSettings();
     168    if (children==NULL) return;
     169    QList<StandardSetting *>::const_iterator i;
     170    for (i = children->constBegin(); i != children->constEnd(); ++i)
     171        (*i)->Save();
     172}
     173
     174/*******************************************************************************
     175                            Group Setting
     176********************************************************************************/
     177GroupSetting::GroupSetting():
     178    StandardSetting(this), TransientStorage()
     179{
     180}
     181
     182void GroupSetting::edit(MythScreenType * screen)
     183{
     184    if (!isEnabled())return;
     185    DialogCompletionEvent *dce =
     186            new DialogCompletionEvent("leveldown", 0, "", "");
     187    QCoreApplication::postEvent(screen, dce);
     188}
     189
     190void GroupSetting::updateButton(MythUIButtonListItem *item)
     191{
     192    item->setEnabled(isEnabled());
     193    item->SetText(label);
     194    item->SetText(settingValue,"value");
     195    item->SetText(getHelpText(),"description");
     196    item->setDrawArrow (haveSubSettings());
     197}
     198
     199
     200/*******************************************************************************
     201                            Text Setting
     202********************************************************************************/
     203
     204MythUITextEditSetting::MythUITextEditSetting(Storage *_storage):
     205    StandardSetting(_storage)
     206{
     207}
     208
     209void MythUITextEditSetting::edit(MythScreenType * screen)
     210{
     211    if (!isEnabled())return;
     212    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
     213
     214    MythTextInputDialog *settingdialog =
     215                                    new MythTextInputDialog(popupStack,
     216                                    getLabel(),FilterNone, false,settingValue);
     217
     218    if (settingdialog->Create())
     219    {
     220        settingdialog->SetReturnEvent(screen, "editsetting");
     221        popupStack->AddScreen(settingdialog);
     222    }
     223};
     224
     225void MythUITextEditSetting::resultEdit(DialogCompletionEvent *dce)
     226{
     227    if (settingValue!=dce->GetResultText())
     228    {
     229        setValue(dce->GetResultText());
     230        m_haveChanged=true;
     231    }
     232}
     233
     234/*******************************************************************************
     235                            ComboBoxSetting
     236********************************************************************************/
     237//TODO do something when rw=true
     238MythUIComboBoxSetting::MythUIComboBoxSetting(Storage *_storage, bool rw):
     239    StandardSetting(_storage)
     240{
     241}
     242
     243MythUIComboBoxSetting::~MythUIComboBoxSetting()
     244{
     245    m_labels.clear();
     246    m_values.clear();
     247}
     248
     249void MythUIComboBoxSetting::setValue(int value)
     250{
     251    if (value>=0 && value < m_values.size())
     252            //Why does the polymorphism does not work here
     253            StandardSetting::setValue(m_values.at(value));
     254}
     255
     256void MythUIComboBoxSetting::addSelection(const QString &label, QString value,
     257                                 bool select)
     258{
     259    value = (value.isEmpty()) ? label : value;
     260    m_labels.push_back(label);
     261    m_values.push_back(value);
     262
     263    if (select || !m_isSet)
     264    {
     265        //Why does the polymorphism does not work here
     266        StandardSetting::setValue(value);
     267        if (!m_isSet) m_isSet = true;
     268    }
     269}
     270
     271void MythUIComboBoxSetting::clearSelections()
     272{
     273    m_labels.clear();
     274    m_values.clear();
     275}
     276
     277void MythUIComboBoxSetting::updateButton(MythUIButtonListItem *item)
     278{
     279    item->setEnabled(isEnabled());
     280    item->SetText(label);
     281    int indexValue = m_values.indexOf(settingValue);
     282    if (indexValue >=0)
     283        item->SetText(m_labels.value(indexValue),"value");
     284    else
     285        item->SetText("","value");
     286    item->SetText(getHelpText(),"description");
     287    item->setDrawArrow (haveSubSettings());
     288}
     289
     290void MythUIComboBoxSetting::edit(MythScreenType * screen)
     291{
     292    if (!isEnabled())return;
     293    MythScreenStack *popupStack =
     294                            GetMythMainWindow()->GetStack("popup stack");
     295
     296    MythDialogBox * m_menuPopup =
     297            new MythDialogBox(getLabel(), popupStack, "optionmenu");
     298
     299    if (m_menuPopup->Create())
     300        popupStack->AddScreen(m_menuPopup);
     301
     302    m_menuPopup->SetReturnEvent(screen, "editsetting");
     303
     304    for (int i = 0; i < m_labels.size() && m_values.size(); ++i)
     305    {
     306        QString value = m_values.at(i);
     307        m_menuPopup->AddButton(m_labels.at(i),value,false,value==settingValue);
     308    }
     309}
     310
     311void MythUIComboBoxSetting::resultEdit(DialogCompletionEvent *dce)
     312{
     313    if (dce->GetResult()!=-1 && settingValue!=dce->GetData().toString())
     314    {
     315        //Why does the polymorphism does not work here
     316        StandardSetting::setValue(dce->GetData().toString());
     317        m_haveChanged=true;
     318    }
     319}
     320
     321
     322/*******************************************************************************
     323                            SpinBox Setting
     324********************************************************************************/
     325
     326MythUISpinBoxSetting::MythUISpinBoxSetting(Storage *_storage, int min, int max, int step, bool allow_single_step):
     327    StandardSetting(_storage),
     328    m_min(min),
     329    m_max(max),
     330    m_step(step),
     331    m_allow_single_step(allow_single_step)
     332{
     333}
     334
     335void MythUISpinBoxSetting::setValue(int value)
     336{
     337    StandardSetting::setValue(QString::number(value));
     338}
     339
     340int MythUISpinBoxSetting::intValue()
     341{
     342    return settingValue.toInt();
     343}
     344
     345void MythUISpinBoxSetting::edit(MythScreenType * screen)
     346{
     347    if (!isEnabled())return;
     348    //TODO use a correct dialog with a spin box
     349    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
     350
     351    MythTextInputDialog *settingdialog =
     352                                    new MythTextInputDialog(popupStack,
     353                                    getLabel(),FilterNone, false,settingValue);
     354
     355
     356    if (settingdialog->Create())
     357    {
     358        settingdialog->SetReturnEvent(screen, "editsetting");
     359        popupStack->AddScreen(settingdialog);
     360    }
     361};
     362
     363void MythUISpinBoxSetting::resultEdit(DialogCompletionEvent *dce)
     364{
     365    if (settingValue!=dce->GetResultText())
     366    {
     367        bool ok;
     368        int value = dce->GetResultText().toInt(&ok);
     369        ok = ok && (value>=m_min) && (value<=m_max);
     370        if (ok && !m_allow_single_step && m_step>0)
     371        {
     372            ok = ((value-m_min)%m_step)==0;
     373        }
     374        if (ok) //TODO give user some feedback
     375        {
     376            StandardSetting::setValue(dce->GetResultText());
     377            m_haveChanged=true;
     378        }
     379    }
     380}
     381
     382/*******************************************************************************
     383                           MythUICheckBoxSetting
     384********************************************************************************/
     385
     386MythUICheckBoxSetting::MythUICheckBoxSetting(Storage *_storage):
     387    StandardSetting(_storage)
     388{
     389}
     390
     391bool MythUICheckBoxSetting::boolValue()
     392{
     393    return settingValue=="1";
     394}
     395
     396
     397void MythUICheckBoxSetting::setValue(bool value)
     398{
     399    //Why does the polymorphism does not work here
     400    StandardSetting::setValue(value?"1":"0");
     401}
     402
     403void MythUICheckBoxSetting::updateButton(MythUIButtonListItem *item)
     404{
     405    item->SetText(label);
     406    item->setCheckable (true);
     407    item->setEnabled(isEnabled());
     408    item->SetText("","value");
     409    item->SetText(getHelpText(),"description");
     410    if (settingValue=="1")
     411        item->setChecked(MythUIButtonListItem::FullChecked);
     412    else
     413        item->setChecked(MythUIButtonListItem::NotChecked);
     414    item->setDrawArrow(haveSubSettings());
     415}
     416
     417void MythUICheckBoxSetting::edit(MythScreenType * screen)
     418{
     419    if (!isEnabled())return;
     420    DialogCompletionEvent *dce =
     421            new DialogCompletionEvent("editsetting", 0, "", "");
     422    QCoreApplication::postEvent(screen, dce);
     423}
     424
     425void MythUICheckBoxSetting::resultEdit(DialogCompletionEvent *dce)
     426{
     427    setValue(!boolValue());
     428    m_haveChanged=true;
     429}
     430
     431/*******************************************************************************
     432                           Standard setting dialog
     433********************************************************************************/
     434
     435StandardSettingDialog::StandardSettingDialog(MythScreenStack *parent, const char *name) :
     436    MythScreenType(parent, name),
     437    m_buttonList(0),
     438    m_title(0),
     439    m_groupHelp(0),
     440    m_selectedSettingHelp(0),
     441    m_menuPopup(0),
     442    m_settingsTree(0),
     443    m_currentGroupSetting(0)
     444{
     445}
     446
     447StandardSettingDialog::~StandardSettingDialog()
     448{
     449    LOG(VB_GENERAL, LOG_ERR, "StandardSettingDialog::~StandardSettingDialog()");
     450    if (m_settingsTree!=0)
     451        m_settingsTree->deleteLater();
     452}
     453
     454bool StandardSettingDialog::Create(void)
     455{
     456    if (!LoadWindowFromXML("standardsetting-ui.xml", "settingssetup", this))
     457        return false;
     458
     459    bool error=false;
     460    UIUtilE::Assign(this, m_title, "title",&error);
     461    UIUtilW::Assign(this, m_groupHelp, "grouphelp",&error);
     462    UIUtilE::Assign(this, m_buttonList,"settingslist",&error);
     463
     464    UIUtilW::Assign(this, m_selectedSettingHelp, "selectedsettinghelp");
     465
     466    connect(m_buttonList,SIGNAL(itemSelected(MythUIButtonListItem*)),
     467        this,SLOT(settingSelected(MythUIButtonListItem*)));
     468    connect(m_buttonList,SIGNAL(itemClicked(MythUIButtonListItem*)),
     469        this,SLOT(settingClicked(MythUIButtonListItem*)));
     470
     471    if (error)
     472    {
     473        LOG(VB_GENERAL, LOG_ERR, "error.");
     474        return false;
     475    }
     476    BuildFocusList();
     477
     478    return true;
     479}
     480
     481void StandardSettingDialog::settingSelected(MythUIButtonListItem *item)
     482{
     483    if (!item)return;
     484
     485    StandardSetting * setting = qVariantValue<StandardSetting*>(item->GetData());
     486    if (setting)
     487    {
     488        if (m_selectedSettingHelp)
     489            m_selectedSettingHelp->SetText(setting->getHelpText());
     490    }
     491}
     492
     493void StandardSettingDialog::settingClicked(MythUIButtonListItem *item)
     494{
     495    StandardSetting* setting = item->GetData().value<StandardSetting*>();
     496    if (setting)
     497    {
     498        setting->edit(this);
     499    }
     500}
     501
     502void StandardSettingDialog::customEvent(QEvent *event)
     503{
     504    if (event->type() == DialogCompletionEvent::kEventType)
     505    {
     506        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
     507        QString resultid  = dce->GetId();
     508
     509        if (resultid == "leveldown")
     510        {
     511            //a GroupSetting have been clicked
     512            LevelDown();
     513        }
     514        else if (resultid == "editsetting")
     515        {
     516            MythUIButtonListItem * item = m_buttonList->GetItemCurrent();
     517            if (item)
     518            {
     519                StandardSetting * ss = item->GetData().value<StandardSetting*>();
     520                if (ss)
     521                {
     522                    ss->resultEdit(dce);
     523                }
     524            }
     525        }
     526        else if (resultid == "exit")
     527        {
     528            int buttonnum = dce->GetResult();
     529            if (buttonnum == 0)
     530            {
     531                Save();
     532                MythScreenType::Close();
     533                if (m_settingsTree)
     534                    m_settingsTree->applyChange();
     535            }
     536            else if (buttonnum == 1)
     537                MythScreenType::Close();
     538        }
     539    }
     540}
     541
     542void StandardSettingDialog::loadSettings(GroupSetting * groupSettings)
     543{
     544
     545    m_settingsTree=groupSettings;
     546    if (m_settingsTree)
     547        m_settingsTree->Load();
     548
     549    setCurrentGroupSetting(m_settingsTree);
     550}
     551
     552void StandardSettingDialog::setCurrentGroupSetting(StandardSetting * groupSettings,
     553        StandardSetting * selectedSetting )
     554{
     555    if (!groupSettings) return;
     556
     557    m_currentGroupSetting=groupSettings;
     558    m_buttonList->Reset();
     559
     560    m_title->SetText(m_currentGroupSetting->getLabel());
     561    if (m_groupHelp) m_groupHelp->SetText(m_currentGroupSetting->getHelpText());
     562    if (!m_currentGroupSetting->haveSubSettings())return;
     563    QList<StandardSetting *> * settings = m_currentGroupSetting->getSubSettings();
     564    if (settings==NULL ) return;
     565    QList<StandardSetting *>::const_iterator i;
     566    MythUIButtonListItem *selectedItem=0;
     567    for (i = settings->constBegin(); i != settings->constEnd(); ++i)
     568    {
     569        if (selectedSetting == (*i))
     570            selectedItem =(*i)->createButton(m_buttonList);
     571        else
     572            (*i)->createButton(m_buttonList);
     573    }
     574    if (selectedItem)
     575        m_buttonList->SetItemCurrent(selectedItem);
     576    settingSelected(m_buttonList->GetItemCurrent());
     577
     578}
     579
     580void StandardSettingDialog::Save()
     581{
     582    if (m_settingsTree)
     583        m_settingsTree->Save();
     584}
     585
     586void StandardSettingDialog::LevelUp()
     587{
     588    if (!m_currentGroupSetting) return;
     589    if (m_currentGroupSetting->getParent())
     590    {
     591        setCurrentGroupSetting(m_currentGroupSetting->getParent(),
     592                    m_currentGroupSetting);
     593    }
     594}
     595
     596void StandardSettingDialog::LevelDown()
     597{
     598    MythUIButtonListItem * item = m_buttonList->GetItemCurrent();
     599    if (item)
     600    {
     601        StandardSetting * ss = item->GetData().value<StandardSetting*>();
     602        if (ss && ss->haveSubSettings() && ss->isEnabled())
     603            setCurrentGroupSetting(ss);
     604    }
     605}
     606
     607void StandardSettingDialog::Close(void)
     608{
     609    if (m_settingsTree->haveChanged())
     610    {
     611        QString label = tr("Exit ?");
     612
     613        MythScreenStack *popupStack =
     614                                GetMythMainWindow()->GetStack("popup stack");
     615
     616        MythDialogBox * m_menuPopup =
     617                new MythDialogBox(label, popupStack, "exitmenu");
     618
     619        if (m_menuPopup->Create())
     620            popupStack->AddScreen(m_menuPopup);
     621
     622        m_menuPopup->SetReturnEvent(this, "exit");
     623
     624        m_menuPopup->AddButton(tr("Save then Exit"));
     625        m_menuPopup->AddButton(tr("Exit without saving changes"));
     626        m_menuPopup->AddButton(tr("Cancel"));
     627    }
     628    else
     629        MythScreenType::Close();
     630}
     631
     632
     633bool StandardSettingDialog::keyPressEvent(QKeyEvent *e)
     634{
     635    QStringList actions;
     636    bool handled = m_buttonList->keyPressEvent(e);
     637    if (handled) return true;
     638    handled = GetMythMainWindow()->TranslateKeyPress("Global", e, actions);
     639
     640    for (int i = 0; i < actions.size() && !handled; i++)
     641    {
     642        QString action = actions[i];
     643        handled = true;
     644
     645        if (action == "LEFT")
     646        {
     647            if (m_currentGroupSetting
     648                && m_currentGroupSetting==m_settingsTree)
     649                Close();
     650            else
     651                LevelUp();
     652        }
     653        else if (action == "RIGHT")
     654            LevelDown();
     655        else
     656            handled = MythScreenType::keyPressEvent(e);
     657    }
     658
     659    return handled;
     660}
     661
     662
     663
     664
     665
  • new file mythtv/programs/mythfrontend/standardsettings.h

    diff --git a/mythtv/programs/mythfrontend/standardsettings.h b/mythtv/programs/mythfrontend/standardsettings.h
    new file mode 100755
    index 0000000..005274b
    - +  
     1#ifndef STANDARDSETTINGS_H_
     2#define STANDARDSETTINGS_H_
     3
     4#include "mythuibuttonlist.h"
     5#include <mythdialogbox.h>
     6#include <mythuibuttontree.h>
     7#include <mythgenerictree.h>
     8#include <QMap>
     9#include "settings.h"
     10
     11#include "mythlogging.h"
     12
     13class StandardSetting;
     14
     15class 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
     25class MPUBLIC NewConfigurable : public QObject
     26{
     27    Q_OBJECT
     28
     29  public:
     30
     31    virtual void updateButton(MythUIButtonListItem *item)=0;
     32
     33    // A label displayed to the user
     34    virtual void setLabel(QString str) { label = str; }
     35    QString getLabel(void) const { return label; }
     36
     37    virtual void setHelpText(const QString &str)
     38        { helptext = str; }
     39    QString getHelpText(void) const { return helptext; }
     40
     41    void setVisible(bool b) { m_visible = b; };
     42    bool isVisible(void) const { return m_visible; };
     43
     44    virtual void setEnabled(bool b) { m_enabled = b; }
     45    bool isEnabled() { return m_enabled; }
     46
     47    Storage *GetStorage(void) { return storage; }
     48
     49  protected:
     50    NewConfigurable(Storage *_storage) :
     51        m_enabled(true), storage(_storage),
     52        label(""), helptext(""), m_visible(true) { }
     53    virtual ~NewConfigurable() { }
     54
     55  protected:
     56    bool m_enabled;
     57    Storage *storage;
     58    QString configName;
     59    QString label;
     60    QString helptext;
     61    bool m_visible;
     62};
     63
     64//Copy of Setting class
     65class MPUBLIC StandardSetting : public NewConfigurable, public StorageUser
     66{
     67    Q_OBJECT
     68
     69  public:
     70    // Gets
     71    virtual QString getValue(void) const
     72        {return settingValue;}
     73
     74    virtual void updateButton(MythUIButtonListItem *item);
     75
     76    // StorageUser
     77    void SetDBValue(const QString &val) { setValue(val); }
     78    QString GetDBValue(void) const { return getValue(); }
     79
     80    //added by xavier
     81    virtual void setEnabled(bool b);
     82    MythUIButtonListItem * createButton(MythUIButtonList * list);
     83    //subsettings
     84    void addChild(StandardSetting *child);
     85    virtual QList<StandardSetting *> *getSubSettings();
     86    virtual bool haveSubSettings();
     87
     88    StandardSetting * getParent();
     89    virtual void edit(MythScreenType * screen)=0;
     90    virtual void resultEdit(DialogCompletionEvent *dce)=0;
     91    //must be a better way
     92    virtual void Load(void);
     93    virtual void Save(void);
     94
     95
     96    void addTargetedChild(const QString &value, StandardSetting * setting);
     97    bool haveChanged();
     98    //added by xavier end
     99  public slots:
     100    virtual void setValue(const QString &newValue);
     101
     102  signals:
     103    void valueChanged(const QString&);
     104    void ShouldRedraw(StandardSetting *);
     105
     106  protected:
     107    StandardSetting(Storage *_storage);
     108    virtual ~StandardSetting();
     109
     110  protected:
     111    void setParent(StandardSetting *parent);
     112    QString settingValue;
     113    void LoadChildren(void);
     114    void SaveChildren(void);
     115    bool m_haveChanged;
     116  private:
     117    StandardSetting * m_parent;
     118    QList<StandardSetting *> m_children;
     119    QMap<QString, QList<StandardSetting *> > m_targets;
     120};
     121
     122
     123/*******************************************************************************
     124*                           TextEdit Setting                                   *
     125*******************************************************************************/
     126
     127
     128class MPUBLIC MythUITextEditSetting : public StandardSetting
     129{
     130  public:
     131    virtual void resultEdit(DialogCompletionEvent *dce);
     132    virtual void edit(MythScreenType * screen);
     133  protected:
     134    MythUITextEditSetting (Storage *_storage);
     135   
     136};
     137
     138
     139class MPUBLIC TransTextEditSetting: public MythUITextEditSetting, public TransientStorage
     140{
     141  public:
     142    TransTextEditSetting() :
     143        MythUITextEditSetting(this), TransientStorage() { }
     144
     145    //Don't want to have to do that but cannont think of a work around
     146    virtual void Load(){MythUITextEditSetting::Load();}
     147    virtual void Save(){MythUITextEditSetting::Save();}
     148};
     149
     150
     151class MPUBLIC HostTextEditSetting: public MythUITextEditSetting, public HostDBStorage
     152{
     153  public:
     154    HostTextEditSetting(const QString &name) :
     155        MythUITextEditSetting(this), HostDBStorage(this, name) { }
     156
     157    //Don't want to have to do that but cannont think of a work around
     158    virtual void Load(){MythUITextEditSetting::Load();HostDBStorage::Load();}
     159    virtual void Save(){MythUITextEditSetting::Save();HostDBStorage::Save();}
     160};
     161
     162
     163/*******************************************************************************
     164*                           ComboBox Setting                                   *
     165*******************************************************************************/
     166//TODO implement rw=true
     167class MPUBLIC MythUIComboBoxSetting : public StandardSetting
     168{
     169  public:
     170    void setValue(int value);
     171    virtual void resultEdit(DialogCompletionEvent *dce);
     172    virtual void edit(MythScreenType * screen);
     173    void addSelection(const QString &label, QString value = QString::null, bool select = false);
     174    void clearSelections();
     175    virtual void updateButton(MythUIButtonListItem *item);
     176  protected:
     177    MythUIComboBoxSetting (Storage *_storage, bool rw = false);
     178    ~MythUIComboBoxSetting();
     179
     180  private:
     181    QVector<QString> m_labels;
     182    QVector<QString> m_values;
     183    bool m_isSet;
     184   
     185};
     186
     187class MPUBLIC HostComboBoxSetting: public MythUIComboBoxSetting, public HostDBStorage
     188{
     189  public:
     190    HostComboBoxSetting(const QString &name, bool rw = false) :
     191        MythUIComboBoxSetting(this, rw), HostDBStorage(this, name) { }
     192
     193    //Don't want to have to do that but cannot think of a work around
     194    virtual void Load(){MythUIComboBoxSetting::Load();HostDBStorage::Load();}
     195    virtual void Save(){MythUIComboBoxSetting::Save();HostDBStorage::Save();}
     196};
     197
     198
     199class MPUBLIC GlobalComboBoxSetting: public MythUIComboBoxSetting, public GlobalDBStorage
     200{
     201  public:
     202    GlobalComboBoxSetting(const QString &name, bool rw = false) :
     203        MythUIComboBoxSetting(this, rw), GlobalDBStorage(this, name) { }
     204
     205    //Don't want to have to do that but cannot think of a work around
     206    virtual void Load(){MythUIComboBoxSetting::Load();GlobalDBStorage::Load();}
     207    virtual void Save(){MythUIComboBoxSetting::Save();GlobalDBStorage::Save();}
     208};
     209
     210/*******************************************************************************
     211*                           SpinBox Setting                                    *
     212*******************************************************************************/
     213
     214
     215class MPUBLIC MythUISpinBoxSetting : public StandardSetting
     216{
     217  public:
     218    void setValue(int value);
     219    int intValue();
     220    virtual void resultEdit(DialogCompletionEvent *dce);
     221    virtual void edit(MythScreenType * screen);
     222  protected:
     223    MythUISpinBoxSetting (Storage *_storage, int min, int max, int step, bool allow_single_step);
     224  private:
     225    int m_min;
     226    int m_max;
     227    int m_step;
     228    bool m_allow_single_step;
     229   
     230};
     231
     232class MPUBLIC TransMythUISpinBoxSetting: public MythUISpinBoxSetting, public TransientStorage
     233{
     234  public:
     235    TransMythUISpinBoxSetting(int min, int max, int step, bool allow_single_step=false) :
     236        MythUISpinBoxSetting(this, min, max, step, allow_single_step), TransientStorage() { }
     237
     238    //Don't want to have to do that but cannont think of a work around
     239    virtual void Load(){MythUISpinBoxSetting::Load();}
     240    virtual void Save(){MythUISpinBoxSetting::Save();}
     241};
     242
     243class MPUBLIC HostSpinBoxSetting: public MythUISpinBoxSetting, public HostDBStorage
     244{
     245  public:
     246    HostSpinBoxSetting(const QString &name, int min, int max, int step, bool allow_single_step=false) :
     247        MythUISpinBoxSetting(this, min, max, step, allow_single_step), HostDBStorage(this, name) { }
     248
     249    //Don't want to have to do that but cannont think of a work around
     250    virtual void Load(){MythUISpinBoxSetting::Load();HostDBStorage::Load();}
     251    virtual void Save(){MythUISpinBoxSetting::Save();HostDBStorage::Save();}
     252};
     253
     254class MPUBLIC GlobalSpinBoxSetting: public MythUISpinBoxSetting, public GlobalDBStorage
     255{
     256  public:
     257    GlobalSpinBoxSetting(const QString &name, int min, int max, int step, bool allow_single_step=false) :
     258        MythUISpinBoxSetting(this, min, max, step, allow_single_step), GlobalDBStorage(this, name) { }
     259
     260    //Don't want to have to do that but cannont think of a work around
     261    virtual void Load(){MythUISpinBoxSetting::Load();GlobalDBStorage::Load();}
     262    virtual void Save(){MythUISpinBoxSetting::Save();GlobalDBStorage::Save();}
     263};
     264
     265/*******************************************************************************
     266*                           CheckBox Setting                                   *
     267*******************************************************************************/
     268
     269class MPUBLIC MythUICheckBoxSetting : public StandardSetting
     270{
     271  public:
     272    virtual void resultEdit(DialogCompletionEvent *dce);
     273    virtual void edit(MythScreenType * screen);
     274    virtual void updateButton(MythUIButtonListItem *item);
     275    void setValue(bool value);
     276    bool boolValue();
     277  protected:
     278    MythUICheckBoxSetting (Storage *_storage);
     279   
     280};
     281
     282class MPUBLIC TransMythUICheckBoxSetting: public MythUICheckBoxSetting, public TransientStorage
     283{
     284  public:
     285    TransMythUICheckBoxSetting() :
     286        MythUICheckBoxSetting(this), TransientStorage() { }
     287    //Don't want to have to do that but cannont think of a work around
     288    /*virtual void Load(){MythUICheckBoxSetting::Load();HostDBStorage::Load();}
     289    virtual void Save(){MythUICheckBoxSetting::Save();HostDBStorage::Save();}*/
     290};
     291
     292class MPUBLIC HostCheckBoxSetting: public MythUICheckBoxSetting, public HostDBStorage
     293{
     294  public:
     295    HostCheckBoxSetting(const QString &name, bool rw = true) :
     296        MythUICheckBoxSetting(this), HostDBStorage(this, name) { }
     297    //Don't want to have to do that but cannont think of a work around
     298    virtual void Load(){MythUICheckBoxSetting::Load();HostDBStorage::Load();}
     299    virtual void Save(){MythUICheckBoxSetting::Save();HostDBStorage::Save();}
     300};
     301
     302class MPUBLIC GlobalCheckBoxSetting: public MythUICheckBoxSetting, public GlobalDBStorage
     303{
     304  public:
     305    GlobalCheckBoxSetting(const QString &name, bool rw = true) :
     306        MythUICheckBoxSetting(this), GlobalDBStorage(this, name) { }
     307    //Don't want to have to do that but cannont think of a work around
     308    virtual void Load(){MythUICheckBoxSetting::Load();GlobalDBStorage::Load();}
     309    virtual void Save(){MythUICheckBoxSetting::Save();GlobalDBStorage::Save();}
     310};
     311
     312/*******************************************************************************
     313*                              Group Setting                                   *
     314*******************************************************************************/
     315
     316class GroupSetting : public StandardSetting, public TransientStorage
     317{
     318  public:
     319    GroupSetting();
     320
     321    virtual void Load(void){StandardSetting::Load();};
     322    virtual void Save(void){StandardSetting::Save();};
     323    virtual void edit(MythScreenType * screen);
     324    virtual void resultEdit(DialogCompletionEvent *dce){};
     325    virtual void applyChange(){};
     326    virtual void updateButton(MythUIButtonListItem *item);
     327};
     328
     329/*******************************************************************************
     330*                            Standard Dialog Setting                            *
     331*******************************************************************************/
     332
     333class StandardSettingDialog : public MythScreenType
     334{
     335    Q_OBJECT
     336
     337  public:
     338
     339    StandardSettingDialog(MythScreenStack *parent, const char *name);
     340    virtual ~StandardSettingDialog();
     341    bool Create(void);
     342    void loadSettings(GroupSetting * groupSettings);
     343    virtual void customEvent(QEvent *event);
     344    virtual bool keyPressEvent(QKeyEvent *);
     345  public slots:
     346    void Close(void);
     347  protected:
     348
     349    MythUIButtonList *m_buttonList;
     350  private slots:
     351    void settingSelected(MythUIButtonListItem *item);
     352    void settingClicked(MythUIButtonListItem *item);
     353  private:
     354    void LevelUp();
     355    void LevelDown();
     356    void setCurrentGroupSetting(StandardSetting * groupSettings,StandardSetting * selectedSetting=0);
     357    void Save();
     358    MythUIText      *m_title;
     359    MythUIText      *m_groupHelp;
     360    MythUIText      *m_selectedSettingHelp;
     361    MythDialogBox   *m_menuPopup;
     362    GroupSetting    *m_settingsTree;
     363    StandardSetting *m_currentGroupSetting;
     364    bool m_loaded;
     365};
     366
     367Q_DECLARE_METATYPE(StandardSetting *);
     368
     369
     370#endif
  • mythtv/programs/mythfrontend/videoglobalsettings.cpp

    diff --git a/mythtv/programs/mythfrontend/videoglobalsettings.cpp b/mythtv/programs/mythfrontend/videoglobalsettings.cpp
    index 0365bfc..55bd18d 100644
    a b  
    99#include "videodlg.h"
    1010#include "videoglobalsettings.h"
    1111
     12#include "mythlogging.h"
     13
    1214namespace
    1315{
    1416// General Settings
    15 HostComboBox *VideoDefaultParentalLevel()
     17HostComboBoxSetting *VideoDefaultParentalLevel()
    1618{
    17     HostComboBox *gc = new HostComboBox("VideoDefaultParentalLevel");
     19    HostComboBoxSetting *gc = new HostComboBoxSetting("VideoDefaultParentalLevel");
    1820    gc->setLabel(QObject::tr("Starting Parental Level"));
    1921    gc->addSelection(QObject::tr("4 - Highest"),
    2022                     QString::number(ParentalLevel::plHigh));
    const char *password_clue =  
    3335    QT_TRANSLATE_NOOP("QObject", "Setting this value to all numbers will make your life "
    3436                "much easier.");
    3537
    36 HostLineEdit *VideoAdminPassword()
     38HostTextEditSetting *VideoAdminPassword()
    3739{
    38     HostLineEdit *gc = new HostLineEdit("VideoAdminPassword");
     40    HostTextEditSetting *gc = new HostTextEditSetting("VideoAdminPassword");
    3941    gc->setLabel(QObject::tr("Parental Level 4 PIN"));
    4042    gc->setHelpText(QString("%1 %2")
    4143        .arg(QObject::tr("This PIN is used to enter Parental Control "
    HostLineEdit *VideoAdminPassword()  
    4446    return gc;
    4547}
    4648
    47 HostLineEdit *VideoAdminPasswordThree()
     49HostTextEditSetting *VideoAdminPasswordThree()
    4850{
    49     HostLineEdit *gc = new HostLineEdit("VideoAdminPasswordThree");
     51    HostTextEditSetting *gc = new HostTextEditSetting("VideoAdminPasswordThree");
    5052    gc->setLabel(QObject::tr("Parental Level 3 PIN"));
    5153    gc->setHelpText(QString("%1 %2")
    5254        .arg(QObject::tr("This PIN is used to enter Parental Control Level 3."))
    HostLineEdit *VideoAdminPasswordThree()  
    5456    return gc;
    5557}
    5658
    57 HostLineEdit *VideoAdminPasswordTwo()
     59HostTextEditSetting *VideoAdminPasswordTwo()
    5860{
    59     HostLineEdit *gc = new HostLineEdit("VideoAdminPasswordTwo");
     61    HostTextEditSetting *gc = new HostTextEditSetting("VideoAdminPasswordTwo");
    6062    gc->setLabel(QObject::tr("Parental Level 2 PIN"));
    6163    gc->setHelpText(QString("%1 %2")
    6264        .arg(QObject::tr("This PIN is used to enter Parental Control Level 2."))
    HostLineEdit *VideoAdminPasswordTwo()  
    6466    return gc;
    6567}
    6668
    67 HostCheckBox *VideoAggressivePC()
     69HostCheckBoxSetting *VideoAggressivePC()
    6870{
    69     HostCheckBox *gc = new HostCheckBox("VideoAggressivePC");
     71    HostCheckBoxSetting *gc = new HostCheckBoxSetting("VideoAggressivePC");
    7072    gc->setLabel(QObject::tr("Aggressive Parental Control"));
    7173    gc->setValue(false);
    7274    gc->setHelpText(QObject::tr("If set, you will not be able to return "
    HostCheckBox *VideoAggressivePC()  
    7678    return gc;
    7779}
    7880
    79 HostLineEdit *VideoStartupDirectory()
     81HostTextEditSetting *VideoStartupDirectory()
    8082{
    81     HostLineEdit *gc = new HostLineEdit("VideoStartupDir");
     83    HostTextEditSetting *gc = new HostTextEditSetting("VideoStartupDir");
    8284    gc->setLabel(QObject::tr("Directories that hold videos"));
    8385    gc->setValue(DEFAULT_VIDEOSTARTUP_DIR);
    8486    gc->setHelpText(QObject::tr("Multiple directories can be separated by ':'. "
    HostLineEdit *VideoStartupDirectory()  
    8789    return gc;
    8890}
    8991
    90 HostLineEdit *VideoArtworkDirectory()
     92HostTextEditSetting *VideoArtworkDirectory()
    9193{
    92     HostLineEdit *gc = new HostLineEdit("VideoArtworkDir");
     94    HostTextEditSetting *gc = new HostTextEditSetting("VideoArtworkDir");
    9395    gc->setLabel(QObject::tr("Directory that holds movie posters"));
    9496    gc->setValue(GetConfDir() + "/Video/Artwork");
    9597    gc->setHelpText(QObject::tr("This directory must exist, and the user "
    HostLineEdit *VideoArtworkDirectory()  
    98100    return gc;
    99101}
    100102
    101 HostLineEdit *VideoScreenshotDirectory()
     103HostTextEditSetting *VideoScreenshotDirectory()
    102104{
    103     HostLineEdit *gc = new HostLineEdit("mythvideo.screenshotDir");
     105    HostTextEditSetting *gc = new HostTextEditSetting("mythvideo.screenshotDir");
    104106    gc->setLabel(QObject::tr("Directory that holds movie screenshots"));
    105107    gc->setValue(GetConfDir() + "/Video/Screenshots");
    106108    gc->setHelpText(QObject::tr("This directory must exist, and the user "
    HostLineEdit *VideoScreenshotDirectory()  
    109111    return gc;
    110112}
    111113
    112 HostLineEdit *VideoBannerDirectory()
     114HostTextEditSetting *VideoBannerDirectory()
    113115{
    114     HostLineEdit *gc = new HostLineEdit("mythvideo.bannerDir");
     116    HostTextEditSetting *gc = new HostTextEditSetting("mythvideo.bannerDir");
    115117    gc->setLabel(QObject::tr("Directory that holds movie/TV Banners"));
    116118    gc->setValue(GetConfDir() + "/Video/Banners");
    117119    gc->setHelpText(QObject::tr("This directory must exist, and the user "
    HostLineEdit *VideoBannerDirectory()  
    120122    return gc;
    121123}
    122124
    123 HostLineEdit *VideoFanartDirectory()
     125HostTextEditSetting *VideoFanartDirectory()
    124126{
    125     HostLineEdit *gc = new HostLineEdit("mythvideo.fanartDir");
     127    HostTextEditSetting *gc = new HostTextEditSetting("mythvideo.fanartDir");
    126128    gc->setLabel(QObject::tr("Directory that holds movie fanart"));
    127129    gc->setValue(GetConfDir() + "/Video/Fanart");
    128130    gc->setHelpText(QObject::tr("This directory must exist, and the user "
    HostLineEdit *VideoFanartDirectory()  
    131133    return gc;
    132134}
    133135
    134 HostLineEdit *TrailerDirectory()
     136HostTextEditSetting *TrailerDirectory()
    135137{
    136     HostLineEdit *gc = new HostLineEdit("mythvideo.TrailersDir");
     138    HostTextEditSetting *gc = new HostTextEditSetting("mythvideo.TrailersDir");
    137139    gc->setLabel(QObject::tr("Directory that holds movie trailers"));
    138140    gc->setValue(GetConfDir() + "/Video/Trailers");
    139141    gc->setHelpText(QObject::tr("This directory must exist, and the user "
    HostLineEdit *TrailerDirectory()  
    148150
    149151// General Settings
    150152
    151 HostComboBox *SetOnInsertDVD()
     153HostComboBoxSetting *SetOnInsertDVD()
    152154{
    153     HostComboBox *gc = new HostComboBox("DVDOnInsertDVD");
     155    HostComboBoxSetting *gc = new HostComboBoxSetting("DVDOnInsertDVD");
    154156    gc->setLabel(QObject::tr("On DVD insertion"));
    155157    gc->addSelection(QObject::tr("Display mythdvd menu"),"1");
    156158    gc->addSelection(QObject::tr("Do nothing"),"0");
    HostComboBox *SetOnInsertDVD()  
    160162    return gc;
    161163}
    162164
    163 HostCheckBox *VideoTreeRemember()
     165HostCheckBoxSetting *VideoTreeRemember()
    164166{
    165     HostCheckBox *gc = new HostCheckBox("mythvideo.VideoTreeRemember");
     167    HostCheckBoxSetting *gc = new HostCheckBoxSetting("mythvideo.VideoTreeRemember");
    166168    gc->setLabel(QObject::tr("Video Tree remembers last selected position"));
    167169    gc->setValue(false);
    168170    gc->setHelpText(QObject::tr("If set, the current position in the Video "
    HostCheckBox *VideoTreeRemember()  
    170172    return gc;
    171173}
    172174
    173 struct ConfigPage
    174 {
    175     typedef std::vector<ConfigurationGroup *> PageList;
    176 
    177   protected:
    178     ConfigPage(PageList &pl) : m_pl(pl)
    179     {
    180     }
    181 
    182     void Add(ConfigurationGroup *page)
    183     {
    184         m_pl.push_back(page);
    185     }
    186 
    187   private:
    188     ConfigPage(const ConfigPage &);
    189     ConfigPage &operator=(const ConfigPage &);
    190 
    191   private:
    192     PageList &m_pl;
    193 };
    194 
    195 struct VConfigPage : public ConfigPage
    196 {
    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     }
    205175
    206     VerticalConfigurationGroup *operator->()
    207     {
    208         return m_vc_page;
    209     }
    210176
    211   private:
    212     VerticalConfigurationGroup *m_vc_page;
    213 };
    214177
    215 class RatingsToPL : public TriggeredConfigurationGroup
     178HostCheckBoxSetting *RatingsToPL()
    216179{
    217   public:
    218     RatingsToPL() : TriggeredConfigurationGroup(false)
     180    HostCheckBoxSetting *r2pl =
     181            new HostCheckBoxSetting("mythvideo.ParentalLevelFromRating");
     182    r2pl->setLabel(QObject::tr("Enable automatic Parental Level from "
     183                               "rating"));
     184    r2pl->setValue(false);
     185    r2pl->setHelpText(QObject::tr("If enabled, searches will automatically "
     186                                  "set the Parental Level to the one "
     187                                  "matching the rating below."));
     188
     189    typedef std::map<ParentalLevel::Level, QString> r2pl_map;
     190    r2pl_map r2pl_defaults;
     191    r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLowest,
     192            QObject::tr("G", "PL 1 default search string.")));
     193    r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLow,
     194            QObject::tr("PG", "PL 2 default search string.")));
     195    r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plMedium,
     196            QObject::tr("PG-13", "PL3 default search string.")));
     197    r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plHigh,
     198            QObject::tr("R:NC-17", "PL4 default search string.")));
     199
     200    for (ParentalLevel pl(ParentalLevel::plLowest);
     201         pl.GetLevel() <= ParentalLevel::plHigh && pl.good(); ++pl)
    219202    {
    220         HostCheckBox *r2pl =
    221                 new HostCheckBox("mythvideo.ParentalLevelFromRating");
    222         r2pl->setLabel(QObject::tr("Enable automatic Parental Level from "
    223                                    "rating"));
    224         r2pl->setValue(false);
    225         r2pl->setHelpText(QObject::tr("If enabled, searches will automatically "
    226                                       "set the Parental Level to the one "
    227                                       "matching the rating below."));
    228         addChild(r2pl);
    229         setTrigger(r2pl);
    230 
    231         typedef std::map<ParentalLevel::Level, QString> r2pl_map;
    232         r2pl_map r2pl_defaults;
    233         r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLowest,
    234                 tr("G", "PL 1 default search string.")));
    235         r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLow,
    236                 tr("PG", "PL 2 default search string.")));
    237         r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plMedium,
    238                 tr("PG-13", "PL3 default search string.")));
    239         r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plHigh,
    240                 tr("R:NC-17", "PL4 default search string.")));
    241 
    242         VerticalConfigurationGroup *vcg = new VerticalConfigurationGroup(true);
    243 
    244         for (ParentalLevel pl(ParentalLevel::plLowest);
    245              pl.GetLevel() <= ParentalLevel::plHigh && pl.good(); ++pl)
     203        HostTextEditSetting *hle = new HostTextEditSetting(QString("mythvideo.AutoR2PL%1")
     204                                             .arg(pl.GetLevel()));
     205        hle->setLabel(QObject::tr("Level %1").arg(pl.GetLevel()));
     206        hle->setHelpText(QObject::tr("Ratings containing these strings "
     207                                     "(separated by :) will be assigned "
     208                                     "to Parental Level %1.")
     209                         .arg(pl.GetLevel()));
     210
     211        r2pl_map::const_iterator def_setting =
     212                r2pl_defaults.find(pl.GetLevel());
     213        if (def_setting != r2pl_defaults.end())
    246214        {
    247             HostLineEdit *hle = new HostLineEdit(QString("mythvideo.AutoR2PL%1")
    248                                                  .arg(pl.GetLevel()));
    249             hle->setLabel(QObject::tr("Level %1").arg(pl.GetLevel()));
    250             hle->setHelpText(QObject::tr("Ratings containing these strings "
    251                                          "(separated by :) will be assigned "
    252                                          "to Parental Level %1.")
    253                              .arg(pl.GetLevel()));
    254 
    255             r2pl_map::const_iterator def_setting =
    256                     r2pl_defaults.find(pl.GetLevel());
    257             if (def_setting != r2pl_defaults.end())
    258             {
    259                 hle->setValue(def_setting->second);
    260             }
    261 
    262             vcg->addChild(hle);
     215            hle->setValue(def_setting->second);
    263216        }
    264217
    265         addTarget("0", new VerticalConfigurationGroup(true));
    266         addTarget("1", vcg);
     218        r2pl->addTargetedChild("1", hle);
    267219    }
    268 };
    269220
    270 } // namespace
     221    return r2pl;
     222}
     223
     224}
    271225
    272226VideoGeneralSettings::VideoGeneralSettings()
     227    :GroupSetting()
    273228{
    274     ConfigPage::PageList pages;
    275 
    276     VConfigPage page1(pages, false);
    277     page1->addChild(VideoStartupDirectory());
    278     page1->addChild(TrailerDirectory());
    279     page1->addChild(VideoArtworkDirectory());
    280     page1->addChild(VideoScreenshotDirectory());
    281     page1->addChild(VideoBannerDirectory());
    282     page1->addChild(VideoFanartDirectory());
    283 
    284     VConfigPage page2(pages, false);
    285     page2->addChild(SetOnInsertDVD());
    286     page2->addChild(VideoTreeRemember());
    287 
    288     // page 3
    289     VerticalConfigurationGroup *pctrl =
    290             new VerticalConfigurationGroup(true, false);
     229    setLabel(QObject::tr("General settings"));
     230
     231    setHelpText(QObject::tr("TODO add a descrition for this group of settings"));
     232   
     233
     234    addChild(VideoStartupDirectory());
     235    addChild(TrailerDirectory());
     236    addChild(VideoArtworkDirectory());
     237    addChild(VideoScreenshotDirectory());
     238    addChild(VideoBannerDirectory());
     239    addChild(VideoFanartDirectory());
     240
     241    addChild(SetOnInsertDVD());
     242    addChild(VideoTreeRemember());
     243
     244    GroupSetting *pctrl =
     245            new GroupSetting();
    291246    pctrl->setLabel(QObject::tr("Parental Control Settings"));
     247
     248    pctrl->setHelpText(QObject::tr("TODO add a description for this group of setting"));
    292249    pctrl->addChild(VideoDefaultParentalLevel());
    293250    pctrl->addChild(VideoAdminPassword());
    294251    pctrl->addChild(VideoAdminPasswordThree());
    295252    pctrl->addChild(VideoAdminPasswordTwo());
    296253    pctrl->addChild(VideoAggressivePC());
    297     VConfigPage page3(pages, false);
    298     page3->addChild(pctrl);
    299254
    300     VConfigPage page4(pages, false);
    301     page4->addChild(new RatingsToPL());
     255    addChild(pctrl);
     256
     257    addChild(RatingsToPL());
    302258
    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     }
    311259}
     260
  • mythtv/programs/mythfrontend/videoglobalsettings.h

    diff --git a/mythtv/programs/mythfrontend/videoglobalsettings.h b/mythtv/programs/mythfrontend/videoglobalsettings.h
    index 9f621e6..de155db 100644
    a b  
    33
    44#include "settings.h"
    55
    6 class VideoGeneralSettings : public ConfigurationWizard
     6#include "standardsettings.h"
     7
     8class VideoGeneralSettings : public GroupSetting
    79{
    810  public:
    911    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>