本文整理汇总了C++中MythMenu类的典型用法代码示例。如果您正苦于以下问题:C++ MythMenu类的具体用法?C++ MythMenu怎么用?C++ MythMenu使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MythMenu类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MythMenu
/** \fn GalleryView::MenuMain()
* \brief Shows the main menu when the MENU button was pressed
* \return void
*/
void GalleryView::MenuMain()
{
// Create the main menu that
// will contain the submenus above
MythMenu *menu = new MythMenu(tr("Image Options"), this, "mainmenu");
// Depending on the status of the sync show either the
// start sync or stop sync. The user can decide if he
// wants to stop the sync before leaving the main screen.
if (!m_syncStatusThread->isSyncRunning())
menu->AddItem(tr("Start Syncronization"), SLOT(ConfirmStartSync()));
else
menu->AddItem(tr("Stop Syncronization"), SLOT(ConfirmStopSync()));
// Add the available submenus to the main menu. The methods will
// check if the requirements for showing the menu item is fulfilled
MenuMetadata(menu);
MenuSelection(menu);
MenuFile(menu);
menu->AddItem(tr("Settings"), SLOT(MenuSettings()));
m_menuPopup = new MythDialogBox(menu, m_popupStack, "menuPopup");
if (!m_menuPopup->Create())
{
delete m_menuPopup;
m_menuPopup = NULL;
return;
}
m_popupStack->AddScreen(m_menuPopup);
}
示例2: tr
/** \fn GalleryView::MenuInformation()
* \brief Shows the menu when the INFO key was pressed
* \return void
*/
void GalleryView::MenuInformation()
{
QString label = tr("Image Information");
MythMenu *menu = new MythMenu(label, this, "infomenu");
// only show the slideshow options and details menu when
// the item is a video or image file
ImageMetadata *im = GetImageMetadataFromSelectedButton();
if (im)
{
if (im->m_type == kImageFile ||
im->m_type == kVideoFile)
{
menu->AddItem(tr("Normal SlideShow"), SLOT(ShowFiles()));
menu->AddItem(tr("Random Slideshow"), SLOT(ShowRandomFiles()));
}
if (im->m_type == kImageFile)
menu->AddItem(tr("Show Details"), SLOT(FileDetails()));
}
m_menuPopup = new MythDialogBox(menu, m_popupStack, "menuPopup");
if (!m_menuPopup->Create())
{
delete m_menuPopup;
m_menuPopup = NULL;
return;
}
m_popupStack->AddScreen(m_menuPopup);
}
示例3: tr
MythMenu* IconView::CreateMetadataMenu(void)
{
QString label = tr("Metadata Options");
MythMenu *menu = new MythMenu(label, this, "metadatamenu");
menu->AddItem(tr("Rotate CW"), 0);
menu->AddItem(tr("Rotate CCW"), 1);
return menu;
}
示例4: tr
void IconView::HandleMainMenu(void)
{
QString label = tr("Gallery Options");
MythMenu *menu = new MythMenu(label, this, "mainmenu");
menu->AddItem(tr("SlideShow"));
menu->AddItem(tr("Random"));
menu->AddItem(tr("Meta Data Options"), NULL, CreateMetadataMenu());
menu->AddItem(tr("Marking Options"), NULL, CreateMarkingMenu());
menu->AddItem(tr("Filter / Sort..."));
menu->AddItem(tr("File Options"), NULL, CreateFileMenu());
menu->AddItem(tr("Settings..."));
// if (m_showDevices)
// {
// QDir d(m_currDir);
// if (!d.exists())
// m_currDir = m_galleryDir;
//
// LoadDirectory(m_currDir);
// m_showDevices = false;
// }
m_menuPopup = new MythDialogBox(menu, m_popupStack, "mythgallerymenupopup");
if (!m_menuPopup->Create())
{
delete m_menuPopup;
m_menuPopup = NULL;
return;
}
m_popupStack->AddScreen(m_menuPopup);
}
示例5: MythMenu
/**
* \brief Add Transforms submenu
* \param mainMenu Parent menu
*/
void GallerySlideView::MenuTransforms(MythMenu &mainMenu)
{
ImagePtrK im = m_slides.GetCurrent().GetImageData();
if (im && !m_playing)
{
MythMenu *menu = new MythMenu(tr("Transform Options"),
this, "metadatamenu");
if (m_editsAllowed)
{
menu->AddItem(tr("Rotate CW"));
menu->AddItem(tr("Rotate CCW"));
menu->AddItem(tr("Flip Horizontal"));
menu->AddItem(tr("Flip Vertical"));
menu->AddItem(tr("Reset to Exif"));
}
if (m_slides.GetCurrent().CanZoomIn())
menu->AddItem(tr("Zoom In"));
if (m_slides.GetCurrent().CanZoomOut())
menu->AddItem(tr("Zoom Out"));
mainMenu.AddItem(tr("Transforms"), NULL, menu);
}
}
示例6: tr
MythMenu* NetTree::createShowViewMenu()
{
QString label = tr("View Options");
MythMenu *menu = new MythMenu(label, this, "options");
if (m_type != DLG_TREE)
menu->AddItem(tr("Switch to List View"), SLOT(switchTreeView()));
if (m_type != DLG_GALLERY)
menu->AddItem(tr("Switch to Gallery View"), SLOT(switchGalleryView()));
if (m_type != DLG_BROWSER)
menu->AddItem(tr("Switch to Browse View"), SLOT(switchBrowseView()));
return menu;
}
示例7: tr
void VisualizerView::ShowMenu(void)
{
QString label = tr("Actions");
MythMenu *menu = new MythMenu(label, this, "menu");
menu->AddItem(tr("Change Visualizer"), NULL, createVisualizerMenu());
menu->AddItem(tr("Show Track Info"), SLOT(showTrackInfoPopup()));
menu->AddItem(tr("Other Options"), NULL, createMainMenu());
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menuPopup = new MythDialogBox(menu, popupStack, "actionmenu");
if (menuPopup->Create())
popupStack->AddScreen(menuPopup);
else
delete menuPopup;
}
示例8: GetImageMetadataFromSelectedButton
/** \fn GalleryView::MenuSelection(MythMenu *)
* \brief Adds a new selection menu entry into the main menu
* \param mainMenu Parent that will hold the menu entry
* \return void
*/
void GalleryView::MenuSelection(MythMenu *mainMenu)
{
ImageMetadata *im = GetImageMetadataFromSelectedButton();
if (im)
{
// Selection / deselection is only
// available for images or videos
if (im->m_type == kImageFile ||
im->m_type == kVideoFile)
{
MythMenu *menu = new MythMenu(tr("Selection Options"),
this, "selectionmenu");
if (!im->m_selected)
menu->AddItem(tr("Select File"),
SLOT(FileSelectOne()));
else
menu->AddItem(tr("Deselect File"),
SLOT(FileDeselectOne()));
menu->AddItem(tr("Select All Files"), SLOT(FileSelectAll()));
menu->AddItem(tr("Deselect All Files"), SLOT(FileDeselectAll()));
menu->AddItem(tr("Invert Selection"), SLOT(FileInvertAll()));
mainMenu->AddItem(tr("Selection Menu"), NULL, menu);
}
}
}
示例9: MythMenu
void StreamView::ShowMenu(void)
{
MythMenu *menu = NULL;
menu = new MythMenu(tr("Stream Actions"), this, "streammenu");
menu->AddItem(tr("Add Stream"));
if (m_streamList->GetItemCurrent())
{
menu->AddItem(tr("Edit Stream"));
menu->AddItem(tr("Remove Stream"));
}
menu->AddItem(tr("More Options"), NULL, createMainMenu());
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menuPopup = new MythDialogBox(menu, popupStack, "actionmenu");
if (menuPopup->Create())
popupStack->AddScreen(menuPopup);
else
delete menu;
}
示例10: tr
void NetTree::showMenu(void)
{
QString label = tr("Playback/Download Options");
MythMenu *menu = new MythMenu(label, this, "options");
ResultItem *item = NULL;
if (m_type == DLG_TREE)
{
MythGenericTree *node = m_siteMap->GetCurrentNode();
if (node)
item = qVariantValue<ResultItem *>(node->GetData());
}
else
{
MythGenericTree *node = GetNodePtrFromButton(m_siteButtonList->GetItemCurrent());
if (node)
item = qVariantValue<ResultItem *>(node->GetData());
}
if (item)
{
if (item->GetDownloadable())
menu->AddItem(tr("Stream Video"), SLOT(streamWebVideo()));
menu->AddItem(tr("Open Web Link"), SLOT(showWebVideo()));
if (item->GetDownloadable())
menu->AddItem(tr("Save This Video"), SLOT(doDownloadAndPlay()));
}
menu->AddItem(tr("Scan/Manage Subscriptions"), NULL, createShowManageMenu());
menu->AddItem(tr("Change View"), NULL, createShowViewMenu());
MythDialogBox *menuPopup = new MythDialogBox(menu, m_popupStack, "mythnettreemenupopup");
if (menuPopup->Create())
m_popupStack->AddScreen(menuPopup);
else
delete menuPopup;
}
示例11: tr
void SearchView::ShowMenu(void)
{
if (GetFocusWidget() == m_tracksList)
{
QString label = tr("Search Actions");
MythMenu *menu = new MythMenu(label, this, "searchviewmenu");
MythUIButtonListItem *item = m_tracksList->GetItemCurrent();
if (item)
{
MusicMetadata *mdata = qVariantValue<MusicMetadata*> (item->GetData());
if (mdata)
{
if (gPlayer->getCurrentPlaylist() && gPlayer->getCurrentPlaylist()->checkTrack(mdata->ID()))
menu->AddItem(tr("Remove From Playlist"));
else
{
menu->AddItem(tr("Add To Playlist"));
menu->AddItem(tr("Add To Playlist And Play"));
}
}
}
if (GetFocusWidget() == m_tracksList || GetFocusWidget() == m_currentPlaylist)
menu->AddItem(tr("Search List..."));
menu->AddItem(tr("More Options"), NULL, createSubMenu());
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menuPopup = new MythDialogBox(menu, popupStack, "actionmenu");
if (menuPopup->Create())
popupStack->AddScreen(menuPopup);
else
delete menu;
}
else
MusicCommon::ShowMenu();
}