本文整理汇总了C++中CGUIDialogOK::DoModal方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogOK::DoModal方法的具体用法?C++ CGUIDialogOK::DoModal怎么用?C++ CGUIDialogOK::DoModal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogOK
的用法示例。
在下文中一共展示了CGUIDialogOK::DoModal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowAndGetInput
// \brief Show CGUIDialogOK dialog, then wait for user to dismiss it.
void CGUIDialogOK::ShowAndGetInput(const CVariant &heading, const CVariant &line0, const CVariant &line1, const CVariant &line2)
{
CGUIDialogOK *dialog = (CGUIDialogOK *)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (!dialog)
return;
dialog->SetHeading(heading);
dialog->SetLine(0, line0);
dialog->SetLine(1, line1);
dialog->SetLine(2, line2);
dialog->DoModal();
}
示例2: OnRipCD
void CGUIWindowMusicBase::OnRipCD()
{
if(g_mediaManager.IsAudio())
{
if (!g_application.CurrentFileItem().IsCDDA())
{
#ifdef HAS_CDDA_RIPPER
CCDDARipper ripper;
ripper.RipCD();
#endif
}
else
{
CGUIDialogOK* pDlgOK = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
pDlgOK->SetHeading(257); // Error
pDlgOK->SetLine(0, g_localizeStrings.Get(20099)); //
pDlgOK->SetLine(1, ""); //
pDlgOK->SetLine(2, "");
pDlgOK->DoModal();
}
}
}
示例3: OnRipTrack
void CGUIWindowMusicBase::OnRipTrack(int iItem)
{
CCdInfo *pCdInfo = CDetectDVDMedia::GetCdInfo();
if (CDetectDVDMedia::IsDiscInDrive() && pCdInfo && pCdInfo->IsAudio(1))
{
if (!g_application.CurrentFileItem().IsCDDA())
{
#ifdef HAS_CDDA_RIPPER
CCDDARipper ripper;
ripper.RipTrack(m_vecItems->Get(iItem));
#endif
}
else
{
CGUIDialogOK* pDlgOK = (CGUIDialogOK*)m_gWindowManager.GetWindow(WINDOW_DIALOG_OK);
pDlgOK->SetHeading(257); // Error
pDlgOK->SetLine(0, g_localizeStrings.Get(20099)); //
pDlgOK->SetLine(1, ""); //
pDlgOK->SetLine(2, "");
pDlgOK->DoModal();
}
}
}
示例4: ProcessRequirements
bool IDirectory::ProcessRequirements()
{
CStdString type = m_requirements["type"].asString();
if (type == "keyboard")
{
CStdString input;
if (CGUIDialogKeyboard::ShowAndGetInput(input, GetLocalized(m_requirements["heading"]), false))
{
m_requirements["input"] = input.c_str();
return true;
}
}
else if (type == "authenticate")
{
CURL url(m_requirements["url"].asString());
if (CPasswordManager::GetInstance().PromptToAuthenticateURL(url))
{
m_requirements.clear();
return true;
}
}
else if (type == "error")
{
CGUIDialogOK *dialog = (CGUIDialogOK *)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (dialog)
{
dialog->SetHeading(GetLocalized(m_requirements["heading"]));
dialog->SetLine(0, GetLocalized(m_requirements["line1"]));
dialog->SetLine(1, GetLocalized(m_requirements["line2"]));
dialog->SetLine(2, GetLocalized(m_requirements["line3"]));
dialog->DoModal();
}
}
m_requirements.clear();
return false;
}
示例5: OnAction
//.........这里部分代码省略.........
CONTROL_ENABLE(CONTROL_NEXT);
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
return true;
}
else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_ENC)
{
CGUIButtonControl* encSelectionButton = (CGUIButtonControl*) GetControl(CONTROL_ENC_SELECTION);
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_ENC);
OnMessage(msg);
int iItem = msg.GetParam1();
encSelectionButton->SetLabel(ENC_LABELS[iItem]);
SET_CONTROL_HIDDEN(CONTROL_ENC);
if (iItem == ENC_NONE)
{
SET_CONTROL_HIDDEN(CONTROL_PASSWORD_GROUP);
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
else
{
SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
}
return true;
}
else if (action.wID == ACTION_MOVE_LEFT && (iControl == CONTROL_ENC_SELECTION || iControl == CONTROL_PASSWORD))
{
SET_CONTROL_HIDDEN(CONTROL_ENC_GROUP);
SET_CONTROL_HIDDEN(CONTROL_PASSWORD_GROUP);
SET_CONTROL_FOCUS(CONTROL_WIRELESS, 0);
return true;
}
else if (action.wID == ACTION_MOVE_DOWN && iControl == CONTROL_ENC_SELECTION)
{
if (GetControl(CONTROL_PASSWORD_GROUP)->IsVisible())
{
SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
}
else if (!GetControl(CONTROL_NEXT)->IsDisabled())
{
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
return true;
}
else if (action.wID == ACTION_MOVE_UP && (iControl == CONTROL_NEXT || iControl == CONTROL_BACK))
{
if (GetControl(CONTROL_PASSWORD_GROUP)->IsVisible())
{
SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
}
else if (GetControl(CONTROL_ENC_GROUP)->IsVisible())
{
SET_CONTROL_FOCUS(CONTROL_ENC_SELECTION, 0);
}
else
{
SET_CONTROL_FOCUS(CONTROL_INTERFACES, 0);
}
return true;
}
else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_NEXT)
{
if (GetControl(CONTROL_ENC_SELECTION)->IsVisible() && GetControl(CONTROL_PASSWORD)->IsVisible())
{
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_ENC);
OnMessage(msg);
int iItem = msg.GetParam1();
CGUIButtonControl* passwordButton = (CGUIButtonControl*) GetControl(CONTROL_PASSWORD);
CStdString password = passwordButton->GetLabel();
if (ENC_MODES[iItem] == ENC_WEP_HEX && !IsHexString(password))
{
CGUIDialogOK *pDialogOK = (CGUIDialogOK *)m_gWindowManager.GetWindow(WINDOW_DIALOG_OK);
pDialogOK->SetHeading("");
pDialogOK->SetLine(0, 51018);
pDialogOK->SetLine(1, 51019);
pDialogOK->DoModal();
return true;
}
}
if (SaveConfiguration())
{
// Close all wizard dialogs
Close();
CGUIDialog* dialog = (CGUIDialog*) m_gWindowManager.GetWindow(WINDOW_BOXEE_WIZARD_AUDIO);
dialog->Close();
dialog = (CGUIDialog*) m_gWindowManager.GetWindow(WINDOW_BOXEE_WIZARD_RESOLUTION);
dialog->Close();
}
return true;
}
return CGUIWindow::OnAction(action);
}