PyObject* Keyboard_DoModal(Keyboard *self, PyObject *args) { CGUIDialogKeyboard *pKeyboard = ((Keyboard*)self)->dlg; if(!pKeyboard) { PyErr_SetString(PyExc_SystemError, "Unable to load virtual keyboard"); return NULL; } int autoClose = 0; if (!PyArg_ParseTuple(args, (char*)"|i", &autoClose)) return NULL; PyXBMCGUILock(); pKeyboard->Initialize(); pKeyboard->SetHeading(self->strHeading); CStdString strDefault(self->strDefault); pKeyboard->SetText(strDefault); pKeyboard->SetHiddenInput(self->bHidden); if (autoClose > 0) pKeyboard->SetAutoClose(autoClose); // do modal of dialog PyXBMCGUIUnlock(); PyXBMCWaitForThreadMessage(TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_KEYBOARD, g_windowManager.GetActiveWindow()); Py_INCREF(Py_None); return Py_None; }
PyObject* Keyboard_SetDefault(Keyboard *self, PyObject *args) { PyObject *line = NULL; if (!PyArg_ParseTuple(args, (char*)"|O", &line)) return NULL; string utf8Line; if (line && !PyGetUnicodeString(utf8Line, line, 1)) return NULL; self->strDefault = utf8Line; CGUIDialogKeyboard *pKeyboard = (CGUIDialogKeyboard*)g_windowManager.GetWindow(WINDOW_DIALOG_KEYBOARD); if(!pKeyboard) { PyErr_SetString(PyExc_SystemError, "Unable to load keyboard"); return NULL; } CStdString strDefault(self->strDefault); pKeyboard->SetText(strDefault); Py_INCREF(Py_None); return Py_None; }
PyObject* Keyboard_DoModal(Keyboard *self, PyObject *args) { CGUIDialogKeyboard *pKeyboard = (CGUIDialogKeyboard*)g_windowManager.GetWindow(WINDOW_DIALOG_KEYBOARD); if(!pKeyboard) { PyErr_SetString(PyExc_SystemError, "Unable to load virtual keyboard"); return NULL; } pKeyboard->Initialize(); pKeyboard->CenterWindow(); pKeyboard->SetHeading(self->strHeading); CStdString strDefault(self->strDefault); pKeyboard->SetText(strDefault); pKeyboard->SetHiddenInput(self->bHidden); // do modal of dialog ThreadMessage tMsg (TMSG_DIALOG_DOMODAL, WINDOW_DIALOG_KEYBOARD, g_windowManager.GetActiveWindow()); g_application.getApplicationMessenger().SendMessage(tMsg, true); Py_INCREF(Py_None); return Py_None; }
PyObject* Keyboard_SetDefault(Keyboard *self, PyObject *args) { PyObject *line = NULL; if (!PyArg_ParseTuple(args, (char*)"|O", &line)) return NULL; string utf8Line; if (line && !PyXBMCGetUnicodeString(utf8Line, line, 1)) return NULL; self->strDefault = utf8Line; CGUIDialogKeyboard *pKeyboard = ((Keyboard*)self)->dlg; if(!pKeyboard) { PyErr_SetString(PyExc_SystemError, "Unable to load keyboard"); return NULL; } CStdString strDefault(self->strDefault); PyXBMCGUILock(); pKeyboard->SetText(strDefault); PyXBMCGUIUnlock(); Py_INCREF(Py_None); return Py_None; }