Skip to content

Commit

Permalink
Add an 'auto-run' setting to mythgallery so that behaviour can be dis…
Browse files Browse the repository at this point in the history
…abled

(cherry picked from commit 80d9234)
  • Loading branch information
stuartm committed Feb 17, 2011
1 parent 84db96c commit 2b7036f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mythplugins/mythgallery/mythgallery/gallerysettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ static HostLineEdit *MythGalleryImportDirs()
return gc;
};

static HostCheckBox *MythGalleryAutoLoad()
{
HostCheckBox *gc = new HostCheckBox("GalleryAutoLoad");
gc->setLabel(QObject::tr("Automatically load MythGallery to display pictures"));
gc->setValue(false);
gc->setHelpText(QObject::tr("When a new CD-Rom or removable storage device containing pictures is detected then load MythGallery to display the content."));
return gc;
}

#ifdef USING_OPENGL

static HostCheckBox *SlideshowUseOpenGL()
Expand Down Expand Up @@ -217,6 +226,7 @@ GallerySettings::GallerySettings()
general->addChild(MythGalleryThumbnailLocation());
general->addChild(MythGallerySortOrder());
general->addChild(MythGalleryImportDirs());
general->addChild(MythGalleryAutoLoad());
general->addChild(MythGalleryMoviePlayerCmd());
addChild(general);

Expand Down
3 changes: 3 additions & 0 deletions mythplugins/mythgallery/mythgallery/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ static void runGallery(void)

static void handleMedia(MythMediaDevice *dev)
{
if (! gCoreContext->GetNumSetting("GalleryAutoLoad", 0))
return;

if (dev && dev->isUsable())
run(dev);
}
Expand Down

0 comments on commit 2b7036f

Please sign in to comment.