Ticket #10092: settings-mythplugins-2012-03-09.diff

File settings-mythplugins-2012-03-09.diff, 34.6 KB (added by Xavier Hervy <xavier.hervy@…>, 12 years ago)
  • mythplugins/mytharchive/mytharchive/archivesettings.cpp

    diff --git a/mythplugins/mytharchive/mytharchive/archivesettings.cpp b/mythplugins/mytharchive/mytharchive/archivesettings.cpp
    index be35649..81f5bc7 100644
    a b  
    1212#include "archivesettings.h"
    1313
    1414
    15 static HostLineEdit *MythArchiveTempDir()
     15static HostFileBrowserSetting *MythArchiveTempDir()
    1616{
    17     HostLineEdit *gc = new HostLineEdit("MythArchiveTempDir");
    18     gc->setLabel(QObject::tr("MythArchive Temp Directory"));
     17    HostFileBrowserSetting *gc = new HostFileBrowserSetting("MythArchiveTempDir");
     18    gc->setLabel(QObject::tr("Temporary Directory"));
    1919    gc->setValue("");
    2020    gc->setHelpText(QObject::tr("Location where MythArchive should create its "
    2121            "temporory work files. LOTS of free space required here."));
     22    gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden);
    2223    return gc;
    2324};
    2425
    25 static HostLineEdit *MythArchiveShareDir()
     26static HostFileBrowserSetting *MythArchiveShareDir()
    2627{
    27     HostLineEdit *gc = new HostLineEdit("MythArchiveShareDir");
    28     gc->setLabel(QObject::tr("MythArchive Share Directory"));
     28    HostFileBrowserSetting *gc = new HostFileBrowserSetting("MythArchiveShareDir");
     29    gc->setLabel(QObject::tr("vShare Directory"));
    2930    gc->setValue(GetShareDir() + "mytharchive/");
    3031    gc->setHelpText(QObject::tr("Location where MythArchive stores its scripts, "
    3132            "intro movies and theme files"));
     33    gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden);
    3234    return gc;
    3335};
    3436
    35 static HostComboBox *PALNTSC()
     37static HostComboBoxSetting *PALNTSC()
    3638{
    37     HostComboBox *gc = new HostComboBox("MythArchiveVideoFormat");
     39    HostComboBoxSetting *gc = new HostComboBoxSetting("MythArchiveVideoFormat");
    3840    gc->setLabel(QObject::tr("Video format"));
    3941    gc->addSelection("PAL");
    4042    gc->addSelection("NTSC");
    static HostComboBox *PALNTSC() 
    4244    return gc;
    4345};
    4446
    45 static HostLineEdit *MythArchiveFileFilter()
     47static HostTextEditSetting *MythArchiveFileFilter()
    4648{
    47     HostLineEdit *gc = new HostLineEdit("MythArchiveFileFilter");
     49    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveFileFilter");
    4850    gc->setLabel(QObject::tr("File Selector Filter"));
    4951    gc->setValue("*.mpg *.mov *.avi *.mpeg *.nuv");
    5052    gc->setHelpText(QObject::tr("The file name filter to use in the file selector."));
    5153    return gc;
    5254};
    5355
    54 static HostLineEdit *MythArchiveDVDLocation()
     56static HostFileBrowserSetting *MythArchiveDVDLocation()
    5557{
    56     HostLineEdit *gc = new HostLineEdit("MythArchiveDVDLocation");
     58    HostFileBrowserSetting *gc = new HostFileBrowserSetting("MythArchiveDVDLocation");
    5759    gc->setLabel(QObject::tr("Location of DVD"));
    5860    gc->setValue("/dev/dvd");
    5961    gc->setHelpText(QObject::tr("Which DVD drive to use when burning discs."));
     62    //TODO does not work with symlink
     63    gc->SetTypeFilter(QDir::AllDirs | QDir::Hidden);
    6064    return gc;
    6165};
    6266
    63 static HostSpinBox *MythArchiveDriveSpeed()
     67static HostSpinBoxSetting *MythArchiveDriveSpeed()
    6468{
    65     HostSpinBox *gc = new HostSpinBox("MythArchiveDriveSpeed", 0, 48, 1);
     69    HostSpinBoxSetting *gc = new HostSpinBoxSetting("MythArchiveDriveSpeed", 0, 48, 1);
    6670    gc->setLabel(QObject::tr("DVD Drive Write Speed"));
    6771    gc->setValue(0);
    6872    gc->setHelpText(QObject::tr("This is the write speed to use when burning a DVD. "
    static HostSpinBox *MythArchiveDriveSpeed() 
    7074    return gc;
    7175};
    7276
    73 static HostLineEdit *MythArchiveDVDPlayerCmd()
     77static HostTextEditSetting *MythArchiveDVDPlayerCmd()
    7478{
    75     HostLineEdit *gc = new HostLineEdit("MythArchiveDVDPlayerCmd");
     79    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveDVDPlayerCmd");
    7680    gc->setLabel(QObject::tr("Command to play DVD"));
    7781    gc->setValue("Internal");
    7882    gc->setHelpText(QObject::tr("Command to run when test playing a created DVD. "
    static HostLineEdit *MythArchiveDVDPlayerCmd() 
    8185    return gc;
    8286};
    8387
    84 static HostCheckBox *MythArchiveCopyRemoteFiles()
     88static HostCheckBoxSetting *MythArchiveCopyRemoteFiles()
    8589{
    86     HostCheckBox *gc = new HostCheckBox("MythArchiveCopyRemoteFiles");
     90    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MythArchiveCopyRemoteFiles");
    8791    gc->setLabel(QObject::tr("Copy remote files"));
    8892    gc->setValue(false);
    8993    gc->setHelpText(QObject::tr("If set files on remote filesystems "
    static HostCheckBox *MythArchiveCopyRemoteFiles() 
    9296    return gc;
    9397};
    9498
    95 static HostCheckBox *MythArchiveAlwaysUseMythTranscode()
     99static HostCheckBoxSetting *MythArchiveAlwaysUseMythTranscode()
    96100{
    97     HostCheckBox *gc = new HostCheckBox("MythArchiveAlwaysUseMythTranscode");
     101    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MythArchiveAlwaysUseMythTranscode");
    98102    gc->setLabel(QObject::tr("Always Use Mythtranscode"));
    99103    gc->setValue(true);
    100104    gc->setHelpText(QObject::tr("If set mpeg2 files will always be passed"
    static HostCheckBox *MythArchiveAlwaysUseMythTranscode() 
    103107    return gc;
    104108};
    105109
    106 static HostCheckBox *MythArchiveUseProjectX()
     110static HostCheckBoxSetting *MythArchiveUseProjectX()
    107111{
    108     HostCheckBox *gc = new HostCheckBox("MythArchiveUseProjectX");
     112    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MythArchiveUseProjectX");
    109113    gc->setLabel(QObject::tr("Use ProjectX"));
    110114    gc->setValue(false);
    111115    gc->setHelpText(QObject::tr("If set ProjectX will be used to cut"
    static HostCheckBox *MythArchiveUseProjectX() 
    114118    return gc;
    115119};
    116120
    117 static HostCheckBox *MythArchiveUseFIFO()
     121static HostCheckBoxSetting *MythArchiveUseFIFO()
    118122{
    119     HostCheckBox *gc = new HostCheckBox("MythArchiveUseFIFO");
     123    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MythArchiveUseFIFO");
    120124    gc->setLabel(QObject::tr("Use FIFOs"));
    121125    gc->setValue(true);
    122126    gc->setHelpText(QObject::tr("The script will use FIFOs to pass the output"
    static HostCheckBox *MythArchiveUseFIFO() 
    126130    return gc;
    127131};
    128132
    129 static HostCheckBox *MythArchiveAddSubtitles()
     133static HostCheckBoxSetting *MythArchiveAddSubtitles()
    130134{
    131     HostCheckBox *gc = new HostCheckBox("MythArchiveAddSubtitles");
     135    HostCheckBoxSetting *gc = new HostCheckBoxSetting("MythArchiveAddSubtitles");
    132136    gc->setLabel(QObject::tr("Add Subtitles"));
    133137    gc->setValue(false);
    134138    gc->setHelpText(QObject::tr("If available this option will add subtitles "
    static HostCheckBox *MythArchiveAddSubtitles() 
    136140    return gc;
    137141};
    138142
    139 static HostComboBox *MainMenuAspectRatio()
     143static HostComboBoxSetting *MainMenuAspectRatio()
    140144{
    141     HostComboBox *gc = new HostComboBox("MythArchiveMainMenuAR");
     145    HostComboBoxSetting *gc = new HostComboBoxSetting("MythArchiveMainMenuAR");
    142146    gc->setLabel(QObject::tr("Main Menu Aspect Ratio"));
    143147    gc->addSelection("4:3");
    144148    gc->addSelection("16:9");
    static HostComboBox *MainMenuAspectRatio() 
    147151    return gc;
    148152};
    149153
    150 static HostComboBox *ChapterMenuAspectRatio()
     154static HostComboBoxSetting *ChapterMenuAspectRatio()
    151155{
    152     HostComboBox *gc = new HostComboBox("MythArchiveChapterMenuAR");
     156    HostComboBoxSetting *gc = new HostComboBoxSetting("MythArchiveChapterMenuAR");
    153157    gc->setLabel(QObject::tr("Chapter Menu Aspect Ratio"));
    154158    gc->addSelection("4:3");
    155159    gc->addSelection("16:9");
    static HostComboBox *ChapterMenuAspectRatio() 
    160164    return gc;
    161165};
    162166
    163 static HostComboBox *MythArchiveDateFormat()
     167static HostComboBoxSetting *MythArchiveDateFormat()
    164168{
    165     HostComboBox *gc = new HostComboBox("MythArchiveDateFormat");
     169    HostComboBoxSetting *gc = new HostComboBoxSetting("MythArchiveDateFormat");
    166170    gc->setLabel(QObject::tr("Date format"));
    167171
    168172    QDate sampdate = QDate::currentDate();
    static HostComboBox *MythArchiveDateFormat() 
    193197    return gc;
    194198}
    195199
    196 static HostComboBox *MythArchiveTimeFormat()
     200static HostComboBoxSetting *MythArchiveTimeFormat()
    197201{
    198     HostComboBox *gc = new HostComboBox("MythArchiveTimeFormat");
     202    HostComboBoxSetting *gc = new HostComboBoxSetting("MythArchiveTimeFormat");
    199203    gc->setLabel(QObject::tr("Time format"));
    200204
    201205    QTime samptime = QTime::currentTime();
    static HostComboBox *MythArchiveTimeFormat() 
    208212    return gc;
    209213}
    210214
    211 static HostComboBox *MythArchiveDefaultEncProfile()
     215static HostComboBoxSetting *MythArchiveDefaultEncProfile()
    212216{
    213     HostComboBox *gc = new HostComboBox("MythArchiveDefaultEncProfile");
     217    HostComboBoxSetting *gc = new HostComboBoxSetting("MythArchiveDefaultEncProfile");
    214218    gc->setLabel(QObject::tr("Default Encoder Profile"));
    215219
    216220    gc->addSelection("HQ", "HQ");
    static HostComboBox *MythArchiveDefaultEncProfile() 
    223227    return gc;
    224228}
    225229
    226 static HostLineEdit *MythArchiveMplexCmd()
     230static HostTextEditSetting *MythArchiveMplexCmd()
    227231{
    228     HostLineEdit *gc = new HostLineEdit("MythArchiveMplexCmd");
     232    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveMplexCmd");
    229233    gc->setLabel(QObject::tr("mplex Command"));
    230234    gc->setValue("mplex");
    231235    gc->setHelpText(QObject::tr("Command to run mplex"));
    232236    return gc;
    233237};
    234238
    235 static HostLineEdit *MythArchiveDvdauthorCmd()
     239static HostTextEditSetting *MythArchiveDvdauthorCmd()
    236240{
    237     HostLineEdit *gc = new HostLineEdit("MythArchiveDvdauthorCmd");
     241    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveDvdauthorCmd");
    238242    gc->setLabel(QObject::tr("dvdauthor command"));
    239243    gc->setValue("dvdauthor");
    240244    gc->setHelpText(QObject::tr("Command to run dvdauthor."));
    241245    return gc;
    242246};
    243247
    244 static HostLineEdit *MythArchiveMkisofsCmd()
     248static HostTextEditSetting *MythArchiveMkisofsCmd()
    245249{
    246     HostLineEdit *gc = new HostLineEdit("MythArchiveMkisofsCmd");
     250    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveMkisofsCmd");
    247251    gc->setLabel(QObject::tr("mkisofs command"));
    248252    gc->setValue("mkisofs");
    249253    gc->setHelpText(QObject::tr("Command to run mkisofs. (Used to create ISO images)"));
    250254    return gc;
    251255};
    252256
    253 static HostLineEdit *MythArchiveGrowisofsCmd()
     257static HostTextEditSetting *MythArchiveGrowisofsCmd()
    254258{
    255     HostLineEdit *gc = new HostLineEdit("MythArchiveGrowisofsCmd");
     259    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveGrowisofsCmd");
    256260    gc->setLabel(QObject::tr("growisofs command"));
    257261    gc->setValue("growisofs");
    258262    gc->setHelpText(QObject::tr("Command to run growisofs. (Used to burn DVD's)"));
    259263    return gc;
    260264};
    261265
    262 static HostLineEdit *MythArchiveM2VRequantiserCmd()
     266static HostTextEditSetting *MythArchiveM2VRequantiserCmd()
    263267{
    264     HostLineEdit *gc = new HostLineEdit("MythArchiveM2VRequantiserCmd");
     268    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveM2VRequantiserCmd");
    265269    gc->setLabel(QObject::tr("M2VRequantiser command"));
    266270    gc->setValue("M2VRequantiser");
    267271    gc->setHelpText(QObject::tr("Command to run M2VRequantiser. Optional - leave blank if you don't have M2VRequantiser installed."));
    268272    return gc;
    269273};
    270274
    271 static HostLineEdit *MythArchiveJpeg2yuvCmd()
     275static HostTextEditSetting *MythArchiveJpeg2yuvCmd()
    272276{
    273     HostLineEdit *gc = new HostLineEdit("MythArchiveJpeg2yuvCmd");
     277    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveJpeg2yuvCmd");
    274278    gc->setLabel(QObject::tr("jpeg2yuv command"));
    275279    gc->setValue("jpeg2yuv");
    276280    gc->setHelpText(QObject::tr("Command to run jpeg2yuv. Part of mjpegtools package"));
    277281    return gc;
    278282};
    279283
    280 static HostLineEdit *MythArchiveSpumuxCmd()
     284static HostTextEditSetting *MythArchiveSpumuxCmd()
    281285{
    282     HostLineEdit *gc = new HostLineEdit("MythArchiveSpumuxCmd");
     286    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveSpumuxCmd");
    283287    gc->setLabel(QObject::tr("spumux command"));
    284288    gc->setValue("spumux");
    285289    gc->setHelpText(QObject::tr("Command to run spumux. Part of dvdauthor package"));
    286290    return gc;
    287291};
    288292
    289 static HostLineEdit *MythArchiveMpeg2encCmd()
     293static HostTextEditSetting *MythArchiveMpeg2encCmd()
    290294{
    291     HostLineEdit *gc = new HostLineEdit("MythArchiveMpeg2encCmd");
     295    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveMpeg2encCmd");
    292296    gc->setLabel(QObject::tr("mpeg2enc command"));
    293297    gc->setValue("mpeg2enc");
    294298    gc->setHelpText(QObject::tr("Command to run mpeg2enc. Part of mjpegtools package"));
    295299    return gc;
    296300};
    297301
    298 static HostLineEdit *MythArchiveProjectXCmd()
     302static HostTextEditSetting *MythArchiveProjectXCmd()
    299303{
    300     HostLineEdit *gc = new HostLineEdit("MythArchiveProjectXCmd");
     304    HostTextEditSetting *gc = new HostTextEditSetting("MythArchiveProjectXCmd");
    301305    gc->setLabel(QObject::tr("projectx command"));
    302306    gc->setValue("projectx");
    303307    gc->setHelpText(QObject::tr("Command to run ProjectX. Will be used to cut "
    static HostLineEdit *MythArchiveProjectXCmd() 
    307311
    308312ArchiveSettings::ArchiveSettings()
    309313{
    310     VerticalConfigurationGroup* vcg1 = new VerticalConfigurationGroup(false);
    311     vcg1->setLabel(QObject::tr("MythArchive Settings"));
    312     vcg1->addChild(MythArchiveTempDir());
    313     vcg1->addChild(MythArchiveShareDir());
    314     vcg1->addChild(PALNTSC());
    315     vcg1->addChild(MythArchiveFileFilter());
    316     vcg1->addChild(MythArchiveDVDLocation());
    317     vcg1->addChild(MythArchiveDriveSpeed());
    318     vcg1->addChild(MythArchiveDVDPlayerCmd());
    319     addChild(vcg1);
    320 
    321     VerticalConfigurationGroup* vcg2 = new VerticalConfigurationGroup(false);
    322     vcg2->setLabel(QObject::tr("MythArchive Settings (2)"));
    323     vcg2->addChild(MythArchiveCopyRemoteFiles());
    324     vcg2->addChild(MythArchiveAlwaysUseMythTranscode());
    325     vcg2->addChild(MythArchiveUseProjectX());
    326     vcg2->addChild(MythArchiveAddSubtitles());
    327     vcg2->addChild(MythArchiveUseFIFO());
    328     vcg2->addChild(MythArchiveDefaultEncProfile());
    329     addChild(vcg2);
    330 
    331     VerticalConfigurationGroup* vcg3 = new VerticalConfigurationGroup(false);
    332     vcg3->setLabel(QObject::tr("DVD Menu Settings"));
    333     vcg3->addChild(MainMenuAspectRatio());
    334     vcg3->addChild(ChapterMenuAspectRatio());
    335     vcg3->addChild(MythArchiveDateFormat());
    336     vcg3->addChild(MythArchiveTimeFormat());
    337     addChild(vcg3);
    338 
    339     VerticalConfigurationGroup* vcg4 = new VerticalConfigurationGroup(false);
    340     vcg4->setLabel(QObject::tr("MythArchive External Commands (1)"));
    341     vcg4->addChild(MythArchiveMplexCmd());
    342     vcg4->addChild(MythArchiveDvdauthorCmd());
    343     vcg4->addChild(MythArchiveSpumuxCmd());
    344     vcg4->addChild(MythArchiveMpeg2encCmd());
    345     addChild(vcg4);
    346 
    347     VerticalConfigurationGroup* vcg5 = new VerticalConfigurationGroup(false);
    348     vcg5->setLabel(QObject::tr("MythArchive External Commands (2)"));
    349     vcg5->addChild(MythArchiveMkisofsCmd());
    350     vcg5->addChild(MythArchiveGrowisofsCmd());
    351     vcg5->addChild(MythArchiveM2VRequantiserCmd());
    352     vcg5->addChild(MythArchiveJpeg2yuvCmd());
    353     vcg5->addChild(MythArchiveProjectXCmd());
    354     addChild(vcg5);
     314    setLabel(QObject::tr("MythArchive Settings"));
     315    addChild(MythArchiveTempDir());
     316    addChild(MythArchiveShareDir());
     317    addChild(PALNTSC());
     318    addChild(MythArchiveFileFilter());
     319    addChild(MythArchiveDVDLocation());
     320    addChild(MythArchiveDriveSpeed());
     321    addChild(MythArchiveDVDPlayerCmd());
     322    addChild(MythArchiveCopyRemoteFiles());
     323    addChild(MythArchiveAlwaysUseMythTranscode());
     324    addChild(MythArchiveUseProjectX());
     325    addChild(MythArchiveAddSubtitles());
     326    addChild(MythArchiveUseFIFO());
     327    addChild(MythArchiveDefaultEncProfile());
     328
     329    GroupSetting* DVDSettings = new GroupSetting();
     330    DVDSettings->setLabel(QObject::tr("DVD Menu Settings"));
     331    DVDSettings->addChild(MainMenuAspectRatio());
     332    DVDSettings->addChild(ChapterMenuAspectRatio());
     333    DVDSettings->addChild(MythArchiveDateFormat());
     334    DVDSettings->addChild(MythArchiveTimeFormat());
     335    addChild(DVDSettings);
     336
     337    GroupSetting* externalCmdSettings = new GroupSetting();
     338    externalCmdSettings->setLabel(QObject::tr("MythArchive External Commands"));
     339    externalCmdSettings->addChild(MythArchiveMplexCmd());
     340    externalCmdSettings->addChild(MythArchiveDvdauthorCmd());
     341    externalCmdSettings->addChild(MythArchiveSpumuxCmd());
     342    externalCmdSettings->addChild(MythArchiveMpeg2encCmd());
     343    externalCmdSettings->addChild(MythArchiveMkisofsCmd());
     344    externalCmdSettings->addChild(MythArchiveGrowisofsCmd());
     345    externalCmdSettings->addChild(MythArchiveM2VRequantiserCmd());
     346    externalCmdSettings->addChild(MythArchiveJpeg2yuvCmd());
     347    externalCmdSettings->addChild(MythArchiveProjectXCmd());
     348    addChild(externalCmdSettings);
    355349}
  • mythplugins/mytharchive/mytharchive/archivesettings.h

    diff --git a/mythplugins/mytharchive/mytharchive/archivesettings.h b/mythplugins/mytharchive/mytharchive/archivesettings.h
    index 72dfe6f..6f58baf 100644
    a b  
    55#ifndef ARCHIVESETTINGS_H
    66#define ARCHIVESETTINGS_H
    77
    8 #include <settings.h>
     8#include <standardsettings.h>
    99
    1010
    11 class ArchiveSettings : public ConfigurationWizard
     11class ArchiveSettings : public GroupSetting
    1212{
    1313  public:
    1414    ArchiveSettings();
  • mythplugins/mytharchive/mytharchive/main.cpp

    diff --git a/mythplugins/mytharchive/mytharchive/main.cpp b/mythplugins/mytharchive/mytharchive/main.cpp
    index 5eb05d7..0cffe5f 100644
    a b int mythplugin_run(void) 
    347347
    348348int mythplugin_config(void)
    349349{
    350     ArchiveSettings settings;
    351     settings.exec();
     350    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     351    StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "archivesettings");
     352
     353    if (ssd->Create())
     354    {
     355        ssd->loadSettings(new ArchiveSettings());
     356        mainStack->AddScreen(ssd);
     357    }
     358    else
     359        delete ssd;
    352360
    353361    return 0;
    354362}
  • mythplugins/mythgallery/mythgallery/gallerysettings.cpp

    diff --git a/mythplugins/mythgallery/mythgallery/gallerysettings.cpp b/mythplugins/mythgallery/mythgallery/gallerysettings.cpp
    index c23db74..94afac0 100644
    a b  
    1212
    1313// General Settings
    1414
    15 static HostLineEdit *MythGalleryFilter()
     15static HostTextEditSetting *MythGalleryFilter()
    1616{
    17     HostLineEdit *gc = new HostLineEdit("GalleryFilterDirectory");
     17    HostTextEditSetting *gc = new HostTextEditSetting("GalleryFilterDirectory");
    1818    gc->setLabel(QObject::tr("Directory filter"));
    1919    gc->setValue("");
    2020    gc->setHelpText(QObject::tr("Enter directory names to be excluded in "
    static HostLineEdit *MythGalleryFilter() 
    2323    return gc;
    2424};
    2525
    26 static HostComboBox *MythGalleryFilterType()
     26static HostComboBoxSetting *MythGalleryFilterType()
    2727{
    28     HostComboBox *gc = new HostComboBox("GalleryFilterType");
     28    HostComboBoxSetting *gc = new HostComboBoxSetting("GalleryFilterType");
    2929    gc->setLabel(QObject::tr("Type filter"));
    3030    gc->addSelection("All", QString::number(kTypeFilterAll));
    3131    gc->addSelection("Images only", QString::number(kTypeFilterImagesOnly));
    static HostComboBox *MythGalleryFilterType() 
    3535    return gc;
    3636};
    3737
    38 static HostLineEdit *MythGalleryDir()
     38static HostFileBrowserSetting *MythGalleryDir()
    3939{
    40     HostLineEdit *gc = new HostLineEdit("GalleryDir");
     40    HostFileBrowserSetting *gc = new HostFileBrowserSetting("GalleryDir");
    4141    gc->setLabel(QObject::tr("Directory that holds images"));
    4242#ifdef Q_WS_MACX
    4343    gc->setValue(QDir::homePath() + "/Pictures");
    static HostLineEdit *MythGalleryDir() 
    4949    return gc;
    5050};
    5151
    52 static HostCheckBox *MythGalleryThumbnailLocation()
     52static HostCheckBoxSetting *MythGalleryThumbnailLocation()
    5353{
    54     HostCheckBox *gc = new HostCheckBox("GalleryThumbnailLocation");
     54    HostCheckBoxSetting *gc = new HostCheckBoxSetting("GalleryThumbnailLocation");
    5555    gc->setLabel(QObject::tr("Store thumbnails in image directory"));
    5656    gc->setValue(true);
    5757    gc->setHelpText(QObject::tr("If set, thumbnails are stored in '.thumbcache' directories within the above directory. If cleared, they are stored in your home directory."));
    5858    return gc;
    5959};
    6060
    61 static HostComboBox *MythGallerySortOrder()
     61static HostComboBoxSetting *MythGallerySortOrder()
    6262{
    63     HostComboBox *gc = new HostComboBox("GallerySortOrder");
     63    HostComboBoxSetting *gc = new HostComboBoxSetting("GallerySortOrder");
    6464    gc->setLabel(QObject::tr("Sort order when browsing"));
    6565    gc->addSelection("Unsorted", QString::number(kSortOrderUnsorted));
    6666    gc->addSelection("Name (A-Z alpha)", QString::number(kSortOrderNameAsc));
    static HostComboBox *MythGallerySortOrder() 
    8383    return gc;
    8484};
    8585
    86 static HostSpinBox *MythGalleryOverlayCaption()
     86static HostSpinBoxSetting *MythGalleryOverlayCaption()
    8787{
    88     HostSpinBox *gc = new HostSpinBox("GalleryOverlayCaption", 0, 600, 1);
     88    HostSpinBoxSetting *gc = new HostSpinBoxSetting("GalleryOverlayCaption", 0, 600, 1);
    8989    gc->setLabel(QObject::tr("Overlay caption"));
    9090    gc->setValue(0);
    9191    gc->setHelpText(QObject::tr("This is the number of seconds to show a caption "
    static HostSpinBox *MythGalleryOverlayCaption() 
    9393    return gc;
    9494};
    9595
    96 static HostLineEdit *MythGalleryImportDirs()
     96static HostTextEditSetting *MythGalleryImportDirs()
    9797{
    98     HostLineEdit *gc = new HostLineEdit("GalleryImportDirs");
     98    HostTextEditSetting *gc = new HostTextEditSetting("GalleryImportDirs");
    9999    gc->setLabel(QObject::tr("Paths to import images from"));
    100100    gc->setValue("/mnt/cdrom:/mnt/camera");
    101101    gc->setHelpText(QObject::tr("This is a colon separated list of paths. "
    static HostLineEdit *MythGalleryImportDirs() 
    104104    return gc;
    105105};
    106106
    107 static HostCheckBox *MythGalleryAutoLoad()
     107static HostCheckBoxSetting *MythGalleryAutoLoad()
    108108{
    109     HostCheckBox *gc = new HostCheckBox("GalleryAutoLoad");
     109    HostCheckBoxSetting *gc = new HostCheckBoxSetting("GalleryAutoLoad");
    110110    gc->setLabel(QObject::tr("Automatically load MythGallery to display pictures"));
    111111    gc->setValue(false);
    112112    gc->setHelpText(QObject::tr("When a new CD-Rom or removable storage device containing pictures is detected then load MythGallery to display the content."));
    113113    return gc;
    114114}
    115115
     116static HostComboBoxSetting *SlideShowTransitionMode()
     117{
     118    //use to be a checkbox
     119    HostComboBoxSetting *gc = new HostComboBoxSetting("SlideshowUseOpenGL");
     120    gc->setLabel(QObject::tr("Transition mode"));
     121    gc->addSelection(QObject::tr("Standard"),"0");
    116122#ifdef USING_OPENGL
     123    gc->addSelection(QObject::tr("OpenGL"),"1");
     124#endif
     125    return gc;
     126};
    117127
    118 static HostCheckBox *SlideshowUseOpenGL()
     128#ifdef USING_OPENGL
     129/*
     130static HostCheckBoxSetting *SlideshowUseOpenGL()
    119131{
    120     HostCheckBox *gc = new HostCheckBox("SlideshowUseOpenGL");
     132    HostCheckBoxSetting *gc = new HostCheckBoxSetting("SlideshowUseOpenGL");
    121133    gc->setLabel(QObject::tr("Use OpenGL transitions"));
    122134    gc->setValue(false);
    123135    gc->setHelpText(QObject::tr("Check this to enable OpenGL "
    124136                                "based slideshow transitions"));
    125137    return gc;
    126 };
     138};*/
    127139
    128 static HostComboBox *SlideshowOpenGLTransition()
     140static HostComboBoxSetting *SlideshowOpenGLTransition()
    129141{
    130     HostComboBox *gc = new HostComboBox("SlideshowOpenGLTransition");
     142    HostComboBoxSetting *gc = new HostComboBoxSetting("SlideshowOpenGLTransition");
    131143    gc->setLabel(QObject::tr("Type of OpenGL transition"));
    132144    gc->addSelection("none");
    133145    gc->addSelection("blend (gl)");
    static HostComboBox *SlideshowOpenGLTransition() 
    146158    return gc;
    147159};
    148160
    149 static HostSpinBox *SlideshowOpenGLTransitionLength()
     161static HostSpinBoxSetting *SlideshowOpenGLTransitionLength()
    150162{
    151     HostSpinBox *gc = new HostSpinBox(
     163    HostSpinBoxSetting *gc = new HostSpinBoxSetting(
    152164        "SlideshowOpenGLTransitionLength", 500, 120000, 500);
    153165    gc->setLabel(QObject::tr("Duration of OpenGL Transition (milliseconds)"));
    154166    gc->setValue(2000);
    static HostSpinBox *SlideshowOpenGLTransitionLength() 
    157169
    158170#endif /* USING_OPENGL */
    159171
    160 static HostComboBox *SlideshowTransition()
     172static HostComboBoxSetting *SlideshowTransition()
    161173{
    162     HostComboBox *gc = new HostComboBox("SlideshowTransition");
     174    HostComboBoxSetting *gc = new HostComboBoxSetting("SlideshowTransition");
    163175    gc->setLabel(QObject::tr("Type of transition"));
    164176    gc->addSelection("none");
    165177    gc->addSelection("chess board");
    static HostComboBox *SlideshowTransition() 
    180192    return gc;
    181193};
    182194
    183 static HostComboBox *SlideshowBackground()
     195static HostComboBoxSetting *SlideshowBackground()
    184196{
    185     HostComboBox *gc = new HostComboBox("SlideshowBackground");
     197    HostComboBoxSetting *gc = new HostComboBoxSetting("SlideshowBackground");
    186198    gc->setLabel(QObject::tr("Type of background"));
    187199    // use names from /etc/X11/rgb.txt
    188200    gc->addSelection("theme","");
    static HostComboBox *SlideshowBackground() 
    193205    return gc;
    194206};
    195207
    196 static HostSpinBox *SlideshowDelay()
     208static HostSpinBoxSetting *SlideshowDelay()
    197209{
    198     HostSpinBox *gc = new HostSpinBox("SlideshowDelay", 0, 86400, 1);
     210    HostSpinBoxSetting *gc = new HostSpinBoxSetting("SlideshowDelay", 0, 86400, 1);
    199211    gc->setLabel(QObject::tr("Slideshow Delay"));
    200212    gc->setValue(5);
    201213    gc->setHelpText(QObject::tr("This is the number of seconds to display each "
    static HostSpinBox *SlideshowDelay() 
    203215    return gc;
    204216};
    205217
    206 static HostCheckBox *SlideshowRecursive()
     218static HostCheckBoxSetting *SlideshowRecursive()
    207219{
    208     HostCheckBox *gc = new HostCheckBox("GalleryRecursiveSlideshow");
     220    HostCheckBoxSetting *gc = new HostCheckBoxSetting("GalleryRecursiveSlideshow");
    209221    gc->setLabel(QObject::tr("Recurse into directories"));
    210222    gc->setHelpText(QObject::tr("Check this to let the slideshow recurse into "
    211223                                "sub-directories."));
    212224    return gc;
    213225};
    214226
    215 class GalleryConfigurationGroup : public TriggeredConfigurationGroup
    216 {
    217   public:
    218     GalleryConfigurationGroup() :
    219         TriggeredConfigurationGroup(false, true, false, false)
    220     {
    221         setLabel(QObject::tr("MythGallery Settings (Slideshow)"));
    222         setUseLabel(false);
    223 
     227GallerySettings::GallerySettings()
     228    :GroupSetting()
     229{
     230    setLabel(QObject::tr("MythGallery Settings"));
     231    addChild(MythGalleryDir());
     232    addChild(MythGalleryThumbnailLocation());
     233    addChild(MythGallerySortOrder());
     234    addChild(MythGalleryImportDirs());
     235    addChild(MythGalleryAutoLoad());
     236    addChild(MythGalleryFilter());
     237    addChild(MythGalleryFilterType());
     238
     239    HostComboBoxSetting* transitionMode = SlideShowTransitionMode();
     240    addChild(transitionMode);
     241    //no opengl
     242    transitionMode->addTargetedChild("0",MythGalleryOverlayCaption());
     243    transitionMode->addTargetedChild("0",SlideshowTransition());
     244    transitionMode->addTargetedChild("0",SlideshowBackground());
    224245#ifdef USING_OPENGL
    225         HostCheckBox* useOpenGL = SlideshowUseOpenGL();
    226         addChild(useOpenGL);
    227         setTrigger(useOpenGL);
    228 
    229         ConfigurationGroup* openGLConfig = new VerticalConfigurationGroup(false);
    230         openGLConfig->addChild(SlideshowOpenGLTransition());
    231         openGLConfig->addChild(SlideshowOpenGLTransitionLength());
    232         addTarget("1", openGLConfig);
     246        transitionMode->addTargetedChild("1",SlideshowOpenGLTransition());
     247        transitionMode->addTargetedChild("1",SlideshowOpenGLTransitionLength());
    233248#endif
    234249
    235         ConfigurationGroup* regularConfig = new VerticalConfigurationGroup(false);
    236         regularConfig->addChild(MythGalleryOverlayCaption());
    237         regularConfig->addChild(SlideshowTransition());
    238         regularConfig->addChild(SlideshowBackground());
    239         addTarget("0", regularConfig);
    240 
    241         addChild(SlideshowDelay());
    242         addChild(SlideshowRecursive());
    243     }
    244 
    245 };
    246 
    247250
    248 GallerySettings::GallerySettings()
    249 {
    250     VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false);
    251     general->setLabel(QObject::tr("MythGallery Settings (General)"));
    252     general->addChild(MythGalleryDir());
    253     general->addChild(MythGalleryThumbnailLocation());
    254     general->addChild(MythGallerySortOrder());
    255     general->addChild(MythGalleryImportDirs());
    256     general->addChild(MythGalleryAutoLoad());
    257     general->addChild(MythGalleryFilter());
    258     general->addChild(MythGalleryFilterType());
    259     addChild(general);
    260251
    261     GalleryConfigurationGroup* config = new GalleryConfigurationGroup();
    262     addChild(config);
     252    addChild(SlideshowDelay());
     253    addChild(SlideshowRecursive());
    263254}
    264255
  • mythplugins/mythgallery/mythgallery/gallerysettings.h

    diff --git a/mythplugins/mythgallery/mythgallery/gallerysettings.h b/mythplugins/mythgallery/mythgallery/gallerysettings.h
    index cd1d27e..82fccbc 100644
    a b  
    11#ifndef GALLERYSETTINGS_H
    22#define GALLERYSETTINGS_H
    33
    4 #include "mythtv/settings.h"
     4#include "mythtv/standardsettings.h"
    55#include "mythtv/mythcontext.h"
    66
    7 class GallerySettings : public ConfigurationWizard
     7class GallerySettings : public GroupSetting
    88{
    99  public: 
    1010    GallerySettings();
  • mythplugins/mythgallery/mythgallery/iconview.cpp

    diff --git a/mythplugins/mythgallery/mythgallery/iconview.cpp b/mythplugins/mythgallery/mythgallery/iconview.cpp
    index 1e05dde..f236a00 100644
    a b void IconView::DoDeleteCurrent(bool doDelete) 
    10511051
    10521052void IconView::HandleSettings(void)
    10531053{
    1054     GallerySettings settings;
    1055     settings.exec();
    1056     gCoreContext->ClearSettingsCache();
     1054    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     1055    StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "gallerysettings");
     1056
     1057    if (ssd->Create())
     1058    {
     1059        ssd->loadSettings(new GallerySettings());
     1060        mainStack->AddScreen(ssd);
     1061        connect(ssd,SIGNAL(Close()),this, SLOT(ReloadSettings()));
     1062    }
     1063    else
     1064        delete ssd;
    10571065
     1066}
     1067
     1068void IconView::ReloadSettings(void)
     1069{
     1070    gCoreContext->ClearSettingsCache();
    10581071    // reload settings
    10591072    m_showcaption = gCoreContext->GetNumSetting("GalleryOverlayCaption", 0);
    10601073    m_sortorder   = gCoreContext->GetNumSetting("GallerySortOrder", 0);
  • mythplugins/mythgallery/mythgallery/iconview.h

    diff --git a/mythplugins/mythgallery/mythgallery/iconview.h b/mythplugins/mythgallery/mythgallery/iconview.h
    index b9c5a33..6243394 100644
    a b class IconView : public MythScreenType 
    8888    void HandleDeleteCurrent(void);
    8989    void HandleSlideShow(void);
    9090    void HandleSettings(void);
     91    void ReloadSettings(void);
    9192    void HandleEject(void);
    9293    void HandleImport(void);
    9394    void HandleShowDevices(void);
  • mythplugins/mythgallery/mythgallery/main.cpp

    diff --git a/mythplugins/mythgallery/mythgallery/main.cpp b/mythplugins/mythgallery/mythgallery/main.cpp
    index 396c9d6..35f7765 100644
    a b int mythplugin_run(void) 
    162162
    163163int mythplugin_config(void)
    164164{
    165     GallerySettings settings;
    166     settings.exec();
     165    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     166    StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "gallerysettings");
    167167
     168    if (ssd->Create())
     169    {
     170        ssd->loadSettings(new GallerySettings());
     171        mainStack->AddScreen(ssd);
     172    }
     173    else
     174        delete ssd;
    168175    return 0;
    169176}
    170177
  • mythplugins/mythzoneminder/mythzoneminder/main.cpp

    diff --git a/mythplugins/mythzoneminder/mythzoneminder/main.cpp b/mythplugins/mythzoneminder/mythzoneminder/main.cpp
    index 8437437..d6e8117 100644
    a b int mythplugin_run(void) 
    160160
    161161int mythplugin_config(void)
    162162{
    163     ZMSettings settings;
    164     settings.exec();
     163    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
     164    StandardSettingDialog *ssd = new StandardSettingDialog(mainStack, "zonemindersettings");
     165
     166    if (ssd->Create())
     167    {
     168        ssd->loadSettings(new ZMSettings());
     169        mainStack->AddScreen(ssd);
     170    }
     171    else
     172        delete ssd;
    165173
    166174    return 0;
    167175}
  • mythplugins/mythzoneminder/mythzoneminder/zmsettings.cpp

    diff --git a/mythplugins/mythzoneminder/mythzoneminder/zmsettings.cpp b/mythplugins/mythzoneminder/mythzoneminder/zmsettings.cpp
    index 702e434..be024cd 100644
    a b  
    1111#include "zmsettings.h"
    1212
    1313
    14 static HostLineEdit *ZMServerIP()
     14static HostTextEditSetting *ZMServerIP()
    1515{
    16     HostLineEdit *gc = new HostLineEdit("ZoneMinderServerIP");
     16    HostTextEditSetting *gc = new HostTextEditSetting("ZoneMinderServerIP");
    1717    gc->setLabel(QObject::tr("IP address of the MythZoneMinder server"));
    1818    gc->setValue("127.0.0.1");
    1919    gc->setHelpText(QObject::tr("Enter the IP address of the MythZoneMinder server "
    static HostLineEdit *ZMServerIP() 
    2121    return gc;
    2222};
    2323
    24 static HostLineEdit *ZMServerPort()
     24static HostTextEditSetting *ZMServerPort()
    2525{
    26     HostLineEdit *gc = new HostLineEdit("ZoneMinderServerPort");
     26    HostTextEditSetting *gc = new HostTextEditSetting("ZoneMinderServerPort");
    2727    gc->setLabel(QObject::tr("Port the server runs on"));
    2828    gc->setValue("6548");
    2929    gc->setHelpText(QObject::tr("Unless you've got good reason to, don't "
    static HostLineEdit *ZMServerPort() 
    3131    return gc;
    3232};
    3333
    34 static HostComboBox *ZMDateFormat()
     34static HostComboBoxSetting *ZMDateFormat()
    3535{
    36     HostComboBox *gc = new HostComboBox("ZoneMinderDateFormat");
     36    HostComboBoxSetting *gc = new HostComboBoxSetting("ZoneMinderDateFormat");
    3737    gc->setLabel(QObject::tr("Date format"));
    3838
    3939    QDate sampdate = QDate::currentDate();
    static HostComboBox *ZMDateFormat() 
    6565    return gc;
    6666}
    6767
    68 static HostComboBox *ZMTimeFormat()
     68static HostComboBoxSetting *ZMTimeFormat()
    6969{
    70     HostComboBox *gc = new HostComboBox("ZoneMinderTimeFormat");
     70    HostComboBoxSetting *gc = new HostComboBoxSetting("ZoneMinderTimeFormat");
    7171    gc->setLabel(QObject::tr("Time format"));
    7272
    7373    QTime samptime = QTime::currentTime();
    static HostComboBox *ZMTimeFormat() 
    8383
    8484ZMSettings::ZMSettings()
    8585{
    86     VerticalConfigurationGroup* vcg1 = new VerticalConfigurationGroup(false);
    87     vcg1->setLabel(QObject::tr("MythZoneMinder Settings"));
    88     vcg1->addChild(ZMServerIP());
    89     vcg1->addChild(ZMServerPort());
    90     vcg1->addChild(ZMDateFormat());
    91     vcg1->addChild(ZMTimeFormat());
    92     addChild(vcg1);
     86    setLabel(QObject::tr("MythZoneMinder Settings"));
     87    addChild(ZMServerIP());
     88    addChild(ZMServerPort());
     89    addChild(ZMDateFormat());
     90    addChild(ZMTimeFormat());
    9391}
  • mythplugins/mythzoneminder/mythzoneminder/zmsettings.h

    diff --git a/mythplugins/mythzoneminder/mythzoneminder/zmsettings.h b/mythplugins/mythzoneminder/mythzoneminder/zmsettings.h
    index b6f2ad5..6c5cc7c 100644
    a b  
    55#ifndef ZMSETTINGS_H
    66#define ZMSETTINGS_H
    77
    8 #include <settings.h>
     8#include <standardsettings.h>
    99
    10 class ZMSettings : public ConfigurationWizard
     10class ZMSettings : public GroupSetting
    1111{
    1212  public:
    1313    ZMSettings();