Ticket #10092: mythfrontendsetup.diff

File mythfrontendsetup.diff, 153.7 KB (added by Xavier Hervy <xavier.hervy@…>, 15 years ago)
  • mythtv/programs/mythfrontend/globalsettings.cpp

    diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
    index a379b8f..883e894 100644
    a b  
    2424#include "mythcorecontext.h"
    2525#include "mythdbcon.h"
    2626#include "mythlogging.h"
    27 #include "dbsettings.h"
     27//#include "dbsettings.h"
    2828#include "mythtranslation.h"
    2929#include "iso639.h"
    3030#include "playbackbox.h"
     
    3939#include "mythdirs.h"
    4040#include "mythuihelper.h"
    4141
    42 static HostCheckBox *DecodeExtraAudio()
     42/* This class have been copied from settingdb.h/.cpp and modified
     43 I believe this is also used by mythtv-setup so
     44I did not want to break it by modifying the original*/
     45class MythDbSettings: public GroupSetting {
     46public:
     47    MythDbSettings();
     48
     49    void Load(void);
     50    void Save(void);
     51
     52protected:
     53    TransTextualSetting *dbHostName;
     54    TransBoolSetting    *dbHostPing;
     55    TransTextualSetting *dbPort;
     56    TransTextualSetting *dbName;
     57    TransTextualSetting *dbUserName;
     58    TransTextualSetting *dbPassword;
     59    TransBoolSetting    *localEnabled;
     60    TransTextualSetting *localHostName;
     61    TransBoolSetting    *wolEnabled;
     62    TransRangeSetting   *wolReconnect;
     63    TransRangeSetting   *wolRetry;
     64    TransTextualSetting *wolCommand;
     65};
     66
     67
     68
     69MythDbSettings::MythDbSettings() :
     70    GroupSetting()
    4371{
    44     HostCheckBox *gc = new HostCheckBox("DecodeExtraAudio");
     72
     73    setLabel(QObject::tr("Database Configuration"));
     74
     75    MSqlQuery query(MSqlQuery::InitCon());
     76    if (query.isConnected())
     77        setHelpText(QObject::tr("All database settings take effect when "
     78                                   "you restart this program."));
     79    else
     80        setHelpText(QObject::tr("MythTV could not connect to the database. "
     81                                   "Please verify your database settings "
     82                                   "below."));
     83
     84    GroupSetting* dbServer = new GroupSetting();
     85    dbServer->setLabel(QObject::tr("Database Server Settings"));
     86    dbHostName = new TransTextualSetting();
     87    dbHostName->setLabel(QObject::tr("Hostname"));
     88    dbHostName->setHelpText(QObject::tr("The host name or IP address of "
     89                                        "the machine hosting the database. "
     90                                        "This information is required."));
     91    dbServer->addChild(dbHostName);
     92
     93
     94    dbHostPing = new TransBoolSetting();
     95    dbHostPing->setLabel(QObject::tr("Ping test server?"));
     96    dbHostPing->setHelpText(QObject::tr("Test basic host connectivity using "
     97                                        "the ping command. Turn off if your "
     98                                        "host or network don't support ping "
     99                                        "(ICMP ECHO) packets"));
     100    dbServer->addChild(dbHostPing);
     101
     102
     103    dbPort = new TransTextualSetting();
     104    dbPort->setLabel(QObject::tr("Port"));
     105    dbPort->setHelpText(QObject::tr("The port number the database is running "
     106                                    "on.  Leave blank if using the default "
     107                                    "port (3306)."));
     108    dbServer->addChild(dbPort);
     109
     110    dbName = new TransTextualSetting();
     111    dbName->setLabel(QObject::tr("Database name"));
     112    dbName->setHelpText(QObject::tr("The name of the database. "
     113                                    "This information is required."));
     114    dbServer->addChild(dbName);
     115
     116    dbUserName = new TransTextualSetting();
     117    dbUserName->setLabel(QObject::tr("User"));
     118    dbUserName->setHelpText(QObject::tr("The user name to use while "
     119                                        "connecting to the database. "
     120                                        "This information is required."));
     121    dbServer->addChild(dbUserName);
     122
     123    dbPassword = new TransTextualSetting();
     124    dbPassword->setLabel(QObject::tr("Password"));
     125    dbPassword->setHelpText(QObject::tr("The password to use while "
     126                                        "connecting to the database. "
     127                                        "This information is required."));
     128    dbServer->addChild(dbPassword);
     129
     130    addChild(dbServer);
     131
     132    localEnabled = new TransBoolSetting();
     133    localEnabled->setLabel(QObject::tr("Use custom identifier for frontend "
     134                                       "preferences"));
     135    localEnabled->setHelpText(QObject::tr("If this frontend's host name "
     136                                          "changes often, check this box "
     137                                          "and provide a network-unique "
     138                                          "name to identify it. "
     139                                          "If unchecked, the frontend "
     140                                          "machine's local host name will "
     141                                          "be used to save preferences in "
     142                                          "the database."));
     143
     144    localHostName = new TransTextualSetting(true);
     145    localHostName->setLabel(QObject::tr("Custom identifier"));
     146    localHostName->setHelpText(QObject::tr("An identifier to use while "
     147                                           "saving the settings for this "
     148                                           "frontend."));
     149    localEnabled->addChild(true, localHostName);
     150
     151    wolEnabled = new TransBoolSetting();
     152    wolEnabled->setLabel(QObject::tr("Enable database server wakeup"));
     153    wolEnabled->setHelpText(QObject::tr("If enabled, the frontend will use "
     154                                        "database wakeup parameters to "
     155                                        "reconnect to the database server."));
     156
     157    wolReconnect = new TransRangeSetting(0, 60, 1, true);
     158    wolReconnect->setLabel(QObject::tr("Reconnect time"));
     159    wolReconnect->setHelpText(QObject::tr("The time in seconds to wait for "
     160                                          "the server to wake up."));
     161
     162    wolEnabled->addChild(true, wolReconnect);
     163
     164    wolRetry = new TransRangeSetting(1, 10, 1, true);
     165    wolRetry->setLabel(QObject::tr("Retry attempts"));
     166    wolRetry->setHelpText(QObject::tr("The number of retries to wake the "
     167                                      "server before the frontend gives "
     168                                      "up."));
     169
     170    wolEnabled->addChild(true, wolReconnect);
     171
     172    wolCommand = new TransTextualSetting(true);
     173    wolCommand->setLabel(QObject::tr("Wake command"));
     174    wolCommand->setHelpText(QObject::tr("The command executed on this "
     175                                        "frontend to wake up the database "
     176                                        "server (eg. sudo /etc/init.d/mysql "
     177                                        "restart)."));
     178
     179    wolEnabled->addChild(true, wolCommand);
     180
     181    addChild(wolEnabled);
     182}
     183
     184void MythDbSettings::Load(void)
     185{
     186    DatabaseParams params = gContext->GetDatabaseParams();
     187
     188    if (params.dbHostName.isEmpty() ||
     189        params.dbUserName.isEmpty() ||
     190        params.dbPassword.isEmpty() ||
     191        params.dbName.isEmpty())
     192        setHelpText(getHelpText() + "\n" +
     193                       QObject::tr("Required fields are"
     194                                   " marked with an asterisk (*)."));
     195
     196    if (params.dbHostName.isEmpty())
     197    {
     198        dbHostName->setLabel("* " + dbHostName->getLabel());
     199//TODO?        dbHostName->setValue(m_DBhostOverride);
     200    }
     201    else
     202        dbHostName->setValue(params.dbHostName);
     203
     204    dbHostPing->setValue(params.dbHostPing);
     205
     206    if (params.dbPort)
     207        dbPort->setValue(QString::number(params.dbPort));
     208
     209    dbUserName->setValue(params.dbUserName);
     210    if (params.dbUserName.isEmpty())
     211        dbUserName->setLabel("* " + dbUserName->getLabel());
     212    dbPassword->setValue(params.dbPassword);
     213    if (params.dbPassword.isEmpty())
     214        dbPassword->setLabel("* " + dbPassword->getLabel());
     215    dbName->setValue(params.dbName);
     216    if (params.dbName.isEmpty())
     217        dbName->setLabel("* " + dbName->getLabel());
     218
     219    localEnabled->setValue(params.localEnabled);
     220    localHostName->setValue(params.localHostName);
     221
     222    wolEnabled->setValue(params.wolEnabled);
     223    wolReconnect->setValue(params.wolReconnect);
     224    wolRetry->setValue(params.wolRetry);
     225    wolCommand->setValue(params.wolCommand);
     226}
     227
     228void MythDbSettings::Save(void)
     229{
     230    DatabaseParams params = gContext->GetDatabaseParams();
     231
     232    params.dbHostName    = dbHostName->getValue();
     233    params.dbHostPing    = dbHostPing->boolValue();
     234    params.dbPort        = dbPort->getValue().toInt();
     235    params.dbUserName    = dbUserName->getValue();
     236    params.dbPassword    = dbPassword->getValue();
     237    params.dbName        = dbName->getValue();
     238    params.dbType        = "QMYSQL";
     239    params.localEnabled  = localEnabled->boolValue();
     240    params.localHostName = localHostName->getValue();
     241    params.wolEnabled    = wolEnabled->boolValue();
     242    params.wolReconnect  = wolReconnect->intValue();
     243    params.wolRetry      = wolRetry->intValue();
     244    params.wolCommand    = wolCommand->getValue();
     245
     246    gContext->SaveDatabaseParams(params);
     247}
     248
     249static HostBoolSetting *DecodeExtraAudio()
     250{
     251    HostBoolSetting *gc = new HostBoolSetting("DecodeExtraAudio");
    45252    gc->setLabel(QObject::tr("Extra audio buffering"));
    46253    gc->setValue(true);
    47254    gc->setHelpText(QObject::tr("Enable this setting if MythTV is playing "
    static HostCheckBox *DecodeExtraAudio()  
    53260    return gc;
    54261}
    55262
    56 static HostComboBox *PIPLocationComboBox()
     263static HostListSetting *PIPLocationComboBox()
    57264{
    58     HostComboBox *gc = new HostComboBox("PIPLocation");
     265    HostListSetting *gc = new HostListSetting("PIPLocation");
    59266    gc->setLabel(QObject::tr("PIP video location"));
    60267    for (uint loc = 0; loc < kPIP_END; ++loc)
    61268        gc->addSelection(toString((PIPLocation) loc), QString::number(loc));
    static HostComboBox *PIPLocationComboBox()  
    63270    return gc;
    64271}
    65272
    66 static HostComboBox *DisplayRecGroup()
     273static HostListSetting *DisplayRecGroup()
    67274{
    68     HostComboBox *gc = new HostComboBox("DisplayRecGroup");
     275    HostListSetting *gc = new HostListSetting("DisplayRecGroup");
    69276    gc->setLabel(QObject::tr("Default group filter to apply"));
    70277
    71278    gc->addSelection(QObject::tr("All Programs"), QString("All Programs"));
    static HostComboBox *DisplayRecGroup()  
    102309    return gc;
    103310}
    104311
    105 static HostCheckBox *QueryInitialFilter()
     312static HostBoolSetting *QueryInitialFilter()
    106313{
    107     HostCheckBox *gc = new HostCheckBox("QueryInitialFilter");
     314    HostBoolSetting *gc = new HostBoolSetting("QueryInitialFilter");
    108315    gc->setLabel(QObject::tr("Always prompt for initial group filter"));
    109316    gc->setValue(false);
    110317    gc->setHelpText(QObject::tr("If enabled, always prompt the user for the "
    static HostCheckBox *QueryInitialFilter()  
    113320    return gc;
    114321}
    115322
    116 static HostCheckBox *RememberRecGroup()
     323static HostBoolSetting *RememberRecGroup()
    117324{
    118     HostCheckBox *gc = new HostCheckBox("RememberRecGroup");
     325    HostBoolSetting *gc = new HostBoolSetting("RememberRecGroup");
    119326    gc->setLabel(QObject::tr("Save current group filter when changed"));
    120327    gc->setValue(true);
    121328    gc->setHelpText(QObject::tr("If enabled, remember the last selected filter "
    static HostCheckBox *RememberRecGroup()  
    124331    return gc;
    125332}
    126333
    127 static HostCheckBox *UseGroupNameAsAllPrograms()
     334static HostBoolSetting *UseGroupNameAsAllPrograms()
    128335{
    129     HostCheckBox *gc = new HostCheckBox("DispRecGroupAsAllProg");
     336    HostBoolSetting *gc = new HostBoolSetting("DispRecGroupAsAllProg");
    130337    gc->setLabel(QObject::tr("Show filter name instead of \"All Programs\""));
    131338    gc->setValue(false);
    132339    gc->setHelpText(QObject::tr("If enabled, use the name of the display "
    static HostCheckBox *UseGroupNameAsAllPrograms()  
    135342    return gc;
    136343}
    137344
    138 static HostCheckBox *PBBStartInTitle()
     345static HostBoolSetting *PBBStartInTitle()
    139346{
    140     HostCheckBox *gc = new HostCheckBox("PlaybackBoxStartInTitle");
     347    HostBoolSetting *gc = new HostBoolSetting("PlaybackBoxStartInTitle");
    141348    gc->setLabel(QObject::tr("Start in group list"));
    142349    gc->setValue(true);
    143350    gc->setHelpText(QObject::tr("If enabled, the focus will "
    static HostCheckBox *PBBStartInTitle()  
    146353    return gc;
    147354}
    148355
    149 static HostCheckBox *SmartForward()
     356static HostBoolSetting *SmartForward()
    150357{
    151     HostCheckBox *gc = new HostCheckBox("SmartForward");
     358    HostBoolSetting *gc = new HostBoolSetting("SmartForward");
    152359    gc->setLabel(QObject::tr("Smart fast forwarding"));
    153360    gc->setValue(false);
    154361    gc->setHelpText(QObject::tr("If enabled, then immediately after "
    static HostCheckBox *SmartForward()  
    157364    return gc;
    158365}
    159366
    160 static HostCheckBox *ExactSeeking()
     367static HostBoolSetting *ExactSeeking()
    161368{
    162     HostCheckBox *gc = new HostCheckBox("ExactSeeking");
     369    HostBoolSetting *gc = new HostBoolSetting("ExactSeeking");
    163370    gc->setLabel(QObject::tr("Seek to exact frame"));
    164371    gc->setValue(false);
    165372    gc->setHelpText(QObject::tr("If enabled, seeking is frame exact, but "
    static HostCheckBox *ExactSeeking()  
    167374    return gc;
    168375}
    169376
    170 static GlobalComboBox *CommercialSkipMethod()
     377static GlobalListSetting *CommercialSkipMethod()
    171378{
    172     GlobalComboBox *bc = new GlobalComboBox("CommercialSkipMethod");
     379    GlobalListSetting *bc = new GlobalListSetting("CommercialSkipMethod");
    173380    bc->setLabel(QObject::tr("Commercial detection method"));
    174381    bc->setHelpText(QObject::tr(
    175382                        "This determines the method used by MythTV to "
    static GlobalComboBox *CommercialSkipMethod()  
    182389    return bc;
    183390}
    184391
    185 static GlobalCheckBox *CommFlagFast()
     392static GlobalBoolSetting *CommFlagFast()
    186393{
    187     GlobalCheckBox *gc = new GlobalCheckBox("CommFlagFast");
     394    GlobalBoolSetting *gc = new GlobalBoolSetting("CommFlagFast");
    188395    gc->setLabel(QObject::tr("Enable experimental speedup of commercial detection"));
    189396    gc->setValue(false);
    190397    gc->setHelpText(QObject::tr("If enabled, experimental commercial detection "
    static GlobalCheckBox *CommFlagFast()  
    192399    return gc;
    193400}
    194401
    195 static HostComboBox *AutoCommercialSkip()
     402static HostListSetting *AutoCommercialSkip()
    196403{
    197     HostComboBox *gc = new HostComboBox("AutoCommercialSkip");
     404    HostListSetting *gc = new HostListSetting("AutoCommercialSkip");
    198405    gc->setLabel(QObject::tr("Automatically skip commercials"));
    199406    gc->addSelection(QObject::tr("Off"), "0");
    200407    gc->addSelection(QObject::tr("Notify, but do not skip"), "2");
    static HostComboBox *AutoCommercialSkip()  
    206413    return gc;
    207414}
    208415
    209 static GlobalCheckBox *AutoMetadataLookup()
     416static GlobalBoolSetting *AutoMetadataLookup()
    210417{
    211     GlobalCheckBox *bc = new GlobalCheckBox("AutoMetadataLookup");
     418    GlobalBoolSetting *bc = new GlobalBoolSetting("AutoMetadataLookup");
    212419    bc->setLabel(QObject::tr("Run metadata lookup"));
    213420    bc->setValue(true);
    214421    bc->setHelpText(QObject::tr("This is the default value used for the "
    static GlobalCheckBox *AutoMetadataLookup()  
    217424    return bc;
    218425}
    219426
    220 static GlobalCheckBox *AutoCommercialFlag()
     427static GlobalBoolSetting *AutoCommercialFlag()
    221428{
    222     GlobalCheckBox *bc = new GlobalCheckBox("AutoCommercialFlag");
     429    GlobalBoolSetting *bc = new GlobalBoolSetting("AutoCommercialFlag");
    223430    bc->setLabel(QObject::tr("Run commercial detection"));
    224431    bc->setValue(true);
    225432    bc->setHelpText(QObject::tr("This is the default value used for the "
    static GlobalCheckBox *AutoCommercialFlag()  
    228435    return bc;
    229436}
    230437
    231 static GlobalCheckBox *AutoTranscode()
     438static GlobalBoolSetting *AutoTranscode()
    232439{
    233     GlobalCheckBox *bc = new GlobalCheckBox("AutoTranscode");
     440    GlobalBoolSetting *bc = new GlobalBoolSetting("AutoTranscode");
    234441    bc->setLabel(QObject::tr("Run transcoder"));
    235442    bc->setValue(false);
    236443    bc->setHelpText(QObject::tr("This is the default value used for the "
    static GlobalCheckBox *AutoTranscode()  
    239446    return bc;
    240447}
    241448
    242 static GlobalComboBox *DefaultTranscoder()
     449static GlobalListSetting *DefaultTranscoder()
    243450{
    244     GlobalComboBox *bc = new GlobalComboBox("DefaultTranscoder");
    245     bc->setLabel(QObject::tr("Default transcoder"));
     451    GlobalListSetting *ls = new GlobalListSetting("DefaultTranscoder");
     452    ls->setLabel(QObject::tr("Default transcoder"));
     453    //begin hack, I did not want to change any code outside of mythfrontend
     454    GlobalComboBox *bc = new GlobalComboBox("DefaultTranscoder");   
    246455    RecordingProfile::fillSelections(bc, RecordingProfile::TranscoderGroup,
    247                                      true);
    248     bc->setHelpText(QObject::tr("This is the default value used for the "
     456                                     true);
     457    uint i;
     458    for (i=0; i< bc->size(); i++)
     459    {
     460        ls->addSelection(bc->GetLabel(i),bc->GetValue(i));
     461    }
     462    delete bc;
     463    //end hack
     464    ls->setHelpText(QObject::tr("This is the default value used for the "
    249465                    "transcoder setting when a new scheduled "
    250466                    "recording is created."));
    251     return bc;
     467    return ls;
    252468}
    253469
    254 static GlobalSpinBox *DeferAutoTranscodeDays()
     470static GlobalRangeSetting *DeferAutoTranscodeDays()
    255471{
    256     GlobalSpinBox *gs = new GlobalSpinBox("DeferAutoTranscodeDays", 0, 365, 1);
     472    GlobalRangeSetting *gs = new GlobalRangeSetting("DeferAutoTranscodeDays", 0, 365, 1);
    257473    gs->setLabel(QObject::tr("Deferral days for auto transcode jobs"));
    258474    gs->setHelpText(QObject::tr("If non-zero, automatic transcode jobs will "
    259475                    "be scheduled to run this many days after a recording "
    static GlobalSpinBox *DeferAutoTranscodeDays()  
    262478    return gs;
    263479}
    264480
    265 static GlobalCheckBox *AutoRunUserJob(uint job_num)
     481static GlobalBoolSetting *AutoRunUserJob(uint job_num)
    266482{
    267483    QString dbStr = QString("AutoRunUserJob%1").arg(job_num);
    268484    QString label = QObject::tr("Run user job #%1")
    269485        .arg(job_num);
    270     GlobalCheckBox *bc = new GlobalCheckBox(dbStr);
     486    GlobalBoolSetting *bc = new GlobalBoolSetting(dbStr);
    271487    bc->setLabel(label);
    272488    bc->setValue(false);
    273489    bc->setHelpText(QObject::tr("This is the default value used for the "
    static GlobalCheckBox *AutoRunUserJob(uint job_num)  
    278494    return bc;
    279495}
    280496
    281 static GlobalCheckBox *AggressiveCommDetect()
     497static GlobalBoolSetting *AggressiveCommDetect()
    282498{
    283     GlobalCheckBox *bc = new GlobalCheckBox("AggressiveCommDetect");
     499    GlobalBoolSetting *bc = new GlobalBoolSetting("AggressiveCommDetect");
    284500    bc->setLabel(QObject::tr("Strict commercial detection"));
    285501    bc->setValue(true);
    286502    bc->setHelpText(QObject::tr("Enable stricter commercial detection code. "
    static GlobalCheckBox *AggressiveCommDetect()  
    288504    return bc;
    289505}
    290506
    291 static HostSpinBox *CommRewindAmount()
     507static HostRangeSetting *CommRewindAmount()
    292508{
    293     HostSpinBox *gs = new HostSpinBox("CommRewindAmount", 0, 10, 1);
     509    HostRangeSetting *gs = new HostRangeSetting("CommRewindAmount", 0, 10, 1);
    294510    gs->setLabel(QObject::tr("Commercial skip automatic rewind amount (secs)"));
    295511    gs->setHelpText(QObject::tr("MythTV will automatically rewind "
    296512                    "this many seconds after performing a commercial skip."));
    static HostSpinBox *CommRewindAmount()  
    298514    return gs;
    299515}
    300516
    301 static HostSpinBox *CommNotifyAmount()
     517static HostRangeSetting *CommNotifyAmount()
    302518{
    303     HostSpinBox *gs = new HostSpinBox("CommNotifyAmount", 0, 10, 1);
     519    HostRangeSetting *gs = new HostRangeSetting("CommNotifyAmount", 0, 10, 1);
    304520    gs->setLabel(QObject::tr("Commercial skip notify amount (secs)"));
    305521    gs->setHelpText(QObject::tr("MythTV will act like a commercial "
    306522                    "begins this many seconds early. This can be useful "
    static HostSpinBox *CommNotifyAmount()  
    310526    return gs;
    311527}
    312528
    313 static GlobalSpinBox *MaximumCommercialSkip()
     529static GlobalRangeSetting *MaximumCommercialSkip()
    314530{
    315     GlobalSpinBox *bs = new GlobalSpinBox("MaximumCommercialSkip", 0, 3600, 10);
     531    GlobalRangeSetting *bs = new GlobalRangeSetting("MaximumCommercialSkip", 0, 3600, 10);
    316532    bs->setLabel(QObject::tr("Maximum commercial skip (secs)"));
    317533    bs->setHelpText(QObject::tr("MythTV will discourage long manual commercial "
    318534                    "skips. Skips which are longer than this will require the "
    static GlobalSpinBox *MaximumCommercialSkip()  
    322538    return bs;
    323539}
    324540
    325 static GlobalSpinBox *MergeShortCommBreaks()
     541static GlobalRangeSetting *MergeShortCommBreaks()
    326542{
    327     GlobalSpinBox *bs = new GlobalSpinBox("MergeShortCommBreaks", 0, 3600, 5);
     543    GlobalRangeSetting *bs = new GlobalRangeSetting("MergeShortCommBreaks", 0, 3600, 5);
    328544    bs->setLabel(QObject::tr("Merge short commercial breaks (secs)"));
    329545    bs->setHelpText(QObject::tr("Treat consecutive commercial breaks shorter "
    330546                    "than this as one break when skipping forward. Useful if "
    static GlobalSpinBox *MergeShortCommBreaks()  
    334550    return bs;
    335551}
    336552
    337 static GlobalSpinBox *AutoExpireExtraSpace()
     553static GlobalRangeSetting *AutoExpireExtraSpace()
    338554{
    339     GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireExtraSpace", 0, 200, 1);
     555    GlobalRangeSetting *bs = new GlobalRangeSetting("AutoExpireExtraSpace", 0, 200, 1);
    340556    bs->setLabel(QObject::tr("Extra disk space (GB)"));
    341557    bs->setHelpText(QObject::tr("Extra disk space (in gigabytes) beyond what "
    342558                    "MythTV requires that you want to keep free on the "
    static GlobalSpinBox *AutoExpireExtraSpace()  
    345561    return bs;
    346562};
    347563
    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()
     564static GlobalRangeSetting *DeletedMaxAge()
    360565{
    361     GlobalSpinBox *bs = new GlobalSpinBox("DeletedMaxAge", 0, 365, 1);
     566    GlobalRangeSetting *bs = new GlobalRangeSetting("DeletedMaxAge", 0, 365, 1);
    362567    bs->setLabel(QObject::tr("Deleted max age (days)"));
    363568    bs->setHelpText(QObject::tr("When set to a number greater than zero, "
    364569                    "Auto-Expire will force expiration of Deleted recordings "
    static GlobalSpinBox *DeletedMaxAge()  
    367572    return bs;
    368573};
    369574
    370 static GlobalCheckBox *DeletedFifoOrder()
     575static GlobalBoolSetting *DeletedFifoOrder()
    371576{
    372     GlobalCheckBox *cb = new GlobalCheckBox("DeletedFifoOrder");
     577    GlobalBoolSetting *cb = new GlobalBoolSetting("DeletedFifoOrder");
    373578    cb->setLabel(QObject::tr("Expire in deleted order"));
    374579    cb->setValue(false);
    375580    cb->setHelpText(QObject::tr(
    static GlobalCheckBox *DeletedFifoOrder()  
    378583    return cb;
    379584};
    380585
    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 };
     586static GlobalBoolSetting *AutoExpireInsteadOfDelete()
     587{
     588    GlobalBoolSetting *cb = new GlobalBoolSetting("AutoExpireInsteadOfDelete");
     589    cb->setLabel(QObject::tr("Auto-Expire instead of delete recording"));
     590    cb->setValue(false);
     591    cb->setHelpText(QObject::tr("If enabled, move deleted recordings to the "
     592                    "'Deleted' recgroup and turn on autoexpire "
     593                    "instead of deleting immediately."));
     594    cb->addChild(true, DeletedFifoOrder());
     595    cb->addChild(true, DeletedMaxAge());
     596    return cb;
     597}
    402598
    403 static GlobalComboBox *AutoExpireMethod()
     599static GlobalListSetting *AutoExpireMethod()
    404600{
    405     GlobalComboBox *bc = new GlobalComboBox("AutoExpireMethod");
     601    GlobalListSetting *bc = new GlobalListSetting("AutoExpireMethod");
    406602    bc->setLabel(QObject::tr("Auto-Expire method"));
    407603    bc->addSelection(QObject::tr("Oldest show first"), "1");
    408604    bc->addSelection(QObject::tr("Lowest priority first"), "2");
    static GlobalComboBox *AutoExpireMethod()  
    414610    return bc;
    415611}
    416612
    417 static GlobalCheckBox *AutoExpireWatchedPriority()
     613static GlobalBoolSetting *AutoExpireWatchedPriority()
    418614{
    419     GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireWatchedPriority");
     615    GlobalBoolSetting *bc = new GlobalBoolSetting("AutoExpireWatchedPriority");
    420616    bc->setLabel(QObject::tr("Watched before unwatched"));
    421617    bc->setValue(false);
    422618    bc->setHelpText(QObject::tr("If enabled, programs that have been marked as "
    static GlobalCheckBox *AutoExpireWatchedPriority()  
    425621    return bc;
    426622}
    427623
    428 static GlobalSpinBox *AutoExpireDayPriority()
     624static GlobalRangeSetting *AutoExpireDayPriority()
    429625{
    430     GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireDayPriority", 1, 400, 1);
     626    GlobalRangeSetting *bs = new GlobalRangeSetting("AutoExpireDayPriority", 1, 400, 1);
    431627    bs->setLabel(QObject::tr("Priority weight"));
    432628    bs->setHelpText(QObject::tr("The number of days bonus a program gets for "
    433629                    "each priority point. This is only used when the Weighted "
    static GlobalSpinBox *AutoExpireDayPriority()  
    436632    return bs;
    437633};
    438634
    439 static GlobalCheckBox *AutoExpireDefault()
     635static GlobalBoolSetting *AutoExpireDefault()
    440636{
    441     GlobalCheckBox *bc = new GlobalCheckBox("AutoExpireDefault");
     637    GlobalBoolSetting *bc = new GlobalBoolSetting("AutoExpireDefault");
    442638    bc->setLabel(QObject::tr("Auto-Expire default"));
    443639    bc->setValue(true);
    444640    bc->setHelpText(QObject::tr("If enabled, any new recording schedules "
    static GlobalCheckBox *AutoExpireDefault()  
    447643    return bc;
    448644}
    449645
    450 static GlobalSpinBox *AutoExpireLiveTVMaxAge()
     646static GlobalRangeSetting *AutoExpireLiveTVMaxAge()
    451647{
    452     GlobalSpinBox *bs = new GlobalSpinBox("AutoExpireLiveTVMaxAge", 1, 365, 1);
     648    GlobalRangeSetting *bs = new GlobalRangeSetting("AutoExpireLiveTVMaxAge", 1, 365, 1);
    453649    bs->setLabel(QObject::tr("Live TV max age (days)"));
    454650    bs->setHelpText(QObject::tr("Auto-Expire will force expiration of Live "
    455651                    "TV recordings when they are this many days old. Live TV "
    static GlobalSpinBox *MinRecordDiskThreshold()  
    474670}
    475671#endif
    476672
    477 static GlobalCheckBox *RerecordWatched()
     673static GlobalBoolSetting *RerecordWatched()
    478674{
    479     GlobalCheckBox *bc = new GlobalCheckBox("RerecordWatched");
     675    GlobalBoolSetting *bc = new GlobalBoolSetting("RerecordWatched");
    480676    bc->setLabel(QObject::tr("Re-record watched"));
    481677    bc->setValue(false);
    482678    bc->setHelpText(QObject::tr("If enabled, programs that have been marked as "
    static GlobalCheckBox *RerecordWatched()  
    485681    return bc;
    486682}
    487683
    488 static GlobalSpinBox *RecordPreRoll()
     684static GlobalRangeSetting *RecordPreRoll()
    489685{
    490     GlobalSpinBox *bs = new GlobalSpinBox("RecordPreRoll", 0, 600, 60, true);
     686    GlobalRangeSetting *bs = new GlobalRangeSetting("RecordPreRoll", 0, 600, 60, true);
    491687    bs->setLabel(QObject::tr("Time to record before start of show "
    492688                 "(secs)"));
    493689    bs->setHelpText(QObject::tr("This global setting allows the recorder "
    static GlobalSpinBox *RecordPreRoll()  
    498694    return bs;
    499695}
    500696
    501 static GlobalSpinBox *RecordOverTime()
     697static GlobalRangeSetting *RecordOverTime()
    502698{
    503     GlobalSpinBox *bs = new GlobalSpinBox("RecordOverTime", 0, 1800, 60, true);
     699    GlobalRangeSetting *bs = new GlobalRangeSetting("RecordOverTime", 0, 1800, 60, true);
    504700    bs->setLabel(QObject::tr("Time to record past end of show (secs)"));
    505701    bs->setValue(0);
    506702    bs->setHelpText(QObject::tr("This global setting allows the recorder "
    static GlobalSpinBox *RecordOverTime()  
    510706    return bs;
    511707}
    512708
    513 static GlobalComboBox *OverTimeCategory()
     709static GlobalListSetting *OverTimeCategory()
    514710{
    515     GlobalComboBox *gc = new GlobalComboBox("OverTimeCategory");
     711    GlobalListSetting *gc = new GlobalListSetting("OverTimeCategory");
    516712    gc->setLabel(QObject::tr("Category of shows to be extended"));
    517713    gc->setHelpText(QObject::tr("For a special category (e.g. "
    518714                    "\"Sports event\"), request that shows be autoextended. "
    static GlobalComboBox *OverTimeCategory()  
    535731    return gc;
    536732}
    537733
    538 static GlobalSpinBox *CategoryOverTime()
     734static GlobalRangeSetting *CategoryOverTime()
    539735{
    540     GlobalSpinBox *bs = new GlobalSpinBox("CategoryOverTime",
     736    GlobalRangeSetting *bs = new GlobalRangeSetting("CategoryOverTime",
    541737                                          0, 180, 60, true);
    542738    bs->setLabel(QObject::tr("Record past end of show (mins)"));
    543739    bs->setValue(30);
    static GlobalSpinBox *CategoryOverTime()  
    548744    return bs;
    549745}
    550746
    551 static VerticalConfigurationGroup *CategoryOverTimeSettings()
     747static GroupSetting *CategoryOverTimeSettings()
    552748{
    553     VerticalConfigurationGroup *vcg =
    554         new VerticalConfigurationGroup(false, false);
     749    GroupSetting *vcg =
     750        new GroupSetting();
    555751
    556752    vcg->setLabel(QObject::tr("Category record over-time"));
    557     vcg->setUseLabel(true);
    558753    vcg->addChild(OverTimeCategory());
    559754    vcg->addChild(CategoryOverTime());
    560755    return vcg;
    void PlaybackProfileConfigs::triggerChanged(const QString &trig)  
    12491444    TriggeredConfigurationGroup::triggerChanged(trig);
    12501445}
    12511446
    1252 static HostComboBox *PlayBoxOrdering()
     1447static HostListSetting *PlayBoxOrdering()
    12531448{
    12541449    QString str[4] =
    12551450    {
    static HostComboBox *PlayBoxOrdering()  
    12641459        "refers to sections (e.g. \"All Programs\") which list "
    12651460        "multiple titles. Sections in parentheses are not affected.");
    12661461
    1267     HostComboBox *gc = new HostComboBox("PlayBoxOrdering");
     1462    HostListSetting *gc = new HostListSetting("PlayBoxOrdering");
    12681463    gc->setLabel(QObject::tr("Episode sort orderings"));
    12691464
    12701465    for (int i = 0; i < 4; ++i)
    static HostComboBox *PlayBoxOrdering()  
    12761471    return gc;
    12771472}
    12781473
    1279 static HostComboBox *PlayBoxEpisodeSort()
     1474static HostListSetting *PlayBoxEpisodeSort()
    12801475{
    1281     HostComboBox *gc = new HostComboBox("PlayBoxEpisodeSort");
     1476    HostListSetting *gc = new HostListSetting("PlayBoxEpisodeSort");
    12821477    gc->setLabel(QObject::tr("Sort episodes"));
    12831478    gc->addSelection(QObject::tr("Record date"), "Date");
    12841479    gc->addSelection(QObject::tr("Season/Episode"), "Season");
    static HostComboBox *PlayBoxEpisodeSort()  
    12881483    return gc;
    12891484}
    12901485
    1291 static HostSpinBox *FFRewReposTime()
     1486static HostRangeSetting *FFRewReposTime()
    12921487{
    1293     HostSpinBox *gs = new HostSpinBox("FFRewReposTime", 0, 200, 5);
     1488    HostRangeSetting *gs = new HostRangeSetting("FFRewReposTime", 0, 200, 5);
    12941489    gs->setLabel(QObject::tr("Fast forward/rewind reposition amount"));
    12951490    gs->setValue(100);
    12961491    gs->setHelpText(QObject::tr("When exiting sticky keys fast forward/rewind "
    static HostSpinBox *FFRewReposTime()  
    13011496    return gs;
    13021497}
    13031498
    1304 static HostCheckBox *FFRewReverse()
     1499static HostBoolSetting *FFRewReverse()
    13051500{
    1306     HostCheckBox *gc = new HostCheckBox("FFRewReverse");
     1501    HostBoolSetting *gc = new HostBoolSetting("FFRewReverse");
    13071502    gc->setLabel(QObject::tr("Reverse direction in fast forward/rewind"));
    13081503    gc->setValue(true);
    13091504    gc->setHelpText(QObject::tr("If enabled, pressing the sticky rewind key "
    static HostCheckBox *FFRewReverse()  
    13141509    return gc;
    13151510}
    13161511
    1317 static HostComboBox *MenuTheme()
     1512static HostListSetting *MenuTheme()
    13181513{
    1319     HostComboBox *gc = new HostComboBox("MenuTheme");
     1514    HostListSetting *gc = new HostListSetting("MenuTheme");
    13201515    gc->setLabel(QObject::tr("Menu theme"));
    13211516
    13221517    QList<ThemeInfo> themelist = GetMythUI()->GetThemes(THEME_MENU);
    static HostComboBox MUNUSED *DecodeVBIFormat()  
    13481543    return gc;
    13491544}
    13501545
    1351 static HostSpinBox *OSDCC708TextZoomPercentage(void)
     1546static HostRangeSetting *OSDCC708TextZoomPercentage(void)
    13521547{
    1353     HostSpinBox *gs = new HostSpinBox("OSDCC708TextZoom", 50, 200, 5);
     1548    HostRangeSetting *gs = new HostRangeSetting("OSDCC708TextZoom", 50, 200, 5);
    13541549    gs->setLabel(QObject::tr("Subtitle text zoom percentage"));
    13551550    gs->setValue(100);
    13561551    gs->setHelpText(QObject::tr("Use this to enlarge or shrink text based subtitles."));
    static HostSpinBox *OSDCC708TextZoomPercentage(void)  
    13581553    return gs;
    13591554}
    13601555
    1361 static HostComboBox *SubtitleFont()
     1556static HostListSetting *SubtitleFont()
    13621557{
    1363     HostComboBox *hcb = new HostComboBox("OSDSubFont");
     1558    HostListSetting *hcb = new HostListSetting("OSDSubFont");
    13641559    QFontDatabase db;
    13651560    QStringList fonts = db.families();
    13661561    QStringList hide  = db.families(QFontDatabase::Symbol);
    static HostComboBox *SubtitleFont()  
    13751570    return hcb;
    13761571}
    13771572
    1378 static HostComboBox *SubtitleCodec()
     1573static HostListSetting *SubtitleCodec()
    13791574{
    1380     HostComboBox *gc = new HostComboBox("SubtitleCodec");
     1575    HostListSetting *gc = new HostListSetting("SubtitleCodec");
    13811576
    13821577    gc->setLabel(QObject::tr("Subtitle Codec"));
    13831578    QList<QByteArray> list = QTextCodec::availableCodecs();
    static HostComboBox *SubtitleCodec()  
    13901585    return gc;
    13911586}
    13921587
    1393 static HostComboBox *ChannelOrdering()
     1588static HostListSetting *ChannelOrdering()
    13941589{
    1395     HostComboBox *gc = new HostComboBox("ChannelOrdering");
     1590    HostListSetting *gc = new HostListSetting("ChannelOrdering");
    13961591    gc->setLabel(QObject::tr("Channel ordering"));
    13971592    gc->addSelection(QObject::tr("channel number"), "channum");
    13981593    gc->addSelection(QObject::tr("callsign"),       "callsign");
    13991594    return gc;
    14001595}
    14011596
    1402 static HostSpinBox *VertScanPercentage()
     1597static HostRangeSetting *VertScanPercentage()
    14031598{
    1404     HostSpinBox *gs = new HostSpinBox("VertScanPercentage", -100, 100, 1);
     1599    HostRangeSetting *gs = new HostRangeSetting("VertScanPercentage", -100, 100, 1);
    14051600    gs->setLabel(QObject::tr("Vertical scaling"));
    14061601    gs->setValue(0);
    14071602    gs->setHelpText(QObject::tr(
    static HostSpinBox *VertScanPercentage()  
    14101605    return gs;
    14111606}
    14121607
    1413 static HostSpinBox *HorizScanPercentage()
     1608static HostRangeSetting *HorizScanPercentage()
    14141609{
    1415     HostSpinBox *gs = new HostSpinBox("HorizScanPercentage", -100, 100, 1);
     1610    HostRangeSetting *gs = new HostRangeSetting("HorizScanPercentage", -100, 100, 1);
    14161611    gs->setLabel(QObject::tr("Horizontal scaling"));
    14171612    gs->setValue(0);
    14181613    gs->setHelpText(QObject::tr(
    static HostSpinBox *HorizScanPercentage()  
    14211616    return gs;
    14221617};
    14231618
    1424 static HostSpinBox *XScanDisplacement()
     1619static HostRangeSetting *XScanDisplacement()
    14251620{
    1426     HostSpinBox *gs = new HostSpinBox("XScanDisplacement", -50, 50, 1);
     1621    HostRangeSetting *gs = new HostRangeSetting("XScanDisplacement", -50, 50, 1);
    14271622    gs->setLabel(QObject::tr("Scan displacement (X)"));
    14281623    gs->setValue(0);
    14291624    gs->setHelpText(QObject::tr("Adjust this to move the image horizontally."));
    14301625    return gs;
    14311626}
    14321627
    1433 static HostSpinBox *YScanDisplacement()
     1628static HostRangeSetting *YScanDisplacement()
    14341629{
    1435     HostSpinBox *gs = new HostSpinBox("YScanDisplacement", -50, 50, 1);
     1630    HostRangeSetting *gs = new HostRangeSetting("YScanDisplacement", -50, 50, 1);
    14361631    gs->setLabel(QObject::tr("Scan displacement (Y)"));
    14371632    gs->setValue(0);
    14381633    gs->setHelpText(QObject::tr("Adjust this to move the image vertically."));
    14391634    return gs;
    14401635};
    14411636
    1442 static HostCheckBox *CCBackground()
     1637static HostBoolSetting *CCBackground()
    14431638{
    1444     HostCheckBox *gc = new HostCheckBox("CCBackground");
     1639    HostBoolSetting *gc = new HostBoolSetting("CCBackground");
    14451640    gc->setLabel(QObject::tr("Black background for closed captioning"));
    14461641    gc->setValue(false);
    14471642    gc->setHelpText(QObject::tr(
    static HostCheckBox *CCBackground()  
    14511646    return gc;
    14521647}
    14531648
    1454 static HostCheckBox *DefaultCCMode()
     1649static HostBoolSetting *DefaultCCMode()
    14551650{
    1456     HostCheckBox *gc = new HostCheckBox("DefaultCCMode");
     1651    HostBoolSetting *gc = new HostBoolSetting("DefaultCCMode");
    14571652    gc->setLabel(QObject::tr("Always display closed captioning or subtitles"));
    14581653    gc->setValue(false);
    14591654    gc->setHelpText(QObject::tr(
    static HostCheckBox *DefaultCCMode()  
    14641659    return gc;
    14651660}
    14661661
    1467 static HostCheckBox *PreferCC708()
     1662static HostBoolSetting *PreferCC708()
    14681663{
    1469     HostCheckBox *gc = new HostCheckBox("Prefer708Captions");
     1664    HostBoolSetting *gc = new HostBoolSetting("Prefer708Captions");
    14701665    gc->setLabel(QObject::tr("Prefer EIA-708 over EIA-608 captions"));
    14711666    gc->setValue(true);
    14721667    gc->setHelpText(
    static HostCheckBox *PreferCC708()  
    14771672    return gc;
    14781673}
    14791674
    1480 static HostCheckBox *EnableMHEG()
     1675static HostBoolSetting *EnableMHEG()
    14811676{
    1482     HostCheckBox *gc = new HostCheckBox("EnableMHEG");
     1677    HostBoolSetting *gc = new HostBoolSetting("EnableMHEG");
    14831678    gc->setLabel(QObject::tr("Enable interactive TV"));
    14841679    gc->setValue(false);
    14851680    gc->setHelpText(QObject::tr(
    static HostCheckBox *EnableMHEG()  
    14891684    return gc;
    14901685}
    14911686
    1492 static HostCheckBox *PersistentBrowseMode()
     1687static HostBoolSetting *PersistentBrowseMode()
    14931688{
    1494     HostCheckBox *gc = new HostCheckBox("PersistentBrowseMode");
     1689    HostBoolSetting *gc = new HostBoolSetting("PersistentBrowseMode");
    14951690    gc->setLabel(QObject::tr("Always use browse mode in Live TV"));
    14961691    gc->setValue(true);
    14971692    gc->setHelpText(
    static HostCheckBox *PersistentBrowseMode()  
    15011696    return gc;
    15021697}
    15031698
    1504 static HostCheckBox *BrowseAllTuners()
     1699static HostBoolSetting *BrowseAllTuners()
    15051700{
    1506     HostCheckBox *gc = new HostCheckBox("BrowseAllTuners");
     1701    HostBoolSetting *gc = new HostBoolSetting("BrowseAllTuners");
    15071702    gc->setLabel(QObject::tr("Browse all channels"));
    15081703    gc->setValue(false);
    15091704    gc->setHelpText(
    static HostCheckBox *BrowseAllTuners()  
    15141709    return gc;
    15151710}
    15161711
    1517 static HostCheckBox *ClearSavedPosition()
     1712static HostBoolSetting *ClearSavedPosition()
    15181713{
    1519     HostCheckBox *gc = new HostCheckBox("ClearSavedPosition");
     1714    HostBoolSetting *gc = new HostBoolSetting("ClearSavedPosition");
    15201715    gc->setLabel(QObject::tr("Clear bookmark on playback"));
    15211716    gc->setValue(true);
    15221717    gc->setHelpText(QObject::tr("If enabled, automatically clear the "
    static HostCheckBox *ClearSavedPosition()  
    15261721    return gc;
    15271722}
    15281723
    1529 static HostCheckBox *AltClearSavedPosition()
     1724static HostBoolSetting *AltClearSavedPosition()
    15301725{
    1531     HostCheckBox *gc = new HostCheckBox("AltClearSavedPosition");
     1726    HostBoolSetting *gc = new HostBoolSetting("AltClearSavedPosition");
    15321727    gc->setLabel(QObject::tr("Alternate clear and save bookmark"));
    15331728    gc->setValue(true);
    15341729    gc->setHelpText(QObject::tr("During playback the SELECT key "
    static HostCheckBox *AltClearSavedPosition()  
    15391734    return gc;
    15401735}
    15411736
    1542 static HostComboBox *PlaybackExitPrompt()
     1737static HostListSetting *PlaybackExitPrompt()
    15431738{
    1544     HostComboBox *gc = new HostComboBox("PlaybackExitPrompt");
     1739    HostListSetting *gc = new HostListSetting("PlaybackExitPrompt");
    15451740    gc->setLabel(QObject::tr("Action on playback exit"));
    15461741    gc->addSelection(QObject::tr("Just exit"), "0");
    15471742    gc->addSelection(QObject::tr("Save position and exit"), "2");
    static HostComboBox *PlaybackExitPrompt()  
    15551750    return gc;
    15561751}
    15571752
    1558 static HostCheckBox *EndOfRecordingExitPrompt()
     1753static HostBoolSetting *EndOfRecordingExitPrompt()
    15591754{
    1560     HostCheckBox *gc = new HostCheckBox("EndOfRecordingExitPrompt");
     1755    HostBoolSetting *gc = new HostBoolSetting("EndOfRecordingExitPrompt");
    15611756    gc->setLabel(QObject::tr("Prompt at end of recording"));
    15621757    gc->setValue(false);
    15631758    gc->setHelpText(QObject::tr("If enabled, a menu will be displayed allowing "
    static HostCheckBox *EndOfRecordingExitPrompt()  
    15661761    return gc;
    15671762}
    15681763
    1569 static HostCheckBox *JumpToProgramOSD()
     1764static HostBoolSetting *JumpToProgramOSD()
    15701765{
    1571     HostCheckBox *gc = new HostCheckBox("JumpToProgramOSD");
     1766    HostBoolSetting *gc = new HostBoolSetting("JumpToProgramOSD");
    15721767    gc->setLabel(QObject::tr("Jump to program OSD"));
    15731768    gc->setValue(true);
    15741769    gc->setHelpText(QObject::tr(
    static HostCheckBox *JumpToProgramOSD()  
    15801775    return gc;
    15811776}
    15821777
    1583 static HostCheckBox *ContinueEmbeddedTVPlay()
     1778static HostBoolSetting *ContinueEmbeddedTVPlay()
    15841779{
    1585     HostCheckBox *gc = new HostCheckBox("ContinueEmbeddedTVPlay");
     1780    HostBoolSetting *gc = new HostBoolSetting("ContinueEmbeddedTVPlay");
    15861781    gc->setLabel(QObject::tr("Continue playback when embedded"));
    15871782    gc->setValue(false);
    15881783    gc->setHelpText(QObject::tr(
    static HostCheckBox *ContinueEmbeddedTVPlay()  
    15931788    return gc;
    15941789}
    15951790
    1596 static HostCheckBox *AutomaticSetWatched()
     1791static HostBoolSetting *AutomaticSetWatched()
    15971792{
    1598     HostCheckBox *gc = new HostCheckBox("AutomaticSetWatched");
     1793    HostBoolSetting *gc = new HostBoolSetting("AutomaticSetWatched");
    15991794    gc->setLabel(QObject::tr("Automatically mark a recording as watched"));
    16001795    gc->setValue(false);
    16011796    gc->setHelpText(QObject::tr("If enabled, when you exit near the end of a "
    static HostCheckBox *AutomaticSetWatched()  
    16061801    return gc;
    16071802}
    16081803
    1609 static HostSpinBox *LiveTVIdleTimeout()
     1804static HostRangeSetting *LiveTVIdleTimeout()
    16101805{
    1611     HostSpinBox *gs = new HostSpinBox("LiveTVIdleTimeout", 0, 3600, 1);
     1806    HostRangeSetting *gs = new HostRangeSetting("LiveTVIdleTimeout", 0, 3600, 1);
    16121807    gs->setLabel(QObject::tr("Live TV idle timeout (mins)"));
    16131808    gs->setValue(0);
    16141809    gs->setHelpText(QObject::tr(
    static HostSpinBox *LiveTVIdleTimeout()  
    16181813    return gs;
    16191814}
    16201815
    1621 // static HostCheckBox *PlaybackPreview()
     1816// static HostBoolSetting *PlaybackPreview()
    16221817// {
    1623 //     HostCheckBox *gc = new HostCheckBox("PlaybackPreview");
     1818//     HostCheckBox *gc = new HostBoolSetting("PlaybackPreview");
    16241819//     gc->setLabel(QObject::tr("Display live preview of recordings"));
    16251820//     gc->setValue(true);
    16261821//     gc->setHelpText(QObject::tr("If enabled, a preview of the recording "
    static HostSpinBox *LiveTVIdleTimeout()  
    16291824//     return gc;
    16301825// }
    16311826//
    1632 // static HostCheckBox *HWAccelPlaybackPreview()
     1827// static HostBoolSetting *HWAccelPlaybackPreview()
    16331828// {
    1634 //     HostCheckBox *gc = new HostCheckBox("HWAccelPlaybackPreview");
     1829//     HostBoolSetting *gc = new HostBoolSetting("HWAccelPlaybackPreview");
    16351830//     gc->setLabel(QObject::tr("Use HW Acceleration for live recording preview"));
    16361831//     gc->setValue(false);
    16371832//     gc->setHelpText(
    static HostSpinBox *LiveTVIdleTimeout()  
    16431838//     return gc;
    16441839// }
    16451840
    1646 static HostCheckBox *UseVirtualKeyboard()
     1841static HostBoolSetting *UseVirtualKeyboard()
    16471842{
    1648     HostCheckBox *gc = new HostCheckBox("UseVirtualKeyboard");
     1843    HostBoolSetting *gc = new HostBoolSetting("UseVirtualKeyboard");
    16491844    gc->setLabel(QObject::tr("Use line edit virtual keyboards"));
    16501845    gc->setValue(true);
    16511846    gc->setHelpText(QObject::tr("If enabled, you can use a virtual keyboard "
    static HostCheckBox *UseVirtualKeyboard()  
    16541849    return gc;
    16551850}
    16561851
    1657 static HostComboBox *OverrideExitMenu()
     1852static HostListSetting *OverrideExitMenu()
    16581853{
    1659     HostComboBox *gc = new HostComboBox("OverrideExitMenu");
     1854    HostListSetting *gc = new HostListSetting("OverrideExitMenu");
    16601855    gc->setLabel(QObject::tr("Customize exit menu options"));
    16611856    gc->addSelection(QObject::tr("Default"), "0");
    16621857    gc->addSelection(QObject::tr("Show quit"), "1");
    static HostComboBox *OverrideExitMenu()  
    16711866    return gc;
    16721867}
    16731868
    1674 static HostLineEdit *RebootCommand()
     1869static HostTextualSetting *RebootCommand()
    16751870{
    1676     HostLineEdit *ge = new HostLineEdit("RebootCommand");
     1871    HostTextualSetting *ge = new HostTextualSetting("RebootCommand");
    16771872    ge->setLabel(QObject::tr("Reboot command"));
    16781873    ge->setValue("");
    16791874    ge->setHelpText(QObject::tr("Optional. Script to run if you select "
    static HostLineEdit *RebootCommand()  
    16831878    return ge;
    16841879}
    16851880
    1686 static HostLineEdit *HaltCommand()
     1881static HostTextualSetting *HaltCommand()
    16871882{
    1688     HostLineEdit *ge = new HostLineEdit("HaltCommand");
     1883    HostTextualSetting *ge = new HostTextualSetting("HaltCommand");
    16891884    ge->setLabel(QObject::tr("Halt command"));
    16901885    ge->setValue("");
    16911886    ge->setHelpText(QObject::tr("Optional. Script to run if you select "
    static HostLineEdit *HaltCommand()  
    16951890    return ge;
    16961891}
    16971892
    1698 static HostLineEdit *LircDaemonDevice()
     1893static HostTextualSetting *LircDaemonDevice()
    16991894{
    1700     HostLineEdit *ge = new HostLineEdit("LircSocket");
     1895    HostTextualSetting *ge = new HostTextualSetting("LircSocket");
    17011896    ge->setLabel(QObject::tr("LIRC daemon socket"));
    17021897
    17031898    /* lircd socket moved from /dev/ to /var/run/lirc/ in lirc 0.8.6 */
    static HostLineEdit *LircDaemonDevice()  
    17121907    return ge;
    17131908}
    17141909
    1715 static HostLineEdit *ScreenShotPath()
     1910static HostTextualSetting *ScreenShotPath()
    17161911{
    1717     HostLineEdit *ge = new HostLineEdit("ScreenShotPath");
     1912    HostTextualSetting *ge = new HostTextualSetting("ScreenShotPath");
    17181913    ge->setLabel(QObject::tr("Screen shot path"));
    17191914    ge->setValue("/tmp/");
    17201915    ge->setHelpText(QObject::tr("Path to screenshot storage location. Should be writable by the frontend"));
    17211916    return ge;
    17221917}
    17231918
    1724 static HostLineEdit *SetupPinCode()
     1919static HostTextualSetting *SetupPinCode()
    17251920{
    1726     HostLineEdit *ge = new HostLineEdit("SetupPinCode");
     1921    HostTextualSetting *ge = new HostTextualSetting("SetupPinCode");
    17271922    ge->setLabel(QObject::tr("Setup PIN code"));
    17281923    ge->setHelpText(QObject::tr("This PIN is used to control access to the "
    17291924                    "setup menus. If you want to use this feature, then "
    static HostLineEdit *SetupPinCode()  
    17321927    return ge;
    17331928}
    17341929
    1735 static HostCheckBox *SetupPinCodeRequired()
     1930static HostBoolSetting *SetupPinCodeRequired()
    17361931{
    1737     HostCheckBox *gc = new HostCheckBox("SetupPinCodeRequired");
     1932    HostBoolSetting *gc = new HostBoolSetting("SetupPinCodeRequired");
    17381933    gc->setLabel(QObject::tr("Require setup PIN") + "    ");
    17391934    gc->setValue(false);
    17401935    gc->setHelpText(QObject::tr("If enabled, you will not be able to return "
    static HostCheckBox *SetupPinCodeRequired()  
    17431938    return gc;
    17441939}
    17451940
    1746 static HostComboBox *XineramaScreen()
     1941static HostListSetting *XineramaScreen()
    17471942{
    1748     HostComboBox *gc = new HostComboBox("XineramaScreen", false);
     1943    HostListSetting *gc = new HostListSetting("XineramaScreen", false);
    17491944    int num = MythDisplay::GetNumberXineramaScreens();
    17501945    for (int i=0; i<num; ++i)
    17511946        gc->addSelection(QString::number(i), QString::number(i));
    static HostComboBox *XineramaScreen()  
    17581953}
    17591954
    17601955
    1761 static HostComboBox *XineramaMonitorAspectRatio()
     1956static HostListSetting *XineramaMonitorAspectRatio()
    17621957{
    1763     HostComboBox *gc = new HostComboBox("XineramaMonitorAspectRatio");
     1958    HostListSetting *gc = new HostListSetting("XineramaMonitorAspectRatio");
    17641959    gc->setLabel(QObject::tr("Monitor aspect ratio"));
    17651960    gc->addSelection(QObject::tr("4:3"),   "1.3333");
    17661961    gc->addSelection(QObject::tr("16:9"),  "1.7777");
    static HostComboBox *XineramaMonitorAspectRatio()  
    17711966    return gc;
    17721967}
    17731968
    1774 static HostComboBox *LetterboxingColour()
     1969static HostListSetting *LetterboxingColour()
    17751970{
    1776     HostComboBox *gc = new HostComboBox("LetterboxColour");
     1971    HostListSetting *gc = new HostListSetting("LetterboxColour");
    17771972    gc->setLabel(QObject::tr("Letterboxing color"));
    17781973    for (int m = kLetterBoxColour_Black; m < kLetterBoxColour_END; ++m)
    17791974        gc->addSelection(toString((LetterBoxColour)m), QString::number(m));
    static HostComboBox *LetterboxingColour()  
    17861981    return gc;
    17871982}
    17881983
    1789 static HostComboBox *AspectOverride()
     1984static HostListSetting *AspectOverride()
    17901985{
    1791     HostComboBox *gc = new HostComboBox("AspectOverride");
     1986    HostListSetting *gc = new HostListSetting("AspectOverride");
    17921987    gc->setLabel(QObject::tr("Video aspect override"));
    17931988    for (int m = kAspect_Off; m < kAspect_END; ++m)
    17941989        gc->addSelection(toString((AspectOverrideMode)m), QString::number(m));
    static HostComboBox *AspectOverride()  
    17991994    return gc;
    18001995}
    18011996
    1802 static HostComboBox *AdjustFill()
     1997static HostListSetting *AdjustFill()
    18031998{
    1804     HostComboBox *gc = new HostComboBox("AdjustFill");
     1999    HostListSetting *gc = new HostListSetting("AdjustFill");
    18052000    gc->setLabel(QObject::tr("Zoom"));
    18062001    for (int m = kAdjustFill_Off; m < kAdjustFill_END; ++m)
    18072002        gc->addSelection(toString((AdjustFillMode)m), QString::number(m));
    static HostComboBox *AdjustFill()  
    18172012
    18182013// Theme settings
    18192014
    1820 static HostSpinBox *GuiWidth()
     2015static HostRangeSetting *GuiWidth()
    18212016{
    1822     HostSpinBox *gs = new HostSpinBox("GuiWidth", 0, 1920, 8, true);
     2017    HostRangeSetting *gs = new HostRangeSetting("GuiWidth", 0, 1920, 8, true);
    18232018    gs->setLabel(QObject::tr("GUI width (pixels)"));
    18242019    gs->setValue(0);
    18252020    gs->setHelpText(QObject::tr("The width of the GUI. Do not make the GUI "
    static HostSpinBox *GuiWidth()  
    18282023    return gs;
    18292024}
    18302025
    1831 static HostSpinBox *GuiHeight()
     2026static HostRangeSetting *GuiHeight()
    18322027{
    1833     HostSpinBox *gs = new HostSpinBox("GuiHeight", 0, 1600, 8, true);
     2028    HostRangeSetting *gs = new HostRangeSetting("GuiHeight", 0, 1600, 8, true);
    18342029    gs->setLabel(QObject::tr("GUI height (pixels)"));
    18352030    gs->setValue(0);
    18362031    gs->setHelpText(QObject::tr("The height of the GUI. Do not make the GUI "
    static HostSpinBox *GuiHeight()  
    18392034    return gs;
    18402035}
    18412036
    1842 static HostSpinBox *GuiOffsetX()
     2037static HostRangeSetting *GuiOffsetX()
    18432038{
    1844     HostSpinBox *gs = new HostSpinBox("GuiOffsetX", -3840, 3840, 32, true);
     2039    HostRangeSetting *gs = new HostRangeSetting("GuiOffsetX", -3840, 3840, 32, true);
    18452040    gs->setLabel(QObject::tr("GUI X offset"));
    18462041    gs->setValue(0);
    18472042    gs->setHelpText(QObject::tr("The horizontal offset where the GUI will be "
    static HostSpinBox *GuiOffsetX()  
    18492044    return gs;
    18502045}
    18512046
    1852 static HostSpinBox *GuiOffsetY()
     2047static HostRangeSetting *GuiOffsetY()
    18532048{
    1854     HostSpinBox *gs = new HostSpinBox("GuiOffsetY", -1600, 1600, 8, true);
     2049    HostRangeSetting *gs = new HostRangeSetting("GuiOffsetY", -1600, 1600, 8, true);
    18552050    gs->setLabel(QObject::tr("GUI Y offset"));
    18562051    gs->setValue(0);
    18572052    gs->setHelpText(QObject::tr("The vertical offset where the GUI will be "
    static HostSpinBox *DisplaySizeHeight()  
    18832078}
    18842079#endif
    18852080
    1886 static HostCheckBox *GuiSizeForTV()
     2081static HostBoolSetting *GuiSizeForTV()
    18872082{
    1888     HostCheckBox *gc = new HostCheckBox("GuiSizeForTV");
     2083    HostBoolSetting *gc = new HostBoolSetting("GuiSizeForTV");
    18892084    gc->setLabel(QObject::tr("Use GUI size for TV playback"));
    18902085    gc->setValue(true);
    18912086    gc->setHelpText(QObject::tr("If enabled, use the above size for TV, "
    static HostCheckBox *GuiSizeForTV()  
    18942089}
    18952090
    18962091#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 }
     2092
    19062093
    19072094static HostSpinBox *VidModeWidth(int idx)
    19082095{
    static HostComboBox *TVVidModeForceAspect(int idx=-1)  
    20322219    return gc;
    20332220}
    20342221
     2222static HostCheckBox *UseVideoModes()
     2223{
     2224    HostCheckBox *gc = new HostCheckBox("UseVideoModes");
     2225    gc->setLabel(QObject::tr("Separate video modes for GUI and TV playback"));
     2226    gc->setValue(false);
     2227    gc->setHelpText(QObject::tr("Switch X Window video modes for TV. "
     2228                    "Requires \"xrandr\" support."));
     2229
     2230    return gc;
     2231}
     2232
    20352233class VideoModeSettings : public TriggeredConfigurationGroup
    20362234{
    20372235  public:
    class VideoModeSettings : public TriggeredConfigurationGroup  
    20842282};
    20852283#endif
    20862284
    2087 static HostCheckBox *HideMouseCursor()
     2285static HostBoolSetting *HideMouseCursor()
    20882286{
    2089     HostCheckBox *gc = new HostCheckBox("HideMouseCursor");
     2287    HostBoolSetting *gc = new HostBoolSetting("HideMouseCursor");
    20902288    gc->setLabel(QObject::tr("Hide mouse cursor in MythTV"));
    20912289    gc->setValue(false);
    20922290    gc->setHelpText(QObject::tr("Toggles mouse cursor visibility for touchscreens. "
    static HostCheckBox *HideMouseCursor()  
    20962294};
    20972295
    20982296
    2099 static HostCheckBox *RunInWindow()
     2297static HostBoolSetting *RunInWindow()
    21002298{
    2101     HostCheckBox *gc = new HostCheckBox("RunFrontendInWindow");
     2299    HostBoolSetting *gc = new HostBoolSetting("RunFrontendInWindow");
    21022300    gc->setLabel(QObject::tr("Use window border"));
    21032301    gc->setValue(false);
    21042302    gc->setHelpText(QObject::tr("Toggles between windowed and "
    static HostCheckBox *RunInWindow()  
    21062304    return gc;
    21072305}
    21082306
    2109 static HostCheckBox *UseFixedWindowSize()
     2307static HostBoolSetting *UseFixedWindowSize()
    21102308{
    21112309{
    2112     HostCheckBox *gc = new HostCheckBox("UseFixedWindowSize");
     2310    HostBoolSetting *gc = new HostBoolSetting("UseFixedWindowSize");
    21132311    gc->setLabel(QObject::tr("Use fixed window size"));
    21142312    gc->setValue(true);
    21152313    gc->setHelpText(QObject::tr(
    static HostCheckBox *UseFixedWindowSize()  
    21192317}
    21202318}
    21212319
    2122 static HostComboBox *MythDateFormatCB()
     2320static HostListSetting *MythDateFormatCB()
    21232321{
    2124     HostComboBox *gc = new HostComboBox("DateFormat");
     2322    HostListSetting *gc = new HostListSetting("DateFormat");
    21252323    gc->setLabel(QObject::tr("Date format"));
    21262324
    21272325    QDate sampdate = QDate::currentDate();
    static HostComboBox *MythDateFormatCB()  
    21602358    return gc;
    21612359}
    21622360
    2163 static HostComboBox *MythShortDateFormat()
     2361static HostListSetting *MythShortDateFormat()
    21642362{
    2165     HostComboBox *gc = new HostComboBox("ShortDateFormat");
     2363    HostListSetting *gc = new HostListSetting("ShortDateFormat");
    21662364    gc->setLabel(QObject::tr("Short date format"));
    21672365
    21682366    QDate sampdate = QDate::currentDate();
    static HostComboBox *MythShortDateFormat()  
    21992397    return gc;
    22002398}
    22012399
    2202 static HostComboBox *MythTimeFormat()
     2400static HostListSetting *MythTimeFormat()
    22032401{
    2204     HostComboBox *gc = new HostComboBox("TimeFormat");
     2402    HostListSetting *gc = new HostListSetting("TimeFormat");
    22052403    gc->setLabel(QObject::tr("Time format"));
    22062404
    22072405    QTime samptime = QTime::currentTime();
    static HostComboBox *MythTimeFormat()  
    22192417    return gc;
    22202418}
    22212419
    2222 static HostComboBox *ChannelFormat()
     2420static HostListSetting *ChannelFormat()
    22232421{
    2224     HostComboBox *gc = new HostComboBox("ChannelFormat");
     2422    HostListSetting *gc = new HostListSetting("ChannelFormat");
    22252423    gc->setLabel(QObject::tr("Channel format"));
    22262424    gc->addSelection(QObject::tr("number"), "<num>");
    22272425    gc->addSelection(QObject::tr("number callsign"), "<num> <sign>");
    static HostComboBox *ChannelFormat()  
    22332431    return gc;
    22342432}
    22352433
    2236 static HostComboBox *LongChannelFormat()
     2434static HostListSetting *LongChannelFormat()
    22372435{
    2238     HostComboBox *gc = new HostComboBox("LongChannelFormat");
     2436    HostListSetting *gc = new HostListSetting("LongChannelFormat");
    22392437    gc->setLabel(QObject::tr("Long channel format"));
    22402438    gc->addSelection(QObject::tr("number"), "<num>");
    22412439    gc->addSelection(QObject::tr("number callsign"), "<num> <sign>");
    static HostComboBox *LongChannelFormat()  
    22472445    return gc;
    22482446}
    22492447
    2250 static GlobalCheckBox *LastFreeCard()
     2448static GlobalBoolSetting *LastFreeCard()
    22512449{
    2252     GlobalCheckBox *bc = new GlobalCheckBox("LastFreeCard");
     2450    GlobalBoolSetting *bc = new GlobalBoolSetting("LastFreeCard");
    22532451    bc->setLabel(QObject::tr("Avoid conflicts between Live TV and "
    22542452                 "scheduled shows"));
    22552453    bc->setValue(false);
    static GlobalCheckBox *LastFreeCard()  
    22592457    return bc;
    22602458}
    22612459
    2262 static GlobalCheckBox *LiveTVPriority()
     2460static GlobalBoolSetting *LiveTVPriority()
    22632461{
    2264     GlobalCheckBox *bc = new GlobalCheckBox("LiveTVPriority");
     2462    GlobalBoolSetting *bc = new GlobalBoolSetting("LiveTVPriority");
    22652463    bc->setLabel(QObject::tr("Allow Live TV to move scheduled shows"));
    22662464    bc->setValue(false);
    22672465    bc->setHelpText(QObject::tr("If enabled, scheduled recordings will "
    static GlobalCheckBox *LiveTVPriority()  
    22702468    return bc;
    22712469}
    22722470
    2273 static HostCheckBox *ChannelGroupRememberLast()
    2274 {
    2275     HostCheckBox *gc = new HostCheckBox("ChannelGroupRememberLast");
    2276     gc->setLabel(QObject::tr("Remember last channel group"));
    2277     gc->setHelpText(QObject::tr("If enabled, the EPG will initially display "
    2278                     "only the channels from the last channel group selected. Pressing "
    2279                     "\"4\" will toggle channel group."));
    2280     gc->setValue(false);
    2281     return gc;
    2282 }
    2283 
    2284 static HostComboBox *ChannelGroupDefault()
     2471static HostListSetting *ChannelGroupDefault()
    22852472{
    2286     HostComboBox *gc = new HostComboBox("ChannelGroupDefault");
     2473    HostListSetting *gc = new HostListSetting("ChannelGroupDefault");
    22872474    gc->setLabel(QObject::tr("Default channel group"));
    22882475
    22892476    ChannelGroupList changrplist;
    static HostComboBox *ChannelGroupDefault()  
    23032490    return gc;
    23042491}
    23052492
    2306 static HostCheckBox *BrowseChannelGroup()
     2493static HostBoolSetting *BrowseChannelGroup()
    23072494{
    2308     HostCheckBox *gc = new HostCheckBox("BrowseChannelGroup");
     2495    HostBoolSetting *gc = new HostBoolSetting("BrowseChannelGroup");
    23092496    gc->setLabel(QObject::tr("Browse/change channels from Channel Group"));
    23102497    gc->setHelpText(QObject::tr("If enabled, Live TV will browse or change "
    23112498                    "channels from the selected channel group. The \"All "
    static HostCheckBox *BrowseChannelGroup()  
    23152502    return gc;
    23162503}
    23172504
    2318 // Channel Group Settings
    2319 class ChannelGroupSettings : public TriggeredConfigurationGroup
     2505static HostBoolSetting *ChannelGroupRememberLast()
    23202506{
    2321   public:
    2322     ChannelGroupSettings() : TriggeredConfigurationGroup(false, true, false, false)
    2323     {
    2324          setLabel(QObject::tr("Remember last channel group"));
    2325          setUseLabel(false);
    2326 
    2327          Setting* RememberChanGrpEnabled = ChannelGroupRememberLast();
    2328          addChild(RememberChanGrpEnabled);
    2329          setTrigger(RememberChanGrpEnabled);
     2507    HostBoolSetting *gc = new HostBoolSetting("ChannelGroupRememberLast");
     2508    gc->setLabel(QObject::tr("Remember last channel group"));
     2509    gc->setHelpText(QObject::tr("If enabled, the EPG will initially display "
     2510                    "only the channels from the last channel group selected. Pressing "
     2511                    "\"4\" will toggle channel group."));
     2512    gc->addChild(false, ChannelGroupDefault());
    23302513
    2331          ConfigurationGroup* settings = new VerticalConfigurationGroup(false,false);
    2332          settings->addChild(ChannelGroupDefault());
    2333          addTarget("0", settings);
     2514    gc->setValue(false);
    23342515
    2335          // show nothing if RememberChanGrpEnabled is on
    2336          addTarget("1", new VerticalConfigurationGroup(true,false));
    2337      };
    2338 };
     2516    return gc;
     2517}
    23392518
    23402519// General RecPriorities settings
    23412520
    2342 static GlobalCheckBox *GRSchedMoveHigher()
     2521static GlobalBoolSetting *GRSchedMoveHigher()
    23432522{
    2344     GlobalCheckBox *bc = new GlobalCheckBox("SchedMoveHigher");
     2523    GlobalBoolSetting *bc = new GlobalBoolSetting("SchedMoveHigher");
    23452524    bc->setLabel(QObject::tr("Reschedule higher priorities"));
    23462525    bc->setHelpText(QObject::tr("Move higher priority programs to other "
    23472526                    "cards and showings when resolving conflicts. This "
    static GlobalCheckBox *GRSchedMoveHigher()  
    23522531    return bc;
    23532532}
    23542533
    2355 static GlobalComboBox *GRSchedOpenEnd()
     2534static GlobalListSetting *GRSchedOpenEnd()
    23562535{
    2357     GlobalComboBox *bc = new GlobalComboBox("SchedOpenEnd");
     2536    GlobalListSetting *bc = new GlobalListSetting("SchedOpenEnd");
    23582537    bc->setLabel(QObject::tr("Avoid back to back recordings"));
    23592538    bc->setHelpText(QObject::tr("Selects the situations where the scheduler "
    23602539                    "will avoid assigning shows to the same card if their "
    static GlobalComboBox *GRSchedOpenEnd()  
    23672546    return bc;
    23682547}
    23692548
    2370 static GlobalSpinBox *GRDefaultStartOffset()
     2549static GlobalRangeSetting *GRDefaultStartOffset()
    23712550{
    2372     GlobalSpinBox *bs = new GlobalSpinBox("DefaultStartOffset",
     2551    GlobalRangeSetting *bs = new GlobalRangeSetting("DefaultStartOffset",
    23732552                                          -10, 30, 5, true);
    23742553    bs->setLabel(QObject::tr("Default 'Start Early' minutes for new "
    23752554                             "recording rules"));
    static GlobalSpinBox *GRDefaultStartOffset()  
    23822561    return bs;
    23832562}
    23842563
    2385 static GlobalSpinBox *GRDefaultEndOffset()
     2564static GlobalRangeSetting *GRDefaultEndOffset()
    23862565{
    2387     GlobalSpinBox *bs = new GlobalSpinBox("DefaultEndOffset",
     2566    GlobalRangeSetting *bs = new GlobalRangeSetting("DefaultEndOffset",
    23882567                                          -10, 30, 5, true);
    23892568    bs->setLabel(QObject::tr("Default 'End Late' minutes for new "
    23902569                             "recording rules"));
    static GlobalSpinBox *GRDefaultEndOffset()  
    23972576    return bs;
    23982577}
    23992578
    2400 static GlobalSpinBox *GRPrefInputRecPriority()
     2579static GlobalRangeSetting *GRPrefInputRecPriority()
    24012580{
    2402     GlobalSpinBox *bs = new GlobalSpinBox("PrefInputPriority", 1, 99, 1);
     2581    GlobalRangeSetting *bs = new GlobalRangeSetting("PrefInputPriority", 1, 99, 1);
    24032582    bs->setLabel(QObject::tr("Preferred input priority"));
    24042583    bs->setHelpText(QObject::tr("Additional priority when a showing "
    24052584                    "matches the preferred input selected in the 'Scheduling "
    static GlobalSpinBox *GRPrefInputRecPriority()  
    24082587    return bs;
    24092588}
    24102589
    2411 static GlobalSpinBox *GRHDTVRecPriority()
     2590static GlobalRangeSetting *GRHDTVRecPriority()
    24122591{
    2413     GlobalSpinBox *bs = new GlobalSpinBox("HDTVRecPriority", -99, 99, 1);
     2592    GlobalRangeSetting *bs = new GlobalRangeSetting("HDTVRecPriority", -99, 99, 1);
    24142593    bs->setLabel(QObject::tr("HDTV recording priority"));
    24152594    bs->setHelpText(QObject::tr("Additional priority when a showing "
    24162595                    "is marked as an HDTV broadcast in the TV listings."));
    static GlobalSpinBox *GRHDTVRecPriority()  
    24182597    return bs;
    24192598}
    24202599
    2421 static GlobalSpinBox *GRWSRecPriority()
     2600static GlobalRangeSetting *GRWSRecPriority()
    24222601{
    2423     GlobalSpinBox *bs = new GlobalSpinBox("WSRecPriority", -99, 99, 1);
     2602    GlobalRangeSetting *bs = new GlobalRangeSetting("WSRecPriority", -99, 99, 1);
    24242603    bs->setLabel(QObject::tr("Widescreen recording priority"));
    24252604    bs->setHelpText(QObject::tr("Additional priority when a showing "
    24262605                    "is marked as widescreen in the TV listings."));
    static GlobalSpinBox *GRWSRecPriority()  
    24282607    return bs;
    24292608}
    24302609
    2431 static GlobalSpinBox *GRAutoRecPriority()
     2610static GlobalRangeSetting *GRAutoRecPriority()
    24322611{
    2433     GlobalSpinBox *bs = new GlobalSpinBox("AutoRecPriority", -99, 99, 1);
     2612    GlobalRangeSetting *bs = new GlobalRangeSetting("AutoRecPriority", -99, 99, 1);
    24342613    bs->setLabel(QObject::tr("Automatic priority range (+/-)"));
    24352614    bs->setHelpText(QObject::tr("Up to this number of priority points may "
    24362615                    "be added for titles that are usually watched soon after "
    static GlobalSpinBox *GRAutoRecPriority()  
    24402619    return bs;
    24412620}
    24422621
    2443 static GlobalSpinBox *GRSignLangRecPriority()
     2622static GlobalRangeSetting *GRSignLangRecPriority()
    24442623{
    2445     GlobalSpinBox *bs = new GlobalSpinBox("SignLangRecPriority",
     2624    GlobalRangeSetting *bs = new GlobalRangeSetting("SignLangRecPriority",
    24462625                                            -99, 99, 1);
    24472626    bs->setLabel(QObject::tr("Sign language recording priority"));
    24482627    bs->setHelpText(QObject::tr("Additional priority when a showing "
    static GlobalSpinBox *GRSignLangRecPriority()  
    24512630    return bs;
    24522631}
    24532632
    2454 static GlobalSpinBox *GROnScrSubRecPriority()
     2633static GlobalRangeSetting *GROnScrSubRecPriority()
    24552634{
    2456     GlobalSpinBox *bs = new GlobalSpinBox("OnScrSubRecPriority",
     2635    GlobalRangeSetting *bs = new GlobalRangeSetting("OnScrSubRecPriority",
    24572636                                            -99, 99, 1);
    24582637    bs->setLabel(QObject::tr("In-vision Subtitles Recording Priority"));
    24592638    bs->setHelpText(QObject::tr("Additional priority when a showing "
    static GlobalSpinBox *GROnScrSubRecPriority()  
    24622641    return bs;
    24632642}
    24642643
    2465 static GlobalSpinBox *GRCCRecPriority()
     2644static GlobalRangeSetting *GRCCRecPriority()
    24662645{
    2467     GlobalSpinBox *bs = new GlobalSpinBox("CCRecPriority",
     2646    GlobalRangeSetting *bs = new GlobalRangeSetting("CCRecPriority",
    24682647                                            -99, 99, 1);
    24692648    bs->setLabel(QObject::tr("Subtitles/CC recording priority"));
    24702649    bs->setHelpText(QObject::tr("Additional priority when a showing "
    static GlobalSpinBox *GRCCRecPriority()  
    24742653    return bs;
    24752654}
    24762655
    2477 static GlobalSpinBox *GRHardHearRecPriority()
     2656static GlobalRangeSetting *GRHardHearRecPriority()
    24782657{
    2479     GlobalSpinBox *bs = new GlobalSpinBox("HardHearRecPriority",
     2658    GlobalRangeSetting *bs = new GlobalRangeSetting("HardHearRecPriority",
    24802659                                            -99, 99, 1);
    24812660    bs->setLabel(QObject::tr("Hard of hearing priority"));
    24822661    bs->setHelpText(QObject::tr("Additional priority when a showing "
    static GlobalSpinBox *GRHardHearRecPriority()  
    24862665    return bs;
    24872666}
    24882667
    2489 static GlobalSpinBox *GRAudioDescRecPriority()
     2668static GlobalRangeSetting *GRAudioDescRecPriority()
    24902669{
    2491     GlobalSpinBox *bs = new GlobalSpinBox("AudioDescRecPriority",
     2670    GlobalRangeSetting *bs = new GlobalRangeSetting("AudioDescRecPriority",
    24922671                                            -99, 99, 1);
    24932672    bs->setLabel(QObject::tr("Audio described priority"));
    24942673    bs->setHelpText(QObject::tr("Additional priority when a showing "
    static GlobalSpinBox *GRAudioDescRecPriority()  
    24972676    return bs;
    24982677}
    24992678
    2500 static GlobalSpinBox *GRSingleRecordRecPriority()
     2679static GlobalRangeSetting *GRSingleRecordRecPriority()
    25012680{
    2502     GlobalSpinBox *bs = new GlobalSpinBox("SingleRecordRecPriority",
     2681    GlobalRangeSetting *bs = new GlobalRangeSetting("SingleRecordRecPriority",
    25032682                                            -99, 99, 1);
    25042683    bs->setLabel(QObject::tr("Single recordings priority"));
    25052684    bs->setHelpText(QObject::tr("Single recordings will receive this "
    static GlobalSpinBox *GRSingleRecordRecPriority()  
    25082687    return bs;
    25092688}
    25102689
    2511 static GlobalSpinBox *GRWeekslotRecordRecPriority()
     2690static GlobalRangeSetting *GRWeekslotRecordRecPriority()
    25122691{
    2513     GlobalSpinBox *bs = new GlobalSpinBox("WeekslotRecordRecPriority",
     2692    GlobalRangeSetting *bs = new GlobalRangeSetting("WeekslotRecordRecPriority",
    25142693                                            -99, 99, 1);
    25152694    bs->setLabel(QObject::tr("Weekslot recordings priority"));
    25162695    bs->setHelpText(QObject::tr("Weekslot recordings will receive this "
    static GlobalSpinBox *GRWeekslotRecordRecPriority()  
    25192698    return bs;
    25202699}
    25212700
    2522 static GlobalSpinBox *GRTimeslotRecordRecPriority()
     2701static GlobalRangeSetting *GRTimeslotRecordRecPriority()
    25232702{
    2524     GlobalSpinBox *bs = new GlobalSpinBox("TimeslotRecordRecPriority",
     2703    GlobalRangeSetting *bs = new GlobalRangeSetting("TimeslotRecordRecPriority",
    25252704                                            -99, 99, 1);
    25262705    bs->setLabel(QObject::tr("Timeslot recordings priority"));
    25272706    bs->setHelpText(QObject::tr("Timeslot recordings will receive this "
    static GlobalSpinBox *GRTimeslotRecordRecPriority()  
    25302709    return bs;
    25312710}
    25322711
    2533 static GlobalSpinBox *GRChannelRecordRecPriority()
     2712static GlobalRangeSetting *GRChannelRecordRecPriority()
    25342713{
    2535     GlobalSpinBox *bs = new GlobalSpinBox("ChannelRecordRecPriority",
     2714    GlobalRangeSetting *bs = new GlobalRangeSetting("ChannelRecordRecPriority",
    25362715                                            -99, 99, 1);
    25372716    bs->setLabel(QObject::tr("Channel recordings priority"));
    25382717    bs->setHelpText(QObject::tr("Channel recordings will receive this "
    static GlobalSpinBox *GRChannelRecordRecPriority()  
    25412720    return bs;
    25422721}
    25432722
    2544 static GlobalSpinBox *GRAllRecordRecPriority()
     2723static GlobalRangeSetting *GRAllRecordRecPriority()
    25452724{
    2546     GlobalSpinBox *bs = new GlobalSpinBox("AllRecordRecPriority",
     2725    GlobalRangeSetting *bs = new GlobalRangeSetting("AllRecordRecPriority",
    25472726                                            -99, 99, 1);
    25482727    bs->setLabel(QObject::tr("All recordings priority"));
    25492728    bs->setHelpText(QObject::tr("The 'All' recording type will receive this "
    static GlobalSpinBox *GRAllRecordRecPriority()  
    25522731    return bs;
    25532732}
    25542733
    2555 static GlobalSpinBox *GRFindOneRecordRecPriority()
     2734static GlobalRangeSetting *GRFindOneRecordRecPriority()
    25562735{
    2557     GlobalSpinBox *bs = new GlobalSpinBox("FindOneRecordRecPriority",
     2736    GlobalRangeSetting *bs = new GlobalRangeSetting("FindOneRecordRecPriority",
    25582737                                            -99, 99, 1);
    25592738    bs->setLabel(QObject::tr("Find one recordings priority"));
    25602739    bs->setHelpText(QObject::tr("Find One, Find Weekly and Find Daily "
    static GlobalSpinBox *GRFindOneRecordRecPriority()  
    25642743    return bs;
    25652744}
    25662745
    2567 static GlobalSpinBox *GROverrideRecordRecPriority()
     2746static GlobalRangeSetting *GROverrideRecordRecPriority()
    25682747{
    2569     GlobalSpinBox *bs = new GlobalSpinBox("OverrideRecordRecPriority",
     2748    GlobalRangeSetting *bs = new GlobalRangeSetting("OverrideRecordRecPriority",
    25702749                                            -99, 99, 1);
    25712750    bs->setLabel(QObject::tr("Override recordings priority"));
    25722751    bs->setHelpText(QObject::tr("Override recordings will receive this "
    static GlobalSpinBox *GROverrideRecordRecPriority()  
    25752754    return bs;
    25762755}
    25772756
    2578 static HostLineEdit *DefaultTVChannel()
     2757static HostTextualSetting *DefaultTVChannel()
    25792758{
    2580     HostLineEdit *ge = new HostLineEdit("DefaultTVChannel");
     2759    HostTextualSetting *ge = new HostTextualSetting("DefaultTVChannel");
    25812760    ge->setLabel(QObject::tr("Guide starts at channel"));
    25822761    ge->setValue("3");
    25832762    ge->setHelpText(QObject::tr("The program guide starts on this channel if "
    static HostLineEdit *DefaultTVChannel()  
    25852764    return ge;
    25862765}
    25872766
    2588 static HostSpinBox *EPGRecThreshold()
     2767static HostRangeSetting *EPGRecThreshold()
    25892768{
    2590     HostSpinBox *gs = new HostSpinBox("SelChangeRecThreshold", 1, 600, 1);
     2769    HostRangeSetting *gs = new HostRangeSetting("SelChangeRecThreshold", 1, 600, 1);
    25912770    gs->setLabel(QObject::tr("Record threshold"));
    25922771    gs->setValue(16);
    25932772    gs->setHelpText(QObject::tr("Pressing SELECT on a show that is at least "
    static HostSpinBox *EPGRecThreshold()  
    25962775    return gs;
    25972776}
    25982777
    2599 static HostComboBox *MythLanguage()
     2778static HostListSetting *MythLanguage()
    26002779{
    2601     HostComboBox *gc = new HostComboBox("Language");
     2780    HostListSetting *gc = new HostListSetting("Language");
    26022781    gc->setLabel(QObject::tr("Language"));
    26032782
    26042783    QMap<QString, QString> langMap = MythTranslation::getLanguages();
    static HostComboBox *MythLanguage()  
    26202799    return gc;
    26212800}
    26222801
    2623 static void ISO639_fill_selections(SelectSetting *widget, uint i)
     2802static void ISO639_fill_selections(ListSetting *listSetting, uint i)
    26242803{
    2625     widget->clearSelections();
     2804    listSetting->clearSelections();
    26262805    QString q = QString("ISO639Language%1").arg(i);
    26272806    QString lang = gCoreContext->GetSetting(q, "").toLower();
    26282807
    static void ISO639_fill_selections(SelectSetting *widget, uint i)  
    26432822            desc = desc.left(idx);
    26442823
    26452824        const QString il = iso639_key_to_str3(it.key());
    2646         widget->addSelection(desc, il, il == lang);
     2825        listSetting->addSelection(desc, il, il == lang);
    26472826    }
    26482827}
    26492828
    2650 static GlobalComboBox *ISO639PreferredLanguage(uint i)
     2829static GlobalListSetting *ISO639PreferredLanguage(uint i)
    26512830{
    2652     GlobalComboBox *gc = new GlobalComboBox(QString("ISO639Language%1").arg(i));
     2831    GlobalListSetting *gc = new GlobalListSetting(QString("ISO639Language%1").arg(i));
    26532832    gc->setLabel(QObject::tr("Guide language #%1").arg(i+1));
    26542833    // We should try to get language from "MythLanguage"
    26552834    // then use code 2 to code 3 map in iso639.h
    static GlobalComboBox *ISO639PreferredLanguage(uint i)  
    26602839    return gc;
    26612840}
    26622841
    2663 static HostCheckBox *NetworkControlEnabled()
     2842static HostRangeSetting *NetworkControlPort()
    26642843{
    2665     HostCheckBox *gc = new HostCheckBox("NetworkControlEnabled");
     2844    HostRangeSetting *gs = new HostRangeSetting("NetworkControlPort", 1025, 65535, 1);
     2845    gs->setLabel(QObject::tr("Network Remote Control port"));
     2846    gs->setValue(6546);
     2847    gs->setHelpText(QObject::tr("This specifies what port the network remote "
     2848                    "Control interface will listen on for new connections."));
     2849    return gs;
     2850}
     2851
     2852static HostBoolSetting *NetworkControlEnabled()
     2853{
     2854    HostBoolSetting *gc = new HostBoolSetting("NetworkControlEnabled");
    26662855    gc->setLabel(QObject::tr("Enable Network Remote Control interface"));
    26672856    gc->setHelpText(QObject::tr("This enables support for controlling "
    26682857                    "mythfrontend over the network."));
    26692858    gc->setValue(false);
     2859
     2860    gc->addChild(true, NetworkControlPort());
    26702861    return gc;
    26712862}
    26722863
    2673 static HostSpinBox *NetworkControlPort()
    2674 {
    2675     HostSpinBox *gs = new HostSpinBox("NetworkControlPort", 1025, 65535, 1);
    2676     gs->setLabel(QObject::tr("Network Remote Control port"));
    2677     gs->setValue(6546);
    2678     gs->setHelpText(QObject::tr("This specifies what port the network remote "
    2679                     "Control interface will listen on for new connections."));
    2680     return gs;
    2681 }
    26822864
    2683 static HostLineEdit *UDPNotifyPort()
     2865
     2866static HostTextualSetting *UDPNotifyPort()
    26842867{
    2685     HostLineEdit *ge = new HostLineEdit("UDPNotifyPort");
     2868    HostTextualSetting *ge = new HostTextualSetting("UDPNotifyPort");
    26862869    ge->setLabel(QObject::tr("UDP notify port"));
    26872870    ge->setValue("6948");
    26882871    ge->setHelpText(QObject::tr("MythTV will listen for "
    static HostLineEdit *UDPNotifyPort()  
    26922875    return ge;
    26932876}
    26942877
    2695 static HostCheckBox *RealtimePriority()
     2878static HostBoolSetting *RealtimePriority()
    26962879{
    2697     HostCheckBox *gc = new HostCheckBox("RealtimePriority");
     2880    HostBoolSetting *gc = new HostBoolSetting("RealtimePriority");
    26982881    gc->setLabel(QObject::tr("Enable realtime priority threads"));
    26992882    gc->setHelpText(QObject::tr("When running mythfrontend with root "
    27002883                    "privileges, some threads can be given enhanced priority. "
    static HostCheckBox *RealtimePriority()  
    27042887    return gc;
    27052888}
    27062889
    2707 static HostCheckBox *EnableMediaMon()
    2708 {
    2709     HostCheckBox *gc = new HostCheckBox("MonitorDrives");
    2710     gc->setLabel(QObject::tr("Monitor CD/DVD") +
    2711                  QObject::tr(" (and other removable devices)"));
    2712     gc->setHelpText(QObject::tr("This enables support for monitoring "
    2713                     "your CD/DVD drives for new disks and launching "
    2714                     "the proper plugin to handle them."));
    2715     gc->setValue(false);
    2716     return gc;
    2717 }
    2718 
    2719 static HostLineEdit *IgnoreMedia()
     2890static HostTextualSetting *IgnoreMedia()
    27202891{
    2721     HostLineEdit *ge = new HostLineEdit("IgnoreDevices");
     2892    HostTextualSetting *ge = new HostTextualSetting("IgnoreDevices");
    27222893    ge->setLabel(QObject::tr("Ignore devices"));
    27232894    ge->setValue("");
    27242895    ge->setHelpText(QObject::tr("If there are any devices that you do not want "
    static HostLineEdit *IgnoreMedia()  
    27272898    return ge;
    27282899}
    27292900
    2730 class MythMediaSettings : public TriggeredConfigurationGroup
     2901static HostBoolSetting *EnableMediaMon()
    27312902{
    2732   public:
    2733      MythMediaSettings() :
    2734          TriggeredConfigurationGroup(false, false, true, true)
    2735      {
    2736          setLabel(QObject::tr("MythMediaMonitor"));
    2737          setUseLabel(false);
    2738 
    2739          Setting* enabled = EnableMediaMon();
    2740          addChild(enabled);
    2741          setTrigger(enabled);
    2742 
    2743          ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
    2744          settings->addChild(IgnoreMedia());
    2745          addTarget("1", settings);
    2746 
    2747          // show nothing if fillEnabled is off
    2748          addTarget("0", new VerticalConfigurationGroup(true));
    2749      };
    2750 };
    2751 
     2903    HostBoolSetting *gc = new HostBoolSetting("MonitorDrives");
     2904    gc->setLabel(QObject::tr("Monitor CD/DVD") +
     2905                 QObject::tr(" (and other removable devices)"));
     2906    gc->setHelpText(QObject::tr("This enables support for monitoring "
     2907                    "your CD/DVD drives for new disks and launching "
     2908                    "the proper plugin to handle them."));
     2909    gc->addChild(true,IgnoreMedia());
     2910    gc->setValue(false);
     2911    return gc;
     2912}
    27522913
    2753 static HostComboBox *DisplayGroupTitleSort()
     2914static HostListSetting *DisplayGroupTitleSort()
    27542915{
    2755     HostComboBox *gc = new HostComboBox("DisplayGroupTitleSort");
     2916    HostListSetting *gc = new HostListSetting("DisplayGroupTitleSort");
    27562917    gc->setLabel(QObject::tr("Sort titles"));
    27572918    gc->addSelection(QObject::tr("Alphabetically"),
    27582919            QString::number(PlaybackBox::TitleSortAlphabetical));
    static HostComboBox *DisplayGroupTitleSort()  
    27632924    return gc;
    27642925}
    27652926
    2766 static HostCheckBox *PlaybackWatchList()
     2927static HostBoolSetting *PlaybackWLStart()
    27672928{
    2768     HostCheckBox *gc = new HostCheckBox("PlaybackWatchList");
    2769     gc->setLabel(QObject::tr("Include the 'Watch List' group"));
    2770     gc->setValue(true);
    2771     gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of "
    2772                                 "recordings sorted to highlight series and "
    2773                                 "shows that need attention in order to "
    2774                                 "keep up to date."));
    2775     return gc;
    2776 }
    2777 
    2778 static HostCheckBox *PlaybackWLStart()
    2779 {
    2780     HostCheckBox *gc = new HostCheckBox("PlaybackWLStart");
     2929    HostBoolSetting *gc = new HostBoolSetting("PlaybackWLStart");
    27812930    gc->setLabel(QObject::tr("Start from the Watch List view"));
    27822931    gc->setValue(false);
    27832932    gc->setHelpText(QObject::tr("If enabled, the 'Watch List' will be the "
    static HostCheckBox *PlaybackWLStart()  
    27862935    return gc;
    27872936}
    27882937
    2789 static HostCheckBox *PlaybackWLAutoExpire()
     2938static HostBoolSetting *PlaybackWLAutoExpire()
    27902939{
    2791     HostCheckBox *gc = new HostCheckBox("PlaybackWLAutoExpire");
     2940    HostBoolSetting *gc = new HostBoolSetting("PlaybackWLAutoExpire");
    27922941    gc->setLabel(QObject::tr("Exclude recordings not set for Auto-Expire"));
    27932942    gc->setValue(false);
    27942943    gc->setHelpText(QObject::tr("Set this if you turn off Auto-Expire only "
    static HostCheckBox *PlaybackWLAutoExpire()  
    27982947    return gc;
    27992948}
    28002949
    2801 static HostSpinBox *PlaybackWLMaxAge()
     2950static HostRangeSetting *PlaybackWLMaxAge()
    28022951{
    2803     HostSpinBox *gs = new HostSpinBox("PlaybackWLMaxAge", 30, 180, 10);
     2952    HostRangeSetting *gs = new HostRangeSetting("PlaybackWLMaxAge", 30, 180, 10);
    28042953    gs->setLabel(QObject::tr("Maximum days counted in the score"));
    28052954    gs->setValue(60);
    28062955    gs->setHelpText(QObject::tr("The 'Watch List' scores are based on 1 point "
    static HostSpinBox *PlaybackWLMaxAge()  
    28102959    return gs;
    28112960}
    28122961
    2813 static HostSpinBox *PlaybackWLBlackOut()
     2962static HostRangeSetting *PlaybackWLBlackOut()
    28142963{
    2815     HostSpinBox *gs = new HostSpinBox("PlaybackWLBlackOut", 0, 5, 1);
     2964    HostRangeSetting *gs = new HostRangeSetting("PlaybackWLBlackOut", 0, 5, 1);
    28162965    gs->setLabel(QObject::tr("Days to exclude weekly episodes after delete"));
    28172966    gs->setValue(2);
    28182967    gs->setHelpText(QObject::tr("When an episode is deleted or marked as "
    static HostSpinBox *PlaybackWLBlackOut()  
    28232972    return gs;
    28242973}
    28252974
    2826 class WatchListSettings : public TriggeredConfigurationGroup
     2975
     2976static HostBoolSetting *PlaybackWatchList()
    28272977{
    2828   public:
    2829      WatchListSettings() :
    2830          TriggeredConfigurationGroup(false, false, true, true)
    2831      {
    2832 
    2833          Setting* watchList = PlaybackWatchList();
    2834          addChild(watchList);
    2835          setTrigger(watchList);
    2836 
    2837          ConfigurationGroup* settings = new VerticalConfigurationGroup(false);
    2838          settings->addChild(PlaybackWLStart());
    2839          settings->addChild(PlaybackWLAutoExpire());
    2840          settings->addChild(PlaybackWLMaxAge());
    2841          settings->addChild(PlaybackWLBlackOut());
    2842          addTarget("1", settings);
    2843 
    2844          addTarget("0", new VerticalConfigurationGroup(true));
    2845     };
    2846 };
     2978    HostBoolSetting *gc = new HostBoolSetting("PlaybackWatchList");
     2979    gc->setLabel(QObject::tr("Include the 'Watch List' group"));
     2980    gc->setValue(true);
     2981    gc->setHelpText(QObject::tr("The 'Watch List' is an abbreviated list of "
     2982                                "recordings sorted to highlight series and "
     2983                                "shows that need attention in order to "
     2984                                "keep up to date."));
    28472985
    2848 static HostCheckBox *LCDShowTime()
     2986    gc->addChild(true,PlaybackWLStart());
     2987    gc->addChild(true,PlaybackWLAutoExpire());
     2988    gc->addChild(true,PlaybackWLMaxAge());
     2989    gc->addChild(true,PlaybackWLBlackOut());
     2990    return gc;
     2991}
     2992
     2993static HostBoolSetting *LCDShowTime()
    28492994{
    2850     HostCheckBox *gc = new HostCheckBox("LCDShowTime");
     2995    HostBoolSetting *gc = new HostBoolSetting("LCDShowTime");
    28512996    gc->setLabel(QObject::tr("Display time"));
    28522997    gc->setHelpText(QObject::tr("Display current time on idle LCD display. "));
    28532998    gc->setValue(true);
    28542999    return gc;
    28553000}
    28563001
    2857 static HostCheckBox *LCDShowRecStatus()
     3002static HostBoolSetting *LCDShowRecStatus()
    28583003{
    2859     HostCheckBox *gc = new HostCheckBox("LCDShowRecStatus");
     3004    HostBoolSetting *gc = new HostBoolSetting("LCDShowRecStatus");
    28603005    gc->setLabel(QObject::tr("Display recording status"));
    28613006    gc->setHelpText(QObject::tr("Display current recordings information on "
    28623007                                "LCD display."));
    static HostCheckBox *LCDShowRecStatus()  
    28643009    return gc;
    28653010}
    28663011
    2867 static HostCheckBox *LCDShowMenu()
     3012static HostBoolSetting *LCDShowMenu()
    28683013{
    2869     HostCheckBox *gc = new HostCheckBox("LCDShowMenu");
     3014    HostBoolSetting *gc = new HostBoolSetting("LCDShowMenu");
    28703015    gc->setLabel(QObject::tr("Display menus"));
    28713016    gc->setHelpText(QObject::tr("Display selected menu on LCD display. "));
    28723017    gc->setValue(true);
    28733018    return gc;
    28743019}
    28753020
    2876 static HostSpinBox *LCDPopupTime()
     3021static HostRangeSetting *LCDPopupTime()
    28773022{
    2878     HostSpinBox *gs = new HostSpinBox("LCDPopupTime", 1, 300, 1, true);
     3023    HostRangeSetting *gs = new HostRangeSetting("LCDPopupTime", 1, 300, 1, true);
    28793024    gs->setLabel(QObject::tr("Menu pop-up time"));
    28803025    gs->setHelpText(QObject::tr("How many seconds the menu will "
    28813026                    "remain visible after navigation."));
    static HostSpinBox *LCDPopupTime()  
    28833028    return gs;
    28843029}
    28853030
    2886 static HostCheckBox *LCDShowMusic()
     3031static HostBoolSetting *LCDShowMusic()
    28873032{
    2888     HostCheckBox *gc = new HostCheckBox("LCDShowMusic");
     3033    HostBoolSetting *gc = new HostBoolSetting("LCDShowMusic");
    28893034    gc->setLabel(QObject::tr("Display music artist and title"));
    28903035    gc->setHelpText(QObject::tr("Display playing artist and song title in "
    28913036                    "MythMusic on LCD display."));
    static HostCheckBox *LCDShowMusic()  
    28933038    return gc;
    28943039}
    28953040
    2896 static HostComboBox *LCDShowMusicItems()
     3041static HostListSetting *LCDShowMusicItems()
    28973042{
    2898     HostComboBox *gc = new HostComboBox("LCDShowMusicItems");
     3043    HostListSetting *gc = new HostListSetting("LCDShowMusicItems");
    28993044    gc->setLabel(QObject::tr("Items"));
    29003045    gc->addSelection(QObject::tr("Artist - Title"), "ArtistTitle");
    29013046    gc->addSelection(QObject::tr("Artist [Album] Title"), "ArtistAlbumTitle");
    static HostComboBox *LCDShowMusicItems()  
    29033048    return gc;
    29043049}
    29053050
    2906 static HostCheckBox *LCDShowChannel()
     3051static HostBoolSetting *LCDShowChannel()
    29073052{
    2908     HostCheckBox *gc = new HostCheckBox("LCDShowChannel");
     3053    HostBoolSetting *gc = new HostBoolSetting("LCDShowChannel");
    29093054    gc->setLabel(QObject::tr("Display channel information"));
    29103055    gc->setHelpText(QObject::tr("Display tuned channel information on LCD display."));
    29113056    gc->setValue(true);
    29123057    return gc;
    29133058}
    29143059
    2915 static HostCheckBox *LCDShowVolume()
     3060static HostBoolSetting *LCDShowVolume()
    29163061{
    2917     HostCheckBox *gc = new HostCheckBox("LCDShowVolume");
     3062    HostBoolSetting *gc = new HostBoolSetting("LCDShowVolume");
    29183063    gc->setLabel(QObject::tr("Display volume information"));
    29193064    gc->setHelpText(QObject::tr("Display volume level information "
    29203065                                "on LCD display."));
    static HostCheckBox *LCDShowVolume()  
    29223067    return gc;
    29233068}
    29243069
    2925 static HostCheckBox *LCDShowGeneric()
     3070static HostBoolSetting *LCDShowGeneric()
    29263071{
    2927     HostCheckBox *gc = new HostCheckBox("LCDShowGeneric");
     3072    HostBoolSetting *gc = new HostBoolSetting("LCDShowGeneric");
    29283073    gc->setLabel(QObject::tr("Display generic information"));
    29293074    gc->setHelpText(QObject::tr("Display generic information on LCD display."));
    29303075    gc->setValue(true);
    29313076    return gc;
    29323077}
    29333078
    2934 static HostCheckBox *LCDBacklightOn()
     3079static HostBoolSetting *LCDBacklightOn()
    29353080{
    2936     HostCheckBox *gc = new HostCheckBox("LCDBacklightOn");
     3081    HostBoolSetting *gc = new HostBoolSetting("LCDBacklightOn");
    29373082    gc->setLabel(QObject::tr("Backlight always on"));
    29383083    gc->setHelpText(QObject::tr("Turn on the backlight permanently "
    29393084                                "on the LCD display."));
    static HostCheckBox *LCDBacklightOn()  
    29413086    return gc;
    29423087}
    29433088
    2944 static HostCheckBox *LCDHeartBeatOn()
     3089static HostBoolSetting *LCDHeartBeatOn()
    29453090{
    2946     HostCheckBox *gc = new HostCheckBox("LCDHeartBeatOn");
     3091    HostBoolSetting *gc = new HostBoolSetting("LCDHeartBeatOn");
    29473092    gc->setLabel(QObject::tr("Heartbeat always on"));
    29483093    gc->setHelpText(QObject::tr("Turn on the LCD heartbeat."));
    29493094    gc->setValue(false);
    29503095    return gc;
    29513096}
    29523097
    2953 static HostCheckBox *LCDBigClock()
     3098static HostBoolSetting *LCDBigClock()
    29543099{
    2955     HostCheckBox *gc = new HostCheckBox("LCDBigClock");
     3100    HostBoolSetting *gc = new HostBoolSetting("LCDBigClock");
    29563101    gc->setLabel(QObject::tr("Display large clock"));
    29573102    gc->setHelpText(QObject::tr("On multiline displays try and display the time as large as possible."));
    29583103    gc->setValue(false);
    29593104    return gc;
    29603105}
    29613106
    2962 static HostLineEdit *LCDKeyString()
     3107static HostTextualSetting *LCDKeyString()
    29633108{
    2964     HostLineEdit *ge = new HostLineEdit("LCDKeyString");
     3109    HostTextualSetting *ge = new HostTextualSetting("LCDKeyString");
    29653110    ge->setLabel(QObject::tr("LCD key order"));
    29663111    ge->setValue("ABCDEF");
    29673112    ge->setHelpText(QObject::tr("Enter the 6 Keypad Return Codes for your "
    static HostLineEdit *LCDKeyString()  
    29723117    return ge;
    29733118}
    29743119
    2975 static HostCheckBox *LCDEnable()
     3120static HostBoolSetting *LCDEnable()
    29763121{
    2977     HostCheckBox *gc = new HostCheckBox("LCDEnable");
     3122    HostBoolSetting *gc = new HostBoolSetting("LCDEnable");
    29783123    gc->setLabel(QObject::tr("Enable LCD device"));
    29793124    gc->setHelpText(QObject::tr("Use an LCD display to view MythTV status "
    29803125                    "information."));
     3126
     3127    gc->addChild(true, LCDShowTime());
     3128    gc->addChild(true, LCDShowMenu());
     3129    gc->addChild(true, LCDShowMusic());
     3130    gc->addChild(true, LCDShowMusicItems());
     3131    gc->addChild(true, LCDShowChannel());
     3132    gc->addChild(true, LCDShowRecStatus());
     3133    gc->addChild(true, LCDShowVolume());
     3134    gc->addChild(true, LCDShowGeneric());
     3135    gc->addChild(true, LCDBacklightOn());
     3136    gc->addChild(true, LCDHeartBeatOn());
     3137    gc->addChild(true, LCDBigClock());
     3138    gc->addChild(true, LCDKeyString());;
     3139    gc->addChild(true, LCDPopupTime());
     3140
    29813141    gc->setValue(false);
    29823142    return gc;
    29833143}
    29843144
    2985 class LcdSettings : public TriggeredConfigurationGroup
    2986 {
    2987   public:
    2988     LcdSettings() : TriggeredConfigurationGroup(false, false,  false, false,
    2989                                                 false, false, false, false)
    2990     {
    2991          setLabel(QObject::tr("LCD device display"));
    2992          setUseLabel(false);
    2993 
    2994          Setting* lcd_enable = LCDEnable();
    2995          addChild(lcd_enable);
    2996          setTrigger(lcd_enable);
    2997 
    2998          ConfigurationGroup *settings =
    2999              new VerticalConfigurationGroup(false, true, false, false);
    3000          ConfigurationGroup *setHoriz =
    3001              new HorizontalConfigurationGroup(false, false, false, false);
    3002 
    3003          ConfigurationGroup* setLeft  =
    3004              new VerticalConfigurationGroup(false, false, false, false);
    3005          ConfigurationGroup* setRight =
    3006              new VerticalConfigurationGroup(false, false, false, false);
    3007 
    3008          setLeft->addChild(LCDShowTime());
    3009          setLeft->addChild(LCDShowMenu());
    3010          setLeft->addChild(LCDShowMusic());
    3011          setLeft->addChild(LCDShowMusicItems());
    3012          setLeft->addChild(LCDShowChannel());
    3013          setLeft->addChild(LCDShowRecStatus());
    3014          setRight->addChild(LCDShowVolume());
    3015          setRight->addChild(LCDShowGeneric());
    3016          setRight->addChild(LCDBacklightOn());
    3017          setRight->addChild(LCDHeartBeatOn());
    3018          setRight->addChild(LCDBigClock());
    3019          setRight->addChild(LCDKeyString());
    3020          setHoriz->addChild(setLeft);
    3021          setHoriz->addChild(setRight);
    3022          settings->addChild(setHoriz);
    3023          settings->addChild(LCDPopupTime());
    3024 
    3025          addTarget("1", settings);
    3026 
    3027          addTarget("0", new VerticalConfigurationGroup(true));
    3028     };
    3029 };
    3030 
    30313145
    30323146#if CONFIG_DARWIN
    3033 static HostCheckBox *MacGammaCorrect()
     3147static HostBoolSetting *MacGammaCorrect()
    30343148{
    3035     HostCheckBox *gc = new HostCheckBox("MacGammaCorrect");
     3149    HostBoolSetting *gc = new HostBoolSetting("MacGammaCorrect");
    30363150    gc->setLabel(QObject::tr("Enable gamma correction for video"));
    30373151    gc->setValue(false);
    30383152    gc->setHelpText(QObject::tr("If enabled, QuickTime will correct the gamma "
    static HostCheckBox *MacGammaCorrect()  
    30413155    return gc;
    30423156}
    30433157
    3044 static HostCheckBox *MacScaleUp()
     3158static HostBoolSetting *MacScaleUp()
    30453159{
    3046     HostCheckBox *gc = new HostCheckBox("MacScaleUp");
     3160    HostBoolSetting *gc = new HostBoolSetting("MacScaleUp");
    30473161    gc->setLabel(QObject::tr("Scale video as necessary"));
    30483162    gc->setValue(true);
    30493163    gc->setHelpText(QObject::tr("If enabled, video will be scaled to fit your "
    static HostCheckBox *MacScaleUp()  
    30523166    return gc;
    30533167}
    30543168
    3055 static HostSpinBox *MacFullSkip()
     3169static HostRangeSetting *MacFullSkip()
    30563170{
    3057     HostSpinBox *gs = new HostSpinBox("MacFullSkip", 0, 30, 1, true);
     3171    HostRangeSetting *gs = new HostRangeSetting("MacFullSkip", 0, 30, 1, true);
    30583172    gs->setLabel(QObject::tr("Frames to skip in fullscreen mode"));
    30593173    gs->setValue(0);
    30603174    gs->setHelpText(QObject::tr("Video displayed in fullscreen or non-windowed "
    static HostSpinBox *MacFullSkip()  
    30653179    return gs;
    30663180}
    30673181
    3068 static HostCheckBox *MacMainEnabled()
     3182static HostRangeSetting *MacMainSkip()
    30693183{
    3070     HostCheckBox *gc = new HostCheckBox("MacMainEnabled");
    3071     gc->setLabel(QObject::tr("Video in main window"));
    3072     gc->setValue(true);
    3073     gc->setHelpText(QObject::tr("If enabled, video will be displayed in the "
    3074                     "main GUI window. Disable this when you only want video "
    3075                     "on the desktop or in a floating window. Only valid when "
    3076                     "\"Use GUI size for TV playback\" and \"Run the "
    3077                     "frontend in a window\" are checked."));
    3078     return gc;
    3079 }
    3080 
    3081 static HostSpinBox *MacMainSkip()
    3082 {
    3083     HostSpinBox *gs = new HostSpinBox("MacMainSkip", 0, 30, 1, true);
     3184    HostRangeSetting *gs = new HostRangeSetting("MacMainSkip", 0, 30, 1, true);
    30843185    gs->setLabel(QObject::tr("Frames to skip"));
    30853186    gs->setValue(0);
    30863187    gs->setHelpText(QObject::tr("Video in the main window will skip this many "
    static HostSpinBox *MacMainSkip()  
    30893190    return gs;
    30903191}
    30913192
    3092 static HostSpinBox *MacMainOpacity()
     3193static HostRangeSetting *MacMainOpacity()
    30933194{
    3094     HostSpinBox *gs = new HostSpinBox("MacMainOpacity", 0, 100, 5, false);
     3195    HostRangeSetting *gs = new HostRangeSetting("MacMainOpacity", 0, 100, 5, false);
    30953196    gs->setLabel(QObject::tr("Opacity"));
    30963197    gs->setValue(100);
    30973198    gs->setHelpText(QObject::tr("The opacity of the main window. Set to "
    static HostSpinBox *MacMainOpacity()  
    31003201    return gs;
    31013202}
    31023203
    3103 class MacMainSettings : public TriggeredConfigurationGroup
    3104 {
    3105   public:
    3106     MacMainSettings() : TriggeredConfigurationGroup(false)
    3107     {
    3108         setLabel(QObject::tr("Video in main window"));
    3109         setUseLabel(false);
    3110         Setting *gc = MacMainEnabled();
    3111         addChild(gc);
    3112         setTrigger(gc);
    3113 
    3114         VerticalConfigurationGroup *opts =
    3115             new VerticalConfigurationGroup(false, false);
    3116         opts->addChild(MacMainSkip());
    3117         opts->addChild(MacMainOpacity());
    3118 
    3119         addTarget("1", opts);
    3120         addTarget("0", new VerticalConfigurationGroup(false, false));
    3121     }
    3122 };
    3123 
    3124 static HostCheckBox *MacFloatEnabled()
     3204static HostBoolSetting *MacMainEnabled()
    31253205{
    3126     HostCheckBox *gc = new HostCheckBox("MacFloatEnabled");
    3127     gc->setLabel(QObject::tr("Video in floating window"));
    3128     gc->setValue(false);
    3129     gc->setHelpText(QObject::tr("If enabled, video will be displayed in a "
    3130                     "floating window. Only valid when \"Use GUI size for TV "
    3131                     "playback\" and \"Run the frontend in a window\" are "
    3132                     "checked."));
     3206    HostBoolSetting *gc = new HostBoolSetting("MacMainEnabled");
     3207    gc->setLabel(QObject::tr("Video in main window"));
     3208    gc->setValue(true);
     3209    gc->setHelpText(QObject::tr("If enabled, video will be displayed in the "
     3210                    "main GUI window. Disable this when you only want video "
     3211                    "on the desktop or in a floating window. Only valid when "
     3212                    "\"Use GUI size for TV playback\" and \"Run the "
     3213                    "frontend in a window\" are checked."));
     3214    gc->addChild(true, MacMainSkip());
     3215    gc->addChild(true, MacMainOpacity());
    31333216    return gc;
    31343217}
    31353218
    static HostSpinBox *MacFloatOpacity()  
    31553238    return gs;
    31563239}
    31573240
    3158 class MacFloatSettings : public TriggeredConfigurationGroup
     3241static HostCheckBox *MacFloatEnabled()
    31593242{
    3160   public:
    3161     MacFloatSettings() : TriggeredConfigurationGroup(false)
    3162     {
    3163         setLabel(QObject::tr("Video in floating window"));
    3164         setUseLabel(false);
    3165         Setting *gc = MacFloatEnabled();
    3166         addChild(gc);
    3167         setTrigger(gc);
     3243    HostCheckBox *gc = new HostCheckBox("MacFloatEnabled");
     3244    gc->setLabel(QObject::tr("Video in floating window"));
     3245    gc->setValue(false);
     3246    gc->setHelpText(QObject::tr("If enabled, video will be displayed in a "
     3247                    "floating window. Only valid when \"Use GUI size for TV "
     3248                    "playback\" and \"Run the frontend in a window\" are "
     3249                    "checked."));
    31683250
    3169         VerticalConfigurationGroup *opts =
    3170             new VerticalConfigurationGroup(false, false);
    3171         opts->addChild(MacFloatSkip());
    3172         opts->addChild(MacFloatOpacity());
     3251    gc->addChild(true, MacFloatSkip());
     3252    gc->addChild(true, MacFloatOpacity());
     3253    return gc;
     3254}
    31733255
    3174         addTarget("1", opts);
    3175         addTarget("0", new VerticalConfigurationGroup(false, false));
    3176     }
    3177 };
     3256static HostSpinBox *MacDockSkip()
     3257{
     3258    HostSpinBox *gs = new HostSpinBox("MacDockSkip", 0, 30, 1, true);
     3259    gs->setLabel(QObject::tr("Frames to skip"));
     3260    gs->setValue(3);
     3261    gs->setHelpText(QObject::tr("Video in the dock icon will skip this many "
     3262                    "frames for each frame drawn. Set to 0 to show "
     3263                    "every frame."));
     3264    return gs;
     3265}
    31783266
    31793267static HostCheckBox *MacDockEnabled()
    31803268{
    static HostCheckBox *MacDockEnabled()  
    31853273                    "application's dock icon. Only valid when \"Use GUI size "
    31863274                    "for TV playback\" and \"Run the frontend in a window\" "
    31873275                    "are checked."));
     3276
     3277    gc->addChild(true, MacDockSkip());
    31883278    return gc;
    31893279}
    31903280
    3191 static HostSpinBox *MacDockSkip()
     3281static HostSpinBox *MacDesktopSkip()
    31923282{
    3193     HostSpinBox *gs = new HostSpinBox("MacDockSkip", 0, 30, 1, true);
     3283    HostSpinBox *gs = new HostSpinBox("MacDesktopSkip", 0, 30, 1, true);
    31943284    gs->setLabel(QObject::tr("Frames to skip"));
    3195     gs->setValue(3);
    3196     gs->setHelpText(QObject::tr("Video in the dock icon will skip this many "
     3285    gs->setValue(0);
     3286    gs->setHelpText(QObject::tr("Video on the desktop will skip this many "
    31973287                    "frames for each frame drawn. Set to 0 to show "
    31983288                    "every frame."));
    31993289    return gs;
    32003290}
    32013291
    3202 class MacDockSettings : public TriggeredConfigurationGroup
    3203 {
    3204   public:
    3205     MacDockSettings() : TriggeredConfigurationGroup(false)
    3206     {
    3207         setLabel(QObject::tr("Video in the dock"));
    3208         setUseLabel(false);
    3209         Setting *gc = MacDockEnabled();
    3210         addChild(gc);
    3211         setTrigger(gc);
    3212 
    3213         Setting *skip = MacDockSkip();
    3214         addTarget("1", skip);
    3215         addTarget("0", new HorizontalConfigurationGroup(false, false));
    3216     }
    3217 };
    3218 
    32193292static HostCheckBox *MacDesktopEnabled()
    32203293{
    32213294    HostCheckBox *gc = new HostCheckBox("MacDesktopEnabled");
    static HostCheckBox *MacDesktopEnabled()  
    32253298                    "desktop, behind the Finder icons. Only valid when \"Use "
    32263299                    "GUI size for TV playback\" and \"Run the frontend in a "
    32273300                    "window\" are checked."));
    3228     return gc;
    3229 }
    32303301
    3231 static HostSpinBox *MacDesktopSkip()
    3232 {
    3233     HostSpinBox *gs = new HostSpinBox("MacDesktopSkip", 0, 30, 1, true);
    3234     gs->setLabel(QObject::tr("Frames to skip"));
    3235     gs->setValue(0);
    3236     gs->setHelpText(QObject::tr("Video on the desktop will skip this many "
    3237                     "frames for each frame drawn. Set to 0 to show "
    3238                     "every frame."));
    3239     return gs;
     3302    gc->addChild(true, MacDesktopSkip());
     3303    return gc;
    32403304}
    32413305
    3242 class MacDesktopSettings : public TriggeredConfigurationGroup
    3243 {
    3244   public:
    3245     MacDesktopSettings() : TriggeredConfigurationGroup(false)
    3246     {
    3247         setLabel(QObject::tr("Video on the desktop"));
    3248         setUseLabel(false);
    3249         Setting *gc = MacDesktopEnabled();
    3250         addChild(gc);
    3251         setTrigger(gc);
    3252 
    3253         Setting *skip = MacDesktopSkip();
    3254         addTarget("1", skip);
    3255         addTarget("0", new HorizontalConfigurationGroup(false, false));
    3256     }
    3257 };
    32583306#endif
    32593307
    3260 static HostCheckBox *WatchTVGuide()
     3308static HostBoolSetting *WatchTVGuide()
    32613309{
    3262     HostCheckBox *gc = new HostCheckBox("WatchTVGuide");
     3310    HostBoolSetting *gc = new HostBoolSetting("WatchTVGuide");
    32633311    gc->setLabel(QObject::tr("Show the program guide when starting Live TV"));
    32643312    gc->setHelpText(QObject::tr("This starts the program guide immediately "
    32653313             "upon starting to watch Live TV."));
    static HostCheckBox *WatchTVGuide()  
    32693317
    32703318MainGeneralSettings::MainGeneralSettings()
    32713319{
    3272     DatabaseSettings::addDatabaseSettings(this);
     3320    setLabel(QObject::tr("General"));
    32733321
    3274     VerticalConfigurationGroup *pin =
    3275         new VerticalConfigurationGroup(false, true, false, false);
     3322    addChild(new MythDbSettings());
     3323
     3324    GroupSetting *pin = new GroupSetting();
    32763325    pin->setLabel(QObject::tr("Settings Access"));
    32773326    pin->addChild(SetupPinCodeRequired());
    32783327    pin->addChild(SetupPinCode());
    32793328    addChild(pin);
    32803329
    3281     VerticalConfigurationGroup *general =
    3282         new VerticalConfigurationGroup(false, true, false, false);
     3330    GroupSetting *general = new GroupSetting();
    32833331    general->setLabel(QObject::tr("General"));
    32843332    general->addChild(UseVirtualKeyboard());
    32853333    general->addChild(ScreenShotPath());
    32863334    addChild(general);
    32873335
    3288     VerticalConfigurationGroup *media =
    3289         new VerticalConfigurationGroup(false, true, false, false);
    3290     media->setLabel(QObject::tr("Media Monitor"));
    3291     MythMediaSettings *mediaMon = new MythMediaSettings();
    3292     media->addChild(mediaMon);
    3293     addChild(media);
     3336    addChild(EnableMediaMon());
    32943337
    3295     VerticalConfigurationGroup *shutdownSettings =
    3296         new VerticalConfigurationGroup(true, true, false, false);
     3338    GroupSetting *shutdownSettings = new GroupSetting();
    32973339    shutdownSettings->setLabel(QObject::tr("Shutdown/Reboot Settings"));
    32983340    shutdownSettings->addChild(OverrideExitMenu());
    32993341    shutdownSettings->addChild(HaltCommand());
    33003342    shutdownSettings->addChild(RebootCommand());
    33013343    addChild(shutdownSettings);
    33023344
    3303     VerticalConfigurationGroup *remotecontrol =
    3304         new VerticalConfigurationGroup(false, true, false, false);
     3345    GroupSetting *remotecontrol = new GroupSetting();
    33053346    remotecontrol->setLabel(QObject::tr("Remote Control"));
    33063347    remotecontrol->addChild(LircDaemonDevice());
    33073348    remotecontrol->addChild(NetworkControlEnabled());
    3308     remotecontrol->addChild(NetworkControlPort());
    33093349    remotecontrol->addChild(UDPNotifyPort());
    33103350    addChild(remotecontrol);
    33113351}
    33123352
    33133353PlaybackSettings::PlaybackSettings()
    33143354{
    3315     uint i = 0, total = 8;
    3316 #if CONFIG_DARWIN
    3317     total += 2;
    3318 #endif // USING_DARWIN
    3319 
    3320 
    3321     VerticalConfigurationGroup* general1 =
    3322         new VerticalConfigurationGroup(false);
    3323     general1->setLabel(QObject::tr("General Playback") +
    3324                       QString(" (%1/%2)").arg(++i).arg(total));
    3325 
    3326     HorizontalConfigurationGroup *columns =
    3327         new HorizontalConfigurationGroup(false, false, true, true);
    3328 
    3329     VerticalConfigurationGroup *column1 =
    3330         new VerticalConfigurationGroup(false, false, true, true);
    3331     column1->addChild(RealtimePriority());
    3332     column1->addChild(DecodeExtraAudio());
    3333     column1->addChild(JumpToProgramOSD());
    3334     columns->addChild(column1);
    3335 
    3336     VerticalConfigurationGroup *column2 =
    3337         new VerticalConfigurationGroup(false, false, true, true);
    3338     column2->addChild(ClearSavedPosition());
    3339     column2->addChild(AltClearSavedPosition());
    3340     column2->addChild(AutomaticSetWatched());
    3341     column2->addChild(ContinueEmbeddedTVPlay());
    3342     columns->addChild(column2);
    3343 
    3344     general1->addChild(columns);
    3345     general1->addChild(LiveTVIdleTimeout());
    3346     addChild(general1);
    3347 
    3348     VerticalConfigurationGroup* general2 =
    3349         new VerticalConfigurationGroup(false);
    3350     general2->setLabel(QObject::tr("General Playback") +
    3351                       QString(" (%1/%2)").arg(++i).arg(total));
    3352 
    3353     HorizontalConfigurationGroup* oscan =
    3354         new HorizontalConfigurationGroup(false, false, true, true);
    3355     VerticalConfigurationGroup *ocol1 =
    3356         new VerticalConfigurationGroup(false, false, true, true);
    3357     VerticalConfigurationGroup *ocol2 =
    3358         new VerticalConfigurationGroup(false, false, true, true);
    3359     ocol1->addChild(VertScanPercentage());
    3360     ocol1->addChild(YScanDisplacement());
    3361     ocol2->addChild(HorizScanPercentage());
    3362     ocol2->addChild(XScanDisplacement());
    3363     oscan->addChild(ocol1);
    3364     oscan->addChild(ocol2);
    3365 
    3366     HorizontalConfigurationGroup* aspect_fill =
    3367         new HorizontalConfigurationGroup(false, false, true, true);
    3368     aspect_fill->addChild(AspectOverride());
    3369     aspect_fill->addChild(AdjustFill());
    3370 
    3371     general2->addChild(oscan);
    3372     general2->addChild(aspect_fill);
    3373     general2->addChild(LetterboxingColour());
    3374     general2->addChild(PIPLocationComboBox());
    3375     general2->addChild(PlaybackExitPrompt());
    3376     general2->addChild(EndOfRecordingExitPrompt());
    3377     addChild(general2);
     3355    setLabel(QObject::tr("Playback"));
     3356    GroupSetting * general = new GroupSetting();
     3357    general->setLabel(QObject::tr("General Playback"));
     3358    general->addChild(RealtimePriority());
     3359    general->addChild(DecodeExtraAudio());
     3360    general->addChild(JumpToProgramOSD());
     3361    general->addChild(ClearSavedPosition());
     3362    general->addChild(AltClearSavedPosition());
     3363    general->addChild(AutomaticSetWatched());
     3364    general->addChild(ContinueEmbeddedTVPlay());
     3365    general->addChild(LiveTVIdleTimeout());
     3366    general->addChild(VertScanPercentage());
     3367    general->addChild(HorizScanPercentage());
     3368    general->addChild(YScanDisplacement());
     3369    general->addChild(XScanDisplacement());
     3370    general->addChild(AspectOverride());
     3371    general->addChild(AdjustFill());
     3372    general->addChild(LetterboxingColour());
     3373    general->addChild(PIPLocationComboBox());
     3374    general->addChild(PlaybackExitPrompt());
     3375    general->addChild(EndOfRecordingExitPrompt());
     3376    addChild(general);
    33783377
    3379     QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
    3380     addChild(new PlaybackProfileConfigs(tmp));
     3378    //QString tmp = QString(" (%1/%2)").arg(++i).arg(total);
     3379    addChild(new GroupSetting("PlaybackProfileConfigs TODO"));
     3380    //TODO addChild(new PlaybackProfileConfigs(tmp));
    33813381
    3382     VerticalConfigurationGroup* pbox = new VerticalConfigurationGroup(false);
    3383     pbox->setLabel(QObject::tr("View Recordings") +
    3384                    QString(" (%1/%2)").arg(++i).arg(total));
     3382    GroupSetting* pbox = new GroupSetting();
     3383    pbox->setLabel(QObject::tr("View Recordings"));
    33853384    pbox->addChild(PlayBoxOrdering());
    33863385    pbox->addChild(PlayBoxEpisodeSort());
    33873386    // Disabled until we re-enable live previews
    PlaybackSettings::PlaybackSettings()  
    33903389    pbox->addChild(PBBStartInTitle());
    33913390    addChild(pbox);
    33923391
    3393     VerticalConfigurationGroup* pbox2 = new VerticalConfigurationGroup(false);
    3394     pbox2->setLabel(QObject::tr("Recording Groups") +
    3395                     QString(" (%1/%2)").arg(++i).arg(total));
     3392    GroupSetting* pbox2 = new GroupSetting();
     3393    pbox2->setLabel(QObject::tr("Recording Groups"));
    33963394    pbox2->addChild(DisplayRecGroup());
    33973395    pbox2->addChild(QueryInitialFilter());
    33983396    pbox2->addChild(RememberRecGroup());
    33993397    pbox2->addChild(UseGroupNameAsAllPrograms());
    34003398    addChild(pbox2);
    34013399
    3402     VerticalConfigurationGroup* pbox3 = new VerticalConfigurationGroup(false);
    3403     pbox3->setLabel(QObject::tr("View Recordings") +
    3404                     QString(" (%1/%2)").arg(++i).arg(total));
     3400    GroupSetting* pbox3 = new GroupSetting();
     3401    pbox3->setLabel(QObject::tr("View Recordings"));
    34053402    pbox3->addChild(DisplayGroupTitleSort());
    3406     pbox3->addChild(new WatchListSettings());
     3403    addChild(PlaybackWatchList());
    34073404    addChild(pbox3);
    34083405
    3409     VerticalConfigurationGroup* seek = new VerticalConfigurationGroup(false);
    3410     seek->setLabel(QObject::tr("Seeking") +
    3411                    QString(" (%1/%2)").arg(++i).arg(total));
     3406    GroupSetting* seek = new GroupSetting();
     3407    seek->setLabel(QObject::tr("Seeking"));
    34123408    seek->addChild(SmartForward());
    34133409    seek->addChild(FFRewReposTime());
    34143410    seek->addChild(FFRewReverse());
    34153411    seek->addChild(ExactSeeking());
    34163412    addChild(seek);
    34173413
    3418     VerticalConfigurationGroup* comms = new VerticalConfigurationGroup(false);
    3419     comms->setLabel(QObject::tr("Commercial Skip") +
    3420                     QString(" (%1/%2)").arg(++i).arg(total));
     3414    GroupSetting* comms = new GroupSetting();
     3415    comms->setLabel(QObject::tr("Commercial Skip"));
    34213416    comms->addChild(AutoCommercialSkip());
    34223417    comms->addChild(CommRewindAmount());
    34233418    comms->addChild(CommNotifyAmount());
    PlaybackSettings::PlaybackSettings()  
    34263421    addChild(comms);
    34273422
    34283423#if CONFIG_DARWIN
    3429     VerticalConfigurationGroup* mac1 = new VerticalConfigurationGroup(false);
    3430     mac1->setLabel(QObject::tr("Mac OS X Video Settings") +
    3431                    QString(" (%1/%2)").arg(++i).arg(total));
    3432     mac1->addChild(MacGammaCorrect());
    3433     mac1->addChild(MacScaleUp());
    3434     mac1->addChild(MacFullSkip());
    3435     addChild(mac1);
    3436 
    3437     VerticalConfigurationGroup* mac2 = new VerticalConfigurationGroup(false);
    3438     mac2->setLabel(QObject::tr("Mac OS X Video Settings") +
    3439                    QString(" (%1/%2)").arg(++i).arg(total));
    3440     mac2->addChild(new MacMainSettings());
    3441     mac2->addChild(new MacFloatSettings());
    3442 
    3443     HorizontalConfigurationGroup *row =
    3444         new HorizontalConfigurationGroup(false, false, true, true);
    3445     row->addChild(new MacDockSettings());
    3446     row->addChild(new MacDesktopSettings());
    3447     mac2->addChild(row);
    3448 
     3424    GroupSetting* mac = new GroupSetting();
     3425    mac->setLabel(QObject::tr("Mac OS X Video Settings"));
     3426    mac->addChild(MacGammaCorrect());
     3427    mac->addChild(MacScaleUp());
     3428    mac->addChild(MacFullSkip());
     3429    mac->addChild(MacMainEnabled());
     3430    mac->addChild(MacFloatEnabled());
     3431    mac->addChild(MacDockEnabled());
     3432    mac->addChild(MacDesktopSettings());
    34493433    addChild(mac2);
    34503434#endif
    34513435}
    34523436
    34533437OSDSettings::OSDSettings()
    34543438{
    3455     VerticalConfigurationGroup* osd = new VerticalConfigurationGroup(false);
    3456     osd->setLabel(QObject::tr("On-screen Display"));
     3439    setLabel(QObject::tr("On-screen Display"));
    34573440
    3458     osd->addChild(EnableMHEG());
    3459     osd->addChild(PersistentBrowseMode());
    3460     osd->addChild(BrowseAllTuners());
    3461     osd->addChild(CCBackground());
    3462     osd->addChild(DefaultCCMode());
    3463     osd->addChild(PreferCC708());
    3464     osd->addChild(SubtitleFont());
    3465     osd->addChild(OSDCC708TextZoomPercentage());
    3466     osd->addChild(SubtitleCodec());
    3467     addChild(osd);
     3441    addChild(EnableMHEG());
     3442    addChild(PersistentBrowseMode());
     3443    addChild(BrowseAllTuners());
     3444    addChild(CCBackground());
     3445    addChild(DefaultCCMode());
     3446    addChild(PreferCC708());
     3447    addChild(SubtitleFont());
     3448    addChild(OSDCC708TextZoomPercentage());
     3449    addChild(SubtitleCodec());
    34683450
    34693451    //VerticalConfigurationGroup *cc = new VerticalConfigurationGroup(false);
    34703452    //cc->setLabel(QObject::tr("Closed Captions"));
    OSDSettings::OSDSettings()  
    34793461
    34803462GeneralSettings::GeneralSettings()
    34813463{
    3482     VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false);
    3483     general->setLabel(QObject::tr("General (Basic)"));
     3464    setLabel(QObject::tr("General"));
     3465    GroupSetting* general = new GroupSetting();
     3466    general->setLabel(QObject::tr("Basic"));
    34843467    general->addChild(ChannelOrdering());
    34853468    general->addChild(ChannelFormat());
    34863469    general->addChild(LongChannelFormat());
    GeneralSettings::GeneralSettings()  
    34883471    general->addChild(LiveTVPriority());
    34893472    addChild(general);
    34903473
    3491     VerticalConfigurationGroup* autoexp = new VerticalConfigurationGroup(false);
    3492     autoexp->setLabel(QObject::tr("General (Auto-Expire)"));
     3474    GroupSetting* autoexp = new GroupSetting();
     3475    autoexp->setLabel(QObject::tr("Auto-Expire"));
    34933476    autoexp->addChild(AutoExpireMethod());
    3494 
    3495     VerticalConfigurationGroup *expgrp0 =
    3496         new VerticalConfigurationGroup(false, false, true, true);
    3497     expgrp0->addChild(AutoExpireDefault());
    3498     expgrp0->addChild(RerecordWatched());
    3499     expgrp0->addChild(AutoExpireWatchedPriority());
    3500 
    3501     VerticalConfigurationGroup *expgrp1 =
    3502         new VerticalConfigurationGroup(false, false, true, true);
    3503     expgrp1->addChild(AutoExpireLiveTVMaxAge());
    3504     expgrp1->addChild(AutoExpireDayPriority());
    3505     expgrp1->addChild(AutoExpireExtraSpace());
    3506 
    3507     HorizontalConfigurationGroup *expgrp =
    3508         new HorizontalConfigurationGroup(false, false, true, true);
    3509     expgrp->addChild(expgrp0);
    3510     expgrp->addChild(expgrp1);
    3511 
    3512     autoexp->addChild(expgrp);
    3513     autoexp->addChild(new DeletedExpireOptions());
    3514 
     3477    autoexp->addChild(AutoExpireDefault());
     3478    autoexp->addChild(RerecordWatched());
     3479    autoexp->addChild(AutoExpireWatchedPriority());
     3480    autoexp->addChild(AutoExpireLiveTVMaxAge());
     3481    autoexp->addChild(AutoExpireDayPriority());
     3482    autoexp->addChild(AutoExpireExtraSpace());
     3483    autoexp->addChild(AutoExpireInsteadOfDelete());
    35153484    addChild(autoexp);
    35163485
    3517     VerticalConfigurationGroup* jobs = new VerticalConfigurationGroup(false);
    3518     jobs->setLabel(QObject::tr("General (Jobs)"));
     3486    GroupSetting* jobs = new GroupSetting();
     3487    jobs->setLabel(QObject::tr("Jobs"));
    35193488    jobs->addChild(CommercialSkipMethod());
    35203489    jobs->addChild(CommFlagFast());
    35213490    jobs->addChild(AggressiveCommDetect());
    35223491    jobs->addChild(DefaultTranscoder());
    35233492    jobs->addChild(DeferAutoTranscodeDays());
    35243493
    3525     VerticalConfigurationGroup* autogrp0 =
    3526         new VerticalConfigurationGroup(false, false, true, true);
    3527     autogrp0->addChild(AutoMetadataLookup());
    3528     autogrp0->addChild(AutoCommercialFlag());
    3529     autogrp0->addChild(AutoTranscode());
    3530 
    3531     VerticalConfigurationGroup* autogrp1 =
    3532         new VerticalConfigurationGroup(false, false, true, true);
    3533     autogrp0->addChild(AutoRunUserJob(1));
    3534     autogrp1->addChild(AutoRunUserJob(2));
    3535     autogrp1->addChild(AutoRunUserJob(3));
    3536     autogrp1->addChild(AutoRunUserJob(4));
    3537 
    3538     HorizontalConfigurationGroup *autogrp =
    3539         new HorizontalConfigurationGroup(true, true, false, true);
     3494    GroupSetting* autogrp = new GroupSetting();
    35403495    autogrp->setLabel(
    35413496        QObject::tr("Default Job Queue Settings for New Scheduled Recordings"));
    3542     autogrp->addChild(autogrp0);
    3543     autogrp->addChild(autogrp1);
     3497    autogrp->addChild(AutoMetadataLookup());
     3498    autogrp->addChild(AutoCommercialFlag());
     3499    autogrp->addChild(AutoTranscode());
     3500    autogrp->addChild(AutoRunUserJob(1));
     3501    autogrp->addChild(AutoRunUserJob(2));
     3502    autogrp->addChild(AutoRunUserJob(3));
     3503    autogrp->addChild(AutoRunUserJob(4));
     3504
    35443505    jobs->addChild(autogrp);
    35453506
    35463507    addChild(jobs);
    35473508
    3548     VerticalConfigurationGroup* general2 = new VerticalConfigurationGroup(false);
    3549     general2->setLabel(QObject::tr("General (Advanced)"));
     3509    GroupSetting* general2 = new GroupSetting();
     3510    general2->setLabel(QObject::tr("Advanced"));
    35503511    general2->addChild(RecordPreRoll());
    35513512    general2->addChild(RecordOverTime());
    35523513    general2->addChild(CategoryOverTimeSettings());
    35533514    addChild(general2);
    35543515
    3555     VerticalConfigurationGroup* changrp = new VerticalConfigurationGroup(false);
    3556     changrp->setLabel(QObject::tr("General (Channel Groups)"));
    3557     ChannelGroupSettings *changroupsettings = new ChannelGroupSettings();
    3558     changrp->addChild(changroupsettings);
     3516    GroupSetting* changrp = new GroupSetting();
     3517    changrp->setLabel(QObject::tr("Channel Groups"));
     3518    changrp->addChild(ChannelGroupRememberLast());
    35593519    changrp->addChild(BrowseChannelGroup());
    35603520    addChild(changrp);
    35613521}
    35623522
    35633523EPGSettings::EPGSettings()
    35643524{
    3565     VerticalConfigurationGroup* epg = new VerticalConfigurationGroup(false);
    3566     epg->setLabel(QObject::tr("Program Guide") + " 1/1");
    3567     epg->addChild(WatchTVGuide());
    3568     epg->addChild(DefaultTVChannel());
    3569     epg->addChild(EPGRecThreshold());
    3570     addChild(epg);
     3525    setLabel(QObject::tr("Program Guide"));
     3526    addChild(WatchTVGuide());
     3527    addChild(DefaultTVChannel());
     3528    addChild(EPGRecThreshold());
    35713529}
    35723530
    35733531GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()
    35743532{
    3575     VerticalConfigurationGroup* sched = new VerticalConfigurationGroup(false);
     3533    setLabel(QObject::tr("Recording Priorities"));
     3534
     3535    GroupSetting* sched = new GroupSetting();
    35763536    sched->setLabel(QObject::tr("Scheduler Options"));
    35773537
    35783538    sched->addChild(GRSchedMoveHigher());
    GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()  
    35853545    sched->addChild(GRAutoRecPriority());
    35863546    addChild(sched);
    35873547
    3588     VerticalConfigurationGroup* access = new VerticalConfigurationGroup(false);
     3548    GroupSetting* access = new GroupSetting();
    35893549    access->setLabel(QObject::tr("Accessibility Options"));
    35903550
    35913551    access->addChild(GRSignLangRecPriority());
    GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()  
    35953555    access->addChild(GRAudioDescRecPriority());
    35963556    addChild(access);
    35973557
    3598     VerticalConfigurationGroup* rtype = new VerticalConfigurationGroup(false);
     3558    GroupSetting* rtype = new GroupSetting();
    35993559    rtype->setLabel(QObject::tr("Recording Type Priority Settings"));
    36003560
    36013561    rtype->addChild(GRSingleRecordRecPriority());
    GeneralRecPrioritiesSettings::GeneralRecPrioritiesSettings()  
    36103570
    36113571AppearanceSettings::AppearanceSettings()
    36123572{
    3613     VerticalConfigurationGroup* screen = new VerticalConfigurationGroup(false);
     3573    setLabel(QObject::tr("Appearance"));
     3574    GroupSetting* screen = new GroupSetting();
    36143575    screen->setLabel(QObject::tr("Theme") + " / " + QObject::tr("Screen Settings"));
    36153576
    36163577    screen->addChild(MenuTheme());
    AppearanceSettings::AppearanceSettings()  
    36243585//    screen->addChild(DisplaySizeHeight());
    36253586//    screen->addChild(DisplaySizeWidth());
    36263587
    3627     VerticalConfigurationGroup *column1 =
    3628         new VerticalConfigurationGroup(false, false, false, false);
    3629 
    3630     column1->addChild(GuiWidth());
    3631     column1->addChild(GuiHeight());
    3632     column1->addChild(GuiOffsetX());
    3633     column1->addChild(GuiOffsetY());
    3634 
    3635     VerticalConfigurationGroup *column2 =
    3636         new VerticalConfigurationGroup(false, false, false, false);
    3637 
    3638     column2->addChild(GuiSizeForTV());
    3639     column2->addChild(HideMouseCursor());
    3640     column2->addChild(RunInWindow());
    3641     column2->addChild(UseFixedWindowSize());
    3642 
    3643     HorizontalConfigurationGroup *columns =
    3644         new HorizontalConfigurationGroup(false, false, false, false);
    3645 
    3646     columns->addChild(column1);
    3647     columns->addChild(column2);
    3648 
    3649     screen->addChild(columns);
     3588    screen->addChild(GuiWidth());
     3589    screen->addChild(GuiHeight());
     3590    screen->addChild(GuiOffsetX());
     3591    screen->addChild(GuiOffsetY());
     3592    screen->addChild(GuiSizeForTV());
     3593    screen->addChild(HideMouseCursor());
     3594    screen->addChild(RunInWindow());
     3595    screen->addChild(UseFixedWindowSize());
    36503596
    36513597    addChild(screen);
    36523598
    36533599#if defined(USING_XRANDR) || CONFIG_DARWIN
    36543600    const vector<DisplayResScreen> scr = GetVideoModes();
    3655     if (!scr.empty())
    3656         addChild(new VideoModeSettings());
     3601    /* TODO if (!scr.empty())
     3602        addChild(new VideoModeSettings()); */
    36573603#endif
    3658     VerticalConfigurationGroup* dates = new VerticalConfigurationGroup(false);
     3604    GroupSetting* dates = new GroupSetting();
    36593605    dates->setLabel(QObject::tr("Localization"));
    36603606    dates->addChild(MythLanguage());
    36613607    dates->addChild(ISO639PreferredLanguage(0));
    AppearanceSettings::AppearanceSettings()  
    36653611    dates->addChild(MythTimeFormat());
    36663612    addChild(dates);
    36673613
    3668     addChild(new LcdSettings());
     3614    addChild(LCDEnable());
    36693615}
    36703616
    36713617// 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..f149108 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
    1617{
    1718  public:
    1819    PlaybackSettings();
    1920};
    2021
    21 class OSDSettings: virtual public ConfigurationWizard
     22class OSDSettings: virtual public GroupSetting
    2223{
    2324  public:
    2425    OSDSettings();
    2526};
    2627
    27 class GeneralSettings : public ConfigurationWizard
     28class GeneralSettings : public GroupSetting
    2829{
    2930  public:
    3031    GeneralSettings();
    3132};
    3233
    33 class EPGSettings : public ConfigurationWizard
     34class EPGSettings : public GroupSetting
    3435{
    3536  public:
    3637    EPGSettings();
    3738};
    3839
    39 class AppearanceSettings : public ConfigurationWizard
     40class AppearanceSettings : public GroupSetting
    4041{
    4142  public:
    4243    AppearanceSettings();
    4344};
    4445
    45 class MainGeneralSettings : public ConfigurationWizard
     46class MainGeneralSettings : public GroupSetting
    4647{
    4748  public:
    4849    MainGeneralSettings();
    4950};
    5051
    51 class GeneralRecPrioritiesSettings : public ConfigurationWizard
     52class GeneralRecPrioritiesSettings : public GroupSetting
    5253{
    5354  public:
    5455    GeneralRecPrioritiesSettings();
  • mythtv/programs/mythfrontend/main.cpp

    diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp
    index 33a8840..dbd60e0 100644
    a b static void TVMenuCallback(void *data, QString &selection)  
    829829        startPrevious();
    830830    else if (sel == "settings appearance")
    831831    {
    832         AppearanceSettings *settings = new AppearanceSettings();
    833         DialogCode res = settings->exec();
    834         delete settings;
     832        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     833        StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
    835834
     835        if (gs->Create())
     836        {
     837            gs->setSettings(new AppearanceSettings());
     838            mainStack->AddScreen(gs);
     839        }
     840        else
     841            delete gs;
     842        /* TODO
    836843        if (kDialogCodeRejected != res)
    837844        {
    838845            qApp->processEvents();
    839846            GetMythMainWindow()->JumpTo("Reload Theme");
    840         }
     847        }*/
    841848    }
    842849    else if (sel == "settings themechooser")
    843850    {
    static void TVMenuCallback(void *data, QString &selection)  
    889896    }
    890897    else if (sel == "settings general")
    891898    {
    892         GeneralSettings settings;
    893         settings.exec();
     899        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     900        StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
     901
     902        if (gs->Create())
     903        {
     904            gs->setSettings(new GeneralSettings());
     905            mainStack->AddScreen(gs);
     906        }
     907        else
     908            delete gs;
    894909    }
    895910    else if (sel == "settings audiogeneral")
    896911    {
    static void TVMenuCallback(void *data, QString &selection)  
    899914    }
    900915    else if (sel == "settings maingeneral")
    901916    {
    902         MainGeneralSettings mainsettings;
    903         mainsettings.exec();
     917        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     918        StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
     919
     920        if (gs->Create())
     921        {
     922            gs->setSettings(new MainGeneralSettings());
     923            mainStack->AddScreen(gs);
     924        }
     925        else
     926            delete gs;
     927
     928        /*TODO need to execute this after
    904929        QStringList strlist( QString("REFRESH_BACKEND") );
    905930        gCoreContext->SendReceiveStringList(strlist);
     931        */
     932       
    906933    }
    907934    else if (sel == "settings playback")
    908935    {
    909         PlaybackSettings settings;
    910         settings.exec();
     936        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     937        StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
     938
     939        if (gs->Create())
     940        {
     941            gs->setSettings(new PlaybackSettings());
     942            mainStack->AddScreen(gs);
     943        }
     944        else
     945            delete gs;
    911946    }
    912947    else if (sel == "settings osd")
    913948    {
    914         OSDSettings settings;
    915         settings.exec();
     949        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     950        StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
     951
     952        if (gs->Create())
     953        {
     954            gs->setSettings(new OSDSettings());
     955            mainStack->AddScreen(gs);
     956        }
     957        else
     958            delete gs;
    916959    }
    917960    else if (sel == "settings epg")
    918961    {
    919         EPGSettings settings;
    920         settings.exec();
     962        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     963        StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
     964
     965        if (gs->Create())
     966        {
     967            gs->setSettings(new EPGSettings());
     968            mainStack->AddScreen(gs);
     969        }
     970        else
     971            delete gs;
    921972    }
    922973    else if (sel == "settings channelgroups")
    923974    {
    static void TVMenuCallback(void *data, QString &selection)  
    926977    }
    927978    else if (sel == "settings generalrecpriorities")
    928979    {
    929         GeneralRecPrioritiesSettings settings;
    930         settings.exec();
     980        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     981        StandardSettingDialog *gs = new StandardSettingDialog(mainStack, "maingeeralsettings");
     982
     983        if (gs->Create())
     984        {
     985            gs->setSettings(new GeneralRecPrioritiesSettings());
     986            mainStack->AddScreen(gs);
     987        }
     988        else
     989            delete gs;
    931990    }
    932991    else if (sel == "settings channelrecpriorities")
    933992    {
    static bool RunMenu(QString themedir, QString themename)  
    10561115// the default values
    10571116static void WriteDefaults()
    10581117{
     1118/*
    10591119    PlaybackSettings ps;
    10601120    ps.Load();
    10611121    ps.Save();
    static void WriteDefaults()  
    10791139    grs.Save();
    10801140    VideoGeneralSettings vgs;
    10811141    vgs.Load();
    1082     vgs.Save();
     1142    vgs.Save();*/
    10831143}
    10841144
    10851145static int internal_play_media(const QString &mrl, const QString &plot,
  • mythtv/programs/mythfrontend/mythfrontend.pro

    diff --git a/mythtv/programs/mythfrontend/mythfrontend.pro b/mythtv/programs/mythfrontend/mythfrontend.pro
    index cf985d6..debf109 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         
     43# maingeneralsettingssetup.h  setup_video_general.h
     44HEADERS += standardsettings.h
    4345
    4446SOURCES += main.cpp playbackbox.cpp viewscheduled.cpp audiogeneralsettings.cpp
    4547SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp
    SOURCES += videoplayercommand.cpp videopopups.cpp  
    6062SOURCES += videofilter.cpp              videolist.cpp
    6163SOURCES += videoplayersettings.cpp      videodlg.cpp
    6264SOURCES += videoglobalsettings.cpp      upnpscanner.cpp
    63 SOURCES += commandlineparser.cpp
     65SOURCES += commandlineparser.cpp       
     66#maingeneralsettingssetup.cpp setup_video_general.cpp
     67SOURCES += standardsettings.cpp
    6468
    6569macx {
    6670    mac_bundle {
  • 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..b15ee98
    - +  
     1#include "standardsettings.h"
     2#include <QCoreApplication>
     3
     4#include <mythcontext.h>
     5#include <mythmainwindow.h>
     6#include <mythdialogbox.h>
     7#include <mythuispinbox.h>
     8#include <mythuitext.h>
     9#include <mythuibutton.h>
     10#include "mythlogging.h"
     11
     12
     13StandardSetting::StandardSetting(const QString &settingName, const QString &text)
     14    : GroupSetting(text),
     15    m_settingName(settingName),
     16    m_haveChanged(false)
     17{
     18    this->SetData(QVariant::fromValue((MythGenericTree*)this));
     19}
     20
     21StandardSetting::~StandardSetting()
     22{
     23}
     24
     25void StandardSetting::SetDBValue(const QString &text){
     26    LOG(VB_GENERAL, LOG_ERR, QString("StandardSettingDialog::SetDBValue(%1) for %2").arg(text).arg(m_settingName));
     27    setSettingValue(text);
     28};
     29
     30void StandardSetting::setSettingValue(const QString newValue)
     31{
     32    m_settingValue=newValue;
     33}
     34
     35const QString StandardSetting::getHelpText()
     36{
     37    return GetText("help");
     38}
     39
     40const QString StandardSetting::getTextValue() const
     41{
     42    return GetText("value");
     43}
     44
     45bool StandardSetting::haveChanged()
     46{
     47    if (m_haveChanged)
     48        return true;
     49    return GroupSetting::haveChanged();
     50}
     51
     52GroupSetting::GroupSetting(const QString &text)
     53    :MythGenericTree (text, 0, true)
     54{
     55}
     56
     57void GroupSetting::setLabel(const QString &label)
     58{
     59    SetText(label);
     60}
     61
     62void GroupSetting::addChild(GroupSetting *standardSetting)
     63{
     64    addNode(standardSetting);
     65}
     66void GroupSetting::setHelpText(const QString &description)
     67{
     68    SetText(description,"help");
     69}
     70
     71//TODO remove the need for this
     72void GroupSetting::setScreen(MythScreenType *screen)
     73{
     74    m_screen = screen;
     75
     76    QList<MythGenericTree*>::iterator it;
     77    QList<MythGenericTree*> *children = this->getAllChildren();
     78
     79    if (!children)
     80        return;
     81
     82    MythGenericTree *child = NULL;
     83
     84    for (it = children->begin(); it != children->end(); ++it)
     85    {
     86        child = *it;
     87        if (!child)
     88            continue;
     89        GroupSetting * setting = dynamic_cast<GroupSetting*>(child);
     90        if (setting)
     91            setting->setScreen(screen);
     92    }
     93}
     94
     95bool GroupSetting::haveChanged()
     96{
     97
     98    QList<MythGenericTree*>::iterator it;
     99    QList<MythGenericTree*> *children = this->getAllChildren();
     100
     101    if (!children)
     102        return false;
     103
     104    MythGenericTree *child = NULL;
     105
     106    for (it = children->begin(); it != children->end(); ++it)
     107    {
     108        child = *it;
     109        if (!child)
     110            continue;
     111        GroupSetting * setting = dynamic_cast<GroupSetting*>(child);
     112        if (setting && setting->haveChanged())
     113            return true;
     114    }
     115    return false;
     116}
     117
     118void GroupSetting::Save()
     119{
     120    QList<MythGenericTree*>::iterator it;
     121    QList<MythGenericTree*> *children = this->getAllChildren();
     122
     123    if (!children)
     124        return;
     125
     126    MythGenericTree *child = NULL;
     127
     128    for (it = children->begin(); it != children->end(); ++it)
     129    {
     130        child = *it;
     131        if (!child)
     132            continue;
     133        GroupSetting * setting = dynamic_cast<GroupSetting*>(child);
     134        if (setting)
     135            setting->Save();
     136    }
     137}
     138
     139void GroupSetting::Load()
     140{
     141    QList<MythGenericTree*>::iterator it;
     142    QList<MythGenericTree*> *children = this->getAllChildren();
     143
     144    if (!children)
     145        return;
     146
     147    MythGenericTree *child = NULL;
     148
     149    for (it = children->begin(); it != children->end(); ++it)
     150    {
     151        child = *it;
     152        if (!child)
     153            continue;
     154        GroupSetting * setting = dynamic_cast<GroupSetting*>(child);
     155        if (setting)
     156            setting->Load();
     157    }
     158}
     159
     160void GroupSetting::edit()
     161{
     162    DialogCompletionEvent *dce =
     163            new DialogCompletionEvent("editsetting", 0, "", "");
     164    QCoreApplication::postEvent(m_screen, dce);
     165}
     166
     167TextualSetting::TextualSetting(const QString &settingName, const QString &text, bool password)
     168    : StandardSetting(settingName, text),
     169    m_password(password)
     170{
     171}
     172
     173void TextualSetting::setValue(const QString &newValue)
     174{
     175    setSettingValue(newValue);
     176}
     177
     178void TextualSetting::edit()
     179{
     180    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
     181
     182    MythTextInputDialog *settingdialog =
     183                                    new MythTextInputDialog(popupStack,
     184                                    this->GetText(),FilterNone, m_password,m_settingValue);
     185
     186    if (settingdialog->Create())
     187    {
     188        settingdialog->SetReturnEvent(m_screen, "editsetting");
     189        popupStack->AddScreen(settingdialog);
     190    }
     191}
     192
     193void TextualSetting::resultEdit(DialogCompletionEvent *dce)
     194{
     195    if (m_settingValue!=dce->GetResultText())
     196    {
     197        m_haveChanged=true;
     198        setSettingValue(dce->GetResultText());
     199    }
     200}
     201
     202void TextualSetting::setSettingValue(const QString newValue)
     203{
     204    m_settingValue = newValue;
     205
     206    if (m_password)
     207        if (m_settingValue.isEmpty())
     208            SetText("","value");
     209        else
     210            SetText("****","value");
     211    else
     212        SetText(m_settingValue,"value");
     213}
     214
     215BoolSetting::BoolSetting(const QString &settingName, const QString &text)
     216    : StandardSetting(settingName, text)
     217{
     218}
     219
     220void BoolSetting::edit()
     221{
     222    //LOG(VB_GENERAL, LOG_ERR, "BoolSetting::edit()");
     223    DialogCompletionEvent *dce =
     224            new DialogCompletionEvent("editsetting", 0, "", QVariant::fromValue((MythGenericTree*)this));
     225    QCoreApplication::postEvent(m_screen, dce);
     226}
     227
     228void BoolSetting::addChild (bool value, GroupSetting *child)
     229{
     230    if (value)
     231        m_OnChildren.append(child);
     232    else
     233        m_OffChildren.append(child);
     234/*
     235    child = StandardSetting::addNode(child);
     236    child->SetVisible(m_settingValue=="1");
     237    return child;*/
     238}
     239
     240void BoolSetting::setSettingValue(const QString newValue)
     241{
     242    m_settingValue = newValue;
     243
     244    QList< GroupSetting * > *nodes = NULL;
     245
     246    if (m_settingValue=="1")
     247    {
     248        SetText(QObject::tr("On"),"value");
     249        nodes=&m_OnChildren;
     250    }
     251    else
     252    {
     253        SetText(QObject::tr("Off"),"value");
     254        nodes=&m_OffChildren;
     255    }
     256
     257    QList< MythGenericTree * > *children = getAllChildren ();
     258    MythGenericTree *child;
     259    foreach(child, *children)
     260    {
     261        this->removeNode(child);
     262    }
     263
     264
     265    GroupSetting *node;
     266    foreach(node, *nodes)
     267    {
     268        this->addNode(node);
     269    }
     270}
     271
     272void BoolSetting::setValue(bool newValue)
     273{
     274    if (newValue)
     275        setSettingValue("1");
     276    else
     277        setSettingValue("0");
     278}
     279
     280void BoolSetting::resultEdit(DialogCompletionEvent *dce)
     281{
     282    if (m_settingValue=="1")
     283        setSettingValue(m_settingValue="0");
     284    else
     285        setSettingValue(m_settingValue="1");
     286    m_haveChanged=true;
     287}
     288
     289RangeSetting::RangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step)
     290    : StandardSetting(settingName)
     291{
     292    m_min  = min;
     293    m_max  = max;
     294}
     295
     296void RangeSetting::setValue(int newValue)
     297{
     298    m_settingValue=QString("%1").arg(newValue);
     299    update();
     300}
     301
     302void RangeSetting::edit()
     303{
     304    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
     305
     306
     307    MythTextInputDialog *settingdialog =
     308                                    new MythTextInputDialog(popupStack,
     309                                    "Range: " +this->GetText(),(InputFilter)(FilterAlpha | FilterSymbols | FilterPunct) ,false, m_settingValue);
     310    if (settingdialog->Create())
     311    {
     312        settingdialog->SetReturnEvent(m_screen, "editsetting");
     313        popupStack->AddScreen(settingdialog);
     314    }
     315}
     316
     317void RangeSetting::resultEdit(DialogCompletionEvent *dce)
     318{
     319    if (m_settingValue!=dce->GetResultText())
     320    {
     321        int newValue=dce->GetResultText().toInt();
     322        if (newValue< m_min || newValue > m_max)
     323        {
     324            //TODO display out of bound message;
     325            MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
     326            MythConfirmationDialog * errorDialog = new MythConfirmationDialog(popupStack,
     327                QObject::tr("out of bound, the value should be between %1 and %2")
     328                    .arg(m_min).arg(m_max),false);
     329            if (errorDialog->Create())
     330                popupStack->AddScreen(errorDialog);
     331        }
     332        else
     333        {
     334            m_haveChanged=true;
     335            setSettingValue(dce->GetResultText());
     336           
     337        }
     338        update();
     339    }
     340}
     341
     342void RangeSetting::update()
     343{
     344    SetText(m_settingValue,"value");
     345}
     346
     347ListSetting::ListSetting(const QString &settingName, const QString &text)
     348    :StandardSetting(settingName, text)
     349{
     350    Load();
     351}
     352
     353void ListSetting::setValue(int newValue)
     354{
     355    QMapIterator<QString, QString> i(m_options);
     356    while (i.hasNext())
     357    {
     358        i.next();
     359        if (newValue==0)
     360        {
     361            setSettingValue(i.key());
     362            return;
     363        }
     364        newValue--;
     365    }
     366}
     367
     368void ListSetting::setSettingValue(const QString newValue)
     369{
     370        LOG(VB_GENERAL, LOG_ERR, QString("ListSetting::setSettingValue(%1) for %2")
     371            .arg(newValue).arg(m_settingName));
     372    m_settingValue=newValue;
     373    if (m_options.contains(m_settingValue))
     374    {
     375        LOG(VB_GENERAL, LOG_ERR, QString("ListSetting::setSettingValue(%1) for %2 => %3")
     376            .arg(newValue).arg(m_settingName).arg(m_options[m_settingValue]));
     377        SetText(m_options[m_settingValue],"value");
     378    }
     379    else
     380    {
     381        LOG(VB_GENERAL, LOG_ERR, QString("*ListSetting::setSettingValue(%1) for %2")
     382            .arg(newValue).arg(m_settingName));
     383        SetText(newValue+"*","value");
     384    }
     385}
     386
     387
     388void ListSetting::addSelection(QString label, QString value, bool select)
     389{
     390    m_options[value]=label;
     391    //TODO do something with select
     392        LOG(VB_GENERAL, LOG_ERR, QString("%1 => %2 =? %3")
     393            .arg(m_settingName).arg(value).arg(m_settingValue));
     394    if (value == m_settingValue && m_options.contains(m_settingValue))
     395        SetText(m_options[m_settingValue],"value");
     396}
     397
     398void ListSetting::clearSelections()
     399{
     400    m_options.clear();
     401}
     402
     403void ListSetting::edit()
     404{
     405    MythScreenStack *popupStack =
     406                            GetMythMainWindow()->GetStack("popup stack");
     407
     408    MythDialogBox * m_menuPopup =
     409            new MythDialogBox(GetText(), popupStack, "optionmenu");
     410
     411    if (m_menuPopup->Create())
     412        popupStack->AddScreen(m_menuPopup);
     413
     414    m_menuPopup->SetReturnEvent(m_screen, "editsetting");
     415
     416    //populate the list of choice
     417    QMapIterator<QString, QString> i(m_options);
     418    while (i.hasNext())
     419    {
     420        i.next();
     421        if (i.key()==m_settingValue)
     422            m_menuPopup->AddButton(i.value(),i.key(),false,true);
     423        else
     424            m_menuPopup->AddButton(i.value(),i.key());
     425    }
     426}
     427
     428void ListSetting::resultEdit(DialogCompletionEvent *dce)
     429{
     430    if (dce->GetResult()!=-1 && m_settingValue!=dce->GetData().toString())
     431    {
     432        m_haveChanged=true;
     433        setSettingValue(dce->GetData().toString());
     434    }
     435}
     436
     437MythSpinBoxDialog::MythSpinBoxDialog(MythScreenStack *parent,
     438                                         const QString &message,
     439                                         const QString &defaultValue)
     440   : MythScreenType(parent, "mythspinboxpopup")
     441{
     442    m_message = message;
     443    m_defaultValue = defaultValue;
     444    m_spinBox = NULL;
     445
     446    m_id = "";
     447    m_retObject = NULL;
     448}
     449
     450bool MythSpinBoxDialog::Create(void)
     451{
     452    if (!LoadWindowFromXML("standardsetting-ui.xml", "MythSpinBoxDialog", this))
     453        return false;
     454
     455    MythUIText *messageText = NULL;
     456    MythUIButton *okButton = NULL;
     457    MythUIButton *cancelButton = NULL;
     458
     459    bool err = false;
     460    UIUtilE::Assign(this, m_spinBox, "input", &err);
     461    UIUtilE::Assign(this, messageText, "message", &err);
     462    UIUtilE::Assign(this, okButton, "ok", &err);
     463    UIUtilW::Assign(this, cancelButton, "cancel");
     464    if (!m_spinBox)LOG(VB_GENERAL, LOG_ERR, "spinBox");
     465    if (!messageText)LOG(VB_GENERAL, LOG_ERR, "messageText");
     466    if (!okButton)LOG(VB_GENERAL, LOG_ERR, "okButton");
     467
     468    if (err)
     469    {
     470        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'MythSpinBoxDialog'");
     471        return false;
     472    }
     473
     474    if (cancelButton)
     475        connect(cancelButton, SIGNAL(Clicked()), SLOT(Close()));
     476    connect(okButton, SIGNAL(Clicked()), SLOT(sendResult()));
     477
     478    m_spinBox->SetValue(m_defaultValue);
     479
     480    messageText->SetText(m_message);
     481
     482    BuildFocusList();
     483
     484    return true;
     485}
     486
     487void MythSpinBoxDialog::SetReturnEvent(QObject *retobject,
     488                                         const QString &resultid)
     489{
     490    m_retObject = retobject;
     491    m_id = resultid;
     492}
     493
     494void MythSpinBoxDialog::sendResult()
     495{
     496    QString inputString = m_spinBox->GetValue();
     497    emit haveResult(inputString);
     498
     499    if (m_retObject)
     500    {
     501        DialogCompletionEvent *dce = new DialogCompletionEvent(m_id, 0,
     502                                                            inputString, "");
     503        QCoreApplication::postEvent(m_retObject, dce);
     504    }
     505
     506    Close();
     507}
     508
     509void MythSpinBoxDialog::SetRange(int low, int high, int step, uint pageMultiple)
     510{
     511    if (m_spinBox)
     512        m_spinBox->SetRange(low, high, step, pageMultiple);
     513}
     514
     515StandardSettingDialog::StandardSettingDialog(MythScreenStack *parent, const char *name) :
     516    MythScreenType(parent, name),
     517    m_buttonTree(0),
     518    m_title(0),
     519    m_grouphelp(0),
     520    m_titleList(0),
     521    m_selectedSettingLabel(0),
     522    m_selectedSettingValue(0),
     523    m_selectedSettingHelp(0),
     524    m_cancelButton(0),
     525    m_saveButton(0),
     526    m_menuPopup(0),
     527    m_loaded(false),
     528    m_editedSetting(0)
     529{
     530    m_settingsTree=new GroupSetting(name);
     531    m_settingsTree->setScreen(this);
     532}
     533
     534StandardSettingDialog::~StandardSettingDialog()
     535{
     536}
     537
     538bool StandardSettingDialog::Create(void)
     539{
     540    LOG(VB_GENERAL, LOG_ERR, "StandardSettingDialog::Create");
     541    if (!LoadWindowFromXML("standardsetting-ui.xml", "settingssetup", this))
     542        return false;
     543
     544    bool error=false;
     545    UIUtilE::Assign(this, m_title, "title",&error);
     546    UIUtilW::Assign(this, m_grouphelp,"grouphelp",&error);
     547    UIUtilE::Assign(this, m_buttonTree,"settingstree",&error);
     548
     549    UIUtilW::Assign(this, m_selectedSettingLabel, "selectedsettinglabel");
     550    UIUtilW::Assign(this, m_selectedSettingValue, "selectedsettingvalue");
     551    UIUtilW::Assign(this, m_selectedSettingHelp, "selectedsettinghelp");
     552
     553    connect(m_buttonTree,SIGNAL(itemSelected(MythUIButtonListItem*)), this,SLOT(settingSelected(MythUIButtonListItem*)));
     554    connect(m_buttonTree,SIGNAL(itemClicked(MythUIButtonListItem*)), this,SLOT(settingClicked(MythUIButtonListItem*)));
     555
     556    if (error)
     557    {
     558        LOG(VB_GENERAL, LOG_ERR, "error.");
     559        return false;
     560    }
     561    BuildFocusList();
     562    return true;
     563}
     564
     565void StandardSettingDialog::settingSelected(MythUIButtonListItem *item)
     566{
     567    MythGenericTree * node = qVariantValue<MythGenericTree*>(item->GetData());
     568    if (m_title)
     569    {
     570        if (node)
     571        {
     572            /*QString newTitle;
     573            MythGenericTree * parentNode;
     574            while (parentNode = node->getParent())
     575            {
     576                newTitle=QString("%1 > %2").arg(parentNode->GetText()).arg(newTitle);
     577                node = parentNode;
     578            }
     579            m_title->SetText(newTitle);*/
     580            m_title->SetText(node->getParent()->GetText());
     581        }
     582    }
     583
     584    if (m_grouphelp)
     585    {
     586        m_grouphelp->SetText(node->getParent()->GetText("help"));
     587    }
     588    else
     589        LOG(VB_GENERAL, LOG_ERR, "StandardSettingDialog::settingSelected()");
     590
     591    if (m_selectedSettingLabel)
     592        m_selectedSettingLabel->SetText(item->GetText());
     593    if (m_selectedSettingValue)
     594        m_selectedSettingValue->SetText(item->GetText("value"));
     595    if (m_selectedSettingHelp)
     596        m_selectedSettingHelp->SetText(item->GetText("help"));
     597
     598   
     599}
     600
     601void StandardSettingDialog::settingClicked(MythUIButtonListItem *item)
     602{
     603    MythGenericTree* tree = item->GetData().value<MythGenericTree*>();
     604    StandardSetting *ss = dynamic_cast<StandardSetting*>(tree);
     605    if (ss)
     606    {
     607        m_editedSetting=ss;
     608        ss->edit();
     609    }
     610    else
     611    {
     612        GroupSetting *gs = dynamic_cast<GroupSetting*>(tree);
     613        if (gs)
     614        {
     615            MythGenericTree *child = gs->getVisibleChildAt(0);
     616            if (child)
     617            m_buttonTree->SetCurrentNode(child);
     618        }
     619    }
     620}
     621
     622void StandardSettingDialog::customEvent(QEvent *event)
     623{
     624    if (event->type() == DialogCompletionEvent::kEventType)
     625    {
     626        DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
     627        QString resultid  = dce->GetId();
     628
     629        if (resultid == "editsetting")
     630        {
     631            if (!m_editedSetting) return;
     632            m_editedSetting->resultEdit(dce);
     633            m_editedSetting=NULL;
     634
     635            //Force to refresh the button tree. not very elegant but no choice at the moment
     636            MythGenericTree *currentNode = m_buttonTree->GetCurrentNode();
     637            m_buttonTree->AssignTree(m_settingsTree);
     638            m_buttonTree->SetCurrentNode(currentNode);
     639        }
     640        else if (resultid == "exit")
     641        {
     642            int buttonnum = dce->GetResult();
     643            if (buttonnum == 0)
     644            {
     645                Save();
     646                MythScreenType::Close();
     647            }
     648            else if (buttonnum == 1)
     649                MythScreenType::Close();
     650        }
     651    }
     652}
     653
     654void StandardSettingDialog::setSettings(GroupSetting * groupSettings)
     655{
     656    m_settingsTree=groupSettings;
     657    m_settingsTree->setScreen(this);
     658    m_settingsTree->Load();
     659    m_buttonTree->AssignTree(m_settingsTree);
     660        BuildFocusList();
     661}
     662
     663void StandardSettingDialog::Save()
     664{
     665    if (m_settingsTree)
     666        m_settingsTree->Save();
     667}
     668
     669void StandardSettingDialog::Close(void)
     670{
     671    if (m_settingsTree->haveChanged())
     672    {
     673        QString label = tr("Exit ?");
     674
     675        MythScreenStack *popupStack =
     676                                GetMythMainWindow()->GetStack("popup stack");
     677
     678        MythDialogBox * m_menuPopup =
     679                new MythDialogBox(label, popupStack, "exitmenu");
     680
     681        if (m_menuPopup->Create())
     682            popupStack->AddScreen(m_menuPopup);
     683
     684        m_menuPopup->SetReturnEvent(this, "exit");
     685
     686        m_menuPopup->AddButton(tr("Save then Exit"));
     687        m_menuPopup->AddButton(tr("Exit without saving changes"));
     688        m_menuPopup->AddButton(tr("Cancel"));
     689    }
     690    else
     691        MythScreenType::Close();
     692}
     693
     694
     695
     696
     697
     698
  • 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..095057d
    - +  
     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
     10/** TODO LIST
     11 ListSetting is not properly initialize, it should show the label not the value
     12Implement Save method
     13*/
     14
     15/*
     16MythUIButtonListItem Type
     17
     18*TextualSetting
     19PasswordSetting
     20DirectorySetting
     21FileSetting
     22*BooleanSetting
     23SpinSetting
     24GroupSetting
     25GroupBooleanSetting
     26GroupListSetting
     27ListSetting
     28ListSetting+refresh
     29FreeListSetting
     30Button for testing
     31*/
     32/*
     33
     34
     35class DBSetting
     36{
     37  public:
     38    virtual const QString getSetting(const QString &settingName)=0;
     39    virtual void setSetting(const QString &settingName, const QString &settingValue)=0;
     40};
     41
     42class HostDBSetting : public DBSetting
     43{
     44  public:
     45    virtual const QString getSetting(const QString &settingName){return "host";};
     46    virtual void setSetting(const QString &settingName, const QString &settingValue){};
     47};
     48
     49class GlobalDBSetting : public DBSetting
     50{
     51  public:
     52    virtual const QString getSetting(const QString &settingName){return "global";};
     53    virtual void setSetting(const QString &settingName, const QString &settingValue){};
     54
     55};*/
     56
     57/**
     58 * Group Setting together
     59 */
     60class GroupSetting : public MythGenericTree, public Storage
     61{
     62  public:
     63    GroupSetting(const QString &text = "");
     64    virtual ~GroupSetting(){};
     65
     66    void setLabel(const QString &label);
     67    QString getLabel(){return GetText();};
     68    void addChild(GroupSetting *groupSetting);
     69    void setHelpText(const QString &description);
     70    QString getHelpText(){return GetText("help");};
     71
     72    void setScreen(MythScreenType *screen);
     73
     74    void Save();
     75    void Load();
     76    virtual void edit();
     77    //virtual void resultEdit(DialogCompletionEvent *dce);
     78    virtual bool haveChanged();
     79  protected:
     80    const QString getSettingName(){return "";};
     81    void setSettingValue(const QString newValue){};
     82    MythScreenType *m_screen;
     83
     84};
     85
     86
     87// allow to set a textual setting
     88class StandardSetting : public GroupSetting, public StorageUser
     89{
     90  public:
     91    StandardSetting(const QString &settingName, const QString &text = "");
     92    virtual ~StandardSetting();
     93
     94    const QString getHelpText();
     95
     96
     97    const QString getTextValue() const;
     98    const QString getValue() const{return GetText("value");};
     99    virtual void resultEdit(DialogCompletionEvent *dce)=0;
     100    bool haveChanged();
     101
     102    void SetDBValue(const QString &text);
     103    QString GetDBValue(void) const { return m_settingValue ;};
     104
     105  protected:
     106    //void SaveChildren();
     107    //void LoadChildren();
     108    //const QString settingName();//{return m_settingName;};
     109    virtual void setSettingValue(const QString newValue);//{m_settingValue=newValue;};
     110    QString m_settingName;
     111    QString m_settingValue;
     112
     113
     114    bool m_haveChanged;
     115    //DBSetting * m_DBSetting;
     116};
     117
     118
     119/**
     120 * Display and edit a textual value
     121 */
     122class TextualSetting : public StandardSetting
     123{
     124  public:
     125    TextualSetting(const QString &settingName, const QString &text = "", bool password=false);
     126    virtual ~TextualSetting(){};
     127    void setValue(const QString &newValue);
     128    void setSettingValue(const QString newValue);
     129    void edit();
     130    virtual void resultEdit(DialogCompletionEvent *dce);
     131   
     132  protected:
     133    bool m_password;
     134};
     135
     136class GlobalTextualSetting : public TextualSetting, public GlobalDBStorage
     137{
     138  public:
     139    GlobalTextualSetting(const QString &settingName, const QString &text = "", bool password=false)
     140        :TextualSetting(settingName, text, password), GlobalDBStorage (this, settingName)
     141    {
     142    };
     143    void Load()
     144    {
     145        TextualSetting::Load();
     146        GlobalDBStorage::Load();
     147    }
     148    void Save()
     149    {
     150        TextualSetting::Save();
     151        GlobalDBStorage::Save();
     152    }
     153
     154
     155
     156};
     157
     158class HostTextualSetting : public TextualSetting, public HostDBStorage
     159{
     160  public:
     161    HostTextualSetting(const QString &settingName, const QString &text = "", bool password=false)
     162        :TextualSetting(settingName, text, password), HostDBStorage (this, settingName)
     163    {
     164    };
     165    void Load()
     166    {
     167        TextualSetting::Load();
     168        HostDBStorage::Load();
     169    }
     170
     171    void Save()
     172    {
     173        TextualSetting::Save();
     174        HostDBStorage::Save();
     175    }
     176};
     177
     178class TransTextualSetting : public TextualSetting, public TransientStorage
     179{
     180  public:
     181    TransTextualSetting(bool password=false)
     182        :TextualSetting("", "", password), TransientStorage()
     183    {
     184    };
     185};
     186
     187
     188/**
     189 * Display and edit a textual value
     190 */
     191
     192class ListSetting : public StandardSetting
     193{
     194  public:
     195    ListSetting(const QString &settingName, const QString &text = "");
     196    virtual ~ListSetting(){};
     197    void setValue(int newValue);
     198    void setSettingValue(const QString newValue);
     199    void addSelection(QString label, QString value, bool select = false);
     200    void clearSelections();
     201    virtual void edit();
     202    virtual void resultEdit(DialogCompletionEvent *dce);
     203  private:
     204    QMap<QString, QString> m_options;
     205};
     206
     207class GlobalListSetting : public ListSetting, public GlobalDBStorage
     208{
     209  public:
     210    GlobalListSetting(const QString &settingName, const QString &text = "")
     211        :ListSetting(settingName, text), GlobalDBStorage (this, settingName)
     212    {
     213    };
     214    void Load()
     215    {
     216        ListSetting::Load();
     217        GlobalDBStorage::Load();
     218    }
     219    void Save()
     220    {
     221        ListSetting::Save();
     222        GlobalDBStorage::Save();
     223    }
     224};
     225
     226class HostListSetting : public ListSetting, public HostDBStorage
     227{
     228  public:
     229    HostListSetting(const QString &settingName, const QString &text = "")
     230        :ListSetting(settingName, text), HostDBStorage (this, settingName)
     231    {
     232    };
     233    void Load()
     234    {
     235        ListSetting::Load();
     236        HostDBStorage::Load();
     237    }
     238    void Save()
     239    {
     240        ListSetting::Save();
     241        HostDBStorage::Save();
     242    }
     243};
     244
     245class TransListSetting : public ListSetting, public TransientStorage
     246{
     247  public:
     248    TransListSetting()
     249        :ListSetting("", ""), TransientStorage()
     250    {
     251    };
     252};
     253
     254/**
     255 * Display and edit a textual value
     256 */
     257
     258class BoolSetting : public StandardSetting
     259{
     260  public:
     261    BoolSetting(const QString &settingName, const QString &text = "");
     262    virtual ~BoolSetting(){};
     263    void setValue(bool newValue);
     264    bool boolValue() const{return GetText("value")=="1";};
     265    void edit();
     266    void resultEdit(DialogCompletionEvent *dce);
     267    void addChild (bool value, GroupSetting *child);
     268
     269  protected:
     270    virtual void setSettingValue(const QString newValue);
     271  private:
     272    QList<GroupSetting *> m_OnChildren;
     273    QList<GroupSetting *> m_OffChildren;
     274};
     275
     276class GlobalBoolSetting : public BoolSetting, public GlobalDBStorage
     277{
     278  public:
     279    GlobalBoolSetting(const QString &settingName, const QString &text = "")
     280        : BoolSetting(settingName, text), GlobalDBStorage (this, settingName)
     281    {
     282    };
     283    void Load()
     284    {
     285        BoolSetting::Load();
     286        GlobalDBStorage::Load();
     287    }
     288    void Save()
     289    {
     290        BoolSetting::Save();
     291        GlobalDBStorage::Save();
     292    }
     293};
     294
     295class HostBoolSetting : public BoolSetting, public HostDBStorage
     296{
     297  public:
     298    HostBoolSetting(const QString &settingName, const QString &text = "")
     299        : BoolSetting(settingName, text), HostDBStorage (this, settingName)
     300    {
     301    };
     302    void Load()
     303    {
     304        BoolSetting::Load();
     305        HostDBStorage::Load();
     306    }
     307    void Save()
     308    {
     309        BoolSetting::Save();
     310        HostDBStorage::Save();
     311    }
     312};
     313
     314class TransBoolSetting : public BoolSetting, public TransientStorage
     315{
     316  public:
     317    TransBoolSetting()
     318        : BoolSetting(""), TransientStorage()
     319    {
     320    };
     321};
     322
     323
     324
     325class RangeSetting : public StandardSetting
     326{
     327  public:
     328    RangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step = false);
     329    virtual ~RangeSetting(){};
     330    virtual void edit();
     331    virtual void resultEdit(DialogCompletionEvent *dce);
     332  //  void SetRange(int min, int max);
     333    void setValue(int newValue);
     334    int intValue() const{return GetText("value").toInt();};
     335  protected:
     336    void update();
     337  private:
     338    int m_min;
     339    int m_max;
     340};
     341
     342class GlobalRangeSetting: public RangeSetting, public GlobalDBStorage
     343{
     344  public:
     345    GlobalRangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step = false)
     346        :RangeSetting(settingName, min, max, step, allow_single_step), GlobalDBStorage (this, settingName)
     347    {
     348    };
     349    void Load()
     350    {
     351        RangeSetting::Load();
     352        GlobalDBStorage::Load();
     353    }
     354    void Save()
     355    {
     356        RangeSetting::Save();
     357        GlobalDBStorage::Save();
     358    }
     359};
     360
     361class HostRangeSetting: public RangeSetting, public HostDBStorage
     362{
     363  public:
     364    HostRangeSetting(const QString &settingName, int min, int max, int step, bool allow_single_step = false)
     365        :RangeSetting(settingName, min, max, step, allow_single_step), HostDBStorage (this, settingName)
     366    {
     367    };
     368    void Load()
     369    {
     370        RangeSetting::Load();
     371        HostDBStorage::Load();
     372    }
     373    void Save()
     374    {
     375        RangeSetting::Save();
     376        HostDBStorage::Save();
     377    }
     378};
     379
     380class TransRangeSetting: public RangeSetting, public TransientStorage
     381{
     382  public:
     383    TransRangeSetting(int min, int max, int step, bool allow_single_step = false)
     384        :RangeSetting("", min, max, step, allow_single_step), TransientStorage()
     385    {
     386    };
     387};
     388
     389
     390
     391
     392
     393class /*MUI_PUBLIC*/ MythSpinBoxDialog : public MythScreenType
     394{
     395    Q_OBJECT
     396
     397  public:
     398    MythSpinBoxDialog(MythScreenStack *parent, const QString &message,
     399                        const QString &defaultValue = "");
     400
     401    bool Create(void);
     402
     403    void SetRange(int low, int high, int step, uint pageMultiple = 5);
     404
     405    void SetReturnEvent(QObject *retobject, const QString &resultid);
     406
     407  signals:
     408     void haveResult(QString);
     409
     410  protected:
     411    MythUISpinBox *m_spinBox;
     412    QString m_message;
     413    QString m_defaultValue;
     414    QObject *m_retObject;
     415    QString m_id;
     416
     417  protected slots:
     418    void sendResult();
     419};
     420
     421
     422
     423
     424class StandardSettingDialog : public MythScreenType
     425{
     426    Q_OBJECT
     427
     428  public:
     429
     430    StandardSettingDialog(MythScreenStack *parent, const char *name);
     431    ~StandardSettingDialog();
     432    bool Create(void);
     433    virtual void customEvent(QEvent *event);
     434    void setSettings(GroupSetting * groupSettings);
     435  public slots:
     436    void Close(void);
     437  protected:
     438    GroupSetting *m_settingsTree;
     439    MythUIButtonTree *m_buttonTree;
     440  private slots:
     441    void settingSelected(MythUIButtonListItem *item);
     442    void settingClicked(MythUIButtonListItem *item);
     443  private:
     444    void Save();
     445    MythUIText *m_title;
     446    MythUIText *m_grouphelp;
     447    MythUIButtonList *m_titleList;
     448    MythUIText *m_selectedSettingLabel;
     449    MythUIText *m_selectedSettingValue;
     450    MythUIText *m_selectedSettingHelp;
     451    MythUIButton *m_cancelButton;
     452    MythUIButton *m_saveButton;
     453    MythDialogBox     *m_menuPopup;
     454    bool m_loaded;
     455    StandardSetting * m_editedSetting;
     456};
     457
     458
     459
     460#endif