00001 #include <mythtv/mythcontext.h>
00002
00003 #include "globalsettings.h"
00004 #include "globals.h"
00005 #include "videodlg.h"
00006 #include "parentalcontrols.h"
00007
00008 #include <map>
00009 #include <vector>
00010
00011 #include <qdir.h>
00012
00013 namespace
00014 {
00015
00016 HostComboBox *VideoDefaultParentalLevel()
00017 {
00018 HostComboBox *gc = new HostComboBox("VideoDefaultParentalLevel");
00019 gc->setLabel(QObject::tr("Starting Parental Level"));
00020 gc->addSelection(QObject::tr("4 - Highest"),
00021 QString::number(ParentalLevel::plHigh));
00022 gc->addSelection(QObject::tr("1 - Lowest"),
00023 QString::number(ParentalLevel::plLowest));
00024 gc->addSelection(QString::number(ParentalLevel::plLow));
00025 gc->addSelection(QString::number(ParentalLevel::plMedium));
00026 gc->setHelpText(QObject::tr("This is the 'level' that MythVideo starts at. "
00027 "Any videos with a level at or below this will be shown in "
00028 "the list or while browsing by default. The Parental PIN "
00029 "should be set to limit changing of the default level."));
00030 return gc;
00031 }
00032
00033 HostComboBox *VideoDefaultView()
00034 {
00035 HostComboBox *gc = new HostComboBox("Default MythVideo View");
00036 gc->setLabel(QObject::tr("Default View"));
00037 gc->addSelection(QObject::tr("Gallery"),
00038 QString::number(VideoDialog::DLG_GALLERY));
00039 gc->addSelection(QObject::tr("Browser"),
00040 QString::number(VideoDialog::DLG_BROWSER));
00041 gc->addSelection(QObject::tr("Listings"),
00042 QString::number(VideoDialog::DLG_TREE));
00043 gc->setHelpText(QObject::tr("The default view for MythVideo. "
00044 "Other views can be reached via the popup menu available "
00045 "via the MENU key."));
00046 return gc;
00047 }
00048
00049 const QString password_clue =
00050 QObject::tr("Setting this value to all numbers will make your life "
00051 "much easier.");
00052
00053 HostLineEdit *VideoAdminPassword()
00054 {
00055 HostLineEdit *gc = new HostLineEdit("VideoAdminPassword");
00056 gc->setLabel(QObject::tr("Parental Level 4 PIN"));
00057 gc->setHelpText(QString("%1 %2")
00058 .arg(QObject::tr("This PIN is used to enter Parental Control "
00059 "Level 4 as well as the Video Manager."))
00060 .arg(password_clue));
00061 return gc;
00062 }
00063
00064 HostLineEdit *VideoAdminPasswordThree()
00065 {
00066 HostLineEdit *gc = new HostLineEdit("VideoAdminPasswordThree");
00067 gc->setLabel(QObject::tr("Parental Level 3 PIN"));
00068 gc->setHelpText(QString("%1 %2")
00069 .arg(QObject::tr("This PIN is used to enter Parental Control Level 3."))
00070 .arg(password_clue));
00071 return gc;
00072 }
00073
00074 HostLineEdit *VideoAdminPasswordTwo()
00075 {
00076 HostLineEdit *gc = new HostLineEdit("VideoAdminPasswordTwo");
00077 gc->setLabel(QObject::tr("Parental Level 2 PIN"));
00078 gc->setHelpText(QString("%1 %2")
00079 .arg(QObject::tr("This PIN is used to enter Parental Control Level 2."))
00080 .arg(password_clue));
00081 return gc;
00082 }
00083
00084 HostCheckBox *VideoAggressivePC()
00085 {
00086 HostCheckBox *gc = new HostCheckBox("VideoAggressivePC");
00087 gc->setLabel(QObject::tr("Aggressive Parental Control"));
00088 gc->setValue(false);
00089 gc->setHelpText(QObject::tr("If set, you will not be able to return "
00090 "to this screen and reset the Parental "
00091 "PIN without first entering the current PIN. You have "
00092 "been warned."));
00093 return gc;
00094 }
00095
00096 HostCheckBox *VideoListUnknownFiletypes()
00097 {
00098 HostCheckBox *gc = new HostCheckBox("VideoListUnknownFiletypes");
00099 gc->setLabel(QObject::tr("Show Unknown File Types"));
00100 gc->setValue(true);
00101 gc->setHelpText(QObject::tr("If set, all files below the Myth Video "
00102 "directory will be displayed unless their "
00103 "extension is explicitly set to be ignored. "));
00104 return gc;
00105 }
00106
00107 HostCheckBox *VideoBrowserNoDB()
00108 {
00109 HostCheckBox *gc = new HostCheckBox("VideoBrowserNoDB");
00110 gc->setLabel(QObject::tr("Video Browser browses files"));
00111 gc->setValue(false);
00112 gc->setHelpText(QObject::tr("If set, this will cause the Video Browser "
00113 "screen to show all relevant files below "
00114 "the MythVideo starting directory whether "
00115 "they have been scanned or not."));
00116 return gc;
00117 }
00118
00119 HostCheckBox *VideoGalleryNoDB()
00120 {
00121 HostCheckBox *gc = new HostCheckBox("VideoGalleryNoDB");
00122 gc->setLabel(QObject::tr("Video Gallery browses files"));
00123 gc->setValue(false);
00124 gc->setHelpText(QObject::tr("If set, this will cause the Video Gallery "
00125 "screen to show all relevant files below "
00126 "the MythVideo starting directory whether "
00127 "they have been scanned or not."));
00128 return gc;
00129 }
00130
00131 HostCheckBox *VideoTreeNoDB()
00132 {
00133 HostCheckBox *gc = new HostCheckBox("VideoTreeNoDB");
00134 gc->setLabel(QObject::tr("Video List browses files"));
00135 gc->setValue(false);
00136 gc->setHelpText(QObject::tr("If set, this will cause the Video List "
00137 "screen to show all relevant files below "
00138 "the MythVideo starting directory whether "
00139 "they have been scanned or not."));
00140 return gc;
00141 }
00142
00143 HostCheckBox *VideoTreeNoMetaData()
00144 {
00145 HostCheckBox *gc = new HostCheckBox("VideoTreeLoadMetaData");
00146 gc->setLabel(QObject::tr("Video List Loads Video Meta Data"));
00147 gc->setValue(true);
00148 gc->setHelpText(QObject::tr("If set along with Browse Files, this "
00149 "will cause the Video List to load any known video meta"
00150 "data from the database. Turning this off can greatly "
00151 " speed up how long it takes to load the Video List tree"));
00152 return gc;
00153 }
00154
00155 HostCheckBox *VideoNewBrowsable()
00156 {
00157 HostCheckBox *gc = new HostCheckBox("VideoNewBrowsable");
00158 gc->setLabel(QObject::tr("Newly scanned files are browsable by default"));
00159 gc->setValue(true);
00160 gc->setHelpText(QObject::tr("If set, newly scanned files in the Video "
00161 "Manager will be marked as browsable and will appear in "
00162 "the 'Browse' menu."));
00163 return gc;
00164 }
00165
00166 HostCheckBox *VideoSortIgnoresCase()
00167 {
00168 HostCheckBox *hcb = new HostCheckBox("mythvideo.sort_ignores_case");
00169 hcb->setLabel(QObject::tr("Sorting ignores case"));
00170 hcb->setValue(true);
00171 hcb->setHelpText(QObject::tr("If set, case is ignored when sorting "
00172 "entries in a view."));
00173 return hcb;
00174 }
00175
00176 HostCheckBox *VideoDBFolderView()
00177 {
00178 HostCheckBox *hcb = new HostCheckBox("mythvideo.db_folder_view");
00179 hcb->setLabel(QObject::tr("Show folders for database views"));
00180 hcb->setValue(true);
00181 hcb->setHelpText(QObject::tr("If set, sub folders of your video "
00182 "directory will be shown in supported "
00183 "views."));
00184 return hcb;
00185 }
00186
00187 HostSpinBox *VideoImageCacheSize()
00188 {
00189 HostSpinBox *hsb = new HostSpinBox("mythvideo.ImageCacheSize", 10,
00190 1000, 10);
00191 hsb->setValue(50);
00192 hsb->setLabel(QObject::tr("Image cache size"));
00193 hsb->setHelpText(QObject::tr("This setting determines the number "
00194 "of images MythVideo will cache for "
00195 "views."));
00196 return hsb;
00197 }
00198
00199 HostCheckBox *VideoTreeRemeber()
00200 {
00201 HostCheckBox *gc = new HostCheckBox("mythvideo.VideoTreeRemember");
00202 gc->setLabel(QObject::tr("Video Tree remembers last selected position"));
00203 gc->setValue(false);
00204 gc->setHelpText(QObject::tr("If set, the current position in the Video "
00205 "Tree is persistent."));
00206 return gc;
00207 }
00208
00209 HostLineEdit *SearchListingsCommand()
00210 {
00211 HostLineEdit *gc = new HostLineEdit("MovieListCommandLine");
00212 gc->setLabel(QObject::tr("Command to search for movie listings"));
00213 gc->setValue(gContext->GetShareDir() + "mythvideo/scripts/imdb.pl " +
00214 "-M tv=no;video=no");
00215 gc->setHelpText(QObject::tr("This command must be "
00216 "executable by the user running MythVideo."));
00217 return gc;
00218 }
00219
00220 HostLineEdit *GetPostersCommand()
00221 {
00222 HostLineEdit *gc = new HostLineEdit("MoviePosterCommandLine");
00223 gc->setLabel(QObject::tr("Command to search for movie posters"));
00224 gc->setValue(gContext->GetShareDir() + "mythvideo/scripts/imdb.pl -P");
00225 gc->setHelpText(QObject::tr("This command must be "
00226 "executable by the user running MythVideo."));
00227 return gc;
00228 }
00229
00230 HostLineEdit *GetDataCommand()
00231 {
00232 HostLineEdit *gc = new HostLineEdit("MovieDataCommandLine");
00233 gc->setLabel(QObject::tr("Command to extract data for movies"));
00234 gc->setValue(gContext->GetShareDir() + "mythvideo/scripts/imdb.pl -D");
00235 gc->setHelpText(QObject::tr("This command must be "
00236 "executable by the user running MythVideo."));
00237 return gc;
00238 }
00239
00240 HostLineEdit *VideoStartupDirectory()
00241 {
00242 HostLineEdit *gc = new HostLineEdit("VideoStartupDir");
00243 gc->setLabel(QObject::tr("Directories that hold videos"));
00244 gc->setValue(DEFAULT_VIDEOSTARTUP_DIR);
00245 gc->setHelpText(QObject::tr("Multiple directories can be separated by ':'. "
00246 "Each directory must exist and be readable by the user "
00247 "running MythVideo."));
00248 return gc;
00249 }
00250
00251 HostLineEdit *VideoArtworkDirectory()
00252 {
00253 HostLineEdit *gc = new HostLineEdit("VideoArtworkDir");
00254 gc->setLabel(QObject::tr("Directory that holds movie posters"));
00255 gc->setValue(MythContext::GetConfDir() + "/MythVideo");
00256 gc->setHelpText(QObject::tr("This directory must exist, and the user "
00257 "running MythVideo needs to have read/write permission "
00258 "to the directory."));
00259 return gc;
00260 }
00261
00262
00263
00264 HostLineEdit *VideoDefaultPlayer()
00265 {
00266 HostLineEdit *gc = new HostLineEdit("VideoDefaultPlayer");
00267 gc->setLabel(QObject::tr("Default Video Player"));
00268 gc->setValue("mplayer -fs -zoom -quiet -vo xv %s");
00269 gc->setHelpText(QObject::tr("This is the command used for any file "
00270 "that the extension is not specifically defined. "
00271 "You may also enter the name of one of the playback "
00272 "plugins such as 'Internal'."));
00273 return gc;
00274 }
00275
00276 HostSpinBox *VideoGalleryRows()
00277 {
00278 HostSpinBox *gc = new HostSpinBox("VideoGalleryRowsPerPage", 2, 5, 1);
00279 gc->setLabel(QObject::tr("Rows to display"));
00280 gc->setValue(3);
00281 return gc;
00282 }
00283
00284 HostSpinBox *VideoGalleryColumns()
00285 {
00286 HostSpinBox *gc = new HostSpinBox("VideoGalleryColsPerPage", 2, 6, 1);
00287 gc->setLabel(QObject::tr("Columns to display"));
00288 gc->setValue(4);
00289 return gc;
00290 }
00291
00292 HostCheckBox *VideoGallerySubtitle()
00293 {
00294 HostCheckBox *gc = new HostCheckBox("VideoGallerySubtitle");
00295 gc->setLabel(QObject::tr("Show title below thumbnails"));
00296 gc->setValue(true);
00297 gc->setHelpText(QObject::tr("If set, the additional text will make the "
00298 "thumbnails smaller."));
00299 return gc;
00300 }
00301
00305
00306
00307
00308 HostLineEdit *SetVCDDevice()
00309 {
00310 HostLineEdit *gc = new HostLineEdit("VCDDeviceLocation");
00311 gc->setLabel(QObject::tr("Location of VCD device"));
00312 gc->setValue("default");
00313 gc->setHelpText(QObject::tr("This device must exist, and the user "
00314 "running MythDVD needs to have read permission "
00315 "on the device.")
00316 + QObject::tr(" 'default' will let the "
00317 "MediaMonitor choose a device."));
00318 return gc;
00319 }
00320
00321 HostLineEdit *SetDVDDevice()
00322 {
00323 HostLineEdit *gc = new HostLineEdit("DVDDeviceLocation");
00324 gc->setLabel(QObject::tr("Location of DVD device"));
00325 gc->setValue("default");
00326 gc->setHelpText(QObject::tr("This device must exist, and the user "
00327 "running MythDVD needs to have read permission "
00328 "on the device.")
00329 + QObject::tr(" 'default' will let the "
00330 "MediaMonitor choose a device."));
00331 return gc;
00332 }
00333
00334 HostComboBox *SetOnInsertDVD()
00335 {
00336 HostComboBox *gc = new HostComboBox("DVDOnInsertDVD");
00337 gc->setLabel(QObject::tr("On DVD insertion"));
00338 gc->addSelection(QObject::tr("Display mythdvd menu"),"1");
00339 gc->addSelection(QObject::tr("Do nothing"),"0");
00340 gc->addSelection(QObject::tr("Play DVD"),"2");
00341 gc->addSelection(QObject::tr("Rip DVD"),"3");
00342 gc->setHelpText(QObject::tr("Media Monitoring should be turned on to "
00343 "allow this feature (Setup -> General -> CD/DVD Monitor"));
00344 return gc;
00345 }
00346
00347 HostSlider *DVDBookmarkDays()
00348 {
00349 HostSlider *gs = new HostSlider("DVDBookmarkDays",5, 50, 5);
00350 gs->setLabel(QObject::tr("Remove DVD Bookmarks Older then (days)"));
00351 gs->setValue(10);
00352 gs->setHelpText((QObject::tr("Delete DVD Bookmarks that are older then the "
00353 "Number of days specified")));
00354 return gs;
00355 }
00356
00357 HostSlider *SetDVDDriveSpeed()
00358 {
00359 HostSlider *gs = new HostSlider("DVDDriveSpeed", 2, 12, 2);
00360 gs->setLabel(QObject::tr("DVD Drive Speed"));
00361 gs->setValue(2);
00362 gs->setHelpText(QObject::tr("Set DVD Drive Speed during DVD Playback. "
00363 "Speed is in multiples of 177KB/s"));
00364 return gs;
00365 }
00366
00367 HostCheckBox *EnableDVDBookmark()
00368 {
00369 HostCheckBox *gc = new HostCheckBox("EnableDVDBookmark");
00370 gc->setLabel(QObject::tr("Enable DVD Bookmark Support"));
00371 gc->setValue(false);
00372 gc->setHelpText(QObject::tr("Enable DVD Bookmark Support"));
00373 return gc;
00374 }
00375
00376 HostCheckBox *DVDBookmarkPrompt()
00377 {
00378 HostCheckBox *gc = new HostCheckBox("DVDBookmarkPrompt");
00379 gc->setLabel(QObject::tr("DVD Bookmark Prompt"));
00380 gc->setValue(false);
00381 gc->setHelpText(QObject::tr("Display a prompt to choose whether "
00382 "to play the DVD from the beginning or from the bookmark"));
00383 return gc;
00384 }
00385
00386 class DVDBookmarkSettings : public TriggeredConfigurationGroup
00387 {
00388 public:
00389 DVDBookmarkSettings():
00390 TriggeredConfigurationGroup(false, false, true, true)
00391 {
00392 Setting *dvdbookmarkSettings = EnableDVDBookmark();
00393 addChild(dvdbookmarkSettings);
00394 setTrigger(dvdbookmarkSettings);
00395
00396 ConfigurationGroup *settings =
00397 new VerticalConfigurationGroup(false);
00398 settings->addChild(DVDBookmarkPrompt());
00399 settings->addChild(DVDBookmarkDays());
00400 addTarget("1", settings);
00401 addTarget("0", new VerticalConfigurationGroup(true));
00402 }
00403 };
00404
00405
00406
00407 HostLineEdit *PlayerCommand()
00408 {
00409 HostLineEdit *gc = new HostLineEdit("mythdvd.DVDPlayerCommand");
00410 gc->setLabel(QObject::tr("DVD Player Command"));
00411
00412 gc->setValue("Internal");
00413 gc->setHelpText(QObject::tr("This can be any command to launch a DVD "
00414 " player (e.g. MPlayer, ogle, etc.). If present, %d will "
00415 "be substituted for the DVD device (e.g. /dev/dvd)."));
00416 return gc;
00417 }
00418
00419 HostLineEdit *VCDPlayerCommand()
00420 {
00421 HostLineEdit *gc = new HostLineEdit("VCDPlayerCommand");
00422 gc->setLabel(QObject::tr("VCD Player Command"));
00423 gc->setValue("mplayer vcd:// -cdrom-device %d -fs -zoom -vo xv");
00424 gc->setHelpText(QObject::tr("This can be any command to launch a VCD "
00425 "player (e.g. MPlayer, xine, etc.). If present, %d will "
00426 "be substituted for the VCD device (e.g. /dev/cdrom)."));
00427 return gc;
00428 }
00429
00430
00431
00432 HostLineEdit *SetRipDirectory()
00433 {
00434 HostLineEdit *gc = new HostLineEdit("DVDRipLocation");
00435 gc->setLabel(QObject::tr("Directory to hold temporary files"));
00436 #ifdef Q_WS_MACX
00437 gc->setValue(QDir::homeDirPath() + "/Library/Application Support");
00438 #else
00439 gc->setValue("/var/lib/mythdvd/temp");
00440 #endif
00441 gc->setHelpText(QObject::tr("This directory must exist, and the user "
00442 "running MythDVD needs to have write permission "
00443 "to the directory."));
00444 return gc;
00445 }
00446
00447 HostLineEdit *TitlePlayCommand()
00448 {
00449 HostLineEdit *gc = new HostLineEdit("TitlePlayCommand");
00450 gc->setLabel(QObject::tr("Title Playing Command"));
00451 gc->setValue("mplayer dvd://%t -dvd-device %d -fs -zoom -vo xv -aid %a "
00452 "-channels %c");
00453 gc->setHelpText(QObject::tr("This is a command used to preview a given "
00454 "title on a DVD. If present %t will be set "
00455 "to the title, %d for device, %a for audio "
00456 "track, %c for audio channels."));
00457 return gc;
00458 }
00459
00460 HostLineEdit *SubTitleCommand()
00461 {
00462 HostLineEdit *gc = new HostLineEdit("SubTitleCommand");
00463 gc->setLabel(QObject::tr("Subtitle arguments:"));
00464 gc->setValue("-sid %s");
00465 gc->setHelpText(QObject::tr("If you choose any subtitles for ripping, this "
00466 "command is added to the end of the Title Play "
00467 "Command to allow previewing of subtitles. If "
00468 "present %s will be set to the subtitle track. "));
00469 return gc;
00470 }
00471
00472 HostLineEdit *TranscodeCommand()
00473 {
00474 HostLineEdit *gc = new HostLineEdit("TranscodeCommand");
00475 gc->setLabel(QObject::tr("Base transcode command"));
00476 gc->setValue("transcode");
00477 gc->setHelpText(QObject::tr("This is the base (without arguments) command "
00478 "to run transcode on your system."));
00479 return gc;
00480 }
00481
00482 HostSpinBox *MTDPortNumber()
00483 {
00484 HostSpinBox *gc = new HostSpinBox("MTDPort", 1024, 65535, 1);
00485 gc->setLabel(QObject::tr("MTD port number"));
00486 gc->setValue(2442);
00487 gc->setHelpText(QObject::tr("The port number that should be used for "
00488 "communicating with the MTD (Myth Transcoding "
00489 "Daemon)"));
00490 return gc;
00491 }
00492
00493 HostCheckBox *MTDLogFlag()
00494 {
00495 HostCheckBox *gc = new HostCheckBox("MTDLogFlag");
00496 gc->setLabel(QObject::tr("MTD logs to terminal window"));
00497 gc->setValue(false);
00498 gc->setHelpText(QObject::tr("If set, the MTD (Myth Transcoding Daemon) "
00499 "will log to the window it is started from. "
00500 "Otherwise, it will write to a file called "
00501 "mtd.log in the top level ripping directory."));
00502 return gc;
00503 }
00504
00505 HostCheckBox *MTDac3Flag()
00506 {
00507 HostCheckBox *gc = new HostCheckBox("MTDac3Flag");
00508 gc->setLabel(QObject::tr("Transcode AC3 Audio"));
00509 gc->setValue(false);
00510 gc->setHelpText(QObject::tr("If set, the MTD (Myth Transcoding Daemon) "
00511 "will, by default, preserve AC3 (Dolby "
00512 "Digital) audio in transcoded files. "));
00513 return gc;
00514 }
00515
00516 HostCheckBox *MTDxvidFlag()
00517 {
00518 HostCheckBox *gc = new HostCheckBox("MTDxvidFlag");
00519 gc->setLabel(QObject::tr("Use xvid rather than divx"));
00520 gc->setValue(true);
00521 gc->setHelpText(QObject::tr("If set, mythdvd will use the (open, free) "
00522 "xvid codec rather than divx whenever "
00523 "possible."));
00524 return gc;
00525 }
00526
00527 HostCheckBox *MTDTrustTranscodeFRDetect()
00528 {
00529 HostCheckBox *gc = new HostCheckBox("mythvideo.TrustTranscodeFRDetect");
00530 gc->setLabel(QObject::tr("Let transcode determine frame rate"));
00531 gc->setValue(true);
00532 gc->setHelpText(QObject::tr("If set, transcode will determine the frame "
00533 "rate automatically. If not set, 23.976 is "
00534 "assumed."));
00535 return gc;
00536 }
00537
00538 HostSpinBox *MTDNiceLevel()
00539 {
00540 HostSpinBox *gc = new HostSpinBox("MTDNiceLevel", 0, 20, 1);
00541 gc->setLabel(QObject::tr("Nice level for MTD"));
00542 gc->setValue(20);
00543 gc->setHelpText(QObject::tr("This determines the priority of the Myth "
00544 "Transcoding Daemon. Higher numbers mean "
00545 "lower priority (more CPU to other tasks)."));
00546 return gc;
00547 }
00548
00549 HostSpinBox *MTDConcurrentTranscodes()
00550 {
00551 HostSpinBox *gc = new HostSpinBox("MTDConcurrentTranscodes", 1, 99, 1);
00552 gc->setLabel(QObject::tr("Simultaneous Transcode Jobs"));
00553 gc->setValue(1);
00554 gc->setHelpText(QObject::tr("This determines the number of simultaneous "
00555 "transcode jobs. If set at 1 (the default), "
00556 "there will only be one active job at a time."));
00557 return gc;
00558 }
00559
00560 HostSpinBox *MTDRipSize()
00561 {
00562 HostSpinBox *gc = new HostSpinBox("MTDRipSize", 0, 4096, 1);
00563 gc->setLabel(QObject::tr("Ripped video segments"));
00564 gc->setValue(0);
00565 gc->setHelpText(QObject::tr("If set to something other than 0, ripped "
00566 "video titles will be broken up into files "
00567 "of this size (in MB). Applies to both perfect "
00568 "quality recordings and intermediate files "
00569 "used for transcoding."));
00570 return gc;
00571 }
00572
00573 struct ConfigPage
00574 {
00575 typedef std::vector<ConfigurationGroup *> PageList;
00576
00577 protected:
00578 ConfigPage(PageList &pl) : m_pl(pl)
00579 {
00580 }
00581
00582 void Add(ConfigurationGroup *page)
00583 {
00584 m_pl.push_back(page);
00585 }
00586
00587 private:
00588 ConfigPage(const ConfigPage &);
00589 ConfigPage &operator=(const ConfigPage &);
00590
00591 private:
00592 PageList &m_pl;
00593 };
00594
00595 struct VConfigPage : public ConfigPage
00596 {
00597 VConfigPage(PageList &pl, bool luselabel = true, bool luseframe = true,
00598 bool lzeroMargin = false, bool lzeroSpace = false) :
00599 ConfigPage(pl)
00600 {
00601 m_vc_page = new VerticalConfigurationGroup(luselabel, luseframe,
00602 lzeroMargin, lzeroSpace);
00603 Add(m_vc_page);
00604 }
00605
00606 VerticalConfigurationGroup *operator->()
00607 {
00608 return m_vc_page;
00609 }
00610
00611 private:
00612 VerticalConfigurationGroup *m_vc_page;
00613 };
00614
00615 class RatingsToPL : public TriggeredConfigurationGroup
00616 {
00617 public:
00618 RatingsToPL() : TriggeredConfigurationGroup(false)
00619 {
00620 HostCheckBox *r2pl =
00621 new HostCheckBox("mythvideo.ParentalLevelFromRating");
00622 r2pl->setLabel(QObject::tr("Enable automatic Parental Level from "
00623 "rating"));
00624 r2pl->setValue(false);
00625 r2pl->setHelpText(QObject::tr("If enabled, searches will automatically "
00626 "set the Parental Level to the one "
00627 "matching the rating below."));
00628 addChild(r2pl);
00629 setTrigger(r2pl);
00630
00631 typedef std::map<ParentalLevel::Level, QString> r2pl_map;
00632 r2pl_map r2pl_defaults;
00633 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLowest,
00634 tr("G", "PL 1 default search string.")));
00635 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plLow,
00636 tr("PG", "PL 2 default search string.")));
00637 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plMedium,
00638 tr("PG-13", "PL3 default search string.")));
00639 r2pl_defaults.insert(r2pl_map::value_type(ParentalLevel::plHigh,
00640 tr("R:NC-17", "PL4 default search string.")));
00641
00642 VerticalConfigurationGroup *vcg = new VerticalConfigurationGroup(true);
00643
00644 for (ParentalLevel pl(ParentalLevel::plLowest);
00645 pl.GetLevel() <= ParentalLevel::plHigh && pl.good(); ++pl)
00646 {
00647 HostLineEdit *hle = new HostLineEdit(QString("mythvideo.AutoR2PL%1")
00648 .arg(pl.GetLevel()));
00649 hle->setLabel(QObject::tr("Level %1").arg(pl.GetLevel()));
00650 hle->setHelpText(QObject::tr("Ratings containing these strings "
00651 "(separated by :) will be assigned "
00652 "to Parental Level %1.")
00653 .arg(pl.GetLevel()));
00654
00655 r2pl_map::const_iterator def_setting =
00656 r2pl_defaults.find(pl.GetLevel());
00657 if (def_setting != r2pl_defaults.end())
00658 {
00659 hle->setValue(def_setting->second);
00660 }
00661
00662 vcg->addChild(hle);
00663 }
00664
00665 addTarget("0", new VerticalConfigurationGroup(true));
00666 addTarget("1", vcg);
00667
00668 }
00669 };
00670
00671
00672 }
00673
00674 VideoGeneralSettings::VideoGeneralSettings()
00675 {
00676 ConfigPage::PageList pages;
00677
00678 VConfigPage page1(pages, false);
00679 page1->addChild(VideoStartupDirectory());
00680 page1->addChild(VideoArtworkDirectory());
00681 page1->addChild(VideoDefaultView());
00682
00683 VConfigPage page2(pages, false);
00684 page2->addChild(VideoListUnknownFiletypes());
00685 page2->addChild(VideoBrowserNoDB());
00686 page2->addChild(VideoGalleryNoDB());
00687 page2->addChild(VideoTreeNoDB());
00688 page2->addChild(VideoTreeNoMetaData());
00689 page2->addChild(VideoNewBrowsable());
00690 page2->addChild(VideoSortIgnoresCase());
00691 page2->addChild(VideoDBFolderView());
00692 page2->addChild(VideoTreeRemeber());
00693 page2->addChild(VideoImageCacheSize());
00694
00695 VConfigPage page3(pages, false);
00696 page3->addChild(SetDVDDevice());
00697 page3->addChild(SetVCDDevice());
00698 page3->addChild(SetOnInsertDVD());
00699 page3->addChild(SetDVDDriveSpeed());
00700 page3->addChild(new DVDBookmarkSettings());
00701
00702
00703 VerticalConfigurationGroup *vman =
00704 new VerticalConfigurationGroup(true, false);
00705 vman->setLabel(QObject::tr("Video Manager"));
00706 vman->addChild(SearchListingsCommand());
00707 vman->addChild(GetPostersCommand());
00708 vman->addChild(GetDataCommand());
00709
00710 VConfigPage page4(pages, false);
00711 page4->addChild(vman);
00712
00713
00714 VerticalConfigurationGroup *vgal =
00715 new VerticalConfigurationGroup(true, false);
00716 vgal->setLabel(QObject::tr("Video Gallery"));
00717 vgal->addChild(VideoGalleryColumns());
00718 vgal->addChild(VideoGalleryRows());
00719 vgal->addChild(VideoGallerySubtitle());
00720 VConfigPage page5(pages, false);
00721 page5->addChild(vgal);
00722
00723
00724 VerticalConfigurationGroup *pctrl =
00725 new VerticalConfigurationGroup(true, false);
00726 pctrl->addChild(VideoDefaultParentalLevel());
00727 pctrl->addChild(VideoAdminPassword());
00728 pctrl->addChild(VideoAdminPasswordThree());
00729 pctrl->addChild(VideoAdminPasswordTwo());
00730 pctrl->addChild(VideoAggressivePC());
00731 VConfigPage page6(pages, false);
00732 page6->addChild(pctrl);
00733
00734 VConfigPage page7(pages, false);
00735 page7->addChild(new RatingsToPL());
00736
00737 int page_num = 1;
00738 for (ConfigPage::PageList::const_iterator p = pages.begin();
00739 p != pages.end(); ++p, ++page_num)
00740 {
00741 (*p)->setLabel(QObject::tr("General Settings (%1/%2)").arg(page_num)
00742 .arg(pages.size()));
00743 addChild(*p);
00744 }
00745 }
00746
00747 VideoPlayerSettings::VideoPlayerSettings()
00748 {
00749 VerticalConfigurationGroup *videoplayersettings =
00750 new VerticalConfigurationGroup(false);
00751 videoplayersettings->setLabel(QObject::tr("Player Settings"));
00752 videoplayersettings->addChild(VideoDefaultPlayer());
00753 videoplayersettings->addChild(PlayerCommand());
00754 videoplayersettings->addChild(VCDPlayerCommand());
00755 addChild(videoplayersettings);
00756 }
00757
00758 DVDRipperSettings::DVDRipperSettings()
00759 {
00760 VerticalConfigurationGroup *rippersettings =
00761 new VerticalConfigurationGroup(false);
00762 rippersettings->setLabel(QObject::tr("DVD Ripper Settings"));
00763 rippersettings->addChild(SetRipDirectory());
00764 rippersettings->addChild(TitlePlayCommand());
00765 rippersettings->addChild(SubTitleCommand());
00766 rippersettings->addChild(TranscodeCommand());
00767 addChild(rippersettings);
00768
00769 VerticalConfigurationGroup *mtdsettings =
00770 new VerticalConfigurationGroup(false);
00771 mtdsettings->setLabel(QObject::tr("MTD Settings"));
00772 mtdsettings->addChild(MTDPortNumber());
00773 mtdsettings->addChild(MTDNiceLevel());
00774 mtdsettings->addChild(MTDConcurrentTranscodes());
00775 mtdsettings->addChild(MTDRipSize());
00776 mtdsettings->addChild(MTDLogFlag());
00777 mtdsettings->addChild(MTDac3Flag());
00778 mtdsettings->addChild(MTDxvidFlag());
00779 mtdsettings->addChild(MTDTrustTranscodeFRDetect());
00780 addChild(mtdsettings);
00781 }