当前位置: 首页>>代码示例>>C++>>正文


C++ CGUIDialogNumeric::SetMode方法代码示例

本文整理汇总了C++中CGUIDialogNumeric::SetMode方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogNumeric::SetMode方法的具体用法?C++ CGUIDialogNumeric::SetMode怎么用?C++ CGUIDialogNumeric::SetMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGUIDialogNumeric的用法示例。


在下文中一共展示了CGUIDialogNumeric::SetMode方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ShowAndVerifyInput

// \brief Show numeric keypad and verify user input against strToVerify.
// \param strToVerify Value to compare against user input.
// \param dlgHeading String shown on dialog title.
// \param bVerifyInput If set as true we verify the users input versus strToVerify.
// \return the result of the check (success, failed, or canceled by user).
InputVerificationResult CGUIDialogNumeric::ShowAndVerifyInput(std::string& strToVerify, const std::string& dlgHeading, bool bVerifyInput)
{
  // Prompt user for password input
  CGUIDialogNumeric *pDialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogNumeric>(WINDOW_DIALOG_NUMERIC);
  pDialog->SetHeading(dlgHeading);

  std::string strInput;
  if (!bVerifyInput)
    strInput = strToVerify;

  pDialog->SetMode(INPUT_PASSWORD, strInput);
  pDialog->Open();

  strInput = pDialog->GetOutputString();

  if (!pDialog->IsConfirmed() || pDialog->IsCanceled())
  {
    // user canceled out
    strToVerify = "";
    return InputVerificationResult::CANCELED;
  }

  const std::string md5pword2 = CDigest::Calculate(CDigest::Type::MD5, strInput);

  if (!bVerifyInput)
  {
    strToVerify = md5pword2;
    return InputVerificationResult::SUCCESS;
  }

  return StringUtils::EqualsNoCase(strToVerify, md5pword2) ? InputVerificationResult::SUCCESS : InputVerificationResult::FAILED;
}
开发者ID:idekker,项目名称:xbmc,代码行数:37,代码来源:GUIDialogNumeric.cpp

示例2: ShowAndGetIPAddress

bool CGUIDialogNumeric::ShowAndGetIPAddress(CStdString &IPAddress, const CStdString &heading)
{
  CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
  if (!pDialog || !IPAddress) return false;
  pDialog->SetMode(INPUT_IP_ADDRESS, (void *)&IPAddress);
  pDialog->SetHeading(heading);
  pDialog->DoModal();
  if (!pDialog->IsConfirmed() || pDialog->IsCanceled())
    return false;
  pDialog->GetOutput(&IPAddress);
  return true;
}
开发者ID:Anankin,项目名称:xbmc,代码行数:12,代码来源:GUIDialogNumeric.cpp

示例3: ShowAndGetDate

bool CGUIDialogNumeric::ShowAndGetDate(SYSTEMTIME &date, const CStdString &heading)
{
  CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
  if (!pDialog) return false;
  pDialog->SetMode(INPUT_DATE, (void *)&date);
  pDialog->SetHeading(heading);
  pDialog->DoModal();
  if (!pDialog->IsConfirmed() || pDialog->IsCanceled())
    return false;
  pDialog->GetOutput(&date);
  return true;
}
开发者ID:Anankin,项目名称:xbmc,代码行数:12,代码来源:GUIDialogNumeric.cpp

示例4: ShowAndGetTime

bool CGUIDialogNumeric::ShowAndGetTime(SYSTEMTIME &time, const std::string &heading)
{
  CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
  if (!pDialog) return false;
  pDialog->SetMode(INPUT_TIME, (void *)&time);
  pDialog->SetHeading(heading);
  pDialog->Open();
  if (!pDialog->IsConfirmed() || pDialog->IsCanceled())
    return false;
  pDialog->GetOutput(&time);
  return true;
}
开发者ID:evilhamster,项目名称:xbmc,代码行数:12,代码来源:GUIDialogNumeric.cpp

示例5: ShowAndGetIPAddress

bool CGUIDialogNumeric::ShowAndGetIPAddress(std::string &IPAddress, const std::string &heading)
{
  CGUIDialogNumeric *pDialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogNumeric>(WINDOW_DIALOG_NUMERIC);
  if (!pDialog) return false;
  pDialog->SetMode(INPUT_IP_ADDRESS, IPAddress);
  pDialog->SetHeading(heading);
  pDialog->Open();
  if (!pDialog->IsConfirmed() || pDialog->IsCanceled())
    return false;
  IPAddress = pDialog->GetOutputString();
  return true;
}
开发者ID:idekker,项目名称:xbmc,代码行数:12,代码来源:GUIDialogNumeric.cpp

示例6: ShowAndGetDate

bool CGUIDialogNumeric::ShowAndGetDate(SYSTEMTIME &date, const std::string &heading)
{
  CGUIDialogNumeric *pDialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogNumeric>(WINDOW_DIALOG_NUMERIC);
  if (!pDialog) return false;
  pDialog->SetMode(INPUT_DATE, date);
  pDialog->SetHeading(heading);
  pDialog->Open();
  if (!pDialog->IsConfirmed() || pDialog->IsCanceled())
    return false;
  date = pDialog->GetOutput();
  return true;
}
开发者ID:idekker,项目名称:xbmc,代码行数:12,代码来源:GUIDialogNumeric.cpp

示例7: ShowAndGetNumber

bool CGUIDialogNumeric::ShowAndGetNumber(CStdString& strInput, const CStdString &strHeading, unsigned int iAutoCloseTimeoutMs /* = 0 */)
{
  // Prompt user for password input
  CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
  pDialog->SetHeading( strHeading );

  pDialog->SetMode(INPUT_NUMBER, (void *)&strInput);
  if (iAutoCloseTimeoutMs)
    pDialog->SetAutoClose(iAutoCloseTimeoutMs);

  pDialog->DoModal();

  if (!pDialog->IsAutoClosed() && (!pDialog->IsConfirmed() || pDialog->IsCanceled()))
    return false;
  pDialog->GetOutput(&strInput);
  return true;
}
开发者ID:Anankin,项目名称:xbmc,代码行数:17,代码来源:GUIDialogNumeric.cpp

示例8: ShowAndGetNumber

bool CGUIDialogNumeric::ShowAndGetNumber(std::string& strInput, const std::string &strHeading, unsigned int iAutoCloseTimeoutMs /* = 0 */)
{
  // Prompt user for password input
  CGUIDialogNumeric *pDialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogNumeric>(WINDOW_DIALOG_NUMERIC);
  pDialog->SetHeading( strHeading );

  pDialog->SetMode(INPUT_NUMBER, strInput);
  if (iAutoCloseTimeoutMs)
    pDialog->SetAutoClose(iAutoCloseTimeoutMs);

  pDialog->Open();

  if (!pDialog->IsAutoClosed() && (!pDialog->IsConfirmed() || pDialog->IsCanceled()))
    return false;
  strInput = pDialog->GetOutputString();
  return true;
}
开发者ID:idekker,项目名称:xbmc,代码行数:17,代码来源:GUIDialogNumeric.cpp

示例9: ShowAndGetSeconds

bool CGUIDialogNumeric::ShowAndGetSeconds(CStdString &timeString, const CStdString &heading)
{
  CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
  if (!pDialog) return false;
  int seconds = StringUtils::TimeStringToSeconds(timeString);
  SYSTEMTIME time = {0};
  time.wHour = seconds / 3600;
  time.wMinute = (seconds - time.wHour * 3600) / 60;
  time.wSecond = seconds - time.wHour * 3600 - time.wMinute * 60;
  pDialog->SetMode(INPUT_TIME_SECONDS, (void *)&time);
  pDialog->SetHeading(heading);
  pDialog->DoModal();
  if (!pDialog->IsConfirmed() || pDialog->IsCanceled())
    return false;
  pDialog->GetOutput(&time);
  seconds = time.wHour * 3600 + time.wMinute * 60 + time.wSecond;
  timeString = StringUtils::SecondsToTimeString(seconds);
  return true;
}
开发者ID:Anankin,项目名称:xbmc,代码行数:19,代码来源:GUIDialogNumeric.cpp

示例10: ShowAndGetSeconds

bool CGUIDialogNumeric::ShowAndGetSeconds(std::string &timeString, const std::string &heading)
{
  CGUIDialogNumeric *pDialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogNumeric>(WINDOW_DIALOG_NUMERIC);
  if (!pDialog) return false;
  int seconds = StringUtils::TimeStringToSeconds(timeString);
  SYSTEMTIME time = {0};
  time.wHour = seconds / 3600;
  time.wMinute = (seconds - time.wHour * 3600) / 60;
  time.wSecond = seconds - time.wHour * 3600 - time.wMinute * 60;
  pDialog->SetMode(INPUT_TIME_SECONDS, time);
  pDialog->SetHeading(heading);
  pDialog->Open();
  if (!pDialog->IsConfirmed() || pDialog->IsCanceled())
    return false;
  time = pDialog->GetOutput();
  seconds = time.wHour * 3600 + time.wMinute * 60 + time.wSecond;
  timeString = StringUtils::SecondsToTimeString(seconds);
  return true;
}
开发者ID:idekker,项目名称:xbmc,代码行数:19,代码来源:GUIDialogNumeric.cpp

示例11: ShowAndVerifyInput

// \brief Show numeric keypad and verify user input against strToVerify.
// \param strToVerify Value to compare against user input.
// \param dlgHeading String shown on dialog title.
// \param bVerifyInput If set as true we verify the users input versus strToVerify.
// \return true if successful display and user input. false if unsuccessful display, no user input, or canceled editing.
bool CGUIDialogNumeric::ShowAndVerifyInput(CStdString& strToVerify, const CStdString& dlgHeading, bool bVerifyInput)
{
  // Prompt user for password input
  CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
  pDialog->SetHeading( dlgHeading );

  CStdString strInput = "";
  if (!bVerifyInput)
    strInput = strToVerify;
  pDialog->SetMode(INPUT_PASSWORD, (void *)&strInput);
  pDialog->DoModal();

  pDialog->GetOutput(&strInput);

  if (!pDialog->IsConfirmed() || pDialog->IsCanceled())
  {
    // user canceled out
    strToVerify ="";
    return false;
  }

  CStdString md5pword2;
  XBMC::XBMC_MD5 md5state;
  md5state.append(strInput);
  md5state.getDigest(md5pword2);

  if (!bVerifyInput)
  {
    strToVerify = md5pword2;
    StringUtils::ToLower(strToVerify);
    return true;
  }

  if (strToVerify.Equals(md5pword2))
    return true;  // entered correct password

  // incorrect password
  return false;
}
开发者ID:Anankin,项目名称:xbmc,代码行数:44,代码来源:GUIDialogNumeric.cpp

示例12: ShowAndVerifyInput

// \brief Show numeric keypad and verify user input against strToVerify.
// \param strToVerify Value to compare against user input.
// \param dlgHeading String shown on dialog title.
// \param bVerifyInput If set as true we verify the users input versus strToVerify.
// \return true if successful display and user input. false if unsuccessful display, no user input, or canceled editing.
bool CGUIDialogNumeric::ShowAndVerifyInput(std::string& strToVerify, const std::string& dlgHeading, bool bVerifyInput)
{
  // Prompt user for password input
  CGUIDialogNumeric *pDialog = (CGUIDialogNumeric *)g_windowManager.GetWindow(WINDOW_DIALOG_NUMERIC);
  pDialog->SetHeading( dlgHeading );

  std::string strInput;
  if (!bVerifyInput)
    strInput = strToVerify;
  pDialog->SetMode(INPUT_PASSWORD, (void *)&strInput);
  pDialog->Open();

  pDialog->GetOutput(&strInput);

  if (!pDialog->IsConfirmed() || pDialog->IsCanceled())
  {
    // user canceled out
    strToVerify ="";
    return false;
  }

  std::string md5pword2 = XBMC::XBMC_MD5::GetMD5(strInput);

  if (!bVerifyInput)
  {
    strToVerify = md5pword2;
    StringUtils::ToLower(strToVerify);
    return true;
  }

  if (StringUtils::EqualsNoCase(strToVerify, md5pword2))
    return true;  // entered correct password

  // incorrect password
  return false;
}
开发者ID:evilhamster,项目名称:xbmc,代码行数:41,代码来源:GUIDialogNumeric.cpp


注:本文中的CGUIDialogNumeric::SetMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。