本文整理汇总了C++中MythConfirmationDialog::SetData方法的典型用法代码示例。如果您正苦于以下问题:C++ MythConfirmationDialog::SetData方法的具体用法?C++ MythConfirmationDialog::SetData怎么用?C++ MythConfirmationDialog::SetData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythConfirmationDialog
的用法示例。
在下文中一共展示了MythConfirmationDialog::SetData方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteRule
void ViewScheduled::deleteRule()
{
MythUIButtonListItem *item = m_schedulesList->GetItemCurrent();
if (!item)
return;
ProgramInfo *pginfo = qVariantValue<ProgramInfo*>(item->GetData());
if (!pginfo)
return;
RecordingRule *record = new RecordingRule();
if (!record->LoadByProgram(pginfo))
{
delete record;
return;
}
QString message = tr("Delete '%1' %2 rule?").arg(record->m_title)
.arg(toString(pginfo->GetRecordingRuleType()));
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *okPopup = new MythConfirmationDialog(popupStack,
message, true);
okPopup->SetReturnEvent(this, "deleterule");
okPopup->SetData(qVariantFromValue(record));
if (okPopup->Create())
popupStack->AddScreen(okPopup);
else
delete okPopup;
}
示例2: ShowDeleteRuleMenu
void ProgLister::ShowDeleteRuleMenu(void)
{
ProgramInfo *pi = GetCurrent();
if (!pi || !pi->GetRecordingRuleID())
return;
RecordingRule *record = new RecordingRule();
if (!record->LoadByProgram(pi))
{
delete record;
return;
}
QString message = tr("Delete '%1' %2 rule?").arg(record->m_title)
.arg(toString(pi->GetRecordingRuleType()));
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *okPopup = new MythConfirmationDialog(
popupStack, message, true);
okPopup->SetReturnEvent(this, "deleterule");
okPopup->SetData(qVariantFromValue(record));
if (okPopup->Create())
popupStack->AddScreen(okPopup);
else
delete okPopup;
}
示例3: remove
void ProgramRecPriority::remove(void)
{
MythUIButtonListItem *item = m_programList->GetItemCurrent();
if (!item)
return;
ProgramRecPriorityInfo *pgRecInfo =
item->GetData().value<ProgramRecPriorityInfo*>();
if (!pgRecInfo ||
(pgRecInfo->recType == kTemplateRecord &&
pgRecInfo->GetCategory()
.compare("Default", Qt::CaseInsensitive) == 0))
{
return;
}
RecordingRule *record = new RecordingRule();
record->m_recordID = pgRecInfo->GetRecordingRuleID();
if (!record->Load())
{
delete record;
return;
}
QString message = tr("Delete '%1' %2 rule?").arg(record->m_title)
.arg(toString(pgRecInfo->GetRecordingRuleType()));
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *okPopup = new MythConfirmationDialog(popupStack,
message, true);
okPopup->SetReturnEvent(this, "deleterule");
okPopup->SetData(qVariantFromValue(record));
if (okPopup->Create())
popupStack->AddScreen(okPopup);
else
delete okPopup;
}
示例4: del
void ChannelEditor::del()
{
MythUIButtonListItem *item = m_channelList->GetItemCurrent();
if (!item)
return;
QString message = tr("Delete channel '%1'?").arg(item->GetText("name"));
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, message, true);
if (dialog->Create())
{
dialog->SetData(qVariantFromValue(item));
dialog->SetReturnEvent(this, "delsingle");
popupStack->AddScreen(dialog);
}
else
delete dialog;
}
示例5: ResolveConflict
/**
* \brief Resolve a potential conflict
* \return true if the conflict should be bound, false otherwise.
*/
void MythControls::ResolveConflict(ActionID *conflict, int error_level,
const QString &key)
{
if (!conflict)
return;
QString label;
bool error = (KeyBindings::kKeyBindingError == error_level);
if (error)
label = tr("This key binding conflicts with %1 in the %2 context. "
"Unable to bind key.")
.arg(conflict->GetAction()).arg(conflict->GetContext());
else
label = tr("This key binding conflicts with %1 in the %2 context. "
"Do you want to bind it anyway?")
.arg(conflict->GetAction()).arg(conflict->GetContext());
MythScreenStack *popupStack =
GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *confirmPopup =
new MythConfirmationDialog(popupStack, label, !error);
if (!error)
{
confirmPopup->SetData(qVariantFromValue(key));
confirmPopup->SetReturnEvent(this, "conflict");
}
if (confirmPopup->Create())
popupStack->AddScreen(confirmPopup);
delete conflict;
}
示例6: DialogShow
void OSD::DialogShow(const QString &window, const QString &text, int updatefor)
{
if (m_Dialog)
{
QString current = m_Dialog->objectName();
if (current != window)
{
DialogQuit();
}
else
{
MythDialogBox *dialog = dynamic_cast<MythDialogBox*>(m_Dialog);
if (dialog)
dialog->Reset();
DialogSetText(text);
}
}
if (!m_Dialog)
{
OverrideUIScale();
MythScreenType *dialog;
if (window == OSD_DLG_EDITOR)
dialog = new ChannelEditor(m_ParentObject, window.toLatin1());
else if (window == OSD_DLG_CONFIRM)
dialog = new MythConfirmationDialog(NULL, text, false);
else
dialog = new MythDialogBox(text, NULL, window.toLatin1(), false, true);
dialog->SetPainter(m_CurrentPainter);
if (dialog->Create())
{
PositionWindow(dialog);
m_Dialog = dialog;
MythDialogBox *dbox = dynamic_cast<MythDialogBox*>(m_Dialog);
if (dbox)
dbox->SetReturnEvent(m_ParentObject, window);
MythConfirmationDialog *cbox = dynamic_cast<MythConfirmationDialog*>(m_Dialog);
if (cbox)
{
cbox->SetReturnEvent(m_ParentObject, window);
cbox->SetData("DIALOG_CONFIRM_X_X");
}
m_Children.insert(window, m_Dialog);
}
else
{
RevertUIScale();
delete dialog;
return;
}
RevertUIScale();
}
if (updatefor)
{
m_NextPulseUpdate = MythDate::current();
m_PulsedDialogText = text;
SetExpiry(window, kOSDTimeout_None, updatefor);
}
DialogBack();
HideAll(true, m_Dialog);
m_Dialog->SetVisible(true);
}
示例7: clicked
void StatusBox::clicked(MythUIButtonListItem *item)
{
if (!item)
return;
LogLine logline = qVariantValue<LogLine>(item->GetData());
MythUIButtonListItem *currentButton = m_categoryList->GetItemCurrent();
QString currentItem;
if (currentButton)
currentItem = currentButton->GetText();
// FIXME: Comparisons against strings here is not great, changing names
// breaks everything and it's inefficient
if (currentItem == tr("Log Entries"))
{
QString message = tr("Acknowledge this log entry?");
MythConfirmationDialog *confirmPopup =
new MythConfirmationDialog(m_popupStack, message);
confirmPopup->SetReturnEvent(this, "LogAck");
confirmPopup->SetData(logline.data);
if (confirmPopup->Create())
m_popupStack->AddScreen(confirmPopup, false);
}
else if (currentItem == tr("Job Queue"))
{
QStringList msgs;
int jobStatus;
jobStatus = JobQueue::GetJobStatus(logline.data.toInt());
if (jobStatus == JOB_QUEUED)
{
QString message = tr("Delete Job?");
MythConfirmationDialog *confirmPopup =
new MythConfirmationDialog(m_popupStack, message);
confirmPopup->SetReturnEvent(this, "JobDelete");
confirmPopup->SetData(logline.data);
if (confirmPopup->Create())
m_popupStack->AddScreen(confirmPopup, false);
}
else if ((jobStatus == JOB_PENDING) ||
(jobStatus == JOB_STARTING) ||
(jobStatus == JOB_RUNNING) ||
(jobStatus == JOB_PAUSED))
{
QString label = tr("Job Queue Actions:");
MythDialogBox *menuPopup = new MythDialogBox(label, m_popupStack,
"statusboxpopup");
if (menuPopup->Create())
m_popupStack->AddScreen(menuPopup, false);
menuPopup->SetReturnEvent(this, "JobModify");
QVariant data = qVariantFromValue(logline.data);
if (jobStatus == JOB_PAUSED)
menuPopup->AddButton(tr("Resume"), data);
else
menuPopup->AddButton(tr("Pause"), data);
menuPopup->AddButton(tr("Stop"), data);
menuPopup->AddButton(tr("No Change"), data);
}
else if (jobStatus & JOB_DONE)
{
QString message = tr("Requeue Job?");
MythConfirmationDialog *confirmPopup =
new MythConfirmationDialog(m_popupStack, message);
confirmPopup->SetReturnEvent(this, "JobRequeue");
confirmPopup->SetData(logline.data);
if (confirmPopup->Create())
m_popupStack->AddScreen(confirmPopup, false);
}
}
else if (currentItem == tr("AutoExpire List"))
{
ProgramInfo* rec = m_expList[m_logList->GetCurrentPos()];
if (rec)
{
QString label = tr("AutoExpire Actions:");
MythDialogBox *menuPopup = new MythDialogBox(label, m_popupStack,
"statusboxpopup");
if (menuPopup->Create())
m_popupStack->AddScreen(menuPopup, false);
menuPopup->SetReturnEvent(this, "AutoExpireManage");
//.........这里部分代码省略.........