1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Added option to import certificate in Certificate Manager

- Cookies manager, browsing library and download manager
  can now be closed with Esc key press
This commit is contained in:
nowrep 2012-04-20 14:49:16 +02:00
parent 0a5c245811
commit 835926cc9e
11 changed files with 66 additions and 8 deletions

View File

@ -287,6 +287,15 @@ void CookieManager::closeEvent(QCloseEvent* e)
e->accept(); e->accept();
} }
void CookieManager::keyPressEvent(QKeyEvent* e)
{
if (e->key() == Qt::Key_Escape) {
close();
}
QWidget::keyPressEvent(e);
}
CookieManager::~CookieManager() CookieManager::~CookieManager()
{ {
delete ui; delete ui;

View File

@ -58,6 +58,7 @@ private slots:
private: private:
void closeEvent(QCloseEvent* e); void closeEvent(QCloseEvent* e);
void keyPressEvent(QKeyEvent* e);
Ui::CookieManager* ui; Ui::CookieManager* ui;

View File

@ -91,6 +91,15 @@ void DownloadManager::resizeEvent(QResizeEvent* e)
emit resized(size()); emit resized(size());
} }
void DownloadManager::keyPressEvent(QKeyEvent* e)
{
if (e->key() == Qt::Key_Escape) {
close();
}
QWidget::keyPressEvent(e);
}
void DownloadManager::startExternalManager(const QUrl &url) void DownloadManager::startExternalManager(const QUrl &url)
{ {
QStringList arguments = m_externalArguments.split(" "); QStringList arguments = m_externalArguments.split(" ");
@ -111,13 +120,13 @@ bool DownloadManager::winEvent(MSG* message, long* result)
} }
#endif #endif
void DownloadManager::timerEvent(QTimerEvent* event) void DownloadManager::timerEvent(QTimerEvent* e)
{ {
QList<QTime> remTimes; QList<QTime> remTimes;
QList<int> progresses; QList<int> progresses;
QList<double> speeds; QList<double> speeds;
if (event->timerId() == m_timer.timerId()) { if (e->timerId() == m_timer.timerId()) {
if (!ui->list->count()) { if (!ui->list->count()) {
ui->speedLabel->clear(); ui->speedLabel->clear();
setWindowTitle(tr("Download Manager")); setWindowTitle(tr("Download Manager"));
@ -164,7 +173,7 @@ void DownloadManager::timerEvent(QTimerEvent* event)
#endif #endif
} }
else { else {
QWidget::timerEvent(event); QWidget::timerEvent(e);
} }
} }

View File

@ -78,9 +78,10 @@ private:
#ifdef W7TASKBAR #ifdef W7TASKBAR
EcWin7 win7; EcWin7 win7;
#endif #endif
void timerEvent(QTimerEvent* event); void timerEvent(QTimerEvent* e);
void closeEvent(QCloseEvent* e); void closeEvent(QCloseEvent* e);
void resizeEvent(QResizeEvent* e); void resizeEvent(QResizeEvent* e);
void keyPressEvent(QKeyEvent* e);
void startExternalManager(const QUrl &url); void startExternalManager(const QUrl &url);

View File

@ -63,7 +63,7 @@ void LocationCompleter::showMostVisited()
cModel->appendRow(item); cModel->appendRow(item);
} }
popup()->setMinimumHeight(190); m_listView->setMinimumHeight(6 * m_listView->rowHeight());
QCompleter::complete(); QCompleter::complete();
} }

View File

@ -165,6 +165,15 @@ void BrowsingLibrary::closeEvent(QCloseEvent* e)
e->accept(); e->accept();
} }
void BrowsingLibrary::keyPressEvent(QKeyEvent* e)
{
if (e->key() == Qt::Key_Escape) {
close();
}
QWidget::keyPressEvent(e);
}
BrowsingLibrary::~BrowsingLibrary() BrowsingLibrary::~BrowsingLibrary()
{ {
delete ui; delete ui;

View File

@ -55,6 +55,8 @@ private slots:
private: private:
void closeEvent(QCloseEvent* e); void closeEvent(QCloseEvent* e);
void keyPressEvent(QKeyEvent* e);
Ui::BrowsingLibrary* ui; Ui::BrowsingLibrary* ui;
HistoryManager* m_historyManager; HistoryManager* m_historyManager;
BookmarksManager* m_bookmarksManager; BookmarksManager* m_bookmarksManager;

View File

@ -1860,7 +1860,7 @@
<item row="17" column="0" colspan="4"> <item row="17" column="0" colspan="4">
<widget class="QLabel" name="label_49"> <widget class="QLabel" name="label_49">
<property name="text"> <property name="text">
<string>Edit CA certificates in SSL Manager</string> <string>Edit CA certificates</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@ -1915,7 +1915,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>SSL Manager</string> <string>Certificate Manager</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -42,6 +42,7 @@ SSLManager::SSLManager(QWidget* parent)
connect(ui->localList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(showLocalCertInfo())); connect(ui->localList, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(showLocalCertInfo()));
connect(ui->localInfoButton, SIGNAL(clicked()), 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->addPath, SIGNAL(clicked()), this, SLOT(addPath()));
connect(ui->deletePath, SIGNAL(clicked()), this, SLOT(deletePath())); connect(ui->deletePath, SIGNAL(clicked()), this, SLOT(deletePath()));
@ -128,6 +129,24 @@ void SSLManager::showCaCertInfo()
showCertificateInfo(cert); showCertificateInfo(cert);
} }
void SSLManager::addLocalCertificate()
{
const QString &path = QFileDialog::getOpenFileName(this, tr("Import certificate..."), QDir::homePath(), "*.crt");
if (path.isEmpty()) {
return;
}
const QList<QSslCertificate> list = QSslCertificate::fromPath(path);
if (list.isEmpty()) {
return;
}
mApp->networkManager()->addLocalCertificate(list.at(0));
refreshLocalList();
}
void SSLManager::showLocalCertInfo() void SSLManager::showLocalCertInfo()
{ {
QListWidgetItem* item = ui->localList->currentItem(); QListWidgetItem* item = ui->localList->currentItem();

View File

@ -39,6 +39,7 @@ public:
private slots: private slots:
void showLocalCertInfo(); void showLocalCertInfo();
void showCaCertInfo(); void showCaCertInfo();
void addLocalCertificate();
void deleteCertificate(); void deleteCertificate();
void ignoreAll(bool state); void ignoreAll(bool state);

View File

@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>SSL Manager</string> <string>Certificate Manager</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
@ -73,6 +73,13 @@
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="addLocalCert">
<property name="text">
<string>Import</string>
</property>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">