本文整理汇总了C++中MythConfirmationDialog类的典型用法代码示例。如果您正苦于以下问题:C++ MythConfirmationDialog类的具体用法?C++ MythConfirmationDialog怎么用?C++ MythConfirmationDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MythConfirmationDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tr
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();
}
示例2: GetMythMainWindow
bool RipStatus::keyPressEvent(QKeyEvent *event)
{
if (GetFocusWidget() && GetFocusWidget()->keyPressEvent(event))
return true;
bool handled = false;
QStringList actions;
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, NULL, true);
if (dialog)
dialog->SetReturnEvent(this, "stop_ripping");
}
else
handled = false;
}
if (!handled && MythScreenType::keyPressEvent(event))
handled = true;
return handled;
}
示例3: RecordingRule
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: GetMythMainWindow
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;
}
示例5: HideConnectionFailurePopup
void MythContextPrivate::HideConnectionFailurePopup(void)
{
MythConfirmationDialog *dlg = this->MBEconnectPopup;
this->MBEconnectPopup = NULL;
if (dlg)
dlg->Close();
}
示例6: GetCurrent
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;
}
示例7: showWarningDialog
void showWarningDialog(const QString msg)
{
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, msg, false);
if (dialog->Create())
popupStack->AddScreen(dialog);
}
示例8: MythConfirmationDialog
void GeneralSetupWizard::slotSubmit(void)
{
QString message = QObject::tr("Would you like to share your "
"hardware profile with the MythTV developers? "
"Profiles are anonymous and are a great way to "
"help with future development.");
MythConfirmationDialog *confirmdialog =
new MythConfirmationDialog(m_popupStack,message);
if (confirmdialog->Create())
m_popupStack->AddScreen(confirmdialog);
connect(confirmdialog, SIGNAL(haveResult(bool)),
SLOT(OnSubmitPromptReturn(bool)));
}
示例9: tr
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);
}
示例10: tr
void NetTree::slotDeleteVideo()
{
QString message = tr("Are you sure you want to delete this file?");
MythConfirmationDialog *confirmdialog =
new MythConfirmationDialog(m_popupStack,message);
if (confirmdialog->Create())
{
m_popupStack->AddScreen(confirmdialog);
connect(confirmdialog, SIGNAL(haveResult(bool)),
SLOT(doDeleteVideo(bool)));
}
else
delete confirmdialog;
}
示例11: GetMythMainWindow
void BookmarkManager::slotDeleteMarked(void)
{
if (GetMarkedCount() == 0)
return;
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
QString message = tr("Are you sure you want to delete the marked bookmarks?");
MythConfirmationDialog *dialog = new MythConfirmationDialog(popupStack, message, true);
if (dialog->Create())
popupStack->AddScreen(dialog);
connect(dialog, SIGNAL(haveResult(bool)),
this, SLOT(slotDoDeleteMarked(bool)));
}
示例12: locker
void NetSearch::doDownloadAndPlay()
{
QMutexLocker locker(&m_lock);
ResultItem *item =
qVariantValue<ResultItem *>(m_searchResultList->GetDataValue());
if (!item)
return;
VERBOSE(VB_GENERAL, QString("Downloading and Inserting %1 "
"into Recordings").arg(item->GetTitle()));
QString filename = getDownloadFilename(item);
// Does the file already exist?
bool exists;
if (filename.startsWith("myth://"))
exists = RemoteFile::Exists(filename);
else
exists = QFile::exists(filename);
if (exists)
{
QString message = tr("This file already downloaded to:\n%1").arg(filename);
MythConfirmationDialog *confirmdialog =
new MythConfirmationDialog(m_popupStack,message, false);
if (confirmdialog->Create())
m_popupStack->AddScreen(confirmdialog);
else
delete confirmdialog;
return;
}
if (m_progress)
m_progress->SetVisible(true);
// Initialize the download
m_redirects = 0;
m_currentDownload = filename;
}
示例13: it
void OSD::CheckExpiry(void)
{
QDateTime now = MythDate::current();
QMutableHashIterator<MythScreenType*, QDateTime> it(m_ExpireTimes);
while (it.hasNext())
{
it.next();
if (it.value() < now)
{
if (it.key() == m_Dialog)
DialogQuit();
else
HideWindow(m_Children.key(it.key()));
}
else if (it.key() == m_Dialog)
{
if (!m_PulsedDialogText.isEmpty() && now > m_NextPulseUpdate)
{
QString newtext = m_PulsedDialogText;
MythDialogBox *dialog = dynamic_cast<MythDialogBox*>(m_Dialog);
if (dialog)
{
// The disambiguation string must be an empty string
// and not a NULL to get extracted by the Qt tools.
QString replace = QCoreApplication::translate("(Common)",
"%n second(s)",
"",
#if QT_VERSION < 0x050000
QCoreApplication::UnicodeUTF8,
#endif
now.secsTo(it.value()));
dialog->SetText(newtext.replace("%d", replace));
}
MythConfirmationDialog *cdialog = dynamic_cast<MythConfirmationDialog*>(m_Dialog);
if (cdialog)
{
QString replace = QString::number(now.secsTo(it.value()));
cdialog->SetMessage(newtext.replace("%d", replace));
}
m_NextPulseUpdate = now.addSecs(1);
}
}
}
}
示例14: RecordingRule
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;
}
示例15: locker
void RSSEditor::slotDeleteSite()
{
QMutexLocker locker(&m_lock);
QString message = tr("Are you sure you want to unsubscribe from this feed?");
MythScreenStack *m_popupStack = GetMythMainWindow()->GetStack("popup stack");
MythConfirmationDialog *confirmdialog =
new MythConfirmationDialog(m_popupStack,message);
if (confirmdialog->Create())
{
m_popupStack->AddScreen(confirmdialog);
connect(confirmdialog, SIGNAL(haveResult(bool)),
SLOT(doDeleteSite(bool)));
}
else
delete confirmdialog;
}