mirror of
https://invent.kde.org/network/falkon.git
synced 2024-09-21 17:52:10 +02:00
Added new page into Site Info: Databases.
- shows all used web databases on the site
This commit is contained in:
parent
d8edd450e9
commit
8e9293e475
|
@ -6,21 +6,21 @@ UI_DIR = $$PWD/../build
|
|||
unix: VERSION = 1.1.8
|
||||
|
||||
# Please read BUILD information #
|
||||
#DEFINES += NO_SYSTEM_DATAPATH
|
||||
#DEFINES += USE_WEBGL
|
||||
#DEFINES += KDE
|
||||
#DEFINES += PORTABLE_BUILD
|
||||
#DEFINES *= NO_SYSTEM_DATAPATH
|
||||
#DEFINES *= USE_WEBGL
|
||||
#DEFINES *= KDE
|
||||
#DEFINES *= PORTABLE_BUILD
|
||||
win32 {
|
||||
DEFINES += W7API
|
||||
DEFINES *= W7API
|
||||
LIBS += User32.lib Ole32.lib Shell32.lib ShlWapi.lib Gdi32.lib ComCtl32.lib
|
||||
}
|
||||
|
||||
DEFINES += QT_NO_URL_CAST_FROM_STRING
|
||||
DEFINES *= QT_NO_URL_CAST_FROM_STRING
|
||||
|
||||
##It won't compile on windows with this define. Some bug in qtsingleapp / qvector template
|
||||
!win32: !CONFIG(debug, debug|release): DEFINES += QT_NO_DEBUG_OUTPUT
|
||||
!win32: !CONFIG(debug, debug|release): DEFINES *= QT_NO_DEBUG_OUTPUT
|
||||
|
||||
CONFIG(debug, debug|release): DEFINES += QUPZILLA_DEBUG_BUILD
|
||||
CONFIG(debug, debug|release): DEFINES *= QUPZILLA_DEBUG_BUILD
|
||||
|
||||
d_no_system_datapath = $$(NO_SYSTEM_DATAPATH)
|
||||
d_use_webgl = $$(USE_WEBGL)
|
||||
|
@ -30,13 +30,13 @@ d_portable = $$(PORTABLE_BUILD)
|
|||
d_nonblock_dialogs = $$(NONBLOCK_JS_DIALOGS)
|
||||
d_use_qtwebkit_2_2 = $$(USE_QTWEBKIT_2_2)
|
||||
|
||||
equals(d_no_system_datapath, "true") { DEFINES += NO_SYSTEM_DATAPATH }
|
||||
equals(d_use_webgl, "true") { DEFINES += USE_WEBGL }
|
||||
equals(d_w7api, "true") { DEFINES += W7API }
|
||||
equals(d_kde, "true") { DEFINES += KDE }
|
||||
equals(d_portable, "true") { DEFINES += PORTABLE_BUILD }
|
||||
equals(d_nonblock_dialogs, "true") { DEFINES += NONBLOCK_JS_DIALOGS }
|
||||
equals(d_use_qtwebkit_2_2, "true") { DEFINES += USE_QTWEBKIT_2_2 }
|
||||
equals(d_no_system_datapath, "true") { DEFINES *= NO_SYSTEM_DATAPATH }
|
||||
equals(d_use_webgl, "true") { DEFINES *= USE_WEBGL }
|
||||
equals(d_w7api, "true") { DEFINES *= W7API }
|
||||
equals(d_kde, "true") { DEFINES *= KDE }
|
||||
equals(d_portable, "true") { DEFINES *= PORTABLE_BUILD }
|
||||
equals(d_nonblock_dialogs, "true") { DEFINES *= NONBLOCK_JS_DIALOGS }
|
||||
equals(d_use_qtwebkit_2_2, "true") { DEFINES *= USE_QTWEBKIT_2_2 }
|
||||
|
||||
!mac:unix {
|
||||
d_prefix = $$(QUPZILLA_PREFIX)
|
||||
|
@ -56,11 +56,11 @@ equals(d_use_qtwebkit_2_2, "true") { DEFINES += USE_QTWEBKIT_2_2 }
|
|||
hicolor_folder = "$$d_prefix"share/icons/hicolor
|
||||
}
|
||||
|
||||
DEFINES += USE_DATADIR=\\\"""$$data_folder/"\\\""
|
||||
DEFINES *= USE_DATADIR=\\\"""$$data_folder/"\\\""
|
||||
|
||||
#Git revision
|
||||
rev = $$system(cd ../ && sh $$PWD/../scripts/getrevision.sh)
|
||||
!equals(rev, ""): DEFINES += GIT_REVISION=\\\"""$$rev"\\\""
|
||||
!equals(rev, ""): DEFINES *= GIT_REVISION=\\\"""$$rev"\\\""
|
||||
}
|
||||
|
||||
isEmpty(QMAKE_LRELEASE) {
|
||||
|
|
4
src/lib/3rdparty/qtsingleapplication.pri
vendored
4
src/lib/3rdparty/qtsingleapplication.pri
vendored
|
@ -10,6 +10,6 @@ qtsingleapplication-uselib:!qtsingleapplication-buildlib {
|
|||
}
|
||||
|
||||
os2|win32 {
|
||||
contains(TEMPLATE, lib):contains(CONFIG, shared):DEFINES += QT_QTSINGLEAPPLICATION_EXPORT
|
||||
else:qtsingleapplication-uselib:DEFINES += QT_QTSINGLEAPPLICATION_IMPORT
|
||||
contains(TEMPLATE, lib):contains(CONFIG, shared):DEFINES *= QT_QTSINGLEAPPLICATION_EXPORT
|
||||
else:qtsingleapplication-uselib:DEFINES *= QT_QTSINGLEAPPLICATION_IMPORT
|
||||
}
|
||||
|
|
1
src/lib/3rdparty/squeezelabelv1.cpp
vendored
1
src/lib/3rdparty/squeezelabelv1.cpp
vendored
|
@ -15,5 +15,6 @@ void SqueezeLabelV1::paintEvent(QPaintEvent* event)
|
|||
setText(elided);
|
||||
}
|
||||
}
|
||||
|
||||
QLabel::paintEvent(event);
|
||||
}
|
||||
|
|
49
src/lib/3rdparty/squeezelabelv2.cpp
vendored
49
src/lib/3rdparty/squeezelabelv2.cpp
vendored
|
@ -1,5 +1,27 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* ============================================================ */
|
||||
#include "squeezelabelv2.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QClipboard>
|
||||
#include <QKeyEvent>
|
||||
#include <QMenu>
|
||||
|
||||
SqueezeLabelV2::SqueezeLabelV2(QWidget* parent)
|
||||
: QLabel(parent)
|
||||
{
|
||||
|
@ -19,6 +41,33 @@ void SqueezeLabelV2::setText(const QString &txt)
|
|||
QLabel::setText(elided);
|
||||
}
|
||||
|
||||
void SqueezeLabelV2::copy()
|
||||
{
|
||||
if (selectedText().length() == text().length()) {
|
||||
QApplication::clipboard()->setText(m_originalText);
|
||||
}
|
||||
else {
|
||||
QApplication::clipboard()->setText(selectedText());
|
||||
}
|
||||
}
|
||||
|
||||
void SqueezeLabelV2::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
QMenu menu;
|
||||
QAction* act = menu.addAction(tr("Copy"), this, SLOT(copy()));
|
||||
act->setShortcut(QKeySequence("Ctrl+C"));
|
||||
act->setEnabled(hasSelectedText());
|
||||
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
|
||||
void SqueezeLabelV2::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_C && event->modifiers() == Qt::ControlModifier) {
|
||||
copy();
|
||||
}
|
||||
}
|
||||
|
||||
QString SqueezeLabelV2::originalText()
|
||||
{
|
||||
return m_originalText;
|
||||
|
|
55
src/lib/3rdparty/squeezelabelv2.h
vendored
55
src/lib/3rdparty/squeezelabelv2.h
vendored
|
@ -1,42 +1,27 @@
|
|||
/* ============================================================
|
||||
* QupZilla - WebKit based browser
|
||||
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* ============================================================ */
|
||||
#ifndef SQUEEZELABELV2_H
|
||||
#define SQUEEZELABELV2_H
|
||||
|
||||
#include "qz_namespace.h"
|
||||
|
||||
/**
|
||||
* Copyright (c) 2009, Benjamin C. Meyer <ben@meyerhome.net>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Benjamin Meyer nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
/*
|
||||
A label that will squeeze the set text to fit within the size of the
|
||||
widget. The text will be elided in the middle.
|
||||
*/
|
||||
class QT_QUPZILLA_EXPORT SqueezeLabelV2 : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -48,11 +33,15 @@ public:
|
|||
QString originalText();
|
||||
void setText(const QString &txt);
|
||||
|
||||
private slots:
|
||||
void copy();
|
||||
|
||||
protected:
|
||||
void contextMenuEvent(QContextMenuEvent *event);
|
||||
void keyPressEvent(QKeyEvent *event);
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
|
||||
private:
|
||||
QString m_SqueezedTextCache;
|
||||
QString m_originalText;
|
||||
};
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "settings.h"
|
||||
#include "locationbarsettings.h"
|
||||
#include "webviewsettings.h"
|
||||
#include "clearprivatedata.h"
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
#include <QFileOpenEvent>
|
||||
|
@ -612,8 +613,7 @@ void MainApplication::saveSettings()
|
|||
m_historymodel->clearHistory();
|
||||
}
|
||||
if (deleteHtml5Storage) {
|
||||
qz_removeDir(m_activeProfil + "Databases");
|
||||
qz_removeDir(m_activeProfil + "LocalStorage");
|
||||
ClearPrivateData::clearLocalStorage();
|
||||
}
|
||||
|
||||
m_searchEnginesManager->saveSettings();
|
||||
|
|
|
@ -204,7 +204,7 @@ void DownloadManager::download(const QNetworkRequest &request, WebPage* page, bo
|
|||
handleUnsupportedContent(m_networkManager->get(req), page, fromPageDownload, suggestedFileName);
|
||||
}
|
||||
|
||||
void DownloadManager::handleUnsupportedContent(QNetworkReply *reply, WebPage *page, bool fromPageDownload, const QString &suggestedFileName)
|
||||
void DownloadManager::handleUnsupportedContent(QNetworkReply* reply, WebPage* page, bool fromPageDownload, const QString &suggestedFileName)
|
||||
{
|
||||
if (!page || reply->url().scheme() == "qupzilla") {
|
||||
return;
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="SqueezeLabelV1" name="fileName">
|
||||
<widget class="SqueezeLabelV2" name="fileName">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
@ -166,9 +166,9 @@
|
|||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>SqueezeLabelV1</class>
|
||||
<class>SqueezeLabelV2</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>squeezelabelv1.h</header>
|
||||
<header>squeezelabelv2.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
|
|
|
@ -3,7 +3,7 @@ unix:QT += dbus
|
|||
TARGET = qupzilla
|
||||
TEMPLATE = lib
|
||||
|
||||
DEFINES += QUPZILLA_SHAREDLIBRARY
|
||||
DEFINES *= QUPZILLA_SHAREDLIBRARY
|
||||
|
||||
include(3rdparty/qtsingleapplication.pri)
|
||||
include(../defines.pri)
|
||||
|
|
|
@ -320,7 +320,7 @@ void LocationBar::contextMenuEvent(QContextMenuEvent* event)
|
|||
m_pasteAndGoAction->setEnabled(!QApplication::clipboard()->text().isEmpty());
|
||||
|
||||
//Prevent choosing first option with double rightclick
|
||||
QPoint pos = mapToGlobal(event->pos());
|
||||
QPoint pos = event->globalPos();
|
||||
QPoint p(pos.x(), pos.y() + 1);
|
||||
m_menu->popup(p);
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ void WebSearchBar::contextMenuEvent(QContextMenuEvent* event)
|
|||
m_pasteAndGoAction->setEnabled(!QApplication::clipboard()->text().isEmpty());
|
||||
|
||||
//Prevent choosing first option with double rightclick
|
||||
QPoint pos = mapToGlobal(event->pos());
|
||||
QPoint pos = event->globalPos();
|
||||
QPoint p(pos.x(), pos.y() + 1);
|
||||
m_menu->popup(p);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,9 @@
|
|||
#include "clickablelabel.h"
|
||||
#include "ui_clearprivatedata.h"
|
||||
#include "iconprovider.h"
|
||||
#include "globalfunctions.h"
|
||||
|
||||
#include <QWebDatabase>
|
||||
#include <QWebSettings>
|
||||
#include <QNetworkDiskCache>
|
||||
#include <QDateTime>
|
||||
|
@ -50,6 +52,35 @@ void ClearPrivateData::historyClicked(bool state)
|
|||
ui->historyLength->setEnabled(state);
|
||||
}
|
||||
|
||||
void ClearPrivateData::clearLocalStorage()
|
||||
{
|
||||
const QString &profile = mApp->getActiveProfilPath();
|
||||
|
||||
qz_removeDir(profile + "LocalStorage");
|
||||
}
|
||||
|
||||
void ClearPrivateData::clearWebDatabases()
|
||||
{
|
||||
const QString &profile = mApp->getActiveProfilPath();
|
||||
|
||||
QWebDatabase::removeAllDatabases();
|
||||
qz_removeDir(profile + "Databases");
|
||||
}
|
||||
|
||||
void ClearPrivateData::clearCache()
|
||||
{
|
||||
mApp->webSettings()->clearMemoryCaches();
|
||||
mApp->networkManager()->cache()->clear();
|
||||
|
||||
QFile::remove(mApp->getActiveProfilPath() + "ApplicationCache.db");
|
||||
}
|
||||
|
||||
void ClearPrivateData::clearIcons()
|
||||
{
|
||||
mApp->webSettings()->clearIconDatabase();
|
||||
mApp->iconProvider()->clearIconDatabase();
|
||||
}
|
||||
|
||||
void ClearPrivateData::clearFlash()
|
||||
{
|
||||
p_QupZilla->tabWidget()->addView(QUrl("http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html"));
|
||||
|
@ -58,6 +89,7 @@ void ClearPrivateData::clearFlash()
|
|||
void ClearPrivateData::dialogAccepted()
|
||||
{
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
|
||||
if (ui->history->isChecked()) {
|
||||
QDateTime dateTime = QDateTime::currentDateTime();
|
||||
qint64 nowMS = QDateTime::currentMSecsSinceEpoch();
|
||||
|
@ -83,18 +115,28 @@ void ClearPrivateData::dialogAccepted()
|
|||
query.exec("DELETE FROM history WHERE date > " + QString::number(date));
|
||||
query.exec("VACUUM");
|
||||
}
|
||||
|
||||
if (ui->cookies->isChecked()) {
|
||||
QList<QNetworkCookie> cookies;
|
||||
mApp->cookieJar()->setAllCookies(cookies);
|
||||
mApp->cookieJar()->setAllCookies(QList<QNetworkCookie>());
|
||||
}
|
||||
|
||||
if (ui->cache->isChecked()) {
|
||||
mApp->webSettings()->clearMemoryCaches();
|
||||
mApp->networkManager()->cache()->clear();
|
||||
clearCache();
|
||||
}
|
||||
|
||||
if (ui->databases->isChecked()) {
|
||||
clearWebDatabases();
|
||||
}
|
||||
|
||||
if (ui->localStorage->isChecked()) {
|
||||
clearLocalStorage();
|
||||
}
|
||||
|
||||
if (ui->icons->isChecked()) {
|
||||
mApp->webSettings()->clearIconDatabase();
|
||||
mApp->iconProvider()->clearIconDatabase();
|
||||
clearIcons();
|
||||
}
|
||||
|
||||
QApplication::restoreOverrideCursor();
|
||||
|
||||
close();
|
||||
}
|
||||
|
|
|
@ -34,6 +34,11 @@ class QT_QUPZILLA_EXPORT ClearPrivateData : public QDialog
|
|||
public:
|
||||
explicit ClearPrivateData(QupZilla* mainClass, QWidget* parent = 0);
|
||||
|
||||
static void clearLocalStorage();
|
||||
static void clearWebDatabases();
|
||||
static void clearCache();
|
||||
static void clearIcons();
|
||||
|
||||
private slots:
|
||||
void historyClicked(bool state);
|
||||
void dialogAccepted();
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>308</width>
|
||||
<height>260</height>
|
||||
<height>310</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -27,21 +27,11 @@
|
|||
<string>Clear history</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="cookies">
|
||||
<property name="text">
|
||||
<string>Clear cookies</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="cache">
|
||||
<property name="text">
|
||||
<string>Clear cache</string>
|
||||
|
@ -51,14 +41,14 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<item row="9" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="icons">
|
||||
<property name="text">
|
||||
<string>Clear icons</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<item row="11" column="1">
|
||||
<widget class="ClickableLabel" name="clearAdobeCookies">
|
||||
<property name="cursor">
|
||||
<cursorShape>PointingHandCursor</cursorShape>
|
||||
|
@ -71,7 +61,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1" colspan="2">
|
||||
<item row="12" column="1" colspan="2">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
@ -106,6 +96,9 @@
|
|||
</item>
|
||||
<item row="3" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="historyLength">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Earlier Today</string>
|
||||
|
@ -141,6 +134,36 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="databases">
|
||||
<property name="text">
|
||||
<string>Clear web databases</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="localStorage">
|
||||
<property name="text">
|
||||
<string>Clear local storage</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="cookies">
|
||||
<property name="text">
|
||||
<string>Clear cookies</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
|
|
@ -88,7 +88,7 @@ void PopupWebView::contextMenuEvent(QContextMenuEvent* event)
|
|||
|
||||
if (!m_menu->isEmpty()) {
|
||||
//Prevent choosing first option with double rightclick
|
||||
const QPoint &pos = mapToGlobal(event->pos());
|
||||
const QPoint &pos = event->globalPos();
|
||||
QPoint p(pos.x(), pos.y() + 1);
|
||||
m_menu->popup(p);
|
||||
return;
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "autofillmodel.h"
|
||||
#include "settings.h"
|
||||
#include "tabbedwebview.h"
|
||||
#include "clearprivatedata.h"
|
||||
|
||||
#include <QSettings>
|
||||
#include <QInputDialog>
|
||||
|
@ -503,9 +504,7 @@ void Preferences::chooseUserStyleClicked()
|
|||
|
||||
void Preferences::deleteHtml5storage()
|
||||
{
|
||||
QString activeProfil = mApp->getActiveProfilPath();
|
||||
qz_removeDir(activeProfil + "Databases");
|
||||
qz_removeDir(activeProfil + "LocalStorage");
|
||||
ClearPrivateData::clearLocalStorage();
|
||||
|
||||
ui->deleteHtml5storage->setText(tr("Deleted"));
|
||||
ui->deleteHtml5storage->setEnabled(false);
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
#include <QNetworkDiskCache>
|
||||
#include <QWebFrame>
|
||||
#include <QClipboard>
|
||||
#include <QWebSecurityOrigin>
|
||||
#include <QWebDatabase>
|
||||
|
||||
QString SiteInfo::showCertInfo(const QString &string)
|
||||
{
|
||||
|
@ -46,13 +48,15 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
|
|||
: QDialog(parent)
|
||||
, ui(new Ui::SiteInfo)
|
||||
, m_certWidget(0)
|
||||
, m_view(view)
|
||||
{
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->listWidget->item(0)->setIcon(QIcon::fromTheme("document-properties", QIcon(":/icons/preferences/document-properties.png")));
|
||||
ui->listWidget->item(1)->setIcon(QIcon::fromTheme("applications-graphics", QIcon(":/icons/preferences/applications-graphics.png")));
|
||||
ui->listWidget->item(2)->setIcon(QIcon::fromTheme("dialog-password", QIcon(":/icons/preferences/dialog-password.png")));
|
||||
ui->listWidget->item(2)->setIcon(QIcon::fromTheme("text-x-sql", QIcon(":/icons/preferences/text-x-sql.png")));
|
||||
ui->listWidget->item(3)->setIcon(QIcon::fromTheme("dialog-password", QIcon(":/icons/preferences/dialog-password.png")));
|
||||
ui->listWidget->item(0)->setSelected(true);
|
||||
|
||||
WebPage* webPage = qobject_cast<WebPage*>(view->page());
|
||||
|
@ -123,6 +127,24 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
|
|||
ui->treeImages->addTopLevelItem(item);
|
||||
}
|
||||
|
||||
//DATABASES
|
||||
const QList<QWebDatabase> databases = frame->securityOrigin().databases();
|
||||
|
||||
int counter = 0;
|
||||
foreach(const QWebDatabase & b, databases) {
|
||||
QListWidgetItem* item = new QListWidgetItem(ui->databaseList);
|
||||
item->setText(b.displayName());
|
||||
item->setData(Qt::UserRole + 10, counter);
|
||||
|
||||
++counter;
|
||||
}
|
||||
|
||||
if (counter == 0) {
|
||||
QListWidgetItem* item = new QListWidgetItem(ui->databaseList);
|
||||
item->setText(tr("No databases are used by this page."));
|
||||
item->setFlags(item->flags() & Qt::ItemIsSelectable);
|
||||
}
|
||||
|
||||
//SECURITY
|
||||
if (cert.isValid()) {
|
||||
ui->securityLabel->setText(tr("<b>Connection is Encrypted.</b>"));
|
||||
|
@ -140,6 +162,7 @@ SiteInfo::SiteInfo(WebView* view, QWidget* parent)
|
|||
connect(ui->secDetailsButton, SIGNAL(clicked()), this, SLOT(securityDetailsClicked()));
|
||||
connect(ui->saveButton, SIGNAL(clicked(QAbstractButton*)), this, SLOT(downloadImage()));
|
||||
|
||||
connect(ui->databaseList, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(databaseItemChanged(QListWidgetItem*)));
|
||||
connect(ui->treeImages, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(showImagePreview(QTreeWidgetItem*)));
|
||||
connect(ui->treeImages, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(imagesCustomContextMenuRequested(const QPoint &)));
|
||||
|
||||
|
@ -161,6 +184,27 @@ void SiteInfo::imagesCustomContextMenuRequested(const QPoint &p)
|
|||
menu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
void SiteInfo::databaseItemChanged(QListWidgetItem* item)
|
||||
{
|
||||
if (!item) {
|
||||
return;
|
||||
}
|
||||
|
||||
int id = item->data(Qt::UserRole + 10).toInt();
|
||||
const QList<QWebDatabase> &list = m_view->page()->mainFrame()->securityOrigin().databases();
|
||||
|
||||
if (id > list.count() - 1) {
|
||||
qDebug("database is shit");
|
||||
return;
|
||||
}
|
||||
|
||||
const QWebDatabase &db = list.at(id);
|
||||
|
||||
ui->databaseName->setText(QString("%1 (%2)").arg(db.displayName(), db.name()));
|
||||
ui->databasePath->setText(db.fileName());
|
||||
ui->databaseSize->setText(DownloadItem::fileSizeToString(db.size()));
|
||||
}
|
||||
|
||||
void SiteInfo::copyActionData()
|
||||
{
|
||||
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||
|
@ -237,7 +281,7 @@ void SiteInfo::showImagePreview(QTreeWidgetItem* item)
|
|||
|
||||
void SiteInfo::securityDetailsClicked()
|
||||
{
|
||||
ui->listWidget->setCurrentRow(2);
|
||||
ui->listWidget->setCurrentRow(3);
|
||||
}
|
||||
|
||||
SiteInfo::~SiteInfo()
|
||||
|
|
|
@ -45,6 +45,7 @@ public:
|
|||
static QString showCertInfo(const QString &string);
|
||||
|
||||
private slots:
|
||||
void databaseItemChanged(QListWidgetItem* item);
|
||||
void showImagePreview(QTreeWidgetItem* item);
|
||||
void securityDetailsClicked();
|
||||
|
||||
|
@ -55,6 +56,7 @@ private slots:
|
|||
private:
|
||||
Ui::SiteInfo* ui;
|
||||
CertificateInfoWidget* m_certWidget;
|
||||
WebView* m_view;
|
||||
|
||||
QPixmap m_activePixmap;
|
||||
QUrl m_baseUrl;
|
||||
|
|
|
@ -49,6 +49,9 @@
|
|||
<property name="uniformItemSizes">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionRectVisible">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>General</string>
|
||||
|
@ -59,6 +62,11 @@
|
|||
<string>Media</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Databases</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Security</string>
|
||||
|
@ -82,6 +90,16 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
|
@ -327,6 +345,95 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QListWidget" name="databaseList">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string><b>Database details</b></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Name:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Path:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Size:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="SqueezeLabelV2" name="databasePath">
|
||||
<property name="text">
|
||||
<string><database not selected></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="SqueezeLabelV2" name="databaseName">
|
||||
<property name="text">
|
||||
<string><database not selected></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="SqueezeLabelV2" name="databaseSize">
|
||||
<property name="text">
|
||||
<string><database not selected></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>124</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_2">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="topMargin">
|
||||
|
@ -365,16 +472,6 @@
|
|||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
|
|
@ -280,7 +280,7 @@ void TabbedWebView::contextMenuEvent(QContextMenuEvent* event)
|
|||
|
||||
if (!m_menu->isEmpty()) {
|
||||
//Prevent choosing first option with double rightclick
|
||||
const QPoint &pos = mapToGlobal(event->pos());
|
||||
const QPoint &pos = event->globalPos();
|
||||
QPoint p(pos.x(), pos.y() + 1);
|
||||
|
||||
m_menu->popup(p);
|
||||
|
|
Loading…
Reference in New Issue
Block a user