1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +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();
}
void CookieManager::keyPressEvent(QKeyEvent* e)
{
if (e->key() == Qt::Key_Escape) {
close();
}
QWidget::keyPressEvent(e);
}
CookieManager::~CookieManager()
{
delete ui;

View File

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

View File

@ -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<QTime> remTimes;
QList<int> progresses;
QList<double> 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);
}
}

View File

@ -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);

View File

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

View File

@ -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;

View File

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

View File

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

View File

@ -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<QSslCertificate> list = QSslCertificate::fromPath(path);
if (list.isEmpty()) {
return;
}
mApp->networkManager()->addLocalCertificate(list.at(0));
refreshLocalList();
}
void SSLManager::showLocalCertInfo()
{
QListWidgetItem* item = ui->localList->currentItem();

View File

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

View File

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