fixes #0002323: Workbench Start recent list of 3 files is - after a crash - not sync with recent list in File Menu Recent list of 4 files

This commit is contained in:
wmayer
2017-10-05 10:38:42 +02:00
parent ef11efce55
commit 67b990c2b5
6 changed files with 130 additions and 31 deletions

View File

@@ -60,6 +60,8 @@ public:
);
add_varargs_method("openBrowserHTML",&Module::openBrowserHTML
);
add_varargs_method("openBrowserWindow",&Module::openBrowserWindow
);
initialize("This module is the WebGui module."); // register with Python
}
@@ -94,11 +96,27 @@ private:
WebGui::BrowserView* pcBrowserView = 0;
pcBrowserView = new WebGui::BrowserView(Gui::getMainWindow());
pcBrowserView->resize(400, 300);
pcBrowserView->setHtml(QString::fromUtf8(HtmlCode),QUrl(QString::fromLatin1(BaseUrl)),QString::fromUtf8(TabName));
pcBrowserView->setHtml(QString::fromUtf8(HtmlCode),QUrl(QString::fromLatin1(BaseUrl)));
pcBrowserView->setWindowTitle(QString::fromUtf8(TabName));
Gui::getMainWindow()->addWindow(pcBrowserView);
return Py::None();
}
Py::Object openBrowserWindow(const Py::Tuple& args)
{
const char* TabName = "Browser";
if (! PyArg_ParseTuple(args.ptr(), "|s",&TabName))
throw Py::Exception();
WebGui::BrowserView* pcBrowserView = 0;
pcBrowserView = new WebGui::BrowserView(Gui::getMainWindow());
pcBrowserView->resize(400, 300);
pcBrowserView->setWindowTitle(QString::fromUtf8(TabName));
Gui::getMainWindow()->addWindow(pcBrowserView);
return Py::asObject(pcBrowserView->getPyObject());
}
};
PyObject* initModule()