extend creation of preferences pages from Python

This commit is contained in:
wmayer
2016-10-22 16:48:02 +02:00
parent f551bf9cc3
commit d28743f35e
2 changed files with 46 additions and 19 deletions

View File

@@ -656,6 +656,7 @@ PyObject* Application::sAddPreferencePage(PyObject * /*self*/, PyObject *args,Py
PyErr_Clear();
PyObject* dlg;
// old style classes
if (PyArg_ParseTuple(args, "O!s", &PyClass_Type, &dlg, &grp)) {
// add to the preferences dialog
new PrefPagePyProducer(Py::Object(dlg), grp);
@@ -663,6 +664,16 @@ PyObject* Application::sAddPreferencePage(PyObject * /*self*/, PyObject *args,Py
Py_INCREF(Py_None);
return Py_None;
}
PyErr_Clear();
// new style classes
if (PyArg_ParseTuple(args, "O!s", &PyType_Type, &dlg, &grp)) {
// add to the preferences dialog
new PrefPagePyProducer(Py::Object(dlg), grp);
Py_INCREF(Py_None);
return Py_None;
}
return 0;
}