summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Morgan <smorgan@mythtv.org>2011-02-17 12:51:20 (GMT)
committer Stuart Morgan <smorgan@mythtv.org>2011-02-17 16:58:02 (GMT)
commit2b7036fe8ac5b1f11ddd3124fbd670009a4cf056 (patch)
treef17456533919ccaa99868a28c97e80a9b64a1535
parent84db96ce569d62da8eeea6ec1aa2e6f56cb34c09 (diff)
Add an 'auto-run' setting to mythgallery so that behaviour can be disabled
(cherry picked from commit 80d9234a505598942214978cc58145320aba0aa2)
-rw-r--r--mythplugins/mythgallery/mythgallery/gallerysettings.cpp10
-rw-r--r--mythplugins/mythgallery/mythgallery/main.cpp3
2 files changed, 13 insertions, 0 deletions
diff --git a/mythplugins/mythgallery/mythgallery/gallerysettings.cpp b/mythplugins/mythgallery/mythgallery/gallerysettings.cpp
index 1da908c..d32fec6 100644
--- a/mythplugins/mythgallery/mythgallery/gallerysettings.cpp
+++ b/mythplugins/mythgallery/mythgallery/gallerysettings.cpp
@@ -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()
@@ -217,6 +226,7 @@ GallerySettings::GallerySettings()
general->addChild(MythGalleryThumbnailLocation());
general->addChild(MythGallerySortOrder());
general->addChild(MythGalleryImportDirs());
+ general->addChild(MythGalleryAutoLoad());
general->addChild(MythGalleryMoviePlayerCmd());
addChild(general);
diff --git a/mythplugins/mythgallery/mythgallery/main.cpp b/mythplugins/mythgallery/mythgallery/main.cpp
index 82146ef..c93f575 100644
--- a/mythplugins/mythgallery/mythgallery/main.cpp
+++ b/mythplugins/mythgallery/mythgallery/main.cpp
@@ -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);
}