本文整理汇总了C++中MythConfirmationDialog::SetReturnEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ MythConfirmationDialog::SetReturnEvent方法的具体用法?C++ MythConfirmationDialog::SetReturnEvent怎么用?C++ MythConfirmationDialog::SetReturnEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MythConfirmationDialog
的用法示例。
在下文中一共展示了MythConfirmationDialog::SetReturnEvent方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyPressEvent
bool StatusBox::keyPressEvent(QKeyEvent *event)
{
if (GetFocusWidget()->keyPressEvent(event))
return true;
bool handled = false;
QStringList actions;
handled = GetMythMainWindow()->TranslateKeyPress("Status", event, actions);
for (int i = 0; i < actions.size() && !handled; ++i)
{
QString action = actions[i];
handled = true;
QRegExp logNumberKeys( "^[12345678]$" );
MythUIButtonListItem* currentButton = m_categoryList->GetItemCurrent();
QString currentItem;
if (currentButton)
currentItem = currentButton->GetText();
handled = true;
if (action == "MENU")
{
if (currentItem == tr("Log Entries"))
{
QString message = tr("Acknowledge all log entries at "
"this priority level or lower?");
MythConfirmationDialog *confirmPopup =
new MythConfirmationDialog(m_popupStack, message);
confirmPopup->SetReturnEvent(this, "LogAckAll");
if (confirmPopup->Create())
m_popupStack->AddScreen(confirmPopup, false);
}
}
else if ((currentItem == tr("Log Entries")) &&
(logNumberKeys.indexIn(action) == 0))
{
m_minLevel = action.toInt();
if (m_helpText)
m_helpText->SetText(tr("Setting priority level to %1")
.arg(m_minLevel));
if (m_justHelpText)
m_justHelpText->SetText(tr("Setting priority level to %1")
.arg(m_minLevel));
doLogEntries();
}
else
handled = false;
}
if (!handled && MythScreenType::keyPressEvent(event))
handled = true;
return handled;
}
示例2: keyPressEvent
bool RipStatus::keyPressEvent(QKeyEvent *event)
{
if (GetFocusWidget() && GetFocusWidget()->keyPressEvent(event))
return true;
QStringList actions;
bool handled = GetMythMainWindow()->TranslateKeyPress("Global", event, actions);
for (int i = 0; i < actions.size() && !handled; i++)
{
QString action = actions[i];
handled = true;
if (action == "ESCAPE" &&
m_ripperThread && m_ripperThread->isRunning())
{
MythConfirmationDialog *dialog =
ShowOkPopup(tr("Cancel ripping the CD?"), this,
static_cast<const char*>(nullptr), true);
if (dialog)
dialog->SetReturnEvent(this, "stop_ripping");
}
else
handled = false;
}
if (!handled && MythScreenType::keyPressEvent(event))
handled = true;
return handled;
}
示例3: 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;
}
示例4: 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;
}
示例5: masterPromptExit
void ExitPrompter::masterPromptExit()
{
if (gCoreContext->IsMasterHost() && needsMFDBReminder())
{
QString label = tr("If you've added or altered channels,"
" please run 'mythfilldatabase' on the"
" master backend to populate the"
" database with guide information.");
MythConfirmationDialog *dia = new MythConfirmationDialog(m_d->stk,
label,
false);
if (!dia->Create())
{
VERBOSE(VB_IMPORTANT, "Can't create fill DB prompt?");
delete dia;
quit();
}
else
{
dia->SetReturnEvent(this, "mythfillprompt");
m_d->stk->AddScreen(dia);
}
}
else
quit();
}
示例6: askSubmit
void ImportIconsWizard::askSubmit(const QString& strParam)
{
m_strParam = strParam;
QString message = tr("You now have the opportunity to transmit your "
"choices back to mythtv.org so that others can "
"benefit from your selections.");
MythConfirmationDialog *confirmPopup =
new MythConfirmationDialog(m_popupStack, message);
confirmPopup->SetReturnEvent(this, "submitresults");
if (confirmPopup->Create())
m_popupStack->AddScreen(confirmPopup, false);
}
示例7: 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;
}
示例8: Close
void MythControls::Close()
{
if (m_bindings && m_bindings->HasChanges())
{
/* prompt user to save changes */
QString label = tr("Save changes?");
MythScreenStack *popupStack =
GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *confirmPopup
= new MythConfirmationDialog(popupStack, label, true);
if (confirmPopup->Create())
popupStack->AddScreen(confirmPopup);
confirmPopup->SetReturnEvent(this, "exit");
}
else
MythScreenType::Close();
}
示例9: 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;
}
示例10: deleteChannels
void ChannelEditor::deleteChannels(void)
{
const QString currentLabel = m_sourceList->GetValue();
bool del_all = m_sourceFilter == FILTER_ALL;
bool del_nul = m_sourceFilter == FILTER_UNASSIGNED;
QString message =
(del_all) ? tr("Delete ALL channels?") :
((del_nul) ? tr("Delete all unassigned channels?") :
tr("Delete all channels on %1?").arg(currentLabel));
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, message, true);
if (dialog->Create())
{
dialog->SetReturnEvent(this, "delall");
popupStack->AddScreen(dialog);
}
else
delete dialog;
}
示例11: 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;
}
示例12: DeleteKey
/**
* \brief Delete the currently active key to action mapping
*
* TODO FIXME This code needs work to support deleteKey
* in any mode exc. Context/Action
*/
void MythControls::DeleteKey(void)
{
QString context = GetCurrentContext();
QString key = GetCurrentKey();
QString action = GetCurrentAction();
if (context.isEmpty() || key.isEmpty() || action.isEmpty())
{
LOG(VB_GENERAL, LOG_ERR,
"Unable to delete binding, missing information");
return;
}
if (m_bindings->RemoveActionKey(context, action, key))
{
RefreshKeyInformation();
return;
}
QString label = tr("This action is mandatory and needs at least one key "
"bound to it. Instead, try rebinding with another key.");
MythScreenStack *popupStack =
GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *confirmPopup =
new MythConfirmationDialog(popupStack, label, false);
if (confirmPopup->Create())
{
confirmPopup->SetReturnEvent(this, "mandatorydelete");
popupStack->AddScreen(confirmPopup);
}
else
delete confirmPopup;
}
示例13: 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);
}
示例14: 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");
//.........这里部分代码省略.........