本文整理汇总了C++中dcguard函数的典型用法代码示例。如果您正苦于以下问题:C++ dcguard函数的具体用法?C++ dcguard怎么用?C++ dcguard使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dcguard函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show
void Window::doModal()
{
TRACE;
if (!existingWindow)
{
bModal = true;
if(iWindowId != ACTIVE_WINDOW)
show();
while (bModal && !g_application.m_bStop)
{
// TODO: garbear added this code to the pythin window.cpp class and
// commented in XBPyThread.cpp. I'm not sure how to handle this
// in this native implementation.
// // Check if XBPyThread::stop() raised a SystemExit exception
// if (PyThreadState_Get()->async_exc == PyExc_SystemExit)
// {
// CLog::Log(LOGDEBUG, "PYTHON: doModal() encountered a SystemExit exception, closing window and returning");
// Window_Close(self, NULL);
// break;
// }
languageHook->makePendingCalls(); // MakePendingCalls
{
DelayedCallGuard dcguard(languageHook);
WaitForActionEvent();
}
}
}
}
示例2: dcguard
void Addon::setSetting(const char* id, const String& value)
{
DelayedCallGuard dcguard(languageHook);
ADDON::AddonPtr addon(pAddon);
bool save=true;
if (g_windowManager.IsWindowActive(WINDOW_DIALOG_ADDON_SETTINGS))
{
CGUIDialogAddonSettings* dialog = (CGUIDialogAddonSettings*)g_windowManager.GetWindow(WINDOW_DIALOG_ADDON_SETTINGS);
if (dialog->GetCurrentID() == addon->ID())
{
CGUIMessage message(GUI_MSG_SETTING_UPDATED,0,0);
std::vector<std::string> params;
params.push_back(id);
params.push_back(value);
message.SetStringParams(params);
g_windowManager.SendThreadMessage(message,WINDOW_DIALOG_ADDON_SETTINGS);
save=false;
}
}
if (save)
{
addon->UpdateSetting(id, value);
addon->SaveSettings();
}
}
示例3: dcguard
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();
}
示例4: dcguard
void Control::setEnabled(bool enabled)
{
DelayedCallGuard dcguard(languageHook);
LOCKGUI;
if (pGUIControl)
pGUIControl->SetEnabled(enabled);
}
示例5: throw
bool Dialog::yesno(const String& heading, const String& line1,
const String& line2,
const String& line3,
const String& nolabel,
const String& yeslabel) throw (WindowException)
{
DelayedCallGuard dcguard(languageHook);
const int window = WINDOW_DIALOG_YES_NO;
CGUIDialogYesNo* pDialog = (CGUIDialogYesNo*)g_windowManager.GetWindow(window);
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(heading);
if (!line1.empty())
pDialog->SetLine(0, line1);
if (!line2.empty())
pDialog->SetLine(1, line2);
if (!line3.empty())
pDialog->SetLine(2, line3);
if (!nolabel.empty())
pDialog->SetChoice(0,nolabel);
if (!yeslabel.empty())
pDialog->SetChoice(1,yeslabel);
//send message and wait for user input
XBMCWaitForThreadMessage(TMSG_DIALOG_DOMODAL, window, ACTIVE_WINDOW);
return pDialog->IsConfirmed();
}
示例6: dcguard
void Window::show()
{
XBMC_TRACE;
DelayedCallGuard dcguard(languageHook);
popActiveWindowId();
CApplicationMessenger::GetInstance().SendMsg(TMSG_GUI_ACTIVATE_WINDOW, iWindowId, 0);
}
示例7: dcguard
void Window::show()
{
TRACE;
DelayedCallGuard dcguard(languageHook);
popActiveWindowId();
std::vector<CStdString> params;
CApplicationMessenger::Get().ActivateWindow(iWindowId, params, false);
}
示例8: dcguard
void Addon::openSettings()
{
AddonPtr temp;
if (!ADDON::CAddonMgr::Get().GetAddon(pAddon->ID(), temp))
return;
DelayedCallGuard dcguard(languageHook);
// show settings dialog
ADDON::AddonPtr addon(pAddon);
CGUIDialogAddonSettings::ShowAndGetInput(addon);
}
示例9: PulseActionEvent
void Window::close()
{
XBMC_TRACE;
bModal = false;
if (!existingWindow)
PulseActionEvent();
{
DelayedCallGuard dcguard(languageHook);
CApplicationMessenger::GetInstance().SendMsg(TMSG_GUI_PREVIOUS_WINDOW, iOldWindowId, 0);
}
iOldWindowId = 0;
}
示例10: PulseActionEvent
void Window::close()
{
XBMC_TRACE;
bModal = false;
if (!existingWindow)
PulseActionEvent();
std::vector<std::string> params;
{
DelayedCallGuard dcguard(languageHook);
CApplicationMessenger::Get().ActivateWindow(iOldWindowId, params, false);
}
iOldWindowId = 0;
}