Example #1
0
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();
}
Example #2
0
File: dialog.cpp Project: foen/xbmc
  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());
  }
Example #3
0
// \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();
}
Example #4
0
// \brief Show CGUIDialogOK dialog, then wait for user to dismiss it.
bool CGUIDialogOK::ShowAndGetInput(CVariant heading, CVariant line0, CVariant line1, CVariant line2)
{
  CGUIDialogOK *dialog = g_windowManager.GetWindow<CGUIDialogOK>(WINDOW_DIALOG_OK);
  if (!dialog) 
    return false;
  dialog->SetHeading(heading);
  dialog->SetLine(0, line0);
  dialog->SetLine(1, line1);
  dialog->SetLine(2, line2);
  dialog->Open();
  return dialog->IsConfirmed();
}
Example #5
0
    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();
    }