本文整理汇总了C++中CGUIDialogOK::SetHeading方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialogOK::SetHeading方法的具体用法?C++ CGUIDialogOK::SetHeading怎么用?C++ CGUIDialogOK::SetHeading使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialogOK
的用法示例。
在下文中一共展示了CGUIDialogOK::SetHeading方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Dialog_OK
PyObject* Dialog_OK(PyObject *self, PyObject *args)
{
const int window = WINDOW_DIALOG_OK;
PyObject* unicodeLine[4];
for (int i = 0; i < 4; i++) unicodeLine[i] = NULL;
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(window);
if (PyXBMCWindowIsNull(pDialog)) return NULL;
// get lines, last 2 lines are optional.
string utf8Line[4];
if (!PyArg_ParseTuple(args, (char*)"OO|OO", &unicodeLine[0], &unicodeLine[1], &unicodeLine[2], &unicodeLine[3])) return NULL;
for (int i = 0; i < 4; i++)
{
if (unicodeLine[i] && !PyXBMCGetUnicodeString(utf8Line[i], unicodeLine[i], i+1))
return NULL;
}
pDialog->SetHeading(utf8Line[0]);
pDialog->SetLine(0, utf8Line[1]);
pDialog->SetLine(1, utf8Line[2]);
pDialog->SetLine(2, utf8Line[3]);
//send message and wait for user input
PyXBMCWaitForThreadMessage(TMSG_DIALOG_DOMODAL, window, ACTIVE_WINDOW);
return Py_BuildValue((char*)"b", pDialog->IsConfirmed());
}
示例2: ok
bool Dialog::ok(const String& heading, const String& line1,
const String& line2,
const String& line3) throw (WindowException)
{
DelayedCallGuard dcguard(languageHook);
const int window = WINDOW_DIALOG_OK;
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(window);
if (pDialog == NULL)
throw WindowException("Error: Window is NULL, this is not possible :-)");
if (!heading.empty())
pDialog->SetHeading(heading);
if (!line1.empty())
pDialog->SetLine(0, line1);
if (!line2.empty())
pDialog->SetLine(1, line2);
if (!line3.empty())
pDialog->SetLine(2, line3);
//send message and wait for user input
XBMCWaitForThreadMessage(TMSG_DIALOG_DOMODAL, window, ACTIVE_WINDOW);
return pDialog->IsConfirmed();
}
示例3: ShowAndGetInput
// \brief Show CGUIDialogOK dialog, then wait for user to dismiss it.
void CGUIDialogOK::ShowAndGetInput(CVariant heading, CVariant text)
{
CGUIDialogOK *dialog = (CGUIDialogOK *)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (!dialog)
return;
dialog->SetHeading(heading);
dialog->SetText(text);
dialog->Open();
}
示例4: Create
ADDON_STATUS CAddonDll::Create(void* funcTable, void* info)
{
/* ensure that a previous instance is destroyed */
Destroy();
if (!funcTable)
return ADDON_STATUS_PERMANENT_FAILURE;
CLog::Log(LOGDEBUG, "ADDON: Dll Initializing - %s", Name().c_str());
m_initialized = false;
if (!LoadDll())
return ADDON_STATUS_PERMANENT_FAILURE;
/* Load add-on function table (written by add-on itself) */
m_pDll->GetAddon(funcTable);
if (!CheckAPIVersion())
return ADDON_STATUS_PERMANENT_FAILURE;
/* Allocate the helper function class to allow crosstalk over
helper libraries */
m_pHelpers = new CAddonInterfaces(this);
/* Call Create to make connections, initializing data or whatever is
needed to become the AddOn running */
ADDON_STATUS status = m_pDll->Create(m_pHelpers->GetCallbacks(), info);
if (status == ADDON_STATUS_OK)
{
m_initialized = true;
}
else if ((status == ADDON_STATUS_NEED_SETTINGS) || (status == ADDON_STATUS_NEED_SAVEDSETTINGS))
{
m_needsavedsettings = (status == ADDON_STATUS_NEED_SAVEDSETTINGS);
if ((status = TransferSettings()) == ADDON_STATUS_OK)
m_initialized = true;
else
new CAddonStatusHandler(ID(), status, "", false);
}
else
{ // Addon failed initialization
CLog::Log(LOGERROR, "ADDON: Dll %s - Client returned bad status (%i) from Create and is not usable", Name().c_str(), status);
CGUIDialogOK* pDialog = g_windowManager.GetWindow<CGUIDialogOK>(WINDOW_DIALOG_OK);
if (pDialog)
{
std::string heading = StringUtils::Format("%s: %s", TranslateType(Type(), true).c_str(), Name().c_str());
pDialog->SetHeading(CVariant{heading});
pDialog->SetLine(1, CVariant{24070});
pDialog->SetLine(2, CVariant{24071});
pDialog->Open();
}
}
return status;
}
示例5: ShowErrorDialog
void CVideoInfoDownloader::ShowErrorDialog(const ADDON::CScraperError &sce)
{
if (!sce.Title().empty())
{
CGUIDialogOK *pdlg = (CGUIDialogOK *)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
pdlg->SetHeading(sce.Title());
pdlg->SetLine(0, sce.Message());
CApplicationMessenger::Get().DoModal(pdlg, WINDOW_DIALOG_OK);
}
}
示例6: ShowAndGetInput
// \brief Show CGUIDialogOK dialog, then wait for user to dismiss it.
bool CGUIDialogOK::ShowAndGetInput(CVariant heading, CVariant text)
{
CGUIDialogOK *dialog = g_windowManager.GetWindow<CGUIDialogOK>(WINDOW_DIALOG_OK);
if (!dialog)
return false;
dialog->SetHeading(heading);
dialog->SetText(text);
dialog->Open();
return dialog->IsConfirmed();
}
示例7: ShowErrorDialog
void CVideoInfoDownloader::ShowErrorDialog(const ADDON::CScraperError &sce)
{
if (!sce.Title().empty())
{
CGUIDialogOK *pdlg = (CGUIDialogOK *)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
pdlg->SetHeading(CVariant{sce.Title()});
pdlg->SetLine(0, CVariant{sce.Message()});
pdlg->Open();
}
}
示例8: 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();
}
示例9: Process
void CAddonStatusHandler::Process()
{
CSingleLock lock(m_critSection);
std::string heading = StringUtils::Format("%s: %s", TranslateType(m_addon->Type(), true).c_str(), m_addon->Name().c_str());
/* Request to restart the AddOn and data structures need updated */
if (m_status == ADDON_STATUS_NEED_RESTART)
{
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (!pDialog) return;
pDialog->SetHeading(CVariant{heading});
pDialog->SetLine(1, CVariant{24074});
pDialog->Open();
CAddonMgr::GetInstance().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
}
/* Some required settings are missing/invalid */
else if ((m_status == ADDON_STATUS_NEED_SETTINGS) || (m_status == ADDON_STATUS_NEED_SAVEDSETTINGS))
{
CGUIDialogYesNo* pDialogYesNo = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialogYesNo) return;
pDialogYesNo->SetHeading(CVariant{heading});
pDialogYesNo->SetLine(1, CVariant{24070});
pDialogYesNo->SetLine(2, CVariant{24072});
pDialogYesNo->SetLine(3, CVariant{m_message});
pDialogYesNo->Open();
if (!pDialogYesNo->IsConfirmed()) return;
if (!m_addon->HasSettings())
return;
if (CGUIDialogAddonSettings::ShowAndGetInput(m_addon))
{
//! @todo Doesn't dialogaddonsettings save these automatically? It should do this.
m_addon->SaveSettings();
CAddonMgr::GetInstance().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
}
}
}
示例10: ok
bool Dialog::ok(const String& heading, const String& line1,
const String& line2,
const String& line3)
{
DelayedCallGuard dcguard(languageHook);
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (pDialog == NULL)
throw WindowException("Error: Window is NULL, this is not possible :-)");
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});
pDialog->Open();
return pDialog->IsConfirmed();
}
示例11: 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();
}
}
}
示例12: 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();
}
}
}
示例13: 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;
}
示例14: Process
void CAddonStatusHandler::Process()
{
CSingleLock lock(m_critSection);
std::string heading = StringUtils::Format("%s: %s", TranslateType(m_addon->Type(), true).c_str(), m_addon->Name().c_str());
/* AddOn lost connection to his backend (for ones that use Network) */
if (m_status == ADDON_STATUS_LOST_CONNECTION)
{
if (m_addon->Type() == ADDON_PVRDLL)
{
if (!CSettings::Get().GetBool("pvrmanager.hideconnectionlostwarning"))
CGUIDialogKaiToast::QueueNotification(CGUIDialogKaiToast::Info, m_addon->Name().c_str(), g_localizeStrings.Get(36030)); // connection lost
// TODO handle disconnects after the add-on's been initialised
}
else
{
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialog) return;
pDialog->SetHeading(heading);
pDialog->SetLine(1, 24070);
pDialog->SetLine(2, 24073);
//send message and wait for user input
ThreadMessage tMsg = {TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_YES_NO, g_windowManager.GetActiveWindow()};
CApplicationMessenger::Get().SendMessage(tMsg, true);
if (pDialog->IsConfirmed())
CAddonMgr::Get().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, false);
}
}
/* Request to restart the AddOn and data structures need updated */
else if (m_status == ADDON_STATUS_NEED_RESTART)
{
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (!pDialog) return;
pDialog->SetHeading(heading);
pDialog->SetLine(1, 24074);
//send message and wait for user input
ThreadMessage tMsg = {TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_OK, g_windowManager.GetActiveWindow()};
CApplicationMessenger::Get().SendMessage(tMsg, true);
CAddonMgr::Get().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
}
/* Some required settings are missing/invalid */
else if ((m_status == ADDON_STATUS_NEED_SETTINGS) || (m_status == ADDON_STATUS_NEED_SAVEDSETTINGS))
{
CGUIDialogYesNo* pDialogYesNo = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialogYesNo) return;
pDialogYesNo->SetHeading(heading);
pDialogYesNo->SetLine(1, 24070);
pDialogYesNo->SetLine(2, 24072);
pDialogYesNo->SetLine(3, m_message);
//send message and wait for user input
ThreadMessage tMsg = {TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_YES_NO, g_windowManager.GetActiveWindow()};
CApplicationMessenger::Get().SendMessage(tMsg, true);
if (!pDialogYesNo->IsConfirmed()) return;
if (!m_addon->HasSettings())
return;
if (CGUIDialogAddonSettings::ShowAndGetInput(m_addon))
{
//todo doesn't dialogaddonsettings save these automatically? should do
m_addon->SaveSettings();
CAddonMgr::Get().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
}
}
/* A unknown event has occurred */
else if (m_status == ADDON_STATUS_UNKNOWN)
{
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (!pDialog) return;
pDialog->SetHeading(heading);
pDialog->SetLine(1, 24070);
pDialog->SetLine(2, 24071);
pDialog->SetLine(3, m_message);
//send message and wait for user input
ThreadMessage tMsg = {TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_OK, g_windowManager.GetActiveWindow()};
CApplicationMessenger::Get().SendMessage(tMsg, true);
}
}
示例15: Process
void CAddonStatusHandler::Process()
{
CSingleLock lock(m_critSection);
CStdString heading;
heading.Format("%s: %s", TranslateType(m_addon->Type(), true).c_str(), m_addon->Name().c_str());
/* AddOn lost connection to his backend (for ones that use Network) */
if (m_status == ADDON_STATUS_LOST_CONNECTION && m_addon->Type() != ADDON_PVRDLL) // TODO display a proper message for pvr addons, but don't popup a dialog that requires user action
{
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialog) return;
pDialog->SetHeading(heading);
pDialog->SetLine(1, 24070);
pDialog->SetLine(2, 24073);
//send message and wait for user input
ThreadMessage tMsg = {TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_YES_NO, g_windowManager.GetActiveWindow()};
g_application.getApplicationMessenger().SendMessage(tMsg, true);
if (pDialog->IsConfirmed())
CAddonMgr::Get().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, false);
}
/* Request to restart the AddOn and data structures need updated */
else if (m_status == ADDON_STATUS_NEED_RESTART)
{
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (!pDialog) return;
pDialog->SetHeading(heading);
pDialog->SetLine(1, 24074);
//send message and wait for user input
ThreadMessage tMsg = {TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_OK, g_windowManager.GetActiveWindow()};
g_application.getApplicationMessenger().SendMessage(tMsg, true);
CAddonMgr::Get().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
}
/* Some required settings are missing/invalid */
else if ((m_status == ADDON_STATUS_NEED_SETTINGS) || (m_status == ADDON_STATUS_NEED_SAVEDSETTINGS))
{
CGUIDialogYesNo* pDialogYesNo = (CGUIDialogYesNo*)g_windowManager.GetWindow(WINDOW_DIALOG_YES_NO);
if (!pDialogYesNo) return;
pDialogYesNo->SetHeading(heading);
pDialogYesNo->SetLine(1, 24070);
pDialogYesNo->SetLine(2, 24072);
pDialogYesNo->SetLine(3, m_message);
//send message and wait for user input
ThreadMessage tMsg = {TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_YES_NO, g_windowManager.GetActiveWindow()};
g_application.getApplicationMessenger().SendMessage(tMsg, true);
if (!pDialogYesNo->IsConfirmed()) return;
if (!m_addon->HasSettings())
return;
if (CGUIDialogAddonSettings::ShowAndGetInput(m_addon))
{
//todo doesn't dialogaddonsettings save these automatically? should do
m_addon->SaveSettings();
CAddonMgr::Get().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true);
}
}
/* A unknown event has occurred */
else if (m_status == ADDON_STATUS_UNKNOWN)
{
//CAddonMgr::Get().DisableAddon(m_addon->ID());
CGUIDialogOK* pDialog = (CGUIDialogOK*)g_windowManager.GetWindow(WINDOW_DIALOG_OK);
if (!pDialog) return;
pDialog->SetHeading(heading);
pDialog->SetLine(1, 24070);
pDialog->SetLine(2, 24071);
pDialog->SetLine(3, m_message);
//send message and wait for user input
ThreadMessage tMsg = {TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_OK, g_windowManager.GetActiveWindow()};
g_application.getApplicationMessenger().SendMessage(tMsg, true);
}
}