本文整理汇总了C++中MythTextInputDialog类的典型用法代码示例。如果您正苦于以下问题:C++ MythTextInputDialog类的具体用法?C++ MythTextInputDialog怎么用?C++ MythTextInputDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MythTextInputDialog类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QString
/** \brief Queries the user for a password to enter a part of MythTV
* restricted by a password.
*
* \param timestamp_setting time settings to be checked
* \param password_setting password to be checked
* \param text the message text to be displayed
* \return true if password checks out or is not needed.
*/
bool MythThemedMenu::checkPinCode(const QString &password_setting)
{
QString timestamp_setting = QString("%1Time").arg(password_setting);
QDateTime curr_time = MythDate::current();
QString last_time_stamp = GetMythDB()->GetSetting(timestamp_setting);
QString password = GetMythDB()->GetSetting(password_setting);
// Password empty? Then skip asking for it
if (password.isEmpty())
return true;
if (last_time_stamp.length() < 1)
{
LOG(VB_GENERAL, LOG_ERR,
"MythThemedMenu: Could not read password/pin time stamp.\n"
"This is only an issue if it happens repeatedly.");
}
else
{
QDateTime last_time = MythDate::fromString(last_time_stamp);
if (!last_time.isValid() || last_time.secsTo(curr_time) < 120)
{
last_time_stamp = MythDate::toString(
curr_time, MythDate::kDatabase);
GetMythDB()->SaveSetting(timestamp_setting, last_time_stamp);
return true;
}
}
LOG(VB_GENERAL, LOG_INFO, QString("Using Password: %1")
.arg(password_setting));
QString text = tr("Enter password:");
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythTextInputDialog *dialog =
new MythTextInputDialog(popupStack, text, FilterNone, true);
if (dialog->Create())
{
dialog->SetReturnEvent(this, "password");
popupStack->AddScreen(dialog);
}
else
delete dialog;
return false;
}
示例2: tr
void BackendSelection::PromptForPassword(void)
{
QString message = tr("Please enter the backend access PIN");
MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
MythTextInputDialog *pwDialog = new MythTextInputDialog(popupStack,
message,
FilterNone,
true);
if (pwDialog->Create())
{
pwDialog->SetReturnEvent(this, "password");
popupStack->AddScreen(pwDialog);
}
else
delete pwDialog;
}
示例3: GetCurrentThumb
void IconView::HandleRename(void)
{
ThumbItem *thumbitem = GetCurrentThumb();
if (!thumbitem)
return;
QString folderName = thumbitem->GetName();
QString message = tr("Rename");
MythTextInputDialog *dialog = new MythTextInputDialog(m_popupStack,
message, FilterNone, false, folderName);
if (dialog->Create())
m_popupStack->AddScreen(dialog);
connect(dialog, SIGNAL(haveResult(QString)),
SLOT(DoRename(QString)), Qt::QueuedConnection);
}
示例4: changeRecPriority
void ProgramRecPriority::customEvent(QEvent *event)
{
if (event->type() == DialogCompletionEvent::kEventType)
{
DialogCompletionEvent *dce = (DialogCompletionEvent*)(event);
QString resultid = dce->GetId();
QString resulttext = dce->GetResultText();
int buttonnum = dce->GetResult();
if (resultid == "menu")
{
if (resulttext == tr("Increase Priority"))
{
changeRecPriority(1);
}
else if (resulttext == tr("Decrease Priority"))
{
changeRecPriority(-1);
}
else if (resulttext == tr("Sort"))
{
showSortMenu();
}
else if (resulttext == tr("Program Details"))
{
ShowDetails();
}
else if (resulttext == tr("Upcoming"))
{
saveRecPriority();
ShowUpcoming();
}
else if (resulttext == tr("Custom Edit"))
{
saveRecPriority();
EditCustom();
}
else if (resulttext == tr("Delete Rule"))
{
saveRecPriority();
remove();
}
else if (resulttext == tr("New Template"))
{
MythScreenStack *popupStack =
GetMythMainWindow()->GetStack("popup stack");
MythTextInputDialog *textInput =
new MythTextInputDialog(popupStack,
tr("Template Name"));
if (textInput->Create())
{
textInput->SetReturnEvent(this, "templatecat");
popupStack->AddScreen(textInput);
}
}
}
else if (resultid == "sortmenu")
{
if (resulttext == tr("Reverse Sort Order"))
{
m_reverseSort = !m_reverseSort;
SortList();
}
else if (resulttext == tr("Sort By Title"))
{
if (m_sortType != byTitle)
{
m_sortType = byTitle;
m_reverseSort = false;
}
else
m_reverseSort = !m_reverseSort;
SortList();
}
else if (resulttext == tr("Sort By Priority"))
{
if (m_sortType != byRecPriority)
{
m_sortType = byRecPriority;
m_reverseSort = false;
}
else
m_reverseSort = !m_reverseSort;
SortList();
}
else if (resulttext == tr("Sort By Type"))
{
if (m_sortType != byRecType)
{
m_sortType = byRecType;
m_reverseSort = false;
}
else
m_reverseSort = !m_reverseSort;
SortList();
}
else if (resulttext == tr("Sort By Count"))
{
if (m_sortType != byCount)
//.........这里部分代码省略.........