本文整理汇总了C++中CGUIDialogYesNo::SetAutoClose方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogYesNo::SetAutoClose方法的具体用法?C++ CGUIDialogYesNo::SetAutoClose怎么用?C++ CGUIDialogYesNo::SetAutoClose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogYesNo
的用法示例。
在下文中一共展示了CGUIDialogYesNo::SetAutoClose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowAndGetInput
int CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant text, CVariant noLabel, CVariant yesLabel, CVariant customLabel, unsigned int autoCloseTime)
{
CGUIDialogYesNo *dialog = CServiceBroker::GetGUI()->GetWindowManager().GetWindow<CGUIDialogYesNo>(WINDOW_DIALOG_YES_NO);
if (!dialog)
return false;
dialog->SetHeading(heading);
dialog->SetText(text);
if (autoCloseTime)
dialog->SetAutoClose(autoCloseTime);
dialog->m_bCanceled = false;
dialog->m_bCustom = false;
dialog->SetChoice(0, !noLabel.empty() ? noLabel : 106);
dialog->SetChoice(1, !yesLabel.empty() ? yesLabel : 107);
dialog->SetChoice(2, customLabel); // Button only visible when label is not empty
dialog->Open();
if (dialog->m_bCanceled)
return -1;
else if (dialog->m_bCustom)
return 2;
else if (dialog->IsConfirmed())
return 1;
else
return 0;
}
示例2: yesno
bool Dialog::yesno(const String& heading, const String& line1,
const String& line2,
const String& line3,
const String& nolabel,
const String& yeslabel,
int autoclose)
{
DelayedCallGuard dcguard(languageHook);
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (pDialog == NULL)
throw WindowException("Error: Window is NULL, this is not possible :-)");
// get lines, last 4 lines are optional.
if (!heading.empty())
pDialog->SetHeading(CVariant{heading});
if (!line1.empty())
pDialog->SetLine(0, CVariant{line1});
if (!line2.empty())
pDialog->SetLine(1, CVariant{line2});
if (!line3.empty())
pDialog->SetLine(2, CVariant{line3});
if (!nolabel.empty())
pDialog->SetChoice(0, CVariant{nolabel});
if (!yeslabel.empty())
pDialog->SetChoice(1, CVariant{yeslabel});
if (autoclose > 0)
pDialog->SetAutoClose(autoclose);
pDialog->Open();
return pDialog->IsConfirmed();
}
示例3: ShowAndGetInput
bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant text, bool &bCanceled, CVariant noLabel /* = "" */, CVariant yesLabel /* = "" */, unsigned int autoCloseTime)
{
CGUIDialogYesNo *dialog = (CGUIDialogYesNo *)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!dialog)
return false;
dialog->SetHeading(heading);
dialog->SetText(text);
if (autoCloseTime)
dialog->SetAutoClose(autoCloseTime);
dialog->m_bCanceled = false;
dialog->SetChoice(0, !noLabel.empty() ? noLabel : 106);
dialog->SetChoice(1, !yesLabel.empty() ? yesLabel : 107);
dialog->Open();
bCanceled = dialog->m_bCanceled;
return (dialog->IsConfirmed()) ? true : false;
}
示例4: ShowAndGetInput
bool CGUIDialogYesNo::ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2, bool &bCanceled, CVariant noLabel, CVariant yesLabel, unsigned int autoCloseTime /* = 0 */)
{
CGUIDialogYesNo *dialog = (CGUIDialogYesNo *)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!dialog)
return false;
dialog->SetHeading(heading);
dialog->SetLine(0, line0);
dialog->SetLine(1, line1);
dialog->SetLine(2, line2);
if (autoCloseTime)
dialog->SetAutoClose(autoCloseTime);
dialog->SetChoice(0, !noLabel.empty() ? noLabel : 106);
dialog->SetChoice(1, !yesLabel.empty() ? yesLabel : 107);
dialog->m_bCanceled = false;
dialog->DoModal();
bCanceled = dialog->m_bCanceled;
return (dialog->IsConfirmed()) ? true : false;
}
示例5: ShowAndGetInput
bool CGUIDialogYesNo::ShowAndGetInput(int heading, int line0, int line1, int line2, int iNoLabel, int iYesLabel, bool& bCanceled, unsigned int autoCloseTime)
{
CGUIDialogYesNo *dialog = (CGUIDialogYesNo *)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!dialog) return false;
dialog->SetHeading(heading);
dialog->SetLine(0, line0);
dialog->SetLine(1, line1);
dialog->SetLine(2, line2);
if (autoCloseTime)
dialog->SetAutoClose(autoCloseTime);
if (iNoLabel != -1)
dialog->SetChoice(0,iNoLabel);
else
dialog->SetChoice(0,106);
if (iYesLabel != -1)
dialog->SetChoice(1,iYesLabel);
else
dialog->SetChoice(1,107);
dialog->m_bCanceled = false;
dialog->DoModal();
bCanceled = dialog->m_bCanceled;
return (dialog->IsConfirmed()) ? true : false;
}
示例6: OnInitWindow
void CGUIWindowBoxeeWizardResolution::OnInitWindow()
{
CGUIWindow::OnInitWindow();
delete m_xrandr;
m_xrandr = new CXRandR();
if (!m_wizardCompletedOnce)
{
CONTROL_DISABLE(CONTROL_NEXT);
}
if (m_afterResolutionChange)
{
CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_SD_HD);
if (pList)
pList->SetSingleSelectedItem();
ShowResolutionsList(IsResolutionHD(m_newResolution), &m_newResolution);
CStdString origHz;
origHz.Format("%.2f", m_originalResolution.hz);
CStdString newHz;
newHz.Format("%.2f", m_newResolution.hz);
if (m_newResolution.name != m_originalResolution.name || origHz != newHz)
{
CGUIDialogYesNo *pDlgYesNo = (CGUIDialogYesNo*)m_gWindowManager.GetWindow(WINDOW_DIALOG_YES_NO);
pDlgYesNo->SetHeading("Resolution Change");
pDlgYesNo->SetLine(0, "Do you want to keep this resolution");
pDlgYesNo->SetLine(1, "(will revert automatically in 6 seconds)");
pDlgYesNo->SetLine(2, "");
pDlgYesNo->SetLine(3, "");
pDlgYesNo->SetChoice(0, "Revert");
pDlgYesNo->SetChoice(1, "Keep");
pDlgYesNo->SetDefaultChoice(0);
pDlgYesNo->SetAutoClose(6000);
pDlgYesNo->DoModal();
if (!pDlgYesNo->IsConfirmed())
{
m_afterResolutionChange = false;
// Set the requested resolution
g_graphicsContext.SetVideoResolution(m_originalResolutionId, TRUE);
// Reload the fonts to they will scale correctly
g_fontManager.ReloadTTFFonts();
// Close the dialog and restart it so it will re-set the size of the labels to
// fit for the new resolutions
Close();
m_gWindowManager.ActivateWindow(WINDOW_BOXEE_WIZARD_RESOLUTION);
}
else
{
int xbmcResolutionId = GetXBMCResolutionId();
if (xbmcResolutionId != -1)
{
g_guiSettings.SetInt("videoscreen.resolution", xbmcResolutionId);
g_guiSettings.SetInt("videoplayer.displayresolution", xbmcResolutionId);
g_guiSettings.SetInt("pictures.displayresolution", xbmcResolutionId);
g_settings.Save();
delete m_xrandr;
m_xrandr = new CXRandR();
}
m_wizardCompletedOnce = true;
CONTROL_ENABLE(CONTROL_NEXT);
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
}
else
{
m_wizardCompletedOnce = true;
CONTROL_ENABLE(CONTROL_NEXT);
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
}
else if (m_resolutionChangedOnce || m_wizardCompletedOnce)
{
XOutput output = GetCurrentOutput();
XMode currentResolution = m_xrandr->GetCurrentMode(output.name);
ShowResolutionsList(IsResolutionHD(currentResolution), ¤tResolution);
}
else
{
XOutput output = GetCurrentOutput();
XMode currentResolution = m_xrandr->GetCurrentMode(output.name);
CGUIMessage msg(GUI_MSG_ITEM_SELECT, GetID(), CONTROL_SD_HD, IsResolutionHD(currentResolution) ? VALUE_HD : VALUE_SD);
OnMessage(msg);
}
}