2011-03-03 18:29:20 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2014-01-11 16:11:42 +01:00
|
|
|
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
|
2011-03-03 18:29:20 +01:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
* ============================================================ */
|
2011-03-02 16:57:41 +01:00
|
|
|
#include "cookiemanager.h"
|
|
|
|
#include "ui_cookiemanager.h"
|
2014-02-19 22:07:21 +01:00
|
|
|
#include "browserwindow.h"
|
2011-03-02 16:57:41 +01:00
|
|
|
#include "cookiejar.h"
|
|
|
|
#include "mainapplication.h"
|
2013-01-22 19:04:22 +01:00
|
|
|
#include "qztools.h"
|
2012-02-17 18:55:34 +01:00
|
|
|
#include "settings.h"
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-12-20 14:45:35 +01:00
|
|
|
#include <QNetworkCookie>
|
2012-02-29 18:33:50 +01:00
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QShortcut>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QInputDialog>
|
|
|
|
#include <QCloseEvent>
|
|
|
|
|
2011-10-26 19:23:50 +02:00
|
|
|
CookieManager::CookieManager(QWidget* parent)
|
|
|
|
: QWidget(parent)
|
|
|
|
, ui(new Ui::CookieManager)
|
2012-02-13 16:59:30 +01:00
|
|
|
, m_refreshCookieJar(true)
|
2011-03-02 16:57:41 +01:00
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2013-01-22 19:04:22 +01:00
|
|
|
QzTools::centerWidgetOnScreen(this);
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2013-07-11 18:18:32 +02:00
|
|
|
if (isRightToLeft()) {
|
|
|
|
ui->cookieTree->headerItem()->setTextAlignment(0, Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
ui->cookieTree->headerItem()->setTextAlignment(1, Qt::AlignRight | Qt::AlignVCenter);
|
|
|
|
ui->cookieTree->setLayoutDirection(Qt::LeftToRight);
|
|
|
|
ui->whiteList->setLayoutDirection(Qt::LeftToRight);
|
|
|
|
ui->blackList->setLayoutDirection(Qt::LeftToRight);
|
|
|
|
}
|
|
|
|
|
2012-02-17 18:55:34 +01:00
|
|
|
// Stored Cookies
|
2013-03-06 09:05:41 +01:00
|
|
|
connect(ui->cookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)));
|
2011-03-02 16:57:41 +01:00
|
|
|
connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll()));
|
2011-11-06 12:05:16 +01:00
|
|
|
connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(removeCookie()));
|
2012-02-17 18:55:34 +01:00
|
|
|
connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
|
|
|
|
connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
|
2013-01-23 14:00:37 +01:00
|
|
|
connect(ui->close3, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
|
2013-02-18 20:55:31 +01:00
|
|
|
connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
|
2013-01-23 01:34:15 +01:00
|
|
|
|
2012-02-17 18:55:34 +01:00
|
|
|
// Cookie Filtering
|
|
|
|
connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist()));
|
|
|
|
connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist()));
|
|
|
|
connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist()));
|
|
|
|
connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist()));
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2013-01-23 01:34:15 +01:00
|
|
|
// Cookie Settings
|
|
|
|
Settings settings;
|
|
|
|
settings.beginGroup("Cookie-Settings");
|
|
|
|
ui->saveCookies->setChecked(settings.value("allowCookies", true).toBool());
|
|
|
|
if (!ui->saveCookies->isChecked()) {
|
|
|
|
ui->deleteCookiesOnClose->setEnabled(false);
|
|
|
|
}
|
|
|
|
ui->deleteCookiesOnClose->setChecked(settings.value("deleteCookiesOnClose", false).toBool());
|
|
|
|
ui->matchExactly->setChecked(settings.value("allowCookiesFromVisitedDomainOnly", false).toBool());
|
|
|
|
ui->filterTracking->setChecked(settings.value("filterTrackingCookie", false).toBool());
|
|
|
|
settings.endGroup();
|
|
|
|
|
|
|
|
connect(ui->saveCookies, SIGNAL(toggled(bool)), this, SLOT(saveCookiesChanged(bool)));
|
|
|
|
|
2012-08-13 15:41:08 +02:00
|
|
|
ui->search->setPlaceholderText(tr("Search"));
|
2011-07-30 17:57:14 +02:00
|
|
|
ui->cookieTree->setDefaultItemShowMode(TreeWidget::ItemsCollapsed);
|
2011-12-10 13:15:07 +01:00
|
|
|
ui->cookieTree->sortItems(0, Qt::AscendingOrder);
|
2012-02-17 18:55:34 +01:00
|
|
|
ui->cookieTree->header()->setDefaultSectionSize(220);
|
|
|
|
ui->cookieTree->setFocus();
|
2012-02-13 18:22:24 +01:00
|
|
|
|
|
|
|
QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this);
|
2012-02-17 18:55:34 +01:00
|
|
|
connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed()));
|
2013-07-07 12:32:55 +02:00
|
|
|
|
|
|
|
QzTools::setWmClass("Cookies", this);
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CookieManager::removeAll()
|
|
|
|
{
|
|
|
|
QMessageBox::StandardButton button = QMessageBox::warning(this, tr("Confirmation"),
|
2011-11-06 17:01:23 +01:00
|
|
|
tr("Are you sure to delete all cookies on your computer?"), QMessageBox::Yes | QMessageBox::No);
|
|
|
|
if (button != QMessageBox::Yes) {
|
2011-03-02 16:57:41 +01:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-02-13 18:22:24 +01:00
|
|
|
QList<QNetworkCookie> emptyList;
|
|
|
|
mApp->cookieJar()->setAllCookies(emptyList);
|
2011-03-02 16:57:41 +01:00
|
|
|
ui->cookieTree->clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CookieManager::removeCookie()
|
|
|
|
{
|
|
|
|
QTreeWidgetItem* current = ui->cookieTree->currentItem();
|
2011-11-06 17:01:23 +01:00
|
|
|
if (!current) {
|
2011-03-02 16:57:41 +01:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-02-13 18:22:24 +01:00
|
|
|
QList<QNetworkCookie> allCookies = mApp->cookieJar()->getAllCookies();
|
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
if (current->text(1).isEmpty()) { //Remove whole cookie group
|
2013-12-30 13:43:48 +01:00
|
|
|
const QString domain = current->data(0, Qt::UserRole + 10).toString();
|
2013-03-06 09:05:41 +01:00
|
|
|
foreach (const QNetworkCookie &cookie, allCookies) {
|
2012-03-13 17:51:06 +01:00
|
|
|
if (cookie.domain() == domain || cookie.domain() == domain.mid(1)) {
|
2012-02-13 18:22:24 +01:00
|
|
|
allCookies.removeOne(cookie);
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
|
|
|
|
2012-02-13 16:59:30 +01:00
|
|
|
ui->cookieTree->deleteItem(current);
|
2011-11-06 12:05:16 +01:00
|
|
|
}
|
|
|
|
else {
|
2013-12-30 13:43:48 +01:00
|
|
|
const QNetworkCookie cookie = qvariant_cast<QNetworkCookie>(current->data(0, Qt::UserRole + 10));
|
2012-02-13 18:22:24 +01:00
|
|
|
allCookies.removeOne(cookie);
|
2012-02-13 16:59:30 +01:00
|
|
|
|
2012-02-17 18:55:34 +01:00
|
|
|
QTreeWidgetItem* parentItem = current->parent();
|
2012-02-13 16:59:30 +01:00
|
|
|
ui->cookieTree->deleteItem(current);
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-02-17 18:55:34 +01:00
|
|
|
if (parentItem->childCount() == 0) {
|
|
|
|
ui->cookieTree->deleteItem(parentItem);
|
2012-02-13 16:59:30 +01:00
|
|
|
}
|
2011-11-06 12:05:16 +01:00
|
|
|
}
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-02-17 18:55:34 +01:00
|
|
|
mApp->cookieJar()->setAllCookies(allCookies);
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
|
|
|
|
2011-03-17 17:03:04 +01:00
|
|
|
void CookieManager::currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* parent)
|
2011-03-02 16:57:41 +01:00
|
|
|
{
|
|
|
|
Q_UNUSED(parent);
|
2011-11-06 17:01:23 +01:00
|
|
|
if (!current) {
|
2011-03-02 16:57:41 +01:00
|
|
|
return;
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-03-02 16:57:41 +01:00
|
|
|
|
|
|
|
if (current->text(1).isEmpty()) {
|
|
|
|
ui->name->setText(tr("<cookie not selected>"));
|
|
|
|
ui->value->setText(tr("<cookie not selected>"));
|
|
|
|
ui->server->setText(tr("<cookie not selected>"));
|
|
|
|
ui->path->setText(tr("<cookie not selected>"));
|
|
|
|
ui->secure->setText(tr("<cookie not selected>"));
|
|
|
|
ui->expiration->setText(tr("<cookie not selected>"));
|
2011-11-06 12:05:16 +01:00
|
|
|
|
|
|
|
ui->removeOne->setText(tr("Remove cookies"));
|
2011-03-02 16:57:41 +01:00
|
|
|
return;
|
|
|
|
}
|
2011-11-06 12:05:16 +01:00
|
|
|
|
2013-12-30 13:43:48 +01:00
|
|
|
const QNetworkCookie cookie = qvariant_cast<QNetworkCookie>(current->data(0, Qt::UserRole + 10));
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-02-13 18:22:24 +01:00
|
|
|
ui->name->setText(cookie.name());
|
|
|
|
ui->value->setText(cookie.value());
|
|
|
|
ui->server->setText(cookie.domain());
|
|
|
|
ui->path->setText(cookie.path());
|
|
|
|
cookie.isSecure() ? ui->secure->setText(tr("Secure only")) : ui->secure->setText(tr("All connections"));
|
|
|
|
cookie.isSessionCookie() ? ui->expiration->setText(tr("Session cookie")) : ui->expiration->setText(QDateTime(cookie.expirationDate()).toString("hh:mm:ss dddd d. MMMM yyyy"));
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-02-13 18:22:24 +01:00
|
|
|
ui->removeOne->setText(tr("Remove cookie"));
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
|
|
|
|
2012-02-13 18:22:24 +01:00
|
|
|
void CookieManager::refreshTable()
|
2011-03-02 16:57:41 +01:00
|
|
|
{
|
2013-02-18 20:55:31 +01:00
|
|
|
disconnect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
|
2013-02-14 19:50:29 +01:00
|
|
|
ui->search->clear();
|
2013-02-18 20:55:31 +01:00
|
|
|
connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
|
2013-02-14 19:50:29 +01:00
|
|
|
|
2012-02-13 16:59:30 +01:00
|
|
|
QTimer::singleShot(0, this, SLOT(slotRefreshTable()));
|
2012-02-17 18:55:34 +01:00
|
|
|
QTimer::singleShot(0, this, SLOT(slotRefreshFilters()));
|
2012-02-13 16:59:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CookieManager::slotRefreshTable()
|
|
|
|
{
|
2012-06-15 17:43:19 +02:00
|
|
|
const QList<QNetworkCookie> &allCookies = mApp->cookieJar()->getAllCookies();
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-02-13 16:59:30 +01:00
|
|
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
2011-03-02 16:57:41 +01:00
|
|
|
ui->cookieTree->clear();
|
|
|
|
|
2012-02-13 16:59:30 +01:00
|
|
|
int counter = 0;
|
2012-12-20 14:45:35 +01:00
|
|
|
QPointer<CookieManager> guard = this;
|
2012-02-17 16:45:18 +01:00
|
|
|
QHash<QString, QTreeWidgetItem*> hash;
|
2012-02-13 18:22:24 +01:00
|
|
|
for (int i = 0; i < allCookies.count(); ++i) {
|
2013-12-30 13:43:48 +01:00
|
|
|
const QNetworkCookie cookie = allCookies.at(i);
|
2011-03-02 16:57:41 +01:00
|
|
|
QTreeWidgetItem* item;
|
|
|
|
|
2012-02-17 16:45:18 +01:00
|
|
|
QString cookieDomain = cookie.domain();
|
2012-09-04 12:42:45 +02:00
|
|
|
if (cookieDomain.startsWith(QLatin1Char('.'))) {
|
2012-02-13 18:22:24 +01:00
|
|
|
cookieDomain = cookieDomain.mid(1);
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-02-17 16:45:18 +01:00
|
|
|
QTreeWidgetItem* findParent = hash[cookieDomain];
|
|
|
|
if (findParent) {
|
|
|
|
item = new QTreeWidgetItem(findParent);
|
2011-11-06 17:01:23 +01:00
|
|
|
}
|
|
|
|
else {
|
2011-03-02 16:57:41 +01:00
|
|
|
QTreeWidgetItem* newParent = new QTreeWidgetItem(ui->cookieTree);
|
2012-02-13 18:22:24 +01:00
|
|
|
newParent->setText(0, cookieDomain);
|
2011-03-02 16:57:41 +01:00
|
|
|
newParent->setIcon(0, style()->standardIcon(QStyle::SP_DirIcon));
|
2012-03-13 17:51:06 +01:00
|
|
|
newParent->setData(0, Qt::UserRole + 10, cookie.domain());
|
2011-03-02 16:57:41 +01:00
|
|
|
ui->cookieTree->addTopLevelItem(newParent);
|
2012-02-17 16:45:18 +01:00
|
|
|
hash[cookieDomain] = newParent;
|
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
item = new QTreeWidgetItem(newParent);
|
|
|
|
}
|
|
|
|
|
2012-02-13 18:22:24 +01:00
|
|
|
item->setText(0, "." + cookieDomain);
|
|
|
|
item->setText(1, cookie.name());
|
2013-02-05 22:33:54 +01:00
|
|
|
item->setData(0, Qt::UserRole + 10, QVariant::fromValue(cookie));
|
2011-03-02 16:57:41 +01:00
|
|
|
ui->cookieTree->addTopLevelItem(item);
|
2012-02-13 16:59:30 +01:00
|
|
|
|
|
|
|
++counter;
|
2012-02-17 16:45:18 +01:00
|
|
|
if (counter > 200) {
|
2012-02-13 16:59:30 +01:00
|
|
|
QApplication::processEvents();
|
|
|
|
counter = 0;
|
|
|
|
}
|
2012-04-02 16:00:08 +02:00
|
|
|
|
|
|
|
if (!guard) {
|
|
|
|
break;
|
|
|
|
}
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
|
|
|
|
2012-02-13 16:59:30 +01:00
|
|
|
QApplication::restoreOverrideCursor();
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
|
|
|
|
2012-02-17 18:55:34 +01:00
|
|
|
void CookieManager::slotRefreshFilters()
|
2011-03-02 16:57:41 +01:00
|
|
|
{
|
2012-07-13 16:43:47 +02:00
|
|
|
ui->whiteList->clear();
|
|
|
|
ui->blackList->clear();
|
|
|
|
|
2012-02-17 18:55:34 +01:00
|
|
|
Settings settings;
|
|
|
|
settings.beginGroup("Cookie-Settings");
|
|
|
|
QStringList whiteList = settings.value("whitelist", QStringList()).toStringList();
|
|
|
|
QStringList blackList = settings.value("blacklist", QStringList()).toStringList();
|
|
|
|
settings.endGroup();
|
|
|
|
|
|
|
|
ui->whiteList->addItems(whiteList);
|
|
|
|
ui->blackList->addItems(blackList);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CookieManager::addWhitelist()
|
|
|
|
{
|
2013-12-30 13:43:48 +01:00
|
|
|
const QString server = QInputDialog::getText(this, tr("Add to whitelist"), tr("Server:"));
|
2012-02-17 18:55:34 +01:00
|
|
|
if (server.isEmpty()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ui->whiteList->addItem(server);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CookieManager::removeWhitelist()
|
|
|
|
{
|
2012-09-11 11:43:11 +02:00
|
|
|
delete ui->whiteList->currentItem();
|
2012-02-17 18:55:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CookieManager::addBlacklist()
|
|
|
|
{
|
2013-12-30 13:43:48 +01:00
|
|
|
const QString server = QInputDialog::getText(this, tr("Add to blacklist"), tr("Server:"));
|
2012-02-17 18:55:34 +01:00
|
|
|
if (server.isEmpty()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ui->blackList->addItem(server);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CookieManager::removeBlacklist()
|
|
|
|
{
|
2012-09-11 11:43:11 +02:00
|
|
|
delete ui->blackList->currentItem();
|
2012-02-17 18:55:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void CookieManager::deletePressed()
|
|
|
|
{
|
|
|
|
if (ui->cookieTree->hasFocus()) {
|
|
|
|
removeCookie();
|
|
|
|
}
|
|
|
|
else if (ui->whiteList->hasFocus()) {
|
|
|
|
removeWhitelist();
|
|
|
|
}
|
|
|
|
else if (ui->blackList->hasFocus()) {
|
|
|
|
removeBlacklist();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-01-23 01:34:15 +01:00
|
|
|
void CookieManager::saveCookiesChanged(bool state)
|
|
|
|
{
|
|
|
|
ui->deleteCookiesOnClose->setEnabled(state);
|
|
|
|
}
|
|
|
|
|
2013-02-18 20:55:31 +01:00
|
|
|
void CookieManager::filterString(const QString &string)
|
|
|
|
{
|
|
|
|
if (string.isEmpty()) {
|
|
|
|
for (int i = 0; i < ui->cookieTree->topLevelItemCount(); ++i) {
|
|
|
|
ui->cookieTree->topLevelItem(i)->setHidden(false);
|
|
|
|
ui->cookieTree->topLevelItem(i)->setExpanded(ui->cookieTree->defaultItemShowMode() == TreeWidget::ItemsExpanded);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
for (int i = 0; i < ui->cookieTree->topLevelItemCount(); ++i) {
|
|
|
|
QString text = "." + ui->cookieTree->topLevelItem(i)->text(0);
|
|
|
|
ui->cookieTree->topLevelItem(i)->setHidden(!text.contains(string, Qt::CaseInsensitive));
|
|
|
|
ui->cookieTree->topLevelItem(i)->setExpanded(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-17 18:55:34 +01:00
|
|
|
void CookieManager::closeEvent(QCloseEvent* e)
|
|
|
|
{
|
|
|
|
QStringList whitelist;
|
|
|
|
QStringList blacklist;
|
|
|
|
|
|
|
|
for (int i = 0; i < ui->whiteList->count(); ++i) {
|
|
|
|
whitelist.append(ui->whiteList->item(i)->text());
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0; i < ui->blackList->count(); ++i) {
|
|
|
|
blacklist.append(ui->blackList->item(i)->text());
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings settings;
|
|
|
|
settings.beginGroup("Cookie-Settings");
|
2013-01-23 01:34:15 +01:00
|
|
|
settings.setValue("allowCookies", ui->saveCookies->isChecked());
|
|
|
|
settings.setValue("deleteCookiesOnClose", ui->deleteCookiesOnClose->isChecked());
|
|
|
|
settings.setValue("allowCookiesFromVisitedDomainOnly", ui->matchExactly->isChecked());
|
|
|
|
settings.setValue("filterTrackingCookie", ui->filterTracking->isChecked());
|
2012-02-17 18:55:34 +01:00
|
|
|
settings.setValue("whitelist", whitelist);
|
|
|
|
settings.setValue("blacklist", blacklist);
|
|
|
|
settings.endGroup();
|
|
|
|
|
|
|
|
mApp->cookieJar()->loadSettings();
|
|
|
|
|
|
|
|
e->accept();
|
2011-03-02 16:57:41 +01:00
|
|
|
}
|
|
|
|
|
2012-04-20 14:49:16 +02:00
|
|
|
void CookieManager::keyPressEvent(QKeyEvent* e)
|
|
|
|
{
|
|
|
|
if (e->key() == Qt::Key_Escape) {
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
|
|
|
QWidget::keyPressEvent(e);
|
|
|
|
}
|
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
CookieManager::~CookieManager()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|