1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

Fixed toggling WebInspector. It now shows correct inspector everytime.

This commit is contained in:
nowrep 2012-03-16 16:57:24 +01:00
parent d5638fbc27
commit bb8e1ffdb5
9 changed files with 27 additions and 5 deletions

View File

@ -1316,7 +1316,7 @@ void QupZilla::showWebInspector(bool toggle)
{
if (m_webInspectorDock) {
if (toggle) {
m_webInspectorDock.data()->setVisible(!m_webInspectorDock.data()->isVisible());
m_webInspectorDock.data()->toggleVisibility();
}
else {
m_webInspectorDock.data()->show();

View File

@ -58,10 +58,12 @@ QupZillaSchemeReply::QupZillaSchemeReply(const QNetworkRequest &req, QObject* pa
setOperation(QNetworkAccessManager::GetOperation);
setRequest(req);
setUrl(req.url());
m_pageName = req.url().path();
if (m_pageName == "about" || m_pageName == "reportbug" || m_pageName == "start" ||
m_pageName == "speeddial" || m_pageName == "config") {
QStringList knownPages;
knownPages << "about" << "reportbug" << "start" << "speeddial" << "config";
if (knownPages.contains(m_pageName)) {
m_buffer.open(QIODevice::ReadWrite);
setError(QNetworkReply::NoError, tr("No Error"));

View File

@ -34,6 +34,16 @@ WebInspectorDockWidget::WebInspectorDockWidget(QupZilla* mainClass)
show();
}
void WebInspectorDockWidget::toggleVisibility()
{
if (isVisible()) {
close();
}
else {
show();
}
}
void WebInspectorDockWidget::close()
{
p_QupZilla->weView()->webTab()->setInspectorVisible(false);

View File

@ -44,6 +44,8 @@ public:
explicit WebInspectorDockWidget(QupZilla* mainClass);
~WebInspectorDockWidget();
void toggleVisibility();
signals:
public slots:

View File

@ -294,7 +294,7 @@ void WebPage::featurePermissionRequested(QWebFrame* frame, const QWebPage::Featu
}
#endif
bool WebPage::event(QEvent *event)
bool WebPage::event(QEvent* event)
{
if (event->type() == QEvent::Leave) {
// QWebPagePrivate::leaveEvent():

View File

@ -20,6 +20,8 @@ RESOURCES = akn_res.qrc
TRANSLATIONS = \
translations/cs_CZ.ts \
translations/de_DE.ts \
translations/id_ID.ts \
translations/ja_JP.ts \
translations/nl_NL.ts \
translations/sr_BA.ts \
translations/sr_RS.ts \

View File

@ -4,6 +4,8 @@
<file>data/copyright</file>
<file>locale/cs_CZ.qm</file>
<file>locale/de_DE.qm</file>
<file>locale/id_ID.qm</file>
<file>locale/ja_JP.qm</file>
<file>locale/nl_NL.qm</file>
<file>locale/sr_BA.qm</file>
<file>locale/sr_RS.qm</file>

View File

@ -28,6 +28,8 @@ RESOURCES = mousegestures.qrc
TRANSLATIONS = \
translations/cs_CZ.ts \
translations/de_DE.ts \
translations/id_ID.ts \
translations/ja_JP.ts \
translations/nl_NL.ts \
translations/sk_SK.ts \
translations/sr_BA.ts \

View File

@ -14,6 +14,8 @@
<file>data/copyright</file>
<file>locale/cs_CZ.qm</file>
<file>locale/de_DE.qm</file>
<file>locale/id_ID.qm</file>
<file>locale/ja_JP.qm</file>
<file>locale/nl_NL.qm</file>
<file>locale/sk_SK.qm</file>
<file>locale/sr_BA.qm</file>