void PopupWebPage::checkBehaviour() { if (m_createNewWindow) { PopupWebView* view = new PopupWebView; view->setWebPage(this); PopupWindow* popup = new PopupWindow(view); popup->setWindowGeometry(m_geometry); popup->setMenuBarVisibility(m_menuBarVisible); popup->setStatusBarVisibility(m_statusBarVisible); popup->setToolBarVisibility(m_toolBarVisible); popup->show(); p_QupZilla->addDeleteOnCloseWidget(popup); disconnect(this, SIGNAL(geometryChangeRequested(QRect)), this, SLOT(slotGeometryChangeRequested(QRect))); disconnect(this, SIGNAL(menuBarVisibilityChangeRequested(bool)), this, SLOT(slotMenuBarVisibilityChangeRequested(bool))); disconnect(this, SIGNAL(toolBarVisibilityChangeRequested(bool)), this, SLOT(slotToolBarVisibilityChangeRequested(bool))); disconnect(this, SIGNAL(statusBarVisibilityChangeRequested(bool)), this, SLOT(slotStatusBarVisibilityChangeRequested(bool))); disconnect(this, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted())); disconnect(this, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); disconnect(this, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished(bool))); } else {
void PopupWebPage::checkBehaviour() { // If menubar/statusbar/toolbar visibility is explicitly set in window.open call, // at least one of those variables will be false. // If so, we should open new window. // But not when all visibilities are false, it occurs with target=_blank links if (!m_createNewWindow && (!m_menuBarVisible || !m_statusBarVisible || !m_toolBarVisible) && !(!m_menuBarVisible && !m_statusBarVisible && !m_toolBarVisible)) { m_createNewWindow = true; } if (m_createNewWindow) { PopupWebView* view = new PopupWebView; view->setWebPage(this); PopupWindow* popup = new PopupWindow(view); popup->setWindowGeometry(m_geometry); popup->setMenuBarVisibility(m_menuBarVisible); popup->setStatusBarVisibility(m_statusBarVisible); popup->setToolBarVisibility(m_toolBarVisible); popup->show(); if (m_isLoading) { view->fakeLoadingProgress(m_progress); } p_QupZilla->addDeleteOnCloseWidget(popup); disconnect(this, SIGNAL(geometryChangeRequested(QRect)), this, SLOT(slotGeometryChangeRequested(QRect))); disconnect(this, SIGNAL(menuBarVisibilityChangeRequested(bool)), this, SLOT(slotMenuBarVisibilityChangeRequested(bool))); disconnect(this, SIGNAL(toolBarVisibilityChangeRequested(bool)), this, SLOT(slotToolBarVisibilityChangeRequested(bool))); disconnect(this, SIGNAL(statusBarVisibilityChangeRequested(bool)), this, SLOT(slotStatusBarVisibilityChangeRequested(bool))); disconnect(this, SIGNAL(loadStarted()), this, SLOT(slotLoadStarted())); disconnect(this, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); disconnect(this, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished(bool))); } else {