diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-11 02:43:30 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-11 02:43:30 +0200 |
| commit | 72e4523e2fb27ee714c30c5aa135198f7b5d553d (patch) | |
| tree | 08dfb374835b66b67642955b658ea6f8c3de2295 /src | |
| parent | 2779c61e83491d1d798f3f494aa890e3f586245a (diff) | |
| download | kristall-72e4523e2fb27ee714c30c5aa135198f7b5d553d.tar.gz | |
Slight improvements for client certificate display, permanent certs are now selectable with double click and have icons, adds changelog into application itself: about:updates
Diffstat (limited to 'src')
| -rw-r--r-- | src/about/updates.gemini | 38 | ||||
| -rw-r--r-- | src/builtins.qrc | 1 | ||||
| -rw-r--r-- | src/certificateselectiondialog.cpp | 10 | ||||
| -rw-r--r-- | src/certificateselectiondialog.hpp | 2 | ||||
| -rw-r--r-- | src/certificateselectiondialog.ui | 6 | ||||
| -rw-r--r-- | src/icons.qrc | 1 | ||||
| -rw-r--r-- | src/icons/certificate.svg | 1 | ||||
| -rw-r--r-- | src/identitycollection.cpp | 47 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 5 | ||||
| -rw-r--r-- | src/mainwindow.hpp | 2 | ||||
| -rw-r--r-- | src/mainwindow.ui | 6 |
11 files changed, 94 insertions, 25 deletions
diff --git a/src/about/updates.gemini b/src/about/updates.gemini new file mode 100644 index 0000000..1e65272 --- /dev/null +++ b/src/about/updates.gemini @@ -0,0 +1,38 @@ +# Kristall Changelog + +## 0.3 +* Adds support for transient client certificates +* Adds support for permanent client certificates +* Added this changelog to the software itself + +## 0.2 +* Implement Ctrl+D/*Add to favourites* menu item +* Implement Ctrl+S/*Save as...* menu item +* Add display for "non-recognized files" +* Added support for gopher:// and gophermaps +* Added "go to home" menu +* Added support for video/* and audio/* via QMediaPlayer +* Added support for file:// scheme +* Added status bar with loading time, file size and mime type +* Added support for command line arguments +* Added option to render all text/* documents as plain text. +* Added option to render gopher maps with icons *OR* text only +* Fixed bug: Correct URL escaping for gemini requests. +* Added progress display in status bar with loading time and already transferred bytes +* Added support for finger:// protocol +* Added experimental *highlighting* and _underlining_ for text/gemini +* Desktop file is provided for integrating with XDG +* Fixed bug: Preformatted lines don't break anymore +* text/gemini parsing updated +* Added support for block quotes +* Added help file +* Added shortcut to focus URL bar +* Added possibility to save/load/share theme presets. Make everything colorful! +* Added a lot of context menus +* Added possibility to open links into a new tab +* Added possibility to open history and favourite items into new tab or same tab +* Added option to use your default OS protocol handler instead of displaying an error message. +* Improved image pan and zooming. Explore those graphics! + +## 0.1 +* Initial release
\ No newline at end of file diff --git a/src/builtins.qrc b/src/builtins.qrc index fae4cc3..35f1fe7 100644 --- a/src/builtins.qrc +++ b/src/builtins.qrc @@ -2,5 +2,6 @@ <qresource prefix="/"> <file>about/easter-egg.gemini</file> <file>about/help.gemini</file> + <file>about/updates.gemini</file> </qresource> </RCC> diff --git a/src/certificateselectiondialog.cpp b/src/certificateselectiondialog.cpp index e3aef35..66e758f 100644 --- a/src/certificateselectiondialog.cpp +++ b/src/certificateselectiondialog.cpp @@ -115,3 +115,13 @@ void CertificateSelectionDialog::on_use_selected_cert_clicked() qDebug() << "Tried to use an invalid identity when the button should not be enabled. This is a bug!"; } } + +void CertificateSelectionDialog::on_certificates_doubleClicked(const QModelIndex &index) +{ + this->cryto_identity = global_identities.getIdentity(index); + if(this->cryto_identity.isValid()) { + this->accept(); + } else { + qDebug() << "Tried to use an invalid identity when the button should not be enabled. This is a bug!"; + } +} diff --git a/src/certificateselectiondialog.hpp b/src/certificateselectiondialog.hpp index da43b0e..e628f5c 100644 --- a/src/certificateselectiondialog.hpp +++ b/src/certificateselectiondialog.hpp @@ -36,6 +36,8 @@ private slots: void on_use_selected_cert_clicked(); + void on_certificates_doubleClicked(const QModelIndex &index); + private: //! Creates an anonymous identity with a randomly chosen name that //! will time out on `timeout`, then accepts the dialog. diff --git a/src/certificateselectiondialog.ui b/src/certificateselectiondialog.ui index 0199982..0244001 100644 --- a/src/certificateselectiondialog.ui +++ b/src/certificateselectiondialog.ui @@ -35,7 +35,11 @@ </widget> </item> <item> - <widget class="QTreeView" name="certificates"/> + <widget class="QTreeView" name="certificates"> + <property name="headerHidden"> + <bool>true</bool> + </property> + </widget> </item> <item> <layout class="QHBoxLayout" name="horizontalLayout_2"> diff --git a/src/icons.qrc b/src/icons.qrc index 12e429a..7987c86 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -37,5 +37,6 @@ <file>icons/help-box.svg</file> <file>icons/shield-outline.svg</file> <file>icons/shield-lock.svg</file> + <file>icons/certificate.svg</file> </qresource> </RCC> diff --git a/src/icons/certificate.svg b/src/icons/certificate.svg new file mode 100644 index 0000000..f158c12 --- /dev/null +++ b/src/icons/certificate.svg @@ -0,0 +1 @@ +<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M4,3C2.89,3 2,3.89 2,5V15A2,2 0 0,0 4,17H12V22L15,19L18,22V17H20A2,2 0 0,0 22,15V8L22,6V5A2,2 0 0,0 20,3H16V3H4M12,5L15,7L18,5V8.5L21,10L18,11.5V15L15,13L12,15V11.5L9,10L12,8.5V5M4,5H9V7H4V5M4,9H7V11H4V9M4,13H9V15H4V13Z" /></svg>
\ No newline at end of file diff --git a/src/identitycollection.cpp b/src/identitycollection.cpp index 9955d3f..43683b2 100644 --- a/src/identitycollection.cpp +++ b/src/identitycollection.cpp @@ -2,6 +2,7 @@ #include <cassert> #include <QDebug> +#include <QIcon> IdentityCollection::IdentityCollection(QObject *parent) : QAbstractItemModel(parent) @@ -152,14 +153,8 @@ QStringList IdentityCollection::groups() const return result; } -//QVariant IdentityCollection::headerData(int section, Qt::Orientation orientation, int role) const -//{ -// return QVariant { }; -//} - QModelIndex IdentityCollection::index(int row, int column, const QModelIndex &parent) const { - qDebug() << "index" << row << column << parent; if (not hasIndex(row, column, parent)) return QModelIndex(); @@ -182,7 +177,6 @@ QModelIndex IdentityCollection::index(int row, int column, const QModelIndex &pa QModelIndex IdentityCollection::parent(const QModelIndex &index) const { - qDebug() << "parent" << index; if (!index.isValid()) return QModelIndex(); @@ -207,37 +201,42 @@ int IdentityCollection::rowCount(const QModelIndex &parent) const else parentItem = static_cast<Node const *>(parent.internalPointer()); - int rc = parentItem->children.size(); - qDebug() << "row count for " << parent << rc; - return rc; + return parentItem->children.size(); } int IdentityCollection::columnCount(const QModelIndex &parent) const { - qDebug() << "column count" << parent; + Q_UNUSED(parent) return 1; } QVariant IdentityCollection::data(const QModelIndex &index, int role) const { - qDebug() << "data" << index << role; if (!index.isValid()) return QVariant(); - if (index.column() != 0) - return QVariant(); - - if (role != Qt::DisplayRole) - return QVariant(); - Node const *item = static_cast<Node const*>(index.internalPointer()); - switch(item->type) { - case Node::Root: return "root"; - case Node::Group: return static_cast<GroupNode const *>(item)->title; - case Node::Identity: return static_cast<IdentityNode const *>(item)->identity.display_name; - default: - return "Unknown"; + if (role == Qt::DisplayRole) + { + switch(item->type) { + case Node::Root: return "root"; + case Node::Group: return static_cast<GroupNode const *>(item)->title; + case Node::Identity: return static_cast<IdentityNode const *>(item)->identity.display_name; + default: + return "Unknown"; + } } + else if(role == Qt::DecorationRole) { + + switch(item->type) { + case Node::Root: return QVariant { }; + case Node::Group: return QIcon(":/icons/folder-open.svg"); + case Node::Identity: return QIcon(":/icons/certificate.svg"); + default: return QVariant { }; + } + } + + return QVariant(); } void IdentityCollection::relayout() diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 9a56133..ec8af9c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -457,3 +457,8 @@ void MainWindow::on_favourites_view_customContextMenuRequested(const QPoint &pos } } } + +void MainWindow::on_actionChangelog_triggered() +{ + this->addNewTab(true, QUrl("about:updates")); +} diff --git a/src/mainwindow.hpp b/src/mainwindow.hpp index 954ba5f..f125551 100644 --- a/src/mainwindow.hpp +++ b/src/mainwindow.hpp @@ -83,6 +83,8 @@ private slots: void on_favourites_view_customContextMenuRequested(const QPoint &pos); + void on_actionChangelog_triggered(); + private: void reloadTheme(); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 3955a40..782d0e3 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -206,6 +206,7 @@ <string>Help</string> </property> <addaction name="actionHelp"/> + <addaction name="actionChangelog"/> <addaction name="separator"/> <addaction name="actionAbout"/> <addaction name="actionAbout_Qt"/> @@ -367,6 +368,11 @@ <string>F1</string> </property> </action> + <action name="actionChangelog"> + <property name="text"> + <string>Changelog</string> + </property> + </action> </widget> <resources> <include location="icons.qrc"/> |
