diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-17 01:29:30 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-17 01:29:30 +0200 |
| commit | 5b14fc424462a5d3a5a509bd177c04e9cba2ce17 (patch) | |
| tree | ad5e9b685be26d22d570ba4788a9b01a65ceb531 /src/settingsdialog.cpp | |
| parent | 03253a724b6fdb3f511510d10c3e62615e305cf2 (diff) | |
| download | kristall-5b14fc424462a5d3a5a509bd177c04e9cba2ce17.tar.gz | |
Makes gemini protocol handler a bit more robust.Makes style preview a file in about: instead of hardcoding it. Starts to implement the options menu for redirection configuration.
Diffstat (limited to 'src/settingsdialog.cpp')
| -rw-r--r-- | src/settingsdialog.cpp | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index 7ef05fb..838d17c 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -102,6 +102,13 @@ SettingsDialog::SettingsDialog(QWidget *parent) : &QItemSelectionModel::currentChanged, this, &SettingsDialog::on_trusted_server_selection); + + this->ui->redirection_mode->clear(); + this->ui->redirection_mode->addItem("Ask for cross-scheme or cross-host redirection"); + this->ui->redirection_mode->addItem("Ask for cross-scheme redirection"); + this->ui->redirection_mode->addItem("Ask for cross-host redirection"); + this->ui->redirection_mode->addItem("Ask for all redirection"); + this->ui->redirection_mode->addItem("Silently redirect everything"); } SettingsDialog::~SettingsDialog() @@ -241,28 +248,11 @@ void SettingsDialog::setSslTrust(const SslTrust &trust) void SettingsDialog::reloadStylePreview() { - auto const document = R"gemini(# H1 Header -## H2 Header -### H3 Header -Plain text document here. -* List A -* List B -=> rela-link Same-Site Link -=> //foreign.host/ Foreign Site Link -=> https://foreign.host/ Cross-Protocol Link -> Multi-lined -> block quotes -``` - ▄▄▄ ██▀███ ▄▄▄█████▓ - ▒████▄ ▓██ ▒ ██▒▓ ██▒ ▓▒ - ▒██ ▀█▄ ▓██ ░▄█ ▒▒ ▓██░ ▒░ - ░██▄▄▄▄██ ▒██▀▀█▄ ░ ▓██▓ ░ - ▓█ ▓██▒░██▓ ▒██▒ ▒██▒ ░ - ▒▒ ▓▒█░░ ▒▓ ░▒▓░ ▒ ░░ - ▒ ▒▒ ░ ░▒ ░ ▒░ ░ - ░ ▒ ░░ ░ ░ - ░ ░ ░ -)gemini"; + QFile document_src { ":/about/style-preview.gemini" }; + bool ok = document_src.open(QFile::ReadOnly); + assert(ok and "failed to find style-preview.gemini!"); + + auto const document = document_src.readAll(); QString host = this->ui->preview_url->text(); if(host.length() == 0) @@ -335,6 +325,7 @@ void SettingsDialog::updateColor(QColor &input) void SettingsDialog::on_trusted_server_selection(const QModelIndex ¤t, const QModelIndex &previous) { + Q_UNUSED(previous); if(auto host = this->current_trust.trusted_hosts.get(current); host) { this->ui->trust_revoke_selected->setEnabled(true); } else { |
