示例#1
0
/** \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
0
/** \fn     GalleryView::MenuMain()
 *  \brief  Shows a dialog popup with the main menu
 *  \return void
 */
void GalleryWidget::MenuMain()
{
    // Create the main menu that will contain the submenus above
    MythMenu *menu = new MythMenu(tr("Image Information"), this, "mainmenu");

    // If no slideshow type was given show the item to start it
    // otherwise show the items to stop or resume a slideshow.
    if (m_slideShowType == kNoSlideShow)
    {
        menu->AddItem(tr("Start Normal SlideShow"),
                      SLOT(StartNormalSlideShow()));
        menu->AddItem(tr("Start Random SlideShow"),
                      SLOT(StartRandomSlideShow()));
    }
    else
    {
        if (m_timer->isActive())
            menu->AddItem(tr("Pause SlideShow"), SLOT(PauseSlideShow()));
        else
        {
            if (m_slideShowType == kNormalSlideShow)
                menu->AddItem(tr("Resume SlideShow"),
                              SLOT(StartNormalSlideShow()));

            if (m_slideShowType == kRandomSlideShow)
                menu->AddItem(tr("Resume SlideShow"),
                              SLOT(StartRandomSlideShow()));
        }
    }

    MenuMetadata(menu);
    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);
}