Ticket #5920: trailerplayback.2.diff
File trailerplayback.2.diff, 2.4 KB (added by , 15 years ago) |
---|
-
mythvideo/mythvideo/videodlg.h
56 56 void SetCurrentNode(MythGenericTree *); 57 57 58 58 void playVideo(); 59 void playTrailer(); 59 60 60 61 void SwitchTree(); 61 62 void SwitchGallery(); -
mythvideo/mythvideo/videodlg.cpp
21 21 #include <mythtv/libmythui/mythuistatetype.h> 22 22 #include <mythtv/libmythui/mythdialogbox.h> 23 23 #include <mythtv/libmythui/mythgenerictree.h> 24 #include "mythtv/libmythui/mythmainwindow.h" 24 25 25 26 #include "videodlg.h" 26 27 #include "videoscan.h" … … 1342 1343 { 1343 1344 QString label = tr("Select action"); 1344 1345 1346 Metadata *metadata = GetMetadata(GetItemCurrent()); 1347 QString trailerFile = QString("%1.trailer").arg(metadata->Filename()); 1348 1345 1349 m_menuPopup = new MythDialogBox(label, m_popupStack, "videomenupopup"); 1346 1350 1347 1351 if (m_menuPopup->Create()) … … 1357 1361 if (node && node->getInt() >= 0) 1358 1362 { 1359 1363 m_menuPopup->AddButton(tr("Watch This Video"), SLOT(playVideo())); 1364 if (QFile::exists(trailerFile)) 1365 { 1366 m_menuPopup->AddButton(tr("Watch Trailer"), SLOT(playTrailer())); 1367 } 1360 1368 m_menuPopup->AddButton(tr("Video Info"), SLOT(InfoMenu())); 1361 1369 m_menuPopup->AddButton(tr("Manage Video"), SLOT(ManageMenu())); 1362 1370 } … … 1554 1562 gContext->GetMainWindow()->currentWidget()->setFocus(); 1555 1563 } 1556 1564 1565 void VideoDialog::playTrailer() 1566 { 1567 QString trailerFile; 1568 QString command_string = "Internal"; 1569 1570 Metadata *metadata = GetMetadata(GetItemCurrent()); 1571 1572 trailerFile = QString("%1.trailer").arg(metadata->Filename()); 1573 1574 VERBOSE(VB_IMPORTANT, QString("Playing Trailer '%1'") 1575 .arg(trailerFile)); 1576 1577 gContext->GetMainWindow()->HandleMedia(command_string, trailerFile); 1578 gContext->GetMainWindow()->raise(); 1579 gContext->GetMainWindow()->activateWindow(); 1580 if (gContext->GetMainWindow()->currentWidget()) 1581 gContext->GetMainWindow()->currentWidget()->setFocus(); 1582 } 1583 1557 1584 void VideoDialog::setParentalLevel(const ParentalLevel::Level &level) 1558 1585 { 1559 1586 m_private->m_parentalLevel.SetLevel(level);