本文整理汇总了C++中MythDialogBox::AddButton方法的典型用法代码示例。如果您正苦于以下问题:C++ MythDialogBox::AddButton方法的具体用法?C++ MythDialogBox::AddButton怎么用?C++ MythDialogBox::AddButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythDialogBox
的用法示例。
在下文中一共展示了MythDialogBox::AddButton方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showSaveMenu
void EditMetadataCommon::showSaveMenu()
{
updateMetadata();
if (!hasMetadataChanged())
{
Close();
return;
}
QString label = tr("Save Changes?");
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menu = new MythDialogBox(label, popupStack, "savechangesmenu");
if (!menu->Create())
{
delete menu;
return;
}
menu->SetReturnEvent(this, "savechangesmenu");
if (metadataOnly)
menu->AddButton(tr("Save Changes"), SLOT(saveToMetadata()));
else
menu->AddButton(tr("Save Changes"), SLOT(saveAll()));
menu->AddButton(tr("Exit/Do Not Save"), SLOT(cleanupAndClose()));
menu->AddButton(tr("Cancel"));
popupStack->AddScreen(menu);
}
示例2: showMenu
void GameUI::showMenu()
{
MythGenericTree *node = m_gameUITree->GetCurrentNode();
if (isLeaf(node))
{
MythScreenStack *popupStack = GetMythMainWindow()->
GetStack("popup stack");
MythDialogBox *showMenuPopup =
new MythDialogBox(node->getString(), popupStack, "showMenuPopup");
if (showMenuPopup->Create())
{
showMenuPopup->SetReturnEvent(this, "showMenuPopup");
RomInfo *romInfo = qVariantValue<RomInfo *>(node->GetData());
if (romInfo)
{
showMenuPopup->AddButton(tr("Show Information"));
if (romInfo->Favorite())
showMenuPopup->AddButton(tr("Remove Favorite"));
else
showMenuPopup->AddButton(tr("Make Favorite"));
showMenuPopup->AddButton(tr("Retrieve Details"));
showMenuPopup->AddButton(tr("Edit Details"));
}
popupStack->AddScreen(showMenuPopup);
}
else
delete showMenuPopup;
}
}
示例3: ShowMenu
void ViewScheduled::ShowMenu(void)
{
QString label = tr("Options");
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menuPopup = new MythDialogBox(label, popupStack,
"menuPopup");
if (menuPopup->Create())
{
menuPopup->SetReturnEvent(this, "menu");
if (m_showAll)
menuPopup->AddButton(tr("Show Important"));
else
menuPopup->AddButton(tr("Show All"));
menuPopup->AddButton(tr("Program Details"));
menuPopup->AddButton(tr("Program Guide"));
menuPopup->AddButton(tr("Channel Search"));
menuPopup->AddButton(tr("Upcoming by title"));
menuPopup->AddButton(tr("Upcoming scheduled"));
menuPopup->AddButton(tr("Previously Recorded"));
menuPopup->AddButton(tr("Custom Edit"));
menuPopup->AddButton(tr("Delete Rule"));
menuPopup->AddButton(tr("Show Inputs"));
popupStack->AddScreen(menuPopup);
}
else
{
delete menuPopup;
}
}
示例4: showMenu
void EditMetadataDialog::showMenu(void )
{
QString label = tr("Options");
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menu = new MythDialogBox(label, popupStack, "optionsmenu");
if (!menu->Create())
{
delete menu;
return;
}
menu->SetReturnEvent(this, "optionsmenu");
menu->AddButton(tr("Edit Albumart Images"));
menu->AddButton(tr("Search Internet For Artist Image"));
menu->AddButton(tr("Search Internet For Album Image"));
menu->AddButton(tr("Search Internet For Genre Image"));
menu->AddButton(tr("Check Track Length"));
menu->AddButton(tr("Cancel"));
popupStack->AddScreen(menu);
}
示例5: promptForRemoval
void GameHandler::promptForRemoval(GameScan scan)
{
QString filename = scan.Rom();
QString RomPath = scan.RomFullPath();
if (m_RemoveAll)
purgeGameDB(filename , RomPath);
if (m_KeepAll || m_RemoveAll)
return;
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *removalPopup = new MythDialogBox(
tr("%1 appears to be missing.\nRemove it from the database?")
.arg(filename), popupStack, "chooseSystemPopup");
if (removalPopup->Create())
{
removalPopup->SetReturnEvent(this, "removalPopup");
removalPopup->AddButton(tr("No"));
removalPopup->AddButton(tr("No to all"));
removalPopup->AddButton(tr("Yes"), qVariantFromValue(scan));
removalPopup->AddButton(tr("Yes to all"), qVariantFromValue(scan));
popupStack->AddScreen(removalPopup);
}
else
delete removalPopup;
}
示例6: showUnitsPopup
void ScreenSetup::showUnitsPopup(const QString &name, ScreenListInfo *si)
{
if (!si)
return;
QString label = QString("%1 %2").arg(name).arg(tr("Change Units"));
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menuPopup = new MythDialogBox(label, popupStack,
"weatherunitspopup");
if (menuPopup->Create())
{
popupStack->AddScreen(menuPopup);
menuPopup->SetReturnEvent(this, "units");
menuPopup->AddButton(tr("English Units"), qVariantFromValue(si));
menuPopup->AddButton(tr("SI Units"), qVariantFromValue(si));
}
else
{
delete menuPopup;
}
}
示例7: handleExit
void ExitPrompter::handleExit()
{
QStringList problems;
// Look for common problems
if (CheckSetup(problems))
{
problems.push_back(QString());
problems.push_back(tr("Do you want to go back and fix this(these) "
"problem(s)?", 0, problems.size()));
MythDialogBox *dia = new MythDialogBox(problems.join("\n"),
m_d->stk, "exit prompt");
if (!dia->Create())
{
VERBOSE(VB_IMPORTANT, "Can't create Exit Prompt dialog?");
delete dia;
quit();
}
dia->SetReturnEvent(this, "problemprompt");
dia->AddButton(tr("Yes please"));
dia->AddButton(tr("No, I know what I am doing"),
SLOT(masterPromptExit()));
m_d->stk->AddScreen(dia);
}
else
masterPromptExit();
}
示例8: ShowMenu
void ThumbFinder::ShowMenu()
{
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menuPopup = new MythDialogBox(tr("Menu"), popupStack, "actionmenu");
if (menuPopup->Create())
popupStack->AddScreen(menuPopup);
menuPopup->SetReturnEvent(this, "action");
menuPopup->AddButton(tr("Exit, Save Thumbnails"), SLOT(savePressed()));
menuPopup->AddButton(tr("Exit, Don't Save Thumbnails"), SLOT(cancelPressed()));
}
示例9: showMenu
void VideoSelector::showMenu()
{
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menuPopup = new MythDialogBox(tr("Menu"), popupStack, "actionmenu");
if (menuPopup->Create())
popupStack->AddScreen(menuPopup);
menuPopup->SetReturnEvent(this, "action");
menuPopup->AddButton(tr("Clear All"), SLOT(clearAll()));
menuPopup->AddButton(tr("Select All"), SLOT(selectAll()));
}
示例10: showMenu
void ExportNative::showMenu()
{
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menuPopup = new MythDialogBox(tr("Menu"), popupStack, "actionmenu");
if (menuPopup->Create())
popupStack->AddScreen(menuPopup);
menuPopup->SetReturnEvent(this, "action");
menuPopup->AddButton(tr("Remove Item"), SLOT(removeItem()));
menuPopup->AddButton(tr("Cancel"), NULL);
}
示例11: channelIconImport
void ChannelEditor::channelIconImport(void)
{
if (m_channelList->GetCount() == 0)
{
ShowOkPopup(tr("Add some channels first!"));
return;
}
int channelID = 0;
MythUIButtonListItem *item = m_channelList->GetItemCurrent();
if (item)
channelID = item->GetData().toInt();
// Get selected channel name from database
QString querystr = QString("SELECT channel.name FROM channel "
"WHERE chanid='%1'").arg(channelID);
QString channelname;
MSqlQuery query(MSqlQuery::InitCon());
query.prepare(querystr);
if (query.exec() && query.next())
{
channelname = query.value(0).toString();
}
QString label = tr("Icon Import Options");
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menu = new MythDialogBox(label, popupStack, "iconoptmenu");
if (menu->Create())
{
menu->SetReturnEvent(this, "iconimportopt");
menu->AddButton(tr("Download all icons..."));
menu->AddButton(tr("Rescan for missing icons..."));
if (!channelname.isEmpty())
menu->AddButton(tr("Download icon for %1").arg(channelname),
channelname);
popupStack->AddScreen(menu);
}
else
{
delete menu;
return;
}
}
示例12: ShowMenu
void ProgLister::ShowMenu(void)
{
QString label = tr("Options");
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menuPopup = new MythDialogBox(
label, popupStack, "menuPopup");
if (!menuPopup->Create())
{
delete menuPopup;
return;
}
menuPopup->SetReturnEvent(this, "menu");
if (m_type != plPreviouslyRecorded)
{
menuPopup->AddButton(tr("Choose Search Phrase..."),
SLOT(ShowChooseViewMenu()));
}
menuPopup->AddButton(tr("Sort"), SLOT(ShowSortMenu()), true);
if (m_type != plPreviouslyRecorded)
menuPopup->AddButton(tr("Record"), SLOT(RecordSelected()));
menuPopup->AddButton(tr("Edit Schedule"), SLOT(EditScheduled()));
menuPopup->AddButton(tr("Program Details"), SLOT(ShowDetails()));
menuPopup->AddButton(tr("Upcoming"), SLOT(ShowUpcoming()));
menuPopup->AddButton(tr("Custom Edit"), SLOT(EditCustom()));
ProgramInfo *pi = m_itemList[m_progList->GetCurrentPos()];
if (m_type != plPreviouslyRecorded)
{
if (pi && pi->GetRecordingRuleID())
menuPopup->AddButton(tr("Delete Rule"), SLOT(ShowDeleteRuleMenu()));
}
else
{
menuPopup->AddButton(
tr("Delete Episode"), SLOT(ShowDeleteOldEpisodeMenu()));
}
menuPopup->AddButton(tr("Cancel"));
popupStack->AddScreen(menuPopup);
}
示例13: ShowMenu
void ChannelRecPriority::ShowMenu()
{
MythUIButtonListItem *item = m_channelList->GetItemCurrent();
if (!item)
return;
QString label = tr("Channel Options");
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *menuPopup = new MythDialogBox(label, popupStack,
"chanrecmenupopup");
if (!menuPopup->Create())
{
delete menuPopup;
menuPopup = nullptr;
return;
}
menuPopup->SetReturnEvent(this, "options");
menuPopup->AddButton(tr("Program List"));
//menuPopup->AddButton(tr("Reset All Priorities"));
popupStack->AddScreen(menuPopup);
}
示例14: backendRunningPrompt
void StartPrompter::backendRunningPrompt(void)
{
bool backendIsRecording = false;
// Get recording status
if (!gCoreContext->IsConnectedToMaster() &&
gCoreContext->ConnectToMasterServer(false))
{
backendIsRecording = RemoteGetRecordingStatus(NULL, false);
}
QString warning = tr("WARNING: The backend is currently running.")+"\n\n"+
tr("Changing existing card inputs, deleting anything, "
"or scanning for channels may not work.")+"\n\n";
if (backendIsRecording)
{
warning += tr("Recording Status: RECORDING.")+"\n"+
tr("If you stop the backend now these recordings will be stopped!");
}
else
{
warning += tr("Recording Status: None.");
}
MythDialogBox *dia = new MythDialogBox(warning, m_d->stk, "actionmenu");
if (!dia->Create())
{
LOG(VB_GENERAL, LOG_ERR, "Can't create Prompt dialog?");
delete dia;
quit();
}
// This is a hack so that the button clicks target the correct slot:
dia->SetReturnEvent(this, QString());
m_d->stk->AddScreen(dia);
QString commandString = gCoreContext->GetSetting("BackendStopCommand");
if (!commandString.isEmpty())
{
// Only show option to stop backend if command is defined.
dia->AddButton(tr("Stop Backend and Continue"), SLOT(stopBackend()));
}
dia->AddButton(tr("Continue"), SLOT(leaveBackendRunning()));
dia->AddButton(tr("Exit"), SLOT(quit()));
}
示例15: clearAllGameData
void GameHandler::clearAllGameData(void)
{
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythDialogBox *clearPopup = new MythDialogBox(tr("This will clear all game metadata "
"from the database. Are you sure you "
"want to do this?"), popupStack, "clearAllPopup");
if (clearPopup->Create())
{
clearPopup->SetReturnEvent(this, "clearAllPopup");
clearPopup->AddButton(tr("No"));
clearPopup->AddButton(tr("Yes"));
popupStack->AddScreen(clearPopup);
}
else
delete clearPopup;
}