diff --git a/src/lib/cookies/cookiemanager.cpp b/src/lib/cookies/cookiemanager.cpp index 38d28e789..d7fda4a83 100644 --- a/src/lib/cookies/cookiemanager.cpp +++ b/src/lib/cookies/cookiemanager.cpp @@ -287,6 +287,15 @@ void CookieManager::closeEvent(QCloseEvent* e) e->accept(); } +void CookieManager::keyPressEvent(QKeyEvent* e) +{ + if (e->key() == Qt::Key_Escape) { + close(); + } + + QWidget::keyPressEvent(e); +} + CookieManager::~CookieManager() { delete ui; diff --git a/src/lib/cookies/cookiemanager.h b/src/lib/cookies/cookiemanager.h index 34b9dd5b3..8a9f8c444 100644 --- a/src/lib/cookies/cookiemanager.h +++ b/src/lib/cookies/cookiemanager.h @@ -58,6 +58,7 @@ private slots: private: void closeEvent(QCloseEvent* e); + void keyPressEvent(QKeyEvent* e); Ui::CookieManager* ui; diff --git a/src/lib/downloads/downloadmanager.cpp b/src/lib/downloads/downloadmanager.cpp index 7dc85b6d2..543460f07 100644 --- a/src/lib/downloads/downloadmanager.cpp +++ b/src/lib/downloads/downloadmanager.cpp @@ -91,6 +91,15 @@ void DownloadManager::resizeEvent(QResizeEvent* e) emit resized(size()); } +void DownloadManager::keyPressEvent(QKeyEvent* e) +{ + if (e->key() == Qt::Key_Escape) { + close(); + } + + QWidget::keyPressEvent(e); +} + void DownloadManager::startExternalManager(const QUrl &url) { QStringList arguments = m_externalArguments.split(" "); @@ -111,13 +120,13 @@ bool DownloadManager::winEvent(MSG* message, long* result) } #endif -void DownloadManager::timerEvent(QTimerEvent* event) +void DownloadManager::timerEvent(QTimerEvent* e) { QList remTimes; QList progresses; QList speeds; - if (event->timerId() == m_timer.timerId()) { + if (e->timerId() == m_timer.timerId()) { if (!ui->list->count()) { ui->speedLabel->clear(); setWindowTitle(tr("Download Manager")); @@ -164,7 +173,7 @@ void DownloadManager::timerEvent(QTimerEvent* event) #endif } else { - QWidget::timerEvent(event); + QWidget::timerEvent(e); } } diff --git a/src/lib/downloads/downloadmanager.h b/src/lib/downloads/downloadmanager.h index deeda287e..0640d6a58 100644 --- a/src/lib/downloads/downloadmanager.h +++ b/src/lib/downloads/downloadmanager.h @@ -78,9 +78,10 @@ private: #ifdef W7TASKBAR EcWin7 win7; #endif - void timerEvent(QTimerEvent* event); + void timerEvent(QTimerEvent* e); void closeEvent(QCloseEvent* e); void resizeEvent(QResizeEvent* e); + void keyPressEvent(QKeyEvent* e); void startExternalManager(const QUrl &url); diff --git a/src/lib/navigation/locationcompleter.cpp b/src/lib/navigation/locationcompleter.cpp index 2e4d1a22a..6b867ee3a 100644 --- a/src/lib/navigation/locationcompleter.cpp +++ b/src/lib/navigation/locationcompleter.cpp @@ -63,7 +63,7 @@ void LocationCompleter::showMostVisited() cModel->appendRow(item); } - popup()->setMinimumHeight(190); + m_listView->setMinimumHeight(6 * m_listView->rowHeight()); QCompleter::complete(); } diff --git a/src/lib/other/browsinglibrary.cpp b/src/lib/other/browsinglibrary.cpp index 6a5e09948..180b4be17 100644 --- a/src/lib/other/browsinglibrary.cpp +++ b/src/lib/other/browsinglibrary.cpp @@ -165,6 +165,15 @@ void BrowsingLibrary::closeEvent(QCloseEvent* e) e->accept(); } +void BrowsingLibrary::keyPressEvent(QKeyEvent* e) +{ + if (e->key() == Qt::Key_Escape) { + close(); + } + + QWidget::keyPressEvent(e); +} + BrowsingLibrary::~BrowsingLibrary() { delete ui; diff --git a/src/lib/other/browsinglibrary.h b/src/lib/other/browsinglibrary.h index 220a8d2ed..5a401a090 100644 --- a/src/lib/other/browsinglibrary.h +++ b/src/lib/other/browsinglibrary.h @@ -55,6 +55,8 @@ private slots: private: void closeEvent(QCloseEvent* e); + void keyPressEvent(QKeyEvent* e); + Ui::BrowsingLibrary* ui; HistoryManager* m_historyManager; BookmarksManager* m_bookmarksManager; diff --git a/src/lib/preferences/preferences.ui b/src/lib/preferences/preferences.ui index 97df33539..dc6f6b077 100644 --- a/src/lib/preferences/preferences.ui +++ b/src/lib/preferences/preferences.ui @@ -1860,7 +1860,7 @@ - Edit CA certificates in SSL Manager + Edit CA certificates true @@ -1915,7 +1915,7 @@ - SSL Manager + Certificate Manager diff --git a/src/lib/preferences/sslmanager.cpp b/src/lib/preferences/sslmanager.cpp index 298f0ffe0..496f5f1ba 100644 --- a/src/lib/preferences/sslmanager.cpp +++ b/src/lib/preferences/sslmanager.cpp @@ -42,6 +42,7 @@ SSLManager::SSLManager(QWidget* parent) connect(ui->localList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(showLocalCertInfo())); connect(ui->localInfoButton, SIGNAL(clicked()), this, SLOT(showLocalCertInfo())); + connect(ui->addLocalCert, SIGNAL(clicked()), this, SLOT(addLocalCertificate())); connect(ui->addPath, SIGNAL(clicked()), this, SLOT(addPath())); connect(ui->deletePath, SIGNAL(clicked()), this, SLOT(deletePath())); @@ -128,6 +129,24 @@ void SSLManager::showCaCertInfo() showCertificateInfo(cert); } +void SSLManager::addLocalCertificate() +{ + const QString &path = QFileDialog::getOpenFileName(this, tr("Import certificate..."), QDir::homePath(), "*.crt"); + + if (path.isEmpty()) { + return; + } + + const QList list = QSslCertificate::fromPath(path); + if (list.isEmpty()) { + return; + } + + mApp->networkManager()->addLocalCertificate(list.at(0)); + + refreshLocalList(); +} + void SSLManager::showLocalCertInfo() { QListWidgetItem* item = ui->localList->currentItem(); diff --git a/src/lib/preferences/sslmanager.h b/src/lib/preferences/sslmanager.h index 6e92cb943..995eecb67 100644 --- a/src/lib/preferences/sslmanager.h +++ b/src/lib/preferences/sslmanager.h @@ -39,6 +39,7 @@ public: private slots: void showLocalCertInfo(); void showCaCertInfo(); + void addLocalCertificate(); void deleteCertificate(); void ignoreAll(bool state); diff --git a/src/lib/preferences/sslmanager.ui b/src/lib/preferences/sslmanager.ui index bf7bda2e3..f5c9b86c0 100644 --- a/src/lib/preferences/sslmanager.ui +++ b/src/lib/preferences/sslmanager.ui @@ -11,7 +11,7 @@ - SSL Manager + Certificate Manager @@ -73,6 +73,13 @@ + + + + Import + + +