--- mythgallery/mythgallery/mythgallery.pro	2009-12-23 12:58:25.660399643 +0100
+++ mythgallery/mythgallery/mythgallery.pro	2009-12-23 18:55:51.803104000 +0100
@@ -19,15 +19,19 @@
 # Input
 HEADERS += iconview.h          singleview.h
 HEADERS += imageview.h
-HEADERS += gallerysettings.h   dbcheck.h
+HEADERS += dbcheck.h
 HEADERS += galleryutil.h
 HEADERS += thumbgenerator.h    thumbview.h
+HEADERS += generalsettings.h
+HEADERS += slideshowsettings.h
 SOURCES += iconview.cpp        singleview.cpp
 SOURCES += imageview.cpp
-SOURCES += gallerysettings.cpp dbcheck.cpp
+SOURCES += dbcheck.cpp
 SOURCES += galleryutil.cpp
 SOURCES += thumbgenerator.cpp  thumbview.cpp
 SOURCES += main.cpp
+SOURCES += generalsettings.cpp
+SOURCES += slideshowsettings.cpp
 
 opengl {
     SOURCES *= glsingleview.cpp gltexture.cpp
--- mythgallery/mythgallery/main.cpp	2009-12-23 12:58:25.794777151 +0100
+++ mythgallery/mythgallery/main.cpp	2009-12-23 17:55:12.218400228 +0100
@@ -10,11 +10,16 @@
 #include <mythtv/mythdialogs.h>
 #include <mythtv/mythmediamonitor.h>
 #include <mythtv/mythpluginapi.h>
+#include <mythtv/libmythui/myththemedmenu.h>
+#include <mythtv/libmythui/mythuihelper.h>
+#include <mythtv/libmythui/mythmainwindow.h>
 
 // mythgallery
 #include "iconview.h"
-#include "gallerysettings.h"
 #include "dbcheck.h"
+#include "generalsettings.h"
+#include "slideshowsettings.h"
+
 
 static int run(MythMediaDevice *dev = NULL)
 {
@@ -110,6 +115,56 @@
         MEDIATYPE_MGALLERY, "gif,jpg,png");
 }
 
+void GalleryCallback(void *data, QString &selection)
+{
+    (void) data;
+
+    QString sel = selection.toLower();
+
+    if (sel == "settings_general")
+    {
+        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
+        GeneralSettings *gs = new GeneralSettings(mainStack, "general settings");
+
+        if (gs->Create())
+            mainStack->AddScreen(gs);
+    }
+    else if (sel == "settings_slideshow")
+    {
+        MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
+        SlideshowSettings *ss = new SlideshowSettings(mainStack, "slideshow settings");
+
+        if (ss->Create())
+            mainStack->AddScreen(ss);
+    }
+}
+
+int runMenu(const QString &menuname)
+{
+    QString themedir = GetMythUI()->GetThemeDir();
+
+    MythThemedMenu *menu =
+            new MythThemedMenu(themedir, menuname,
+                               GetMythMainWindow()->GetMainStack(),
+                               "music menu");
+
+    menu->setCallback(GalleryCallback, NULL);
+    menu->setKillable();
+
+    if (menu->foundTheme())
+    {
+        GetMythMainWindow()->GetMainStack()->AddScreen(menu);
+        return 0;
+    }
+    else
+    {
+        VERBOSE(VB_IMPORTANT, QString("Couldn't find menu %1 or theme %2")
+                .arg(menuname).arg(themedir));
+        delete menu;
+        return -1;
+    }
+}
+
 int mythplugin_init(const char *libversion)
 {
     if (!gContext->TestPopupVersion("mythgallery", libversion,
@@ -120,10 +175,6 @@
     UpgradeGalleryDatabaseSchema();
     gContext->ActivateSettingsCache(true);
 
-    GallerySettings settings;
-    settings.Load();
-    settings.Save();
-
     setupKeys();
 
     return 0;
@@ -136,9 +187,6 @@
 
 int mythplugin_config(void)
 {
-    GallerySettings settings;
-    settings.exec();
-
-    return 0;
+    return runMenu("gallery_settings.xml");
 }
 
--- mythgallery/theme/default-wide/gallery-ui.xml	2009-12-23 12:58:28.607450061 +0100
+++ mythgallery/theme/default-wide/gallery-ui.xml	2009-12-23 18:52:42.289432000 +0100
@@ -114,4 +114,175 @@
 
     </window>
 
+	
+	<window name="generalsettings">
+		
+		<textarea name="gallerydir_label" from="basetextarea">
+			<area>200,140,440,40</area>
+			<align>right,vcenter</align>
+			<value>Directory that holds images:</value>
+		</textarea>
+		<textarea name="gallerydirfilter_label" from="basetextarea">
+			<area>200,190,440,40</area>
+			<align>right,vcenter</align>
+			<value>Directory filter:</value>
+		</textarea>
+		<textarea name="defaultthumbnaildir_label" from="basetextarea">
+			<area>200,240,440,40</area>
+			<align>right,vcenter</align>
+			<value>Store thumbnails in image directory:</value>
+		</textarea>
+		<textarea name="scalemax_label" from="basetextarea">
+			<area>200,290,440,40</area>
+			<align>right,vcenter</align>
+			<value>Scale image to the maximum screen size:</value>
+		</textarea>
+		<textarea name="filesortorder_label" from="basetextarea">
+			<area>200,340,440,40</area>
+			<align>right,vcenter</align>
+			<value>Sort order when browsing:</value>
+		</textarea>
+		<textarea name="importdirs_label" from="basetextarea">
+			<area>200,390,440,40</area>
+			<align>right,vcenter</align>
+			<value>Paths to import images from:</value>
+		</textarea>
+		<textarea name="movieplayercmd_label" from="basetextarea">
+			<area>200,440,440,40</area>
+			<align>right,vcenter</align>
+			<value>Command run to display movie files:</value>
+		</textarea>
+		
+		<textedit name="gallerydir" from="basetextedit">
+			<position>650,140</position>
+		</textedit>
+		<textedit name="gallerydirfilter" from="basetextedit">
+			<position>650,190</position>
+		</textedit>
+		<checkbox name="defaultthumbnaildir" from="basecheckbox">
+			<position>650,245</position>
+		</checkbox>
+		<checkbox name="scalemax" from="basecheckbox">
+			<position>650,295</position>
+		</checkbox>
+		<buttonlist name="filesortorder" from="baseselector">
+			<position>650,340</position>
+		</buttonlist>
+		<textedit name="importdirs" from="basetextedit">
+			<position>650,390</position>
+		</textedit>
+		<textedit name="movieplayercmd" from="basetextedit">
+			<position>650,440</position>
+		</textedit>
+		
+		<textarea name="helptext" from="basetextarea">
+			<area>215,500,850,80</area>
+			<cutdown>yes</cutdown>
+			<align>allcenter</align>
+			<multiline>yes</multiline>
+		</textarea>
+		
+		<button name="save" from="basebutton">
+			<position>480,600</position>
+			<value>Save</value>
+		</button>
+		<button name="cancel" from="basebutton">
+			<position>650,600</position>
+			<value>Cancel</value>
+		</button>
+		
+	</window>
+	
+	
+	<window name="slideshowsettings">
+		
+		<textarea name="slideshowdelay_label" from="basetextarea">
+			<area>240,90,400,40</area>
+			<align>right,vcenter</align>
+			<value>Slideshow Delay:</value>
+		</textarea>
+		<textarea name="recursiveslideshow_label" from="basetextarea">
+			<area>240,140,400,40</area>
+			<align>right,vcenter</align>
+			<value>Recurse into directories:</value>
+		</textarea>
+		<textarea name="useopengl_label" from="basetextarea">
+			<area>240,190,400,40</area>
+			<align>right,vcenter</align>
+			<value>Use OpenGL transitions:</value>
+		</textarea>
+		
+		<textarea name="opengltransition_label" from="basetextarea">
+			<area>240,255,400,40</area>
+			<align>right,vcenter</align>
+			<value>Type of OpenGL transition:</value>
+		</textarea>
+		<textarea name="opengltransitionlength_label" from="basetextarea">
+			<area>240,310,400,40</area>
+			<align>right,vcenter</align>
+			<value>Duration of OpenGL Transition (milliseconds):</value>
+		</textarea>
+		
+		<textarea name="showcaption_label" from="basetextarea">
+			<area>240,380,400,40</area>
+			<align>right,vcenter</align>
+			<value>Overlay caption:</value>
+		</textarea>
+		<textarea name="slideshowtransition_label" from="basetextarea">
+			<area>240,430,400,40</area>
+			<align>right,vcenter</align>
+			<value>Type of transition:</value>
+		</textarea>
+		<textarea name="slideshowbackground_label" from="basetextarea">
+			<area>240,480,400,40</area>
+			<align>right,vcenter</align>
+			<value>Type of background:</value>
+		</textarea>
+		
+		<spinbox name="slideshowdelay" from="basespinbox">
+			<position>650,90</position>
+		</spinbox>
+		<checkbox name="recursiveslideshow" from="basecheckbox">
+			<position>650,145</position>
+		</checkbox>
+		<checkbox name="useopengl" from="basecheckbox">
+			<position>650,195</position>
+		</checkbox>
+		
+		<buttonlist name="opengltransition" from="baseselector">
+			<position>650,255</position>
+		</buttonlist>
+		<spinbox name="opengltransitionlength" from="basespinbox">
+			<position>650,310</position>
+		</spinbox>
+		
+		<spinbox name="showcaption" from="basespinbox">
+			<position>650,380</position>
+		</spinbox>
+		<buttonlist name="slideshowtransition" from="baseselector">
+			<position>650,430</position>
+		</buttonlist>
+		<buttonlist name="slideshowbackground" from="baseselector">
+			<position>650,480</position>
+		</buttonlist>
+		
+		<textarea name="helptext" from="basetextarea">
+			<area>255,540,770,80</area>
+			<cutdown>yes</cutdown>
+			<align>allcenter</align>
+			<multiline>yes</multiline>
+		</textarea>
+		
+		<button name="save" from="basebutton">
+			<position>480,640</position>
+			<value>Save</value>
+		</button>
+		<button name="cancel" from="basebutton">
+			<position>650,640</position>
+			<value>Cancel</value>
+		</button>
+		
+	</window>
+	
+	
 </mythuitheme>
--- mythgallery/theme/menus/gallery_settings.xml	1970-01-01 01:00:00.000000000 +0100
+++ mythgallery/theme/menus/gallery_settings.xml	2009-12-23 17:31:34.894321000 +0100
@@ -0,0 +1,34 @@
+<mythmenu name="GALLERY_SETTINGS">
+
+   <button>
+      <type>GALLERY_SETTINGS_GENERAL</type>
+      <text>General Settings</text>
+      <text lang="IT">Impostazioni generali</text>
+      <text lang="ES">Opciones Generales</text>
+      <text lang="CA">Opcions Generals</text>
+      <text lang="DE">Grundeinstellungen</text>
+      <text lang="DA">Generelle indstillinger</text>
+      <text lang="NL">Algemeen</text>
+      <text lang="PT">Configurações Gerais</text>
+      <text lang="SV">Generellt</text>
+      <text lang="JA">全般設定</text>
+      <text lang="FI">Yleiset Asetukset</text>
+      <text lang="SL">Splošne nastavitve</text>
+      <text lang="ET">Üldised sätted</text>
+      <text lang="RU">Общие настройки</text>
+      <text lang="PL">Ustawienia ogólne</text>
+      <text lang="NB">Generelle innstillinger</text>
+      <action>SETTINGS_GENERAL</action>
+      <description>Gallery folders and general options</description>
+   </button>
+   
+   <button>
+	   <type>MUSIC_SETTINGS_SLIDESHOW</type>
+	   <text>Slideshow Settings</text>
+	   <text lang="DE">Diashow Einstellungen</text>
+	   <action>SETTINGS_SLIDESHOW</action>
+	   <description>Slideshow apperance and OpenGL options</description>
+	   <description lang="DE">Diashow-Aussehen und OpenGL Optionen</description>
+   </button>
+   
+</mythmenu>
--- mythgallery/mythgallery/iconview.h	2009-12-23 12:58:25.802402991 +0100
+++ mythgallery/mythgallery/iconview.h	2009-12-23 14:41:25.313400668 +0100
@@ -77,6 +77,11 @@
     void HandleSubMenuMetadata(void);
     void HandleSubMenuMark(void);
     void HandleSubMenuFile(void);
+    void HandleSubMenuSettings(void);
+
+    void HandleGeneralSettings(void);
+    void HandleSlideshowSettings(void);
+    void ReloadSettings(void);
 
   private slots:
     void HandleRotateCW(void);
@@ -84,7 +89,6 @@
     void HandleDeleteCurrent(void);
     void HandleSlideShow(void);
     void HandleRandomShow(void);
-    void HandleSettings(void);
     void HandleEject(void);
     void HandleImport(void);
     void HandleShowDevices(void);
--- mythgallery/mythgallery/iconview.cpp	2009-12-23 12:58:25.709400144 +0100
+++ mythgallery/mythgallery/iconview.cpp	2009-12-23 17:33:09.063402319 +0100
@@ -45,7 +45,8 @@
 
 // MythGallery headers
 #include "galleryutil.h"
-#include "gallerysettings.h"
+#include "generalsettings.h"
+#include "slideshowsettings.h"
 #include "thumbgenerator.h"
 #include "iconview.h"
 #include "singleview.h"
@@ -757,7 +758,19 @@
                     HandleSubMenuFile();
                     break;
                 case 5:
-                    HandleSettings();
+                    HandleSubMenuSettings();
+                    break;
+            }
+        }
+        else if (resultid == "settingsmenu")
+        {
+            switch (buttonnum)
+            {
+                case 0:
+                    HandleGeneralSettings();
+                    break;
+                case 1:
+                    HandleSlideshowSettings();
                     break;
             }
         }
@@ -915,6 +928,21 @@
     m_menuPopup->AddButton(tr("Rename"));
 }
 
+void IconView::HandleSubMenuSettings(void)
+{
+    QString label = tr("Settings Options");
+
+    m_menuPopup = new MythDialogBox(label, m_popupStack, "mythgallerymenupopup");
+
+    if (m_menuPopup->Create())
+        m_popupStack->AddScreen(m_menuPopup);
+
+    m_menuPopup->SetReturnEvent(this, "settingsmenu");
+
+    m_menuPopup->AddButton(tr("General Options"));
+    m_menuPopup->AddButton(tr("Slideshow Options"));
+}
+
 void IconView::HandleRotateCW(void)
 {
     ThumbItem *thumbitem = GetCurrentThumb();
@@ -987,10 +1015,30 @@
     }
 }
 
-void IconView::HandleSettings(void)
+void IconView::HandleGeneralSettings(void)
+{
+    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
+    GeneralSettings *gs = new GeneralSettings(mainStack, "general settings");
+
+    if (gs->Create())
+        mainStack->AddScreen(gs);
+
+    ReloadSettings();
+}
+
+void IconView::HandleSlideshowSettings(void)
+{
+    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
+    SlideshowSettings *ss = new SlideshowSettings(mainStack, "slideshow settings");
+
+    if (ss->Create())
+        mainStack->AddScreen(ss);
+
+    ReloadSettings();
+}
+
+void IconView::ReloadSettings(void)
 {
-    GallerySettings settings;
-    settings.exec();
     gContext->ClearSettingsCache();
 
     // reload settings
--- mythgallery/mythgallery/generalsettings.cpp	1970-01-01 01:00:00.000000000 +0100
+++ mythgallery/mythgallery/generalsettings.cpp	2009-12-23 18:03:23.837788522 +0100
@@ -0,0 +1,169 @@
+#include <iostream>
+using namespace std;
+
+// Qt
+#include <QString>
+
+// MythTV
+#include <mythtv/mythcontext.h>
+#include <mythtv/mythdbcon.h>
+#include <mythtv/mythdirs.h>
+
+#include "generalsettings.h"
+
+
+GeneralSettings::GeneralSettings(MythScreenStack *parent, const char *name)
+        : MythScreenType(parent, name),
+        m_galleryDir(NULL),
+        m_galleryDirFilter(NULL),
+        m_useDefaultThumbnailDir(NULL),
+        m_scaleMax(NULL),
+        m_fileSortOrder(NULL),
+        m_importDirs(NULL),
+        m_moviePlayerCmd(NULL),
+        m_helpText(NULL),
+        m_saveButton(NULL),
+        m_cancelButton(NULL)
+{
+}
+
+GeneralSettings::~GeneralSettings()
+{
+
+}
+
+bool GeneralSettings::Create()
+{
+    bool foundtheme = false;
+
+    // Load the theme for this screen
+    foundtheme = LoadWindowFromXML("gallery-ui.xml", "generalsettings", this);
+
+    if (!foundtheme)
+        return false;
+
+    m_galleryDir = dynamic_cast<MythUITextEdit *> (GetChild("gallerydir"));
+    m_galleryDirFilter = dynamic_cast<MythUITextEdit *> (GetChild("gallerydirfilter"));
+    m_useDefaultThumbnailDir = dynamic_cast<MythUICheckBox *> (GetChild("defaultthumbnaildir"));
+    m_scaleMax = dynamic_cast<MythUICheckBox *> (GetChild("scalemax"));
+    m_fileSortOrder = dynamic_cast<MythUIButtonList *> (GetChild("filesortorder"));
+    m_importDirs = dynamic_cast<MythUITextEdit *> (GetChild("importdirs"));
+    m_moviePlayerCmd = dynamic_cast<MythUITextEdit *> (GetChild("movieplayercmd"));
+    m_helpText = dynamic_cast<MythUIText *> (GetChild("helptext"));
+    m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save"));
+    m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel"));
+
+    if (!m_galleryDir || !m_useDefaultThumbnailDir || !m_scaleMax ||
+        !m_importDirs || !m_moviePlayerCmd ||
+        !m_saveButton || !m_cancelButton)
+    {
+        VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements.");
+        return false;
+    }
+
+    m_galleryDir->SetText(gContext->GetSetting("GalleryDir"));
+    m_galleryDirFilter->SetText(gContext->GetSetting("GalleryDirFilter"));
+
+    int loadUseDefaultThumbnailDir = gContext->GetNumSetting("GalleryThumbnailLocation", 0);
+    if (loadUseDefaultThumbnailDir == 1)
+        m_useDefaultThumbnailDir->SetCheckState(MythUIStateType::Full);
+
+    int loadScaleMax = gContext->GetNumSetting("GalleryScaleMax", 0);
+    if (loadScaleMax == 1)
+        m_scaleMax->SetCheckState(MythUIStateType::Full);
+
+    new MythUIButtonListItem(m_fileSortOrder, tr("Name (A-Z alpha)"), qVariantFromValue( QString::number(QDir::Name | QDir::DirsFirst | QDir::IgnoreCase) ));
+    new MythUIButtonListItem(m_fileSortOrder, tr("Reverse Name (Z-A alpha)"), qVariantFromValue( QString::number(QDir::Name | QDir::DirsFirst | QDir::IgnoreCase | QDir::Reversed) ));
+    new MythUIButtonListItem(m_fileSortOrder, tr("Mod Time (earliest first)"), qVariantFromValue( QString::number(QDir::Time | QDir::DirsFirst | QDir::IgnoreCase | QDir::Reversed) ));
+    new MythUIButtonListItem(m_fileSortOrder, tr("Reverse Mod Time (most recent first)"), qVariantFromValue( QString::number(QDir::Time | QDir::DirsFirst | QDir::IgnoreCase) ));
+    new MythUIButtonListItem(m_fileSortOrder, tr("Creation Time (earliest first)"), qVariantFromValue( QString::number( 0x1000 | QDir::Reversed) ));
+    new MythUIButtonListItem(m_fileSortOrder, tr("Reverse Creation Time (most recent first)"), qVariantFromValue( QString::number( 0x1000 ) ));
+    m_fileSortOrder->SetValueByData(gContext->GetSetting("GallerySortOrder"));
+
+    m_importDirs->SetText(gContext->GetSetting("GalleryImportDirs"));
+    m_moviePlayerCmd->SetText(gContext->GetSetting("GalleryMoviePlayerCmd"));
+
+    connect(m_galleryDir,  SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_useDefaultThumbnailDir,  SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_scaleMax,  SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_fileSortOrder,  SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_importDirs,  SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_moviePlayerCmd,  SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+
+    connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(slotSave()));
+    connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close()));
+
+    if (!BuildFocusList())
+        VERBOSE(VB_IMPORTANT, "Failed to build a focuslist. Something is wrong");
+
+    SetFocusWidget(m_galleryDir);
+
+    return true;
+}
+
+bool GeneralSettings::keyPressEvent(QKeyEvent *event)
+{
+    if (GetFocusWidget()->keyPressEvent(event))
+        return true;
+
+    bool handled = false;
+
+    if (!handled && MythScreenType::keyPressEvent(event))
+        handled = true;
+
+    return handled;
+}
+
+void GeneralSettings::slotSave(void)
+{
+    gContext->SaveSetting("GalleryDir", m_galleryDir->GetText());
+    gContext->SaveSetting("GalleryDirFilter", m_galleryDirFilter->GetText());
+    gContext->SaveSetting("GalleryImportDirs", m_importDirs->GetText());
+    gContext->SaveSetting("GalleryMoviePlayerCmd", m_moviePlayerCmd->GetText());
+
+    int saveUseDefaultThumbnailDir = (m_useDefaultThumbnailDir->GetCheckState() == MythUIStateType::Full) ? 1 : 0;
+    gContext->SaveSetting("GalleryThumbnailLocation", saveUseDefaultThumbnailDir);
+
+    int saveScaleMax = (m_scaleMax->GetCheckState() == MythUIStateType::Full) ? 1 : 0;
+    gContext->SaveSetting("GalleryScaleMax", saveScaleMax);
+
+    gContext->SaveSetting("GallerySortOrder", m_fileSortOrder->GetDataValue().toString());
+    Close();
+}
+
+void GeneralSettings::slotFocusChanged(void)
+{
+    if (!m_helpText)
+        return;
+
+    QString msg = "";
+    if (GetFocusWidget() == m_galleryDir)
+        msg = tr("This directory must exist and "
+                 "MythGallery needs to have read permission");
+    else if (GetFocusWidget() == m_galleryDirFilter)
+        msg = tr("Enter direcory names to be excluded in the gallery browser. "
+                 "(multiple entries are delimited with a colon)");
+    else if (GetFocusWidget() == m_useDefaultThumbnailDir)
+        msg = tr("If set, thumbnails are stored in '.thumbcache' directories "
+                 "within the above directory. If cleared, "
+                 "they are stored in your home directory.");
+    else if (GetFocusWidget() == m_scaleMax)
+        msg = tr("Check this to scale the image to the maximum "
+                 "No black borders will be visible.");
+    else if (GetFocusWidget() == m_fileSortOrder)
+        msg = tr("This is the sort order for the displayed "
+                 "picture thumbnails.");
+    else if (GetFocusWidget() == m_importDirs)
+        msg = tr("This is a colon separated list of paths. "
+                 "If the path in the list is a directory, its contents will "
+                 "be copied. If it is an executable, it will be run.");
+    else if (GetFocusWidget() == m_moviePlayerCmd)
+        msg = tr("This command is executed whenever a movie "
+                 "file is selected.");
+    else if (GetFocusWidget() == m_cancelButton)
+        msg = tr("Exit without saving settings");
+    else if (GetFocusWidget() == m_saveButton)
+        msg = tr("Save settings and Exit");
+
+    m_helpText->SetText(msg);
+}
--- mythgallery/mythgallery/generalsettings.h	1970-01-01 01:00:00.000000000 +0100
+++ mythgallery/mythgallery/generalsettings.h	2009-12-23 14:50:26.147503191 +0100
@@ -0,0 +1,45 @@
+#ifndef GENERALSETTINGS_H
+#define GENERALSETTINGS_H
+
+#include <mythtv/mythwidgets.h>
+#include <mythtv/mythdialogs.h>
+
+#include <mythtv/libmythui/mythuispinbox.h>
+#include <mythtv/libmythui/mythuibutton.h>
+#include <mythtv/libmythui/mythuibuttonlist.h>
+#include <mythtv/libmythui/mythuicheckbox.h>
+#include <mythtv/libmythui/mythscreentype.h>
+#include <mythtv/libmythui/mythdialogbox.h>
+
+
+class GeneralSettings : public MythScreenType
+{
+    Q_OBJECT
+public:
+    GeneralSettings(MythScreenStack *parent, const char *name = 0);
+    ~GeneralSettings();
+
+    bool Create();
+    bool keyPressEvent(QKeyEvent *event);
+
+ private:
+    MythUITextEdit     *m_galleryDir;
+    MythUITextEdit     *m_galleryDirFilter;
+    MythUICheckBox     *m_useDefaultThumbnailDir;
+    MythUICheckBox     *m_scaleMax;
+    MythUIButtonList   *m_fileSortOrder;
+    MythUITextEdit     *m_importDirs;
+    MythUITextEdit     *m_moviePlayerCmd;
+
+    MythUIText         *m_helpText;
+    MythUIButton       *m_saveButton;
+    MythUIButton       *m_cancelButton;
+
+private slots:
+    void slotSave(void);
+    void slotFocusChanged(void);
+
+};
+
+#endif // GENERALSETTINGS_H
+
--- mythgallery/mythgallery/slideshowsettings.h	1970-01-01 01:00:00.000000000 +0100
+++ mythgallery/mythgallery/slideshowsettings.h	2009-12-23 18:28:10.478526774 +0100
@@ -0,0 +1,46 @@
+#ifndef SLIDESHOWSETTINGS_H
+#define SLIDESHOWSETTINGS_H
+
+#include <mythtv/mythwidgets.h>
+#include <mythtv/mythdialogs.h>
+
+#include <mythtv/libmythui/mythuispinbox.h>
+#include <mythtv/libmythui/mythuibutton.h>
+#include <mythtv/libmythui/mythuibuttonlist.h>
+#include <mythtv/libmythui/mythuicheckbox.h>
+#include <mythtv/libmythui/mythscreentype.h>
+#include <mythtv/libmythui/mythdialogbox.h>
+
+
+class SlideshowSettings : public MythScreenType
+{
+    Q_OBJECT
+public:
+    SlideshowSettings(MythScreenStack *parent, const char *name = 0);
+    ~SlideshowSettings();
+
+    bool Create();
+    bool keyPressEvent(QKeyEvent *event);
+
+private:
+    MythUICheckBox     *m_useOpenGL;
+    MythUISpinBox      *m_slideShowDelay;
+    MythUICheckBox     *m_recursiveSlideshow;
+    MythUIButtonList   *m_openGLTransition;
+    MythUISpinBox      *m_openGLTransitionLength;
+    MythUISpinBox      *m_showCaption;
+    MythUIButtonList   *m_slideShowTransition;
+    MythUIButtonList   *m_slideShowBackground;
+
+    MythUIText         *m_helpText;
+    MythUIButton       *m_saveButton;
+    MythUIButton       *m_cancelButton;
+
+private slots:
+    void slotSave(void);
+    void slotFocusChanged(void);
+    void toggleUseOpenGL(void);
+
+};
+
+#endif // SLIDESHOWSETTINGS_H
--- mythgallery/mythgallery/slideshowsettings.cpp	1970-01-01 01:00:00.000000000 +0100
+++ mythgallery/mythgallery/slideshowsettings.cpp	2009-12-23 18:41:22.488774524 +0100
@@ -0,0 +1,233 @@
+#include <iostream>
+using namespace std;
+
+// Qt
+#include <QString>
+
+// MythTV
+#include <mythtv/mythcontext.h>
+#include <mythtv/mythdbcon.h>
+#include <mythtv/mythdirs.h>
+
+#include "slideshowsettings.h"
+
+
+SlideshowSettings::SlideshowSettings(MythScreenStack *parent, const char *name)
+        : MythScreenType(parent, name),
+    m_slideShowDelay(NULL),
+    m_recursiveSlideshow(NULL),
+    m_openGLTransition(NULL),
+    m_openGLTransitionLength(NULL),
+    m_showCaption(NULL),
+    m_slideShowTransition(NULL),
+    m_slideShowBackground(NULL),
+    m_helpText(NULL),
+    m_saveButton(NULL),
+    m_cancelButton(NULL)
+{
+}
+
+SlideshowSettings::~SlideshowSettings()
+{
+
+}
+
+bool SlideshowSettings::Create()
+{
+    bool foundtheme = false;
+
+    // Load the theme for this screen
+    foundtheme = LoadWindowFromXML("gallery-ui.xml", "slideshowsettings", this);
+
+    if (!foundtheme)
+        return false;
+
+    m_useOpenGL = dynamic_cast<MythUICheckBox *> (GetChild("useopengl"));
+    m_slideShowDelay = dynamic_cast<MythUISpinBox *> (GetChild("slideshowdelay"));
+    m_recursiveSlideshow = dynamic_cast<MythUICheckBox *> (GetChild("recursiveslideshow"));
+    m_openGLTransition = dynamic_cast<MythUIButtonList *> (GetChild("opengltransition"));
+    m_openGLTransitionLength = dynamic_cast<MythUISpinBox *> (GetChild("opengltransitionlength"));
+    m_showCaption = dynamic_cast<MythUISpinBox *> (GetChild("showcaption"));
+    m_slideShowTransition = dynamic_cast<MythUIButtonList *> (GetChild("slideshowtransition"));
+    m_slideShowBackground = dynamic_cast<MythUIButtonList *> (GetChild("slideshowbackground"));
+    m_helpText = dynamic_cast<MythUIText *> (GetChild("helptext"));
+    m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save"));
+    m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel"));
+
+    if (!m_useOpenGL || !m_slideShowDelay || !m_recursiveSlideshow ||
+        !m_openGLTransition || !m_openGLTransitionLength ||
+        !m_showCaption || !m_slideShowTransition || !m_slideShowBackground ||
+        !m_saveButton || !m_cancelButton)
+    {
+        VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements.");
+        return false;
+    }
+
+    int loadUseOpenGL = gContext->GetNumSetting("SlideshowUseOpenGL", 0);
+    if (loadUseOpenGL == 1)
+        m_useOpenGL->SetCheckState(MythUIStateType::Full);
+
+    int loadRecursiveSlideshow = gContext->GetNumSetting("GalleryRecursiveSlideshow", 0);
+    if (loadRecursiveSlideshow == 1)
+        m_recursiveSlideshow->SetCheckState(MythUIStateType::Full);
+
+    m_slideShowDelay->SetRange(1,600,1);
+    m_slideShowDelay->SetValue(gContext->GetNumSetting("SlideshowDelay"));
+
+    new MythUIButtonListItem(m_openGLTransition, tr("None"), qVariantFromValue( QString("none")));
+    new MythUIButtonListItem(m_openGLTransition, tr("Blend"), qVariantFromValue( QString("blend (gl)")));
+    new MythUIButtonListItem(m_openGLTransition, tr("Zoom Blend"), qVariantFromValue( QString("zoom blend (gl)")));
+    new MythUIButtonListItem(m_openGLTransition, tr("Fade"), qVariantFromValue( QString("fade (gl)")));
+    new MythUIButtonListItem(m_openGLTransition, tr("Rotate"), qVariantFromValue( QString("rotate (gl)")));
+    new MythUIButtonListItem(m_openGLTransition, tr("Bend"), qVariantFromValue( QString("bend (gl)")));
+    new MythUIButtonListItem(m_openGLTransition, tr("In & Out"), qVariantFromValue( QString("inout (gl)")));
+    new MythUIButtonListItem(m_openGLTransition, tr("Slide"), qVariantFromValue( QString("slide (gl)")));
+    new MythUIButtonListItem(m_openGLTransition, tr("Flutter"), qVariantFromValue( QString("flutter (gl)")));
+    new MythUIButtonListItem(m_openGLTransition, tr("Cube"), qVariantFromValue( QString("cube (gl)")));
+    new MythUIButtonListItem(m_openGLTransition, tr("Random"), qVariantFromValue( QString("random (gl)")));
+    m_openGLTransition->SetValueByData(gContext->GetSetting("SlideshowOpenGLTransition"));
+
+    m_openGLTransitionLength->SetRange(1000, 10000, 200);
+    m_openGLTransitionLength->SetValue(gContext->GetNumSetting("SlideshowOpenGLTransitionLength"));
+
+    m_showCaption->SetRange(0,600,1);
+    m_showCaption->SetValue(gContext->GetNumSetting("GalleryOverlayCaption"));
+
+    new MythUIButtonListItem(m_slideShowTransition, tr("None"), qVariantFromValue( QString("none")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Chess board"), qVariantFromValue( QString("chess board")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Melt down"), qVariantFromValue( QString("melt down")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Sweep"), qVariantFromValue( QString("sweep")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Noise"), qVariantFromValue( QString("noise")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Growing"), qVariantFromValue( QString("growing")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Incoming edges"), qVariantFromValue( QString("incoming edges")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Horizontal lines"), qVariantFromValue( QString("horizontal lines")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Vertical lines"), qVariantFromValue( QString("vertical lines")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Circle out"), qVariantFromValue( QString("circle out")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Multicircle out"), qVariantFromValue( QString("multicircle out")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Spiral in"), qVariantFromValue( QString("spiral in")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Blobs"), qVariantFromValue( QString("blobs")));
+    new MythUIButtonListItem(m_slideShowTransition, tr("Random"), qVariantFromValue( QString("random")));
+    m_slideShowTransition->SetValueByData(gContext->GetSetting("SlideshowTransition"));
+
+    new MythUIButtonListItem(m_slideShowBackground, tr("Theme background"), qVariantFromValue( QString("theme")));
+    new MythUIButtonListItem(m_slideShowBackground, tr("Black background"), qVariantFromValue( QString("black")));
+    new MythUIButtonListItem(m_slideShowBackground, tr("White background"), qVariantFromValue( QString("white")));
+    m_slideShowBackground->SetValueByData(gContext->GetSetting("SlideshowBackground"));
+
+    toggleUseOpenGL();
+
+    connect(m_useOpenGL, SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_slideShowDelay, SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_recursiveSlideshow, SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_openGLTransition, SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_openGLTransitionLength, SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_showCaption, SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_slideShowTransition, SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_slideShowBackground, SIGNAL(TakingFocus()), SLOT(slotFocusChanged()));
+    connect(m_useOpenGL, SIGNAL(valueChanged()), SLOT(toggleUseOpenGL()));
+
+    connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(slotSave()));
+    connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close()));
+
+
+    if (!BuildFocusList())
+        VERBOSE(VB_IMPORTANT, "Failed to build a focuslist. Something is wrong");
+
+    SetFocusWidget(m_slideShowDelay);
+
+    return true;
+}
+
+bool SlideshowSettings::keyPressEvent(QKeyEvent *event)
+{
+    if (GetFocusWidget()->keyPressEvent(event))
+        return true;
+
+    bool handled = false;
+
+    if (!handled && MythScreenType::keyPressEvent(event))
+        handled = true;
+
+    return handled;
+}
+
+void SlideshowSettings::slotSave(void)
+{
+    int saveUseOpenGL = (m_useOpenGL->GetCheckState() == MythUIStateType::Full) ? 1 : 0;
+    gContext->SaveSetting("SlideshowUseOpenGL", saveUseOpenGL);
+
+    int saveRecursiveSlideshow = (m_recursiveSlideshow->GetCheckState() == MythUIStateType::Full) ? 1 : 0;
+    gContext->SaveSetting("GalleryRecursiveSlideshow", saveRecursiveSlideshow);
+
+    gContext->SaveSetting("SlideshowDelay", m_slideShowDelay->GetValue());
+
+    if (m_useOpenGL->GetCheckState() == MythUIStateType::Full)
+    {
+        m_openGLTransition->SetVisible(true);
+        m_openGLTransitionLength->SetVisible(true);
+    }
+    else
+    {
+        gContext->SaveSetting("GalleryOverlayCaption", m_showCaption->GetValue());
+        gContext->SaveSetting("SlideshowTransition", m_slideShowTransition->GetDataValue().toString());
+        gContext->SaveSetting("SlideshowBackground", m_slideShowBackground->GetDataValue().toString());
+    }
+
+    Close();
+}
+
+void SlideshowSettings::slotFocusChanged(void)
+{
+    if (!m_helpText)
+        return;
+
+    QString msg = "";
+    if (GetFocusWidget() == m_useOpenGL)
+        msg = tr("Check this to enable OpenGL "
+                 "based slideshow transitions");
+    else if (GetFocusWidget() == m_slideShowDelay)
+        msg = tr("This is the number of seconds to display each picture.");
+    else if (GetFocusWidget() == m_recursiveSlideshow)
+        msg = tr("Check this to let the slideshow recurse into "
+                 "sub-directories.");
+    else if (GetFocusWidget() == m_openGLTransition)
+        msg = tr("This is the type of OpenGL transition used "
+                 "between pictures in slideshow mode.");
+    else if (GetFocusWidget() == m_openGLTransitionLength)
+        msg = tr("Duration of OpenGL Transition (milliseconds)");
+    else if (GetFocusWidget() == m_showCaption)
+        msg = tr("This is the number of seconds to show a caption "
+                 "on top of a full size picture.");
+    else if (GetFocusWidget() == m_slideShowTransition)
+        msg = tr("This is the type of transition used "
+                 "between pictures in slideshow mode.");
+    else if (GetFocusWidget() == m_slideShowBackground)
+        msg = tr("This is the type of background for each "
+                 "picture in single view mode.");
+    else if (GetFocusWidget() == m_cancelButton)
+        msg = tr("Exit without saving settings");
+    else if (GetFocusWidget() == m_saveButton)
+        msg = tr("Save settings and Exit");
+
+    m_helpText->SetText(msg);
+}
+
+void SlideshowSettings::toggleUseOpenGL()
+{
+    if (m_useOpenGL->GetCheckState() == MythUIStateType::Full)
+    {
+        m_openGLTransition->SetVisible(true);
+        m_openGLTransitionLength->SetVisible(true);
+        m_showCaption->SetVisible(false);
+        m_slideShowTransition->SetVisible(false);
+        m_slideShowBackground->SetVisible(false);
+    }
+    else
+    {
+        m_openGLTransition->SetVisible(false);
+        m_openGLTransitionLength->SetVisible(false);
+        m_showCaption->SetVisible(true);
+        m_slideShowTransition->SetVisible(true);
+        m_slideShowBackground->SetVisible(true);
+    }
+}
