Ticket #7800: mythvideo-mythui-settings.patch
File mythvideo-mythui-settings.patch, 66.3 KB (added by , 16 years ago) |
---|
-
mythvideo/mythvideo/main.cpp
12 12 #include <mythtv/libmythui/mythdialogbox.h> 13 13 14 14 #include "videodlg.h" 15 #include "globalsettings.h"16 15 #include "fileassoc.h" 17 16 #include "playersettings.h" 18 17 #include "metadatasettings.h" 18 #include "importsettings.h" 19 #include "generalsettings.h" 20 #include "dvdsettings.h" 21 #include "parentalsettings.h" 22 #include "mtdsettings.h" 19 23 #include "dbcheck.h" 20 24 #include "cleanup.h" 21 25 #include "globals.h" … … 400 404 401 405 if (passwordValid) 402 406 { 403 VideoGeneralSettings settings; 404 settings.exec(); 407 VERBOSE(VB_IMPORTANT, "Pwd valid, Loading Parental"); 408 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 409 ParentalSettings *ps = new ParentalSettings(mainStack, "parental settings"); 410 411 if (ps->Create()) 412 mainStack->AddScreen(ps); 405 413 } 406 414 else 407 415 { … … 432 440 runScreen(VideoDialog::DLG_TREE); 433 441 else if (sel == "gallery") 434 442 runScreen(VideoDialog::DLG_GALLERY); 435 else if (sel == "settings_general")436 {437 RunSettingsCompletion::Create(gContext->438 GetNumSetting("VideoAggressivePC", 0));439 }440 443 else if (sel == "settings_player") 441 444 { 442 445 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 443 444 446 PlayerSettings *ps = new PlayerSettings(mainStack, "player settings"); 445 447 446 448 if (ps->Create()) … … 449 451 else if (sel == "settings_metadata") 450 452 { 451 453 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 452 453 454 MetadataSettings *ms = new MetadataSettings(mainStack, "metadata settings"); 454 455 455 456 if (ms->Create()) … … 458 459 else if (sel == "settings_associations") 459 460 { 460 461 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 461 462 462 FileAssocDialog *fa = new FileAssocDialog(mainStack, "fa dialog"); 463 463 464 464 if (fa->Create()) 465 465 mainStack->AddScreen(fa); 466 466 } 467 else if (sel == "settings_general") 468 { 469 VERBOSE(VB_IMPORTANT, "Loading General"); 470 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 471 GeneralSettings *gs = new GeneralSettings(mainStack, "general settings"); 472 473 if (gs->Create()) 474 mainStack->AddScreen(gs); 475 } 476 else if (sel == "settings_dvd") 477 { 478 VERBOSE(VB_IMPORTANT, "Loading DVD"); 479 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 480 DvdSettings *ds = new DvdSettings(mainStack, "dvd settings"); 481 482 if (ds->Create()) 483 mainStack->AddScreen(ds); 484 } 485 else if (sel == "settings_parental") 486 { 487 VERBOSE(VB_IMPORTANT, "Loading Parental"); 488 RunSettingsCompletion::Create(gContext->GetNumSetting("VideoAggressivePC", 0)); 489 } 490 else if (sel == "settings_import") 491 { 492 VERBOSE(VB_IMPORTANT, "Loading Import"); 493 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 494 ImportSettings *is = new ImportSettings(mainStack, "import settings"); 495 496 if (is->Create()) 497 mainStack->AddScreen(is); 498 } 499 else if (sel == "settings_mtd") 500 { 501 VERBOSE(VB_IMPORTANT, "Loading MTD"); 502 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 503 MtdSettings *ms = new MtdSettings(mainStack, "mtd settings"); 504 505 if (ms->Create()) 506 mainStack->AddScreen(ms); 507 } 467 508 else if (sel == "dvd_play") 468 509 { 469 510 playDVD(); … … 476 517 { 477 518 startDVDRipper(); 478 519 } 479 else if (sel == "dvd_settings_rip")480 {481 DVDRipperSettings settings;482 settings.exec();483 }484 520 } 485 521 486 522 int runMenu(const QString &menuname) … … 532 568 return -1; 533 569 } 534 570 535 VideoGeneralSettings general;536 general.Load();537 general.Save();538 539 DVDRipperSettings rsettings;540 rsettings.Load();541 rsettings.Save();542 543 571 setupKeys(); 544 572 545 573 return 0; -
mythvideo/mythvideo/dvdsettings.cpp
1 using namespace std; 2 3 // Qt 4 #include <QString> 5 6 // MythTV 7 #include <mythcontext.h> 8 #include <mythdbcon.h> 9 #include <mythdirs.h> 10 11 #include "dvdsettings.h" 12 13 DvdSettings::DvdSettings(MythScreenStack *parent, const char *name) 14 : MythScreenType(parent, name), 15 m_dvdOnInsertDVD(NULL), 16 m_dvdDriveSpeed(NULL), 17 m_enableDVDBookmark(NULL), 18 m_dvdBookmarkPrompt(NULL), 19 m_dvdBookmarkDays(NULL), 20 m_helpText(NULL), 21 m_saveButton(NULL), 22 m_cancelButton(NULL) 23 { 24 } 25 26 DvdSettings::~DvdSettings() 27 { 28 29 } 30 31 bool DvdSettings::Create() 32 { 33 bool foundtheme = false; 34 35 // Load the theme for this screen 36 foundtheme = LoadWindowFromXML("video-ui.xml", "dvdsettings", this); 37 38 if (!foundtheme) 39 return false; 40 41 m_dvdOnInsertDVD = dynamic_cast<MythUIButtonList *> (GetChild("dvdoninsertdvd")); 42 m_dvdDriveSpeed = dynamic_cast<MythUISpinBox *> (GetChild("dvddrivespeed")); 43 m_enableDVDBookmark = dynamic_cast<MythUICheckBox *> (GetChild("enabledvdbookmark")); 44 m_dvdBookmarkPrompt = dynamic_cast<MythUICheckBox *> (GetChild("dvdbookmarkprompt")); 45 m_dvdBookmarkDays = dynamic_cast<MythUISpinBox *> (GetChild("dvdbookmarkdays")); 46 47 m_helpText = dynamic_cast<MythUIText *> (GetChild("helptext")); 48 m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save")); 49 m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel")); 50 51 if (!m_dvdOnInsertDVD || !m_dvdDriveSpeed || !m_enableDVDBookmark || 52 !m_dvdBookmarkPrompt || !m_dvdBookmarkDays || 53 !m_saveButton || !m_cancelButton) 54 { 55 VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements."); 56 return false; 57 } 58 59 new MythUIButtonListItem(m_dvdOnInsertDVD, tr("Do nothing"), qVariantFromValue(0)); 60 new MythUIButtonListItem(m_dvdOnInsertDVD, tr("Show DVD Menu"), qVariantFromValue(1)); 61 new MythUIButtonListItem(m_dvdOnInsertDVD, tr("Play DVD"), qVariantFromValue(2)); 62 new MythUIButtonListItem(m_dvdOnInsertDVD, tr("Rip DVD"), qVariantFromValue(3)); 63 m_dvdOnInsertDVD->SetValueByData(gContext->GetSetting("DVDOnInsertDVD")); 64 65 m_dvdDriveSpeed->SetRange(2, 12, 2); 66 m_dvdDriveSpeed->SetValue(gContext->GetSetting("DVDDriveSpeed")); 67 68 int loadEnableDVDBookmark = gContext->GetNumSetting("EnableDVDBookmark", 0); 69 if (loadEnableDVDBookmark == 1) 70 m_enableDVDBookmark->SetCheckState(MythUIStateType::Full); 71 72 int loadDvdBookmarkPrompt = gContext->GetNumSetting("DVDBookmarkPrompt", 0); 73 if (loadDvdBookmarkPrompt == 1) 74 m_dvdBookmarkPrompt->SetCheckState(MythUIStateType::Full); 75 76 m_dvdBookmarkDays->SetRange(5, 50, 5); 77 m_dvdBookmarkDays->SetValue(gContext->GetSetting("DVDBookmarkDays")); 78 79 toggleUseDVD(); 80 81 connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(slotSave())); 82 connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); 83 connect(m_dvdOnInsertDVD, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 84 connect(m_dvdDriveSpeed, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 85 connect(m_enableDVDBookmark, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 86 connect(m_dvdBookmarkPrompt, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 87 connect(m_dvdBookmarkDays, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 88 connect(m_enableDVDBookmark, SIGNAL(valueChanged()), SLOT(toggleUseDVD())); 89 90 if (!BuildFocusList()) 91 VERBOSE(VB_IMPORTANT, "Failed to build a focuslist. Something is wrong"); 92 93 SetFocusWidget(m_dvdOnInsertDVD); 94 95 return true; 96 } 97 98 bool DvdSettings::keyPressEvent(QKeyEvent *event) 99 { 100 if (GetFocusWidget()->keyPressEvent(event)) 101 return true; 102 103 bool handled = false; 104 105 if (!handled && MythScreenType::keyPressEvent(event)) 106 handled = true; 107 108 return handled; 109 } 110 111 void DvdSettings::slotSave(void) 112 { 113 gContext->SaveSetting("DVDOnInsertDVD", m_dvdOnInsertDVD->GetDataValue().toString()); 114 gContext->SaveSetting("DVDDriveSpeed", m_dvdBookmarkDays->GetValue()); 115 gContext->SaveSetting("DVDBookmarkDays", m_dvdBookmarkDays->GetValue()); 116 117 int saveEnableDVDBookmark = (m_enableDVDBookmark->GetCheckState() == MythUIStateType::Full) ? 1 : 0; 118 gContext->SaveSetting("EnableDVDBookmark", saveEnableDVDBookmark); 119 120 int saveDvdBookmarkPrompt = (m_dvdBookmarkPrompt->GetCheckState() == MythUIStateType::Full) ? 1 : 0; 121 gContext->SaveSetting("DVDBookmarkPrompt", saveDvdBookmarkPrompt); 122 123 Close(); 124 } 125 126 void DvdSettings::slotFocusChanged(void) 127 { 128 if (!m_helpText) 129 return; 130 131 QString msg = ""; 132 if (GetFocusWidget() == m_dvdOnInsertDVD) 133 msg = tr("Media Monitoring should be turned on to " 134 "allow this feature (Setup -> General -> CD/DVD Monitor)."); 135 else if (GetFocusWidget() == m_dvdDriveSpeed) 136 msg = tr("Set DVD Drive Speed during DVD Playback. " 137 "Speed is in multiples of 177KB/s. " 138 "Slower speeds may reduce drive noise but in " 139 "some cases it causes playback to stutter."); 140 else if (GetFocusWidget() == m_enableDVDBookmark) 141 msg = tr("Enable the setting and skipping to " 142 "of a bookmark in DVD playback."); 143 else if (GetFocusWidget() == m_dvdBookmarkPrompt) 144 msg = tr("Display a prompt to choose whether " 145 "to play the DVD from the beginning or from the bookmark."); 146 else if (GetFocusWidget() == m_dvdBookmarkDays) 147 msg = tr("Delete DVD Bookmarks that are older than the " 148 "number of days specified."); 149 else if (GetFocusWidget() == m_cancelButton) 150 msg = tr("Exit without saving settings"); 151 else if (GetFocusWidget() == m_saveButton) 152 msg = tr("Save settings and Exit"); 153 154 m_helpText->SetText(msg); 155 } 156 157 void DvdSettings::toggleUseDVD(void) 158 { 159 int checked = (m_enableDVDBookmark->GetCheckState() == MythUIStateType::Full) ? true : false; 160 161 m_dvdBookmarkPrompt->SetVisible(checked); 162 m_dvdBookmarkDays->SetVisible(checked); 163 } 164 165 -
mythvideo/mythvideo/dvdsettings.h
1 #ifndef DVDSETTINGS_H 2 #define DVDSETTINGS_H 3 4 #include <mythtv/mythwidgets.h> 5 #include <mythtv/mythdialogs.h> 6 7 #include <libmythui/mythuispinbox.h> 8 #include <libmythui/mythuibutton.h> 9 #include <libmythui/mythuibuttonlist.h> 10 #include <libmythui/mythuicheckbox.h> 11 #include <libmythui/mythscreentype.h> 12 #include <libmythui/mythdialogbox.h> 13 14 15 class DvdSettings : public MythScreenType 16 { 17 Q_OBJECT 18 public: 19 DvdSettings(MythScreenStack *parent, const char *name = 0); 20 ~DvdSettings(); 21 22 bool Create(void); 23 bool keyPressEvent(QKeyEvent *); 24 25 private: 26 MythUIButtonList *m_dvdOnInsertDVD; 27 MythUISpinBox *m_dvdDriveSpeed; 28 MythUICheckBox *m_enableDVDBookmark; 29 MythUICheckBox *m_dvdBookmarkPrompt; 30 MythUISpinBox *m_dvdBookmarkDays; 31 32 MythUIText *m_helpText; 33 MythUIButton *m_saveButton; 34 MythUIButton *m_cancelButton; 35 36 private slots: 37 void slotSave(void); 38 void slotFocusChanged(void); 39 void toggleUseDVD(void); 40 41 }; 42 43 #endif // DVDSETTINGS_H -
mythvideo/mythvideo/fileassoc.cpp
328 328 const QString &lname) : 329 329 MythScreenType(screenParent, lname), m_commandEdit(0), 330 330 m_extensionList(0), m_defaultCheck(0), m_ignoreCheck(0), m_doneButton(0), 331 m_newButton(0), m_deleteButton(0), m_private(new FileAssocDialogPrivate) 331 m_newButton(0), m_deleteButton(0), m_helpText(NULL), 332 m_private(new FileAssocDialogPrivate) 332 333 { 333 334 } 334 335 … … 370 371 SLOT(OnNewExtensionPressed())); 371 372 connect(m_deleteButton, SIGNAL(Clicked()), SLOT(OnDeletePressed())); 372 373 374 connect(m_extensionList, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 375 connect(m_commandEdit, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 376 connect(m_defaultCheck, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 377 connect(m_ignoreCheck, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 378 connect(m_doneButton, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 379 connect(m_newButton, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 380 connect(m_deleteButton, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 381 373 382 UpdateScreen(); 374 383 375 384 if (!BuildFocusList()) 376 385 VERBOSE(VB_IMPORTANT, "Failed to build a focuslist."); 377 386 387 SetFocusWidget(m_extensionList); 388 378 389 return true; 379 390 } 380 391 … … 526 537 527 538 BuildFocusList(); 528 539 } 540 541 void FileAssocDialog::slotFocusChanged(void) 542 { 543 if (!m_helpText) 544 return; 545 546 QString msg = ""; 547 if (GetFocusWidget() == m_extensionList) 548 msg = tr("Select the extension you want to edit."); 549 else if (GetFocusWidget() == m_commandEdit) 550 msg = tr("Command to the player that shall be used to play the video file with the specified extension."); 551 else if (GetFocusWidget() == m_defaultCheck) 552 msg = tr("Use the default player for videos with this file extension."); 553 else if (GetFocusWidget() == m_ignoreCheck) 554 msg = tr("Check to skip playing videos that have this file extension."); 555 else if (GetFocusWidget() == m_doneButton) 556 msg = tr("Save settings and exit "); 557 else if (GetFocusWidget() == m_newButton) 558 msg = tr("Create a new file extension setting"); 559 else if (GetFocusWidget() == m_deleteButton) 560 msg = tr("Delete current file extension setting"); 561 562 m_helpText->SetText(msg); 563 } -
mythvideo/mythvideo/fileassoc.h
36 36 private: 37 37 void UpdateScreen(bool useSelectionOverride = false); 38 38 39 private slots: 40 void slotFocusChanged(void); 41 39 42 private: 40 43 MythUITextEdit *m_commandEdit; 41 44 MythUIButtonList *m_extensionList; … … 44 47 MythUIButton *m_doneButton; 45 48 MythUIButton *m_newButton; 46 49 MythUIButton *m_deleteButton; 50 MythUIText *m_helpText; 47 51 48 52 class FileAssocDialogPrivate *m_private; 49 53 }; -
mythvideo/mythvideo/generalsettings.cpp
1 using namespace std; 2 3 // Qt 4 #include <QString> 5 6 // MythTV 7 #include <mythcontext.h> 8 #include <mythdbcon.h> 9 #include <mythdirs.h> 10 11 #include "generalsettings.h" 12 13 GeneralSettings::GeneralSettings(MythScreenStack *parent, const char *name) 14 : MythScreenType(parent, name), 15 m_videoStartupDir(NULL), 16 m_videoArtworkDir(NULL), 17 m_screenshotDir(NULL), 18 m_bannerDir(NULL), 19 m_fanartDir(NULL), 20 m_trailersDir(NULL), 21 m_helpText(NULL), 22 m_saveButton(NULL), 23 m_cancelButton(NULL) 24 { 25 } 26 27 GeneralSettings::~GeneralSettings() 28 { 29 30 } 31 32 bool GeneralSettings::Create() 33 { 34 bool foundtheme = false; 35 36 // Load the theme for this screen 37 foundtheme = LoadWindowFromXML("video-ui.xml", "generalsettings", this); 38 39 if (!foundtheme) 40 return false; 41 42 m_videoStartupDir = dynamic_cast<MythUITextEdit *> (GetChild("startupdir")); 43 m_videoArtworkDir = dynamic_cast<MythUITextEdit *> (GetChild("artworkdir")); 44 m_screenshotDir = dynamic_cast<MythUITextEdit *> (GetChild("screenshotdir")); 45 m_bannerDir = dynamic_cast<MythUITextEdit *> (GetChild("bannerdir")); 46 m_fanartDir = dynamic_cast<MythUITextEdit *> (GetChild("fanartdir")); 47 m_trailersDir = dynamic_cast<MythUITextEdit *> (GetChild("trailersdir")); 48 49 m_helpText = dynamic_cast<MythUIText *> (GetChild("helptext")); 50 m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save")); 51 m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel")); 52 53 if (!m_videoStartupDir || !m_videoArtworkDir || !m_screenshotDir || 54 !m_bannerDir || !m_fanartDir || !m_trailersDir || 55 !m_saveButton || !m_cancelButton) 56 { 57 VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements."); 58 return false; 59 } 60 61 m_videoStartupDir->SetText(gContext->GetSetting("VideoStartupDir")); 62 m_videoArtworkDir->SetText(gContext->GetSetting("VideoArtworkDir")); 63 m_screenshotDir->SetText(gContext->GetSetting("mythvideo.screenshotDir")); 64 m_bannerDir->SetText(gContext->GetSetting("mythvideo.bannerDir")); 65 m_fanartDir->SetText(gContext->GetSetting("mythvideo.fanartDir")); 66 m_trailersDir->SetText(gContext->GetSetting("mythvideo.TrailersDir")); 67 68 connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(slotSave())); 69 connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); 70 connect(m_videoStartupDir, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 71 connect(m_videoArtworkDir, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 72 connect(m_screenshotDir, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 73 connect(m_bannerDir, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 74 connect(m_fanartDir, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 75 connect(m_trailersDir, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 76 77 if (!BuildFocusList()) 78 VERBOSE(VB_IMPORTANT, "Failed to build a focuslist. Something is wrong"); 79 80 SetFocusWidget(m_videoStartupDir); 81 82 return true; 83 } 84 85 bool GeneralSettings::keyPressEvent(QKeyEvent *event) 86 { 87 if (GetFocusWidget()->keyPressEvent(event)) 88 return true; 89 90 bool handled = false; 91 92 if (!handled && MythScreenType::keyPressEvent(event)) 93 handled = true; 94 95 return handled; 96 } 97 98 void GeneralSettings::slotSave(void) 99 { 100 gContext->SaveSetting("VideoStartupDir", m_videoStartupDir->GetText()); 101 gContext->SaveSetting("VideoArtworkDir", m_videoArtworkDir->GetText()); 102 gContext->SaveSetting("mythvideo.screenshotDir", m_screenshotDir->GetText()); 103 gContext->SaveSetting("mythvideo.bannerDir", m_bannerDir->GetText()); 104 gContext->SaveSetting("mythvideo.fanartDir", m_fanartDir->GetText()); 105 gContext->SaveSetting("mythvideo.TrailersDir", m_trailersDir->GetText()); 106 107 Close(); 108 } 109 110 void GeneralSettings::slotFocusChanged(void) 111 { 112 if (!m_helpText) 113 return; 114 115 QString msg = ""; 116 if (GetFocusWidget() == m_videoStartupDir) 117 msg = tr("Multiple directories can be separated by ':'. " 118 "Each directory must exist and be readable by the user " 119 "running MythVideo."); 120 else if (GetFocusWidget() == m_videoArtworkDir) 121 msg = tr("This directory must exist, and the user " 122 "running MythVideo needs to have read/write permission " 123 "to the directory."); 124 else if (GetFocusWidget() == m_screenshotDir) 125 msg = tr("This directory must exist, and the user " 126 "running MythVideo needs to have read/write permission " 127 "to the directory."); 128 else if (GetFocusWidget() == m_bannerDir) 129 msg = tr("This directory must exist, and the user " 130 "running MythVideo needs to have read/write permission " 131 "to the directory."); 132 else if (GetFocusWidget() == m_fanartDir) 133 msg = tr("This directory must exist, and the user " 134 "running MythVideo needs to have read/write permission " 135 "to the directory."); 136 else if (GetFocusWidget() == m_trailersDir) 137 msg = tr("This directory must exist, and the user " 138 "running MythVideo needs to have read/write permission " 139 "to the directory."); 140 else if (GetFocusWidget() == m_cancelButton) 141 msg = tr("Exit without saving settings"); 142 else if (GetFocusWidget() == m_saveButton) 143 msg = tr("Save settings and Exit"); 144 145 m_helpText->SetText(msg); 146 } 147 -
mythvideo/mythvideo/generalsettings.h
1 #ifndef GENERALSETTINGS_H 2 #define GENERALSETTINGS_H 3 4 #include <mythtv/mythwidgets.h> 5 #include <mythtv/mythdialogs.h> 6 7 #include <libmythui/mythuispinbox.h> 8 #include <libmythui/mythuibutton.h> 9 #include <libmythui/mythuibuttonlist.h> 10 #include <libmythui/mythuicheckbox.h> 11 #include <libmythui/mythscreentype.h> 12 #include <libmythui/mythdialogbox.h> 13 14 15 class GeneralSettings : public MythScreenType 16 { 17 Q_OBJECT 18 public: 19 GeneralSettings(MythScreenStack *parent, const char *name = 0); 20 ~GeneralSettings(); 21 22 bool Create(void); 23 bool keyPressEvent(QKeyEvent *); 24 25 private: 26 MythUITextEdit *m_videoStartupDir; 27 MythUITextEdit *m_videoArtworkDir; 28 MythUITextEdit *m_screenshotDir; 29 MythUITextEdit *m_bannerDir; 30 MythUITextEdit *m_fanartDir; 31 MythUITextEdit *m_trailersDir; 32 33 MythUIText *m_helpText; 34 MythUIButton *m_saveButton; 35 MythUIButton *m_cancelButton; 36 37 private slots: 38 void slotSave(void); 39 void slotFocusChanged(void); 40 41 }; 42 43 #endif // GENERALSETTINGS_H -
mythvideo/mythvideo/importsettings.cpp
1 using namespace std; 2 3 // Qt 4 #include <QString> 5 6 // MythTV 7 #include <mythcontext.h> 8 #include <mythdbcon.h> 9 #include <mythdirs.h> 10 11 #include "importsettings.h" 12 13 ImportSettings::ImportSettings(MythScreenStack *parent, const char *name) 14 : MythScreenType(parent, name), 15 m_dvdRipLocation(NULL), 16 m_titlePlayCommand(NULL), 17 m_subTitleCommand(NULL), 18 m_transcodeCommand(NULL), 19 m_helpText(NULL), 20 m_saveButton(NULL), 21 m_cancelButton(NULL) 22 { 23 } 24 25 ImportSettings::~ImportSettings() 26 { 27 28 } 29 30 bool ImportSettings::Create() 31 { 32 bool foundtheme = false; 33 34 // Load the theme for this screen 35 foundtheme = LoadWindowFromXML("video-ui.xml", "importsettings", this); 36 37 if (!foundtheme) 38 return false; 39 40 m_dvdRipLocation = dynamic_cast<MythUITextEdit *> (GetChild("dvdriplocation")); 41 m_titlePlayCommand = dynamic_cast<MythUITextEdit *> (GetChild("titleplaycommand")); 42 m_subTitleCommand = dynamic_cast<MythUITextEdit *> (GetChild("subtitlecommand")); 43 m_transcodeCommand = dynamic_cast<MythUITextEdit *> (GetChild("transcodecommand")); 44 m_helpText = dynamic_cast<MythUIText *> (GetChild("helptext")); 45 m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save")); 46 m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel")); 47 48 if (!m_dvdRipLocation || !m_titlePlayCommand || 49 !m_subTitleCommand || !m_transcodeCommand || 50 !m_saveButton || !m_cancelButton) 51 { 52 VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements."); 53 return false; 54 } 55 56 m_dvdRipLocation->SetText(gContext->GetSetting("DVDRipLocation")); 57 m_titlePlayCommand->SetText(gContext->GetSetting("TitlePlayCommand")); 58 m_subTitleCommand->SetText(gContext->GetSetting("SubTitleCommand")); 59 m_transcodeCommand->SetText(gContext->GetSetting("TranscodeCommand")); 60 61 connect(m_dvdRipLocation, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 62 connect(m_titlePlayCommand, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 63 connect(m_subTitleCommand, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 64 connect(m_transcodeCommand, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 65 connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(slotSave())); 66 connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); 67 68 if (!BuildFocusList()) 69 VERBOSE(VB_IMPORTANT, "Failed to build a focuslist. Something is wrong"); 70 71 SetFocusWidget(m_dvdRipLocation); 72 73 return true; 74 } 75 76 bool ImportSettings::keyPressEvent(QKeyEvent *event) 77 { 78 if (GetFocusWidget()->keyPressEvent(event)) 79 return true; 80 81 bool handled = false; 82 83 if (!handled && MythScreenType::keyPressEvent(event)) 84 handled = true; 85 86 return handled; 87 } 88 89 void ImportSettings::slotSave(void) 90 { 91 gContext->SaveSetting("DVDRipLocation", m_dvdRipLocation->GetText()); 92 gContext->SaveSetting("TitlePlayCommand", m_titlePlayCommand->GetText()); 93 gContext->SaveSetting("SubTitleCommand", m_subTitleCommand->GetText()); 94 gContext->SaveSetting("TranscodeCommand", m_transcodeCommand->GetText()); 95 96 Close(); 97 } 98 99 void ImportSettings::slotFocusChanged(void) 100 { 101 if (!m_helpText) 102 return; 103 104 QString msg = ""; 105 if (GetFocusWidget() == m_dvdRipLocation) 106 msg = tr("This directory must exist, and the user " 107 "running MythDVD needs to have write permission " 108 "to the directory."); 109 else if (GetFocusWidget() == m_titlePlayCommand) 110 msg = tr("This is a command used to preview a given " 111 "title on a DVD. If present %t will be set " 112 "to the title, %d for device, %a for audio " 113 "track, %c for audio channels."); 114 else if (GetFocusWidget() == m_subTitleCommand) 115 msg = tr("If you choose any subtitles for ripping, this " 116 "command is added to the end of the Title Play " 117 "Command to allow previewing of subtitles. If " 118 "present %s will be set to the subtitle track."); 119 else if (GetFocusWidget() == m_transcodeCommand) 120 msg = tr("This is the base (without arguments) command " 121 "to run transcode on your system."); 122 else if (GetFocusWidget() == m_cancelButton) 123 msg = tr("Exit without saving settings"); 124 else if (GetFocusWidget() == m_saveButton) 125 msg = tr("Save settings and Exit"); 126 127 m_helpText->SetText(msg); 128 } 129 -
mythvideo/mythvideo/importsettings.h
1 #ifndef IMPORTSETTINGS_H 2 #define IMPORTSETTINGS_H 3 4 #include <mythtv/mythwidgets.h> 5 #include <mythtv/mythdialogs.h> 6 7 #include <libmythui/mythuispinbox.h> 8 #include <libmythui/mythuibutton.h> 9 #include <libmythui/mythuibuttonlist.h> 10 #include <libmythui/mythuicheckbox.h> 11 #include <libmythui/mythscreentype.h> 12 #include <libmythui/mythdialogbox.h> 13 14 15 class ImportSettings : public MythScreenType 16 { 17 Q_OBJECT 18 public: 19 ImportSettings(MythScreenStack *parent, const char *name = 0); 20 ~ImportSettings(); 21 22 bool Create(void); 23 bool keyPressEvent(QKeyEvent *); 24 25 private: 26 MythUITextEdit *m_dvdRipLocation; 27 MythUITextEdit *m_titlePlayCommand; 28 MythUITextEdit *m_subTitleCommand; 29 MythUITextEdit *m_transcodeCommand; 30 MythUIText *m_helpText; 31 MythUIButton *m_saveButton; 32 MythUIButton *m_cancelButton; 33 34 private slots: 35 void slotSave(void); 36 void slotFocusChanged(void); 37 38 }; 39 40 #endif // IMPORTSETTINGS_H -
mythvideo/mythvideo/mtdsettings.cpp
1 using namespace std; 2 3 // Qt 4 #include <QString> 5 6 // MythTV 7 #include <mythcontext.h> 8 #include <mythdbcon.h> 9 #include <mythdirs.h> 10 11 #include "mtdsettings.h" 12 13 MtdSettings::MtdSettings(MythScreenStack *parent, const char *name) 14 : MythScreenType(parent, name), 15 m_mtdPort(NULL), 16 m_mtdNiceLevel(NULL), 17 m_mtdConcurrentTranscodes(NULL), 18 m_mtdRipSize(NULL), 19 m_mtdConsoleLog(NULL), 20 m_mtdKeepAc3(NULL), 21 m_mtdPreferXvid(NULL), 22 m_mtdFrDetect(NULL), 23 m_helpText(NULL), 24 m_saveButton(NULL), 25 m_cancelButton(NULL) 26 { 27 } 28 29 MtdSettings::~MtdSettings() 30 { 31 32 } 33 34 bool MtdSettings::Create() 35 { 36 bool foundtheme = false; 37 38 // Load the theme for this screen 39 foundtheme = LoadWindowFromXML("video-ui.xml", "mtdsettings", this); 40 41 if (!foundtheme) 42 return false; 43 44 m_mtdPort = dynamic_cast<MythUISpinBox *> (GetChild("mtdport")); 45 m_mtdNiceLevel = dynamic_cast<MythUISpinBox *> (GetChild("mtdnicelevel")); 46 m_mtdConcurrentTranscodes = dynamic_cast<MythUISpinBox *> (GetChild("mtdconcurrenttranscodes")); 47 m_mtdRipSize = dynamic_cast<MythUISpinBox *> (GetChild("mtdripsize")); 48 m_mtdConsoleLog = dynamic_cast<MythUICheckBox *> (GetChild("mtdconsolelog")); 49 m_mtdKeepAc3 = dynamic_cast<MythUICheckBox *> (GetChild("mtdkeepac3")); 50 m_mtdPreferXvid = dynamic_cast<MythUICheckBox *> (GetChild("mtdpreferxvid")); 51 m_mtdFrDetect = dynamic_cast<MythUICheckBox *> (GetChild("mtdfrdetect")); 52 53 m_helpText = dynamic_cast<MythUIText *> (GetChild("helptext")); 54 m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save")); 55 m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel")); 56 57 if (!m_mtdPort || !m_mtdNiceLevel || 58 !m_mtdConcurrentTranscodes || !m_mtdRipSize || 59 !m_mtdConsoleLog || !m_mtdKeepAc3 || 60 !m_mtdPreferXvid || !m_mtdFrDetect || 61 !m_saveButton || !m_cancelButton) 62 { 63 VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements."); 64 return false; 65 } 66 67 m_mtdPort->SetRange(1024, 65535, 1); 68 m_mtdPort->SetValue(gContext->GetNumSetting("MTDPort")); 69 70 m_mtdNiceLevel->SetRange(0, 20, 1); 71 m_mtdNiceLevel->SetValue(gContext->GetNumSetting("MTDNiceLevel")); 72 73 m_mtdConcurrentTranscodes->SetRange(1, 99, 1); 74 m_mtdConcurrentTranscodes->SetValue(gContext->GetNumSetting("MTDConcurrentTranscodes")); 75 76 m_mtdRipSize->SetRange(0, 4096, 1); 77 m_mtdRipSize->SetValue(gContext->GetNumSetting("MTDRipSize")); 78 79 80 int loadMtdConsoleLog = gContext->GetNumSetting("MTDLogFlag", 0); 81 if (loadMtdConsoleLog == 1) 82 m_mtdConsoleLog->SetCheckState(MythUIStateType::Full); 83 84 int loadMtdKeepAc3 = gContext->GetNumSetting("MTDac3Flag", 0); 85 if (loadMtdKeepAc3 == 1) 86 m_mtdKeepAc3->SetCheckState(MythUIStateType::Full); 87 88 int loadMtdPreferXvid = gContext->GetNumSetting("MTDxvidFlag", 0); 89 if (loadMtdPreferXvid == 1) 90 m_mtdPreferXvid->SetCheckState(MythUIStateType::Full); 91 92 int loadMtdFrDetect = gContext->GetNumSetting("mythvideo.TrustTranscodeFRDetect", 0); 93 if (loadMtdFrDetect == 1) 94 m_mtdFrDetect->SetCheckState(MythUIStateType::Full); 95 96 97 connect(m_mtdPort, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 98 connect(m_mtdNiceLevel, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 99 connect(m_mtdConcurrentTranscodes, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 100 connect(m_mtdRipSize, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 101 connect(m_mtdConsoleLog, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 102 connect(m_mtdKeepAc3, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 103 connect(m_mtdPreferXvid, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 104 connect(m_mtdFrDetect, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 105 106 connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(slotSave())); 107 connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); 108 109 if (!BuildFocusList()) 110 VERBOSE(VB_IMPORTANT, "Failed to build a focuslist. Something is wrong"); 111 112 SetFocusWidget(m_mtdPort); 113 114 return true; 115 } 116 117 bool MtdSettings::keyPressEvent(QKeyEvent *event) 118 { 119 if (GetFocusWidget()->keyPressEvent(event)) 120 return true; 121 122 bool handled = false; 123 124 if (!handled && MythScreenType::keyPressEvent(event)) 125 handled = true; 126 127 return handled; 128 } 129 130 void MtdSettings::slotSave(void) 131 { 132 gContext->SaveSetting("MTDPort", m_mtdPort->GetValue()); 133 gContext->SaveSetting("MTDNiceLevel", m_mtdNiceLevel->GetValue()); 134 gContext->SaveSetting("MTDConcurrentTranscodes", m_mtdConcurrentTranscodes->GetValue()); 135 gContext->SaveSetting("MTDRipSize", m_mtdRipSize->GetValue()); 136 137 int saveMtdConsoleLog = (m_mtdConsoleLog->GetCheckState() == MythUIStateType::Full) ? 1 : 0; 138 gContext->SaveSetting("MTDLogFlag", saveMtdConsoleLog); 139 140 int saveMtdKeepAc3 = (m_mtdKeepAc3->GetCheckState() == MythUIStateType::Full) ? 1 : 0; 141 gContext->SaveSetting("MTDac3Flag", saveMtdKeepAc3); 142 143 int saveMtdPreferXvid = (m_mtdPreferXvid->GetCheckState() == MythUIStateType::Full) ? 1 : 0; 144 gContext->SaveSetting("MTDxvidFlag", saveMtdPreferXvid); 145 146 int saveMtdFrDetect = (m_mtdFrDetect->GetCheckState() == MythUIStateType::Full) ? 1 : 0; 147 gContext->SaveSetting("mythvideo.TrustTranscodeFRDetect", saveMtdFrDetect); 148 Close(); 149 } 150 151 void MtdSettings::slotFocusChanged(void) 152 { 153 if (!m_helpText) 154 return; 155 156 QString msg = ""; 157 if (GetFocusWidget() == m_mtdPort) 158 msg = tr("The port number that should be used for " 159 "communicating with the MTD (Myth Transcoding " 160 "Daemon)"); 161 else if (GetFocusWidget() == m_mtdNiceLevel) 162 msg = tr("This determines the priority of the Myth " 163 "Transcoding Daemon. Higher numbers mean " 164 "lower priority (more CPU to other tasks)."); 165 else if (GetFocusWidget() == m_mtdConcurrentTranscodes) 166 msg = tr("This determines the number of simultaneous " 167 "transcode jobs. If set at 1 (the default), " 168 "there will only be one active job at a time."); 169 else if (GetFocusWidget() == m_mtdRipSize) 170 msg = tr("If set to something other than 0, ripped " 171 "video titles will be broken up into files " 172 "of this size (in MB). Applies to both perfect " 173 "quality recordings and intermediate files " 174 "used for transcoding."); 175 else if (GetFocusWidget() == m_mtdConsoleLog) 176 msg = tr("If set, the MTD (Myth Transcoding Daemon) " 177 "will log to the window it is started from. " 178 "Otherwise, it will write to a file called " 179 "mtd.log in the top level ripping directory."); 180 else if (GetFocusWidget() == m_mtdKeepAc3) 181 msg = tr("If set, the MTD (Myth Transcoding Daemon) " 182 "will, by default, preserve AC3 (Dolby " 183 "Digital) audio in transcoded files."); 184 else if (GetFocusWidget() == m_mtdPreferXvid) 185 msg = tr("If set, mythdvd will use the (open, free) " 186 "xvid codec rather than divx whenever " 187 "possible."); 188 else if (GetFocusWidget() == m_mtdFrDetect) 189 msg = tr("If set, transcode will determine the frame " 190 "rate automatically. If not set, 23.976 is " 191 "assumed."); 192 else if (GetFocusWidget() == m_cancelButton) 193 msg = tr("Exit without saving settings"); 194 else if (GetFocusWidget() == m_saveButton) 195 msg = tr("Save settings and Exit"); 196 197 m_helpText->SetText(msg); 198 } 199 -
mythvideo/mythvideo/mtdsettings.h
1 #ifndef MTDSETTINGS_H 2 #define MTDSETTINGS_H 3 4 #include <mythtv/mythwidgets.h> 5 #include <mythtv/mythdialogs.h> 6 7 #include <libmythui/mythuispinbox.h> 8 #include <libmythui/mythuibutton.h> 9 #include <libmythui/mythuibuttonlist.h> 10 #include <libmythui/mythuicheckbox.h> 11 #include <libmythui/mythscreentype.h> 12 #include <libmythui/mythdialogbox.h> 13 14 15 class MtdSettings : public MythScreenType 16 { 17 Q_OBJECT 18 public: 19 MtdSettings(MythScreenStack *parent, const char *name = 0); 20 ~MtdSettings(); 21 22 bool Create(void); 23 bool keyPressEvent(QKeyEvent *); 24 25 private: 26 MythUISpinBox *m_mtdPort; 27 MythUISpinBox *m_mtdNiceLevel; 28 MythUISpinBox *m_mtdConcurrentTranscodes; 29 MythUISpinBox *m_mtdRipSize; 30 MythUICheckBox *m_mtdConsoleLog; 31 MythUICheckBox *m_mtdKeepAc3; 32 MythUICheckBox *m_mtdPreferXvid; 33 MythUICheckBox *m_mtdFrDetect; 34 35 MythUIText *m_helpText; 36 MythUIButton *m_saveButton; 37 MythUIButton *m_cancelButton; 38 39 private slots: 40 void slotSave(void); 41 void slotFocusChanged(void); 42 43 }; 44 45 #endif // MTDSETTINGS_H -
mythvideo/mythvideo/parentalsettings.cpp
1 using namespace std; 2 3 // Qt 4 #include <QString> 5 6 // MythTV 7 #include <mythcontext.h> 8 #include <mythdbcon.h> 9 #include <mythdirs.h> 10 11 #include "parentalcontrols.h" 12 #include "parentalsettings.h" 13 14 15 ParentalSettings::ParentalSettings(MythScreenStack *parent, const char *name) 16 : MythScreenType(parent, name), 17 m_defaultParentalLevel(NULL), 18 m_adminPassword4(NULL), 19 m_adminPassword3(NULL), 20 m_adminPassword2(NULL), 21 m_aggressivePC(NULL), 22 m_parentalLevelFromRating(NULL), 23 m_parentalLevel1(NULL), 24 m_parentalLevel2(NULL), 25 m_parentalLevel3(NULL), 26 m_parentalLevel4(NULL), 27 m_helpText(NULL), 28 m_saveButton(NULL), 29 m_cancelButton(NULL) 30 { 31 } 32 33 ParentalSettings::~ParentalSettings() 34 { 35 36 } 37 38 bool ParentalSettings::Create() 39 { 40 bool foundtheme = false; 41 42 // Load the theme for this screen 43 foundtheme = LoadWindowFromXML("video-ui.xml", "parentalsettings", this); 44 45 if (!foundtheme) 46 return false; 47 48 m_defaultParentalLevel = dynamic_cast<MythUIButtonList *> (GetChild("defaultparentallevel")); 49 m_adminPassword4 = dynamic_cast<MythUITextEdit *> (GetChild("adminpassword4")); 50 m_adminPassword3 = dynamic_cast<MythUITextEdit *> (GetChild("adminpassword3")); 51 m_adminPassword2 = dynamic_cast<MythUITextEdit *> (GetChild("adminpassword2")); 52 m_aggressivePC = dynamic_cast<MythUICheckBox *> (GetChild("aggressivepc")); 53 m_parentalLevelFromRating = dynamic_cast<MythUICheckBox *> (GetChild("parentallevelfromrating")); 54 m_parentalLevel1 = dynamic_cast<MythUITextEdit *> (GetChild("parentallevel1")); 55 m_parentalLevel2 = dynamic_cast<MythUITextEdit *> (GetChild("parentallevel2")); 56 m_parentalLevel3 = dynamic_cast<MythUITextEdit *> (GetChild("parentallevel3")); 57 m_parentalLevel4 = dynamic_cast<MythUITextEdit *> (GetChild("parentallevel4")); 58 59 m_helpText = dynamic_cast<MythUIText *> (GetChild("helptext")); 60 m_saveButton = dynamic_cast<MythUIButton *> (GetChild("save")); 61 m_cancelButton = dynamic_cast<MythUIButton *> (GetChild("cancel")); 62 63 if (!m_defaultParentalLevel || 64 !m_adminPassword4 || !m_adminPassword3 || !m_adminPassword2 || 65 !m_aggressivePC || !m_parentalLevelFromRating || 66 !m_parentalLevel1 || !m_parentalLevel2 || 67 !m_parentalLevel3 || !m_parentalLevel4 || 68 !m_saveButton || !m_cancelButton) 69 { 70 VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements."); 71 return false; 72 } 73 74 new MythUIButtonListItem(m_defaultParentalLevel, tr("4 - High"), qVariantFromValue(QString(ParentalLevel::plHigh))); 75 new MythUIButtonListItem(m_defaultParentalLevel, tr("3 - Medium"), qVariantFromValue(QString(ParentalLevel::plMedium))); 76 new MythUIButtonListItem(m_defaultParentalLevel, tr("2 - Low"), qVariantFromValue(QString(ParentalLevel::plLow))); 77 new MythUIButtonListItem(m_defaultParentalLevel, tr("1 - Lowest"), qVariantFromValue(QString(ParentalLevel::plLowest))); 78 m_defaultParentalLevel->SetValueByData(gContext->GetSetting("VideoDefaultParentalLevel")); 79 80 m_adminPassword4->SetText(gContext->GetSetting("VideoAdminPassword")); 81 m_adminPassword3->SetText(gContext->GetSetting("VideoAdminPasswordThree")); 82 m_adminPassword2->SetText(gContext->GetSetting("VideoAdminPasswordTwo")); 83 84 int loadAggressivePC = gContext->GetNumSetting("VideoAggressivePC", 0); 85 if (loadAggressivePC == 1) 86 m_aggressivePC->SetCheckState(MythUIStateType::Full); 87 88 int loadParentalLevelFromRating = gContext->GetNumSetting("mythvideo.ParentalLevelFromRating", 0); 89 if (loadParentalLevelFromRating == 1) 90 m_parentalLevelFromRating->SetCheckState(MythUIStateType::Full); 91 92 m_parentalLevel1->SetText(gContext->GetSetting("mythvideo.AutoR2PL1", "G")); 93 m_parentalLevel2->SetText(gContext->GetSetting("mythvideo.AutoR2PL2", "PG")); 94 m_parentalLevel3->SetText(gContext->GetSetting("mythvideo.AutoR2PL3", "PG-13")); 95 m_parentalLevel4->SetText(gContext->GetSetting("mythvideo.AutoR2PL4", "R:NC-17")); 96 97 toggleLevelFromRating(); 98 99 connect(m_defaultParentalLevel, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 100 connect(m_adminPassword4, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 101 connect(m_adminPassword3, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 102 connect(m_adminPassword2, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 103 connect(m_aggressivePC, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 104 connect(m_parentalLevelFromRating, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 105 connect(m_parentalLevel1, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 106 connect(m_parentalLevel2, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 107 connect(m_parentalLevel3, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 108 connect(m_parentalLevel4, SIGNAL(TakingFocus()), SLOT(slotFocusChanged())); 109 connect(m_parentalLevelFromRating, SIGNAL(valueChanged()), SLOT(toggleLevelFromRating())); 110 connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(slotSave())); 111 connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close())); 112 113 if (!BuildFocusList()) 114 VERBOSE(VB_IMPORTANT, "Failed to build a focuslist. Something is wrong"); 115 116 SetFocusWidget(m_defaultParentalLevel); 117 118 return true; 119 } 120 121 bool ParentalSettings::keyPressEvent(QKeyEvent *event) 122 { 123 if (GetFocusWidget()->keyPressEvent(event)) 124 return true; 125 126 bool handled = false; 127 128 if (!handled && MythScreenType::keyPressEvent(event)) 129 handled = true; 130 131 return handled; 132 } 133 134 void ParentalSettings::slotSave(void) 135 { 136 gContext->SaveSetting("VideoDefaultParentalLevel", m_defaultParentalLevel->GetDataValue().toString()); 137 138 gContext->SaveSetting("VideoAdminPassword", m_adminPassword4->GetText()); 139 gContext->SaveSetting("VideoAdminPasswordThree", m_adminPassword3->GetText()); 140 gContext->SaveSetting("VideoAdminPasswordTwo", m_adminPassword2->GetText()); 141 142 int saveAggressivePC = (m_aggressivePC->GetCheckState() == MythUIStateType::Full) ? 1 : 0; 143 gContext->SaveSetting("VideoAggressivePC", saveAggressivePC); 144 145 int saveParentalLevelFromRating = (m_parentalLevelFromRating->GetCheckState() == MythUIStateType::Full) ? 1 : 0; 146 gContext->SaveSetting("mythvideo.ParentalLevelFromRating", saveParentalLevelFromRating); 147 148 gContext->SaveSetting("mythvideo.AutoR2PL1", m_parentalLevel1->GetText()); 149 gContext->SaveSetting("mythvideo.AutoR2PL2", m_parentalLevel2->GetText()); 150 gContext->SaveSetting("mythvideo.AutoR2PL3", m_parentalLevel3->GetText()); 151 gContext->SaveSetting("mythvideo.AutoR2PL4", m_parentalLevel4->GetText()); 152 153 Close(); 154 } 155 156 void ParentalSettings::slotFocusChanged(void) 157 { 158 if (!m_helpText) 159 return; 160 161 QString msg = ""; 162 if (GetFocusWidget() == m_defaultParentalLevel) 163 msg = tr("This is the 'level' that MythVideo starts at. " 164 "Any videos with a level at or below this will be shown in " 165 "the list or while browsing by default. The Parental PIN " 166 "should be set to limit changing of the default level."); 167 else if (GetFocusWidget() == m_adminPassword4) 168 msg = tr("This PIN is used to enter Parental Control " 169 "Level 4 as well as the Video Manager."); 170 else if (GetFocusWidget() == m_adminPassword3) 171 msg = tr("This PIN is used to enter Parental Control Level 3."); 172 else if (GetFocusWidget() == m_adminPassword2) 173 msg = tr("This PIN is used to enter Parental Control Level 2."); 174 else if (GetFocusWidget() == m_aggressivePC) 175 msg = tr("If set, you will not be able to return " 176 "to this screen and reset the Parental " 177 "PIN without first entering the current PIN. You have " 178 "been warned."); 179 else if (GetFocusWidget() == m_parentalLevelFromRating) 180 msg = tr("If enabled, searches will automatically " 181 "set the Parental Level to the one " 182 "matching the rating below."); 183 else if (GetFocusWidget() == m_parentalLevel1) 184 msg = tr("Ratings containing these strings " 185 "(separated by :) will be assigned " 186 "to Parental Level 1."); 187 else if (GetFocusWidget() == m_parentalLevel2) 188 msg = tr("Ratings containing these strings " 189 "(separated by :) will be assigned " 190 "to Parental Level 2."); 191 else if (GetFocusWidget() == m_parentalLevel3) 192 msg = tr("Ratings containing these strings " 193 "(separated by :) will be assigned " 194 "to Parental Level 3."); 195 else if (GetFocusWidget() == m_parentalLevel4) 196 msg = tr("Ratings containing these strings " 197 "(separated by :) will be assigned " 198 "to Parental Level 4."); 199 else if (GetFocusWidget() == m_cancelButton) 200 msg = tr("Exit without saving settings"); 201 else if (GetFocusWidget() == m_saveButton) 202 msg = tr("Save settings and Exit"); 203 204 m_helpText->SetText(msg); 205 } 206 207 void ParentalSettings::toggleLevelFromRating(void) 208 { 209 int checked = (m_parentalLevelFromRating->GetCheckState() == MythUIStateType::Full) ? true : false; 210 211 m_parentalLevel1->SetVisible(checked); 212 m_parentalLevel2->SetVisible(checked); 213 m_parentalLevel3->SetVisible(checked); 214 m_parentalLevel4->SetVisible(checked); 215 } 216 -
mythvideo/mythvideo/parentalsettings.h
1 #ifndef PARENTALSETTINGS_H 2 #define PARENTALSETTINGS_H 3 4 #include <mythtv/mythwidgets.h> 5 #include <mythtv/mythdialogs.h> 6 7 #include <libmythui/mythuispinbox.h> 8 #include <libmythui/mythuibutton.h> 9 #include <libmythui/mythuibuttonlist.h> 10 #include <libmythui/mythuicheckbox.h> 11 #include <libmythui/mythscreentype.h> 12 #include <libmythui/mythdialogbox.h> 13 14 15 class ParentalSettings : public MythScreenType 16 { 17 Q_OBJECT 18 public: 19 ParentalSettings(MythScreenStack *parent, const char *name = 0); 20 ~ParentalSettings(); 21 22 bool Create(void); 23 bool keyPressEvent(QKeyEvent *); 24 25 private: 26 MythUIButtonList *m_defaultParentalLevel; 27 MythUITextEdit *m_adminPassword4; 28 MythUITextEdit *m_adminPassword3; 29 MythUITextEdit *m_adminPassword2; 30 MythUICheckBox *m_aggressivePC; 31 32 MythUICheckBox *m_parentalLevelFromRating; 33 MythUITextEdit *m_parentalLevel1; 34 MythUITextEdit *m_parentalLevel2; 35 MythUITextEdit *m_parentalLevel3; 36 MythUITextEdit *m_parentalLevel4; 37 38 MythUIText *m_helpText; 39 MythUIButton *m_saveButton; 40 MythUIButton *m_cancelButton; 41 42 private slots: 43 void slotSave(void); 44 void slotFocusChanged(void); 45 void toggleLevelFromRating(void); 46 47 }; 48 49 #endif // PARENTALSETTINGS_H -
mythvideo/theme/menus/video_settings.xml
23 23 </button> 24 24 25 25 <button> 26 <type>VIDEO_SETTINGS_DVD</type> 27 <text>DVD Settings</text> 28 <text lang="DE">DVD Einstellungen</text> 29 <action>SETTINGS_DVD</action> 30 <description>Options for internal DVD playback</description> 31 <description lang="DE">Optionen fÃŒr den internen DVD Spieler</description> 32 </button> 33 34 <button> 35 <type>VIDEO_SETTINGS_PARENTAL</type> 36 <text>Parental Settings</text> 37 <text lang="DE">Altersfreigabe</text> 38 <action>SETTINGS_PARENTAL</action> 39 <description>Options for parental controls</description> 40 <description lang="DE">Optionen zur Altersfreigabe und Bewertungen</description> 41 </button> 42 43 <button> 26 44 <type>VIDEO_SETTINGS_PLAYER</type> 27 45 <text>Player Settings</text> 28 46 <text lang="ES">Opciones de reproducción</text> … … 75 93 76 94 <!-- MythDVD --> 77 95 <button> 78 <type> DVD_RIP</type>79 <text> Rip Settings</text>96 <type>VIDEO_SETTINGS_IMPORT</type> 97 <text>DVD Rip Settings</text> 80 98 <text lang="DA">Genkodnings indstillinger</text> 81 99 <text lang="PT">Conf. Importação DVDs</text> 82 <text lang="DE"> Import</text>100 <text lang="DE">DVD Import</text> 83 101 <text lang="SV">InstÀllningar för kopiering</text> 84 102 <text lang="ES">Opciones de "ripear"</text> 85 103 <text lang="CA">Opcions de volcat</text> … … 90 108 <text lang="RU">ÐаÑÑÑПйкО ОЌпПÑÑа</text> 91 109 <text lang="PL">Ustaw zrzucanie DVD</text> 92 110 <text lang="NB">Innstillinger for import</text> 93 <action>DVD_SETTINGS_RIP</action> 94 <description>DVD Rip and Transcode options</description> 111 <action>SETTINGS_IMPORT</action> 112 <description>DVD Rip options</description> 113 <description lang="DE">DVD Import Optionen</description> 114 </button> 115 116 <button> 117 <type>VIDEO_SETTINGS_MTD</type> 118 <text>Trancoding Settings</text> 119 <text lang="DE">Umwandlung</text> 120 <action>SETTINGS_MTD</action> 121 <description>Options for the Myth Transcoding Deamon</description> 122 <description lang="DE">Optionen fÃŒr den Myth Umwandler</description> 95 123 </button> 96 124 97 125 </mythmenu> -
mythvideo/theme/default-wide/video-ui.xml
1506 1506 1507 1507 </window> 1508 1508 1509 1510 1511 <window name="generalsettings"> 1512 1513 <textarea name="startupdir_label" from="basetextarea"> 1514 <area>240,150,400,40</area> 1515 <align>right,vcenter</align> 1516 <value>Directories that hold videos:</value> 1517 </textarea> 1518 <textarea name="artworkdir_label" from="basetextarea"> 1519 <area>240,200,400,40</area> 1520 <align>right,vcenter</align> 1521 <value>Directory that holds movie posters:</value> 1522 </textarea> 1523 <textarea name="screenshotdir_label" from="basetextarea"> 1524 <area>240,250,400,40</area> 1525 <align>right,vcenter</align> 1526 <value>Directory that holds movie screenshots:</value> 1527 </textarea> 1528 <textarea name="bannerdir_label" from="basetextarea"> 1529 <area>240,300,400,40</area> 1530 <align>right,vcenter</align> 1531 <value>Directory that holds movie/TV Banners:</value> 1532 </textarea> 1533 <textarea name="fanartdir_label" from="basetextarea"> 1534 <area>240,350,400,40</area> 1535 <align>right,vcenter</align> 1536 <value>Directory that holds movie fanart:</value> 1537 </textarea> 1538 <textarea name="trailersdir_label" from="basetextarea"> 1539 <area>240,400,400,40</area> 1540 <align>right,vcenter</align> 1541 <value>Directory that holds movie trailers:</value> 1542 </textarea> 1543 1544 <textedit name="startupdir" from="basetextedit"> 1545 <area>650,150,280,40</area> 1546 </textedit> 1547 <textedit name="artworkdir" from="basetextedit"> 1548 <area>650,200,280,40</area> 1549 </textedit> 1550 <textedit name="screenshotdir" from="basetextedit"> 1551 <area>650,250,280,40</area> 1552 </textedit> 1553 <textedit name="bannerdir" from="basetextedit"> 1554 <area>650,300,280,40</area> 1555 </textedit> 1556 <textedit name="fanartdir" from="basetextedit"> 1557 <area>650,350,280,40</area> 1558 </textedit> 1559 <textedit name="trailersdir" from="basetextedit"> 1560 <area>650,400,280,40</area> 1561 </textedit> 1562 1563 <textarea name="helptext" from="basetextarea"> 1564 <area>205,451,870,80</area> 1565 <cutdown>yes</cutdown> 1566 <align>allcenter</align> 1567 <multiline>yes</multiline> 1568 </textarea> 1569 1570 <button name="save" from="basebutton"> 1571 <position>480,550</position> 1572 <value>Save</value> 1573 </button> 1574 <button name="cancel" from="basebutton"> 1575 <position>650,550</position> 1576 <value>Cancel</value> 1577 </button> 1578 </window> 1579 1580 1581 <window name="dvdsettings"> 1582 1583 <textarea name="dvdoninsertdvd_label" from="basetextarea"> 1584 <area>200,180,440,40</area> 1585 <align>right,vcenter</align> 1586 <value>On DVD insertion:</value> 1587 </textarea> 1588 <textarea name="dvddrivespeed_label" from="basetextarea"> 1589 <area>200,230,440,40</area> 1590 <align>right,vcenter</align> 1591 <value>DVD Drive Speed:</value> 1592 </textarea> 1593 <textarea name="enabledvdbookmark_label" from="basetextarea"> 1594 <area>200,280,440,40</area> 1595 <align>right,vcenter</align> 1596 <value>Enable DVD Bookmark Support:</value> 1597 </textarea> 1598 <textarea name="dvdbookmarkprompt_label" from="basetextarea"> 1599 <area>200,330,440,40</area> 1600 <align>right,vcenter</align> 1601 <value>DVD Bookmark Prompt:</value> 1602 </textarea> 1603 <textarea name="dvdbookmarkdays_label" from="basetextarea"> 1604 <area>200,380,440,40</area> 1605 <align>right,vcenter</align> 1606 <value>Remove DVD Bookmarks Older than (days):</value> 1607 </textarea> 1608 1609 <buttonlist name="dvdoninsertdvd" from="baseselector"> 1610 <area>650,180,280,40</area> 1611 </buttonlist> 1612 <spinbox name="dvddrivespeed" from="basespinbox"> 1613 <area>650,230,280,40</area> 1614 </spinbox> 1615 <checkbox name="enabledvdbookmark" from="basecheckbox"> 1616 <area>650,285,280,40</area> 1617 </checkbox> 1618 <checkbox name="dvdbookmarkprompt" from="basecheckbox"> 1619 <area>650,335,280,40</area> 1620 </checkbox> 1621 <spinbox name="dvdbookmarkdays" from="basespinbox"> 1622 <area>650,380,280,40</area> 1623 </spinbox> 1624 1625 <textarea name="helptext" from="basetextarea"> 1626 <area>205,431,870,80</area> 1627 <cutdown>yes</cutdown> 1628 <align>allcenter</align> 1629 <multiline>yes</multiline> 1630 </textarea> 1631 1632 <button name="save" from="basebutton"> 1633 <position>480,530</position> 1634 <value>Save</value> 1635 </button> 1636 <button name="cancel" from="basebutton"> 1637 <position>650,530</position> 1638 <value>Cancel</value> 1639 </button> 1640 </window> 1641 1642 1643 <window name="parentalsettings"> 1644 1645 <textarea name="defaultparentallevel_label" from="basetextarea"> 1646 <area>200,110,440,40</area> 1647 <align>right,vcenter</align> 1648 <value>Starting Parental Level:</value> 1649 </textarea> 1650 <textarea name="adminpassword4_label" from="basetextarea"> 1651 <area>150,160,250,40</area> 1652 <align>right,vcenter</align> 1653 <value>PIN for Parental Level 4:</value> 1654 </textarea> 1655 <textarea name="adminpassword3_label" from="basetextarea"> 1656 <area>590,160,50,40</area> 1657 <align>right,vcenter</align> 1658 <value>3:</value> 1659 </textarea> 1660 <textarea name="adminpassword2_label" from="basetextarea"> 1661 <area>830,160,50,40</area> 1662 <align>right,vcenter</align> 1663 <value>2:</value> 1664 </textarea> 1665 <textarea name="aggressivepc_label" from="basetextarea"> 1666 <area>200,210,440,40</area> 1667 <align>right,vcenter</align> 1668 <value>Aggressive Parental Control:</value> 1669 </textarea> 1670 1671 <textarea name="parentallevelfromrating_label" from="basetextarea"> 1672 <area>160,270,480,40</area> 1673 <align>right,vcenter</align> 1674 <value>Enable automatic Parental Level from rating:</value> 1675 </textarea> 1676 <textarea name="parentallevel1_label" from="basetextarea"> 1677 <area>200,320,440,40</area> 1678 <align>right,vcenter</align> 1679 <value>PL 1 default search string:</value> 1680 </textarea> 1681 <textarea name="parentallevel2_label" from="basetextarea"> 1682 <area>200,370,440,40</area> 1683 <align>right,vcenter</align> 1684 <value>PL 2 default search string:</value> 1685 </textarea> 1686 <textarea name="parentallevel3_label" from="basetextarea"> 1687 <area>200,420,440,40</area> 1688 <align>right,vcenter</align> 1689 <value>PL 3 default search string:</value> 1690 </textarea> 1691 <textarea name="parentallevel4_label" from="basetextarea"> 1692 <area>200,470,440,40</area> 1693 <align>right,vcenter</align> 1694 <value>PL 4 default search string:</value> 1695 </textarea> 1696 1697 <buttonlist name="defaultparentallevel" from="baseselector"> 1698 <position>650,110</position> 1699 </buttonlist> 1700 <textedit name="adminpassword4" from="basetextedit"> 1701 <position>410,160</position> 1702 </textedit> 1703 <textedit name="adminpassword3" from="basetextedit"> 1704 <position>650,160</position> 1705 </textedit> 1706 <textedit name="adminpassword2" from="basetextedit"> 1707 <position>890,160</position> 1708 </textedit> 1709 <checkbox name="aggressivepc" from="basecheckbox"> 1710 <position>650,215</position> 1711 </checkbox> 1712 1713 <checkbox name="parentallevelfromrating" from="basecheckbox"> 1714 <position>650,275</position> 1715 </checkbox> 1716 <textedit name="parentallevel1" from="basetextedit"> 1717 <position>650,320</position> 1718 </textedit> 1719 <textedit name="parentallevel2" from="basetextedit"> 1720 <position>650,370</position> 1721 </textedit> 1722 <textedit name="parentallevel3" from="basetextedit"> 1723 <position>650,420</position> 1724 </textedit> 1725 <textedit name="parentallevel4" from="basetextedit"> 1726 <position>650,470</position> 1727 </textedit> 1728 1729 <textarea name="helptext" from="basetextarea"> 1730 <area>165,526,960,80</area> 1731 <cutdown>yes</cutdown> 1732 <align>allcenter</align> 1733 <multiline>yes</multiline> 1734 </textarea> 1735 1736 <button name="save" from="basebutton"> 1737 <position>480,625</position> 1738 <value>Save</value> 1739 </button> 1740 <button name="cancel" from="basebutton"> 1741 <position>650,625</position> 1742 <value>Cancel</value> 1743 </button> 1744 </window> 1745 1746 1747 <window name="importsettings"> 1748 1749 <textarea name="dvdriplocation_label" from="basetextarea"> 1750 <area>240,200,400,40</area> 1751 <align>right,vcenter</align> 1752 <value>Directory to hold temporary files:</value> 1753 </textarea> 1754 <textarea name="titleplaycommand_label" from="basetextarea"> 1755 <area>240,250,400,40</area> 1756 <align>right,vcenter</align> 1757 <value>Title Playing Command:</value> 1758 </textarea> 1759 <textarea name="subtitlecommand_label" from="basetextarea"> 1760 <area>240,300,400,40</area> 1761 <align>right,vcenter</align> 1762 <value>Subtitle arguments:</value> 1763 </textarea> 1764 <textarea name="transcodecommand_label" from="basetextarea"> 1765 <area>240,350,400,40</area> 1766 <align>right,vcenter</align> 1767 <value>Base transcode command:</value> 1768 </textarea> 1769 1770 <textedit name="dvdriplocation" from="basetextedit"> 1771 <area>650,200,280,40</area> 1772 </textedit> 1773 <textedit name="titleplaycommand" from="basetextedit"> 1774 <area>650,250,280,40</area> 1775 </textedit> 1776 <textedit name="subtitlecommand" from="basetextedit"> 1777 <area>650,300,280,40</area> 1778 </textedit> 1779 <textedit name="transcodecommand" from="basetextedit"> 1780 <area>650,350,280,40</area> 1781 </textedit> 1782 1783 <textarea name="helptext" from="basetextarea"> 1784 <area>205,401,870,80</area> 1785 <cutdown>yes</cutdown> 1786 <align>allcenter</align> 1787 <multiline>yes</multiline> 1788 </textarea> 1789 1790 <button name="save" from="basebutton"> 1791 <position>480,500</position> 1792 <value>Save</value> 1793 </button> 1794 <button name="cancel" from="basebutton"> 1795 <position>650,500</position> 1796 <value>Cancel</value> 1797 </button> 1798 </window> 1799 1800 1801 <window name="mtdsettings"> 1802 1803 <textarea name="mtdport_label" from="basetextarea"> 1804 <area>240,100,400,40</area> 1805 <align>right,vcenter</align> 1806 <value>MTD port number:</value> 1807 </textarea> 1808 <textarea name="mtdnicelevel_label" from="basetextarea"> 1809 <area>240,150,400,40</area> 1810 <align>right,vcenter</align> 1811 <value>Nice level for MTD:</value> 1812 </textarea> 1813 <textarea name="mtdconcurrenttranscodes_label" from="basetextarea"> 1814 <area>240,200,400,40</area> 1815 <align>right,vcenter</align> 1816 <value>Simultaneous Transcode Jobs:</value> 1817 </textarea> 1818 <textarea name="mtdripsize_label" from="basetextarea"> 1819 <area>240,250,400,40</area> 1820 <align>right,vcenter</align> 1821 <value>Ripped video segments:</value> 1822 </textarea> 1823 <textarea name="mtdconsolelog_label" from="basetextarea"> 1824 <area>240,300,400,40</area> 1825 <align>right,vcenter</align> 1826 <value>MTD logs to terminal window:</value> 1827 </textarea> 1828 <textarea name="mtdkeepac3_label" from="basetextarea"> 1829 <area>240,350,400,40</area> 1830 <align>right,vcenter</align> 1831 <value>Transcode AC3 Audio:</value> 1832 </textarea> 1833 <textarea name="mtdpreferxvid_label" from="basetextarea"> 1834 <area>240,400,400,40</area> 1835 <align>right,vcenter</align> 1836 <value>Use xvid rather than divx:</value> 1837 </textarea> 1838 <textarea name="mtdfrdetect_label" from="basetextarea"> 1839 <area>240,450,400,40</area> 1840 <align>right,vcenter</align> 1841 <value>Let transcode determine frame rate:</value> 1842 </textarea> 1843 1844 <spinbox name="mtdport" from="basespinbox"> 1845 <area>650,100,280,40</area> 1846 </spinbox> 1847 <spinbox name="mtdnicelevel" from="basespinbox"> 1848 <area>650,150,280,40</area> 1849 </spinbox> 1850 <spinbox name="mtdconcurrenttranscodes" from="basespinbox"> 1851 <area>650,200,280,40</area> 1852 </spinbox> 1853 <spinbox name="mtdripsize" from="basespinbox"> 1854 <area>650,250,280,40</area> 1855 </spinbox> 1856 <checkbox name="mtdconsolelog" from="basecheckbox"> 1857 <area>650,305,280,40</area> 1858 </checkbox> 1859 <checkbox name="mtdkeepac3" from="basecheckbox"> 1860 <area>650,355,280,40</area> 1861 </checkbox> 1862 <checkbox name="mtdpreferxvid" from="basecheckbox"> 1863 <area>650,405,280,40</area> 1864 </checkbox> 1865 <checkbox name="mtdfrdetect" from="basecheckbox"> 1866 <area>650,455,280,40</area> 1867 </checkbox> 1868 1869 <textarea name="helptext" from="basetextarea"> 1870 <area>205,501,870,80</area> 1871 <cutdown>yes</cutdown> 1872 <align>allcenter</align> 1873 <multiline>yes</multiline> 1874 </textarea> 1875 1876 <button name="save" from="basebutton"> 1877 <position>480,600</position> 1878 <value>Save</value> 1879 </button> 1880 <button name="cancel" from="basebutton"> 1881 <position>650,600</position> 1882 <value>Cancel</value> 1883 </button> 1884 </window> 1885 1886 1509 1887 </mythuitheme> 1510 1888 <!-- vim: set expandtab ts=4 sw=4 : --> -
mythvideo/mythvideo/mythvideo.pro
38 38 HEADERS += cleanup.h globals.h dirscan.h videoutils.h 39 39 HEADERS += parentalcontrols.h playercommand.h playersettings.h 40 40 HEADERS += metadatasettings.h 41 HEADERS += generalsettings.h 42 HEADERS += dvdsettings.h 43 HEADERS += parentalsettings.h 44 HEADERS += importsettings.h 45 HEADERS += mtdsettings.h 41 46 42 47 #MythDVD 43 48 HEADERS += dvdripbox.h dvdinfo.h titledialog.h … … 51 56 SOURCES += globals.cpp dirscan.cpp videoutils.cpp 52 57 SOURCES += parentalcontrols.cpp playercommand.cpp 53 58 SOURCES += playersettings.cpp metadatasettings.cpp 59 SOURCES += generalsettings.cpp 60 SOURCES += dvdsettings.cpp 61 SOURCES += parentalsettings.cpp 62 SOURCES += importsettings.cpp 63 SOURCES += mtdsettings.cpp 54 64 55 65 #MythDVD 56 66 SOURCES += dvdripbox.cpp dvdinfo.cpp titledialog.cpp -
mythvideo/mythvideo/videodlg.cpp
45 45 #include "playercommand.h" 46 46 #include "videodlg.h" 47 47 #include "fileassoc.h" 48 #include "generalsettings.h" 49 #include "dvdsettings.h" 50 #include "parentalsettings.h" 48 51 #include "playersettings.h" 49 52 #include "metadatasettings.h" 53 #include "importsettings.h" 54 #include "mtdsettings.h" 50 55 51 56 namespace 52 57 { … … 3102 3107 3103 3108 m_menuPopup->SetReturnEvent(this, "view"); 3104 3109 3110 m_menuPopup->AddButton(tr("General Settings"), SLOT(ShowGeneralSettings())); 3111 m_menuPopup->AddButton(tr("DVD Settings"), SLOT(ShowDvdSettings())); 3112 m_menuPopup->AddButton(tr("Parental Settings"), SLOT(ShowParentalSettings())); 3105 3113 m_menuPopup->AddButton(tr("Player Settings"), SLOT(ShowPlayerSettings())); 3106 3114 m_menuPopup->AddButton(tr("Metadata Settings"), SLOT(ShowMetadataSettings())); 3107 3115 m_menuPopup->AddButton(tr("File Type Settings"), SLOT(ShowExtensionSettings())); 3116 m_menuPopup->AddButton(tr("DVD Rip Settings"), SLOT(ShowImportSettings())); 3117 m_menuPopup->AddButton(tr("Transcoding Settings"), SLOT(ShowTranscodingSettings())); 3118 } 3119 3120 /** \fn VideoDialog::ShowGeneralSettings() 3121 * \brief Pop up a MythUI Menu for MythVideo General Settings. 3122 * \return void. 3123 */ 3124 void VideoDialog::ShowGeneralSettings() 3125 { 3126 GeneralSettings *gs = new GeneralSettings(m_popupStack, "general settings"); 3127 3128 if (gs->Create()) 3129 m_popupStack->AddScreen(gs); 3130 else 3131 delete gs; 3132 } 3133 3134 /** \fn VideoDialog::ShowDvdSettings() 3135 * \brief Pop up a MythUI Menu for MythVideo DVD Settings. 3136 * \return void. 3137 */ 3138 void VideoDialog::ShowDvdSettings() 3139 { 3140 DvdSettings *ds = new DvdSettings(m_popupStack, "dvd settings"); 3141 3142 if (ds->Create()) 3143 m_popupStack->AddScreen(ds); 3144 else 3145 delete ds; 3146 } 3147 3148 /** \fn VideoDialog::ShowParentalSettings() 3149 * \brief Pop up a MythUI Menu for MythVideo Parental Settings. 3150 * \return void. 3151 */ 3152 void VideoDialog::ShowParentalSettings() 3153 { 3154 ParentalSettings *ps = new ParentalSettings(m_popupStack, "parental settings"); 3155 3156 if (ps->Create()) 3157 m_popupStack->AddScreen(ps); 3158 else 3159 delete ps; 3108 3160 } 3109 3161 3110 3162 /** \fn VideoDialog::ShowPlayerSettings() … … 3149 3201 delete fa; 3150 3202 } 3151 3203 3204 /** \fn VideoDialog::ShowImportSettings() 3205 * \brief Pop up a MythUI Menu for MythVideo Import Settings. 3206 * \return void. 3207 */ 3208 void VideoDialog::ShowImportSettings() 3209 { 3210 ImportSettings *is = new ImportSettings(m_popupStack, "import settings"); 3211 3212 if (is->Create()) 3213 m_popupStack->AddScreen(is); 3214 else 3215 delete is; 3216 } 3217 3218 /** \fn VideoDialog::ShowTranscodingSettings() 3219 * \brief Pop up a MythUI Menu for MythVideo Transcoding Settings. 3220 * \return void. 3221 */ 3222 void VideoDialog::ShowTranscodingSettings() 3223 { 3224 MtdSettings *ms = new MtdSettings(m_popupStack, "mtd settings"); 3225 3226 if (ms->Create()) 3227 m_popupStack->AddScreen(ms); 3228 else 3229 delete ms; 3230 } 3231 3152 3232 /** \fn VideoDialog::MetadataBrowseMenu() 3153 3233 * \brief Pop up a MythUI Menu for MythVideo Metadata Browse modes. 3154 3234 * \return void. -
mythvideo/mythvideo/videodlg.h
119 119 void ShowCastDialog(); 120 120 void ShowHomepage(); 121 121 bool DoItemDetailShow(); 122 void ShowGeneralSettings(); 123 void ShowDvdSettings(); 124 void ShowParentalSettings(); 122 125 void ShowPlayerSettings(); 123 126 void ShowExtensionSettings(); 124 127 void ShowMetadataSettings(); 128 void ShowImportSettings(); 129 void ShowTranscodingSettings(); 125 130 126 131 void OnParentalChange(int amount); 127 132