static int runMenu(QString which_menu) { QString themedir = GetMythUI()->GetThemeDir(); MythThemedMenu *diag = new MythThemedMenu( themedir, which_menu, GetMythMainWindow()->GetMainStack(), "music menu"); diag->setCallback(MusicCallback, NULL); diag->setKillable(); if (diag->foundTheme()) { if (LCD *lcd = LCD::Get()) { lcd->switchToTime(); } GetMythMainWindow()->GetMainStack()->AddScreen(diag); return 0; } else { VERBOSE(VB_IMPORTANT, QString("Couldn't find menu %1 or theme %2") .arg(which_menu).arg(themedir)); delete diag; return -1; } }
int mythplugin_config() { QString menuname = "weather_settings.xml"; QString themedir = GetMythUI()->GetThemeDir(); MythThemedMenu *menu = new MythThemedMenu( themedir, menuname, GetMythMainWindow()->GetMainStack(), "weather menu"); menu->setCallback(WeatherCallback, nullptr); menu->setKillable(); if (menu->foundTheme()) { if (LCD *lcd = LCD::Get()) { lcd->setFunctionLEDs(FUNC_NEWS, false); lcd->switchToTime(); } GetMythMainWindow()->GetMainStack()->AddScreen(menu); return 0; } else { LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find menu %1 or theme %2") .arg(menuname).arg(themedir)); delete menu; return -1; } }
static int runMenu(QString which_menu) { QString themedir = GetMythUI()->GetThemeDir(); MythThemedMenu *menu = new MythThemedMenu( themedir, which_menu, GetMythMainWindow()->GetMainStack(), "game menu"); GameData data; menu->setCallback(GameCallback, &data); menu->setKillable(); if (menu->foundTheme()) { if (LCD *lcd = LCD::Get()) lcd->switchToTime(); GetMythMainWindow()->GetMainStack()->AddScreen(menu); return 0; } else { LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find menu %1 or theme %2") .arg(which_menu).arg(themedir)); delete menu; return -1; } }
static int runMenu(QString which_menu) { QString themedir = GetMythUI()->GetThemeDir(); // find the 'mainmenu' MythThemedMenu so we can use the callback from it MythThemedMenu *mainMenu = NULL; QObject *parentObject = GetMythMainWindow()->GetMainStack()->GetTopScreen(); while (parentObject) { MythThemedMenu *menu = dynamic_cast<MythThemedMenu *>(parentObject); if (menu && menu->objectName() == "mainmenu") { mainMenu = menu; break; } parentObject = parentObject->parent(); } MythThemedMenu *diag = new MythThemedMenu( themedir, which_menu, GetMythMainWindow()->GetMainStack(), "music menu"); // save the callback from the main menu if (mainMenu) mainMenu->getCallback(&m_callback, &m_callbackdata); diag->setCallback(MusicCallback, NULL); diag->setKillable(); if (diag->foundTheme()) { if (LCD *lcd = LCD::Get()) { lcd->switchToTime(); } GetMythMainWindow()->GetMainStack()->AddScreen(diag); return 0; } else { LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find menu %1 or theme %2") .arg(which_menu).arg(themedir)); delete diag; return -1; } }
void runMenu(QString which_menu) { QString themedir = GetMythUI()->GetThemeDir(); MythThemedMenu *diag = new MythThemedMenu(themedir, which_menu, GetMythMainWindow()->GetMainStack(), "wmr928 menu"); diag->setCallback(MenuCallback, NULL); diag->setKillable(); if (diag->foundTheme()) { GetMythMainWindow()->GetMainStack()->AddScreen(diag); } else { cerr << "Couldn't find theme " << qPrintable(themedir) << endl; } }
static int runMenu(QString which_menu) { QString themedir = GetMythUI()->GetThemeDir(); MythThemedMenu *diag = new MythThemedMenu( themedir, which_menu, GetMythMainWindow()->GetMainStack(), "archive menu"); diag->setCallback(ArchiveCallback, NULL); diag->setKillable(); if (diag->foundTheme()) { GetMythMainWindow()->GetMainStack()->AddScreen(diag); return 0; } else { LOG(VB_GENERAL, LOG_ERR, QString("Couldn't find menu %1 or theme %2") .arg(which_menu).arg(themedir)); delete diag; return -1; } }