00001
00002
00003 #include <QDir>
00004
00005
00006 #include <mythcontext.h>
00007
00008
00009 #include "config.h"
00010 #include "gallerysettings.h"
00011 #include "galleryfilter.h"
00012
00013
00014
00015 static HostLineEdit *MythGalleryFilter()
00016 {
00017 HostLineEdit *gc = new HostLineEdit("GalleryFilterDirectory");
00018 gc->setLabel(QObject::tr("Directory filter"));
00019 gc->setValue("");
00020 gc->setHelpText(QObject::tr("Enter directory names to be excluded in "
00021 "browser. (multiple entries delimited with "
00022 "':')"));
00023 return gc;
00024 };
00025
00026 static HostComboBox *MythGalleryFilterType()
00027 {
00028 HostComboBox *gc = new HostComboBox("GalleryFilterType");
00029 gc->setLabel(QObject::tr("Type filter"));
00030 gc->addSelection("All", QString::number(kTypeFilterAll));
00031 gc->addSelection("Images only", QString::number(kTypeFilterImagesOnly));
00032 gc->addSelection("Movies only", QString::number(kTypeFilterMoviesOnly));
00033 gc->setHelpText(QObject::tr("This is the type filter for the displayed "
00034 "thumbnails."));
00035 return gc;
00036 };
00037
00038 static HostLineEdit *MythGalleryDir()
00039 {
00040 HostLineEdit *gc = new HostLineEdit("GalleryDir");
00041 gc->setLabel(QObject::tr("Directory that holds images"));
00042 #ifdef Q_WS_MACX
00043 gc->setValue(QDir::homePath() + "/Pictures");
00044 #else
00045 gc->setValue("/var/lib/pictures");
00046 #endif
00047 gc->setHelpText(QObject::tr("This directory must exist and "
00048 "MythGallery needs to have read permission."));
00049 return gc;
00050 };
00051
00052 static HostCheckBox *MythGalleryThumbnailLocation()
00053 {
00054 HostCheckBox *gc = new HostCheckBox("GalleryThumbnailLocation");
00055 gc->setLabel(QObject::tr("Store thumbnails in image directory"));
00056 gc->setValue(true);
00057 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."));
00058 return gc;
00059 };
00060
00061 static HostComboBox *MythGallerySortOrder()
00062 {
00063 HostComboBox *gc = new HostComboBox("GallerySortOrder");
00064 gc->setLabel(QObject::tr("Sort order when browsing"));
00065 gc->addSelection("Unsorted", QString::number(kSortOrderUnsorted));
00066 gc->addSelection("Name (A-Z alpha)", QString::number(kSortOrderNameAsc));
00067 gc->addSelection("Reverse Name (Z-A alpha)",
00068 QString::number(kSortOrderNameDesc));
00069 gc->addSelection("Mod Time (oldest first)",
00070 QString::number(kSortOrderModTimeAsc));
00071 gc->addSelection("Reverse Mod Time (newest first)",
00072 QString::number(kSortOrderModTimeDesc));
00073 gc->addSelection("Extension (A-Z alpha)",
00074 QString::number(kSortOrderExtAsc));
00075 gc->addSelection("Reverse Extension (Z-A alpha)",
00076 QString::number(kSortOrderExtDesc));
00077 gc->addSelection("Filesize (smallest first)",
00078 QString::number(kSortOrderSizeAsc));
00079 gc->addSelection("Reverse Filesize (largest first)",
00080 QString::number(kSortOrderSizeDesc));
00081 gc->setHelpText(QObject::tr("This is the sort order for the displayed "
00082 "picture thumbnails."));
00083 return gc;
00084 };
00085
00086 static HostSpinBox *MythGalleryOverlayCaption()
00087 {
00088 HostSpinBox *gc = new HostSpinBox("GalleryOverlayCaption", 0, 600, 1);
00089 gc->setLabel(QObject::tr("Overlay caption"));
00090 gc->setValue(0);
00091 gc->setHelpText(QObject::tr("This is the number of seconds to show a caption "
00092 "on top of a full size picture."));
00093 return gc;
00094 };
00095
00096 static HostLineEdit *MythGalleryImportDirs()
00097 {
00098 HostLineEdit *gc = new HostLineEdit("GalleryImportDirs");
00099 gc->setLabel(QObject::tr("Paths to import images from"));
00100 gc->setValue("/mnt/cdrom:/mnt/camera");
00101 gc->setHelpText(QObject::tr("This is a colon separated list of paths. "
00102 "If the path in the list is a directory, its contents will "
00103 "be copied. If it is an executable, it will be run."));
00104 return gc;
00105 };
00106
00107 static HostCheckBox *MythGalleryAutoLoad()
00108 {
00109 HostCheckBox *gc = new HostCheckBox("GalleryAutoLoad");
00110 gc->setLabel(QObject::tr("Automatically load MythGallery to display pictures"));
00111 gc->setValue(false);
00112 gc->setHelpText(QObject::tr("When a new CD-Rom or removable storage device containing pictures is detected then load MythGallery to display the content."));
00113 return gc;
00114 }
00115
00116 #ifdef USING_OPENGL
00117
00118 static HostCheckBox *SlideshowUseOpenGL()
00119 {
00120 HostCheckBox *gc = new HostCheckBox("SlideshowUseOpenGL");
00121 gc->setLabel(QObject::tr("Use OpenGL transitions"));
00122 gc->setValue(false);
00123 gc->setHelpText(QObject::tr("Check this to enable OpenGL "
00124 "based slideshow transitions"));
00125 return gc;
00126 };
00127
00128 static HostComboBox *SlideshowOpenGLTransition()
00129 {
00130 HostComboBox *gc = new HostComboBox("SlideshowOpenGLTransition");
00131 gc->setLabel(QObject::tr("Type of OpenGL transition"));
00132 gc->addSelection("none");
00133 gc->addSelection("blend (gl)");
00134 gc->addSelection("zoom blend (gl)");
00135 gc->addSelection("fade (gl)");
00136 gc->addSelection("rotate (gl)");
00137 gc->addSelection("bend (gl)");
00138 gc->addSelection("inout (gl)");
00139 gc->addSelection("slide (gl)");
00140 gc->addSelection("flutter (gl)");
00141 gc->addSelection("cube (gl)");
00142 gc->addSelection("Ken Burns (gl)");
00143 gc->addSelection("random (gl)");
00144 gc->setHelpText(QObject::tr("This is the type of OpenGL transition used "
00145 "between pictures in slideshow mode."));
00146 return gc;
00147 };
00148
00149 static HostSpinBox *SlideshowOpenGLTransitionLength()
00150 {
00151 HostSpinBox *gc = new HostSpinBox(
00152 "SlideshowOpenGLTransitionLength", 500, 120000, 500);
00153 gc->setLabel(QObject::tr("Duration of OpenGL Transition (milliseconds)"));
00154 gc->setValue(2000);
00155 return gc;
00156 };
00157
00158 #endif
00159
00160 static HostComboBox *SlideshowTransition()
00161 {
00162 HostComboBox *gc = new HostComboBox("SlideshowTransition");
00163 gc->setLabel(QObject::tr("Type of transition"));
00164 gc->addSelection("none");
00165 gc->addSelection("chess board");
00166 gc->addSelection("melt down");
00167 gc->addSelection("sweep");
00168 gc->addSelection("noise");
00169 gc->addSelection("growing");
00170 gc->addSelection("incoming edges");
00171 gc->addSelection("horizontal lines");
00172 gc->addSelection("vertical lines");
00173 gc->addSelection("circle out");
00174 gc->addSelection("multicircle out");
00175 gc->addSelection("spiral in");
00176 gc->addSelection("blobs");
00177 gc->addSelection("random");
00178 gc->setHelpText(QObject::tr("This is the type of transition used "
00179 "between pictures in slideshow mode."));
00180 return gc;
00181 };
00182
00183 static HostComboBox *SlideshowBackground()
00184 {
00185 HostComboBox *gc = new HostComboBox("SlideshowBackground");
00186 gc->setLabel(QObject::tr("Type of background"));
00187
00188 gc->addSelection("theme","");
00189 gc->addSelection("black");
00190 gc->addSelection("white");
00191 gc->setHelpText(QObject::tr("This is the type of background for each "
00192 "picture in single view mode."));
00193 return gc;
00194 };
00195
00196 static HostSpinBox *SlideshowDelay()
00197 {
00198 HostSpinBox *gc = new HostSpinBox("SlideshowDelay", 0, 86400, 1);
00199 gc->setLabel(QObject::tr("Slideshow Delay"));
00200 gc->setValue(5);
00201 gc->setHelpText(QObject::tr("This is the number of seconds to display each "
00202 "picture."));
00203 return gc;
00204 };
00205
00206 static HostCheckBox *SlideshowRecursive()
00207 {
00208 HostCheckBox *gc = new HostCheckBox("GalleryRecursiveSlideshow");
00209 gc->setLabel(QObject::tr("Recurse into directories"));
00210 gc->setHelpText(QObject::tr("Check this to let the slideshow recurse into "
00211 "sub-directories."));
00212 return gc;
00213 };
00214
00215 class GalleryConfigurationGroup : public TriggeredConfigurationGroup
00216 {
00217 public:
00218 GalleryConfigurationGroup() :
00219 TriggeredConfigurationGroup(false, true, false, false)
00220 {
00221 setLabel(QObject::tr("MythGallery Settings (Slideshow)"));
00222 setUseLabel(false);
00223
00224 #ifdef USING_OPENGL
00225 HostCheckBox* useOpenGL = SlideshowUseOpenGL();
00226 addChild(useOpenGL);
00227 setTrigger(useOpenGL);
00228
00229 ConfigurationGroup* openGLConfig = new VerticalConfigurationGroup(false);
00230 openGLConfig->addChild(SlideshowOpenGLTransition());
00231 openGLConfig->addChild(SlideshowOpenGLTransitionLength());
00232 addTarget("1", openGLConfig);
00233 #endif
00234
00235 ConfigurationGroup* regularConfig = new VerticalConfigurationGroup(false);
00236 regularConfig->addChild(MythGalleryOverlayCaption());
00237 regularConfig->addChild(SlideshowTransition());
00238 regularConfig->addChild(SlideshowBackground());
00239 addTarget("0", regularConfig);
00240
00241 addChild(SlideshowDelay());
00242 addChild(SlideshowRecursive());
00243 }
00244
00245 };
00246
00247
00248 GallerySettings::GallerySettings()
00249 {
00250 VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false);
00251 general->setLabel(QObject::tr("MythGallery Settings (General)"));
00252 general->addChild(MythGalleryDir());
00253 general->addChild(MythGalleryThumbnailLocation());
00254 general->addChild(MythGallerySortOrder());
00255 general->addChild(MythGalleryImportDirs());
00256 general->addChild(MythGalleryAutoLoad());
00257 general->addChild(MythGalleryFilter());
00258 general->addChild(MythGalleryFilterType());
00259 addChild(general);
00260
00261 GalleryConfigurationGroup* config = new GalleryConfigurationGroup();
00262 addChild(config);
00263 }
00264