[code] Remove wantsFocus(QUrl) signal. Instead using better solution.

When HTTP authorization is requested, this signal is used to
set the originating WebTab as current widget in tabwidget.
remotes/origin/falkon
nowrep 13 years ago
parent 00cf5cdbd2
commit d8527917ca
  1. 1
      README.md
  2. 16
      src/lib/network/networkmanager.cpp
  3. 1
      src/lib/network/networkmanager.h
  4. 8
      src/lib/webview/tabbedwebview.cpp
  5. 2
      src/lib/webview/tabbedwebview.h

@ -44,6 +44,7 @@ and you have read the BUILDING information.
* pkg-config is optional (to correctly detect versions of QtWebKit) * pkg-config is optional (to correctly detect versions of QtWebKit)
* pkg-config is required for Hunspell spellcheck * pkg-config is required for Hunspell spellcheck
* Hunspell development package for spellcheck * Hunspell development package for spellcheck
* QtWebKit 2.3 is needed to have support for spellcheck
**Windows** **Windows**
* QtWebKit 2.3 is required * QtWebKit 2.3 is required

@ -21,6 +21,7 @@
#include "networkmanagerproxy.h" #include "networkmanagerproxy.h"
#include "mainapplication.h" #include "mainapplication.h"
#include "webpage.h" #include "webpage.h"
#include "tabbedwebview.h"
#include "pluginproxy.h" #include "pluginproxy.h"
#include "adblockmanager.h" #include "adblockmanager.h"
#include "networkproxyfactory.h" #include "networkproxyfactory.h"
@ -300,9 +301,20 @@ void NetworkManager::authentication(QNetworkReply* reply, QAuthenticator* auth)
pass->setText(storedPassword); pass->setText(storedPassword);
} }
} }
emit wantsFocus(reply->url());
//Do not save when private browsing is enabled // Try to set the originating WebTab as a current tab
QWebFrame* frame = qobject_cast<QWebFrame*>(reply->request().originatingObject());
if (frame) {
WebPage* page = qobject_cast<WebPage*>(frame->page());
if (page) {
TabbedWebView* view = qobject_cast<TabbedWebView*>(page->view());
if (view) {
view->setAsCurrentTab();
}
}
}
// Do not save when private browsing is enabled
if (mApp->isPrivateSession()) { if (mApp->isPrivateSession()) {
save->setVisible(false); save->setVisible(false);
} }

@ -58,7 +58,6 @@ public:
void disconnectObjects(); void disconnectObjects();
signals: signals:
void wantsFocus(const QUrl &url);
void sslDialogClosed(); void sslDialogClosed();
private slots: private slots:

@ -57,8 +57,6 @@ TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab)
connect(this, SIGNAL(statusBarMessage(QString)), p_QupZilla->statusBar(), SLOT(showMessage(QString))); connect(this, SIGNAL(statusBarMessage(QString)), p_QupZilla->statusBar(), SLOT(showMessage(QString)));
connect(mApp->networkManager(), SIGNAL(wantsFocus(QUrl)), this, SLOT(getFocus(QUrl)));
connect(p_QupZilla, SIGNAL(setWebViewMouseTracking(bool)), this, SLOT(trackMouse(bool))); connect(p_QupZilla, SIGNAL(setWebViewMouseTracking(bool)), this, SLOT(trackMouse(bool)));
// Tracking mouse also on tabs created in fullscreen // Tracking mouse also on tabs created in fullscreen
@ -302,11 +300,9 @@ void TabbedWebView::openNewTab()
m_tabWidget->addView(QUrl()); m_tabWidget->addView(QUrl());
} }
void TabbedWebView::getFocus(const QUrl &urla) void TabbedWebView::setAsCurrentTab()
{ {
if (urla == url()) { m_tabWidget->setCurrentWidget(m_webTab);
m_tabWidget->setCurrentWidget(m_webTab);
}
} }
void TabbedWebView::mouseMoveEvent(QMouseEvent* event) void TabbedWebView::mouseMoveEvent(QMouseEvent* event)

@ -58,6 +58,7 @@ signals:
public slots: public slots:
void titleChanged(); void titleChanged();
void setAsCurrentTab();
void stop(); void stop();
void showIcon(); void showIcon();
@ -76,7 +77,6 @@ private slots:
void slotLoadFinished(); void slotLoadFinished();
void urlChanged(const QUrl &url); void urlChanged(const QUrl &url);
void linkHovered(const QString &link, const QString &title, const QString &content); void linkHovered(const QString &link, const QString &title, const QString &content);
void getFocus(const QUrl &urla);
void setIp(const QHostInfo &info); void setIp(const QHostInfo &info);
void checkRss(); void checkRss();
void slotIconChanged(); void slotIconChanged();

Loading…
Cancel
Save