diff --git a/src/Mod/Start/Gui/Workbench.cpp b/src/Mod/Start/Gui/Workbench.cpp index 619214464b..190dcc5b04 100644 --- a/src/Mod/Start/Gui/Workbench.cpp +++ b/src/Mod/Start/Gui/Workbench.cpp @@ -24,7 +24,7 @@ #include "PreCompiled.h" #ifndef _PreComp_ -# include +# include #endif #include "Workbench.h" @@ -60,20 +60,23 @@ StartGui::Workbench::~Workbench() void StartGui::Workbench::activated() { // Ensure that we don't open the Start page multiple times + QString title = QCoreApplication::translate("Workbench", "Start page"); QList ch = Gui::getMainWindow()->windows(); - for (QList::const_iterator c = ch.begin(); c != ch.end(); c++) - if ((*c)->windowTitle() == QObject::tr("Start page")) + for (QList::const_iterator c = ch.begin(); c != ch.end(); ++c) { + if ((*c)->windowTitle() == title) return; + } try { + QByteArray utf8Title = title.toUtf8(); Gui::Command::doCommand(Gui::Command::Gui,"import WebGui"); Gui::Command::doCommand(Gui::Command::Gui,"from StartPage import StartPage"); #if defined(FC_OS_WIN32) Gui::Command::doCommand(Gui::Command::Gui,"WebGui.openBrowserHTML" - "(StartPage.handle(),App.getResourceDir() + 'Mod/Start/StartPage/','Start page')"); + "(StartPage.handle(),App.getResourceDir() + 'Mod/Start/StartPage/','%s')", utf8Title.data()); #else Gui::Command::doCommand(Gui::Command::Gui,"WebGui.openBrowserHTML" - "(StartPage.handle(),'file://' + App.getResourceDir() + 'Mod/Start/StartPage/','Start page')"); + "(StartPage.handle(),'file://' + App.getResourceDir() + 'Mod/Start/StartPage/','%s')", utf8Title.data()); #endif } catch (const Base::Exception& e) { diff --git a/src/Mod/Web/Gui/AppWebGui.cpp b/src/Mod/Web/Gui/AppWebGui.cpp index df8c9420cf..7e4e80f0d1 100644 --- a/src/Mod/Web/Gui/AppWebGui.cpp +++ b/src/Mod/Web/Gui/AppWebGui.cpp @@ -91,26 +91,11 @@ private: if (! PyArg_ParseTuple(args.ptr(), "ss|s",&HtmlCode,&BaseUrl,&TabName)) throw Py::Exception(); - QMdiSubWindow* browserView = 0; - QMdiArea* mdiArea = Gui::getMainWindow()->findChild(); - QList mdiViews = mdiArea->subWindowList(); - for (QList::iterator it = mdiViews.begin(); it != mdiViews.end(); ++it) { - if (qobject_cast((*it)->widget())) { - browserView = *it; - break; - } - } - - if (!browserView) { - 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)); - Gui::getMainWindow()->addWindow(pcBrowserView); - } - else { - mdiArea->setActiveSubWindow(browserView); - } + 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)); + Gui::getMainWindow()->addWindow(pcBrowserView); return Py::None(); }