From 4805c389a7650d85064a3e959936defb8e16968f Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Mon, 15 Feb 2021 16:38:45 +1100 Subject: Added search engine preference --- src/dialogs/settingsdialog.cpp | 11 ++++++ src/dialogs/settingsdialog.hpp | 2 ++ src/dialogs/settingsdialog.ui | 77 ++++++++++++++++++++++++++---------------- 3 files changed, 61 insertions(+), 29 deletions(-) (limited to 'src/dialogs') diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index 252c7a6..c164171 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -218,6 +218,12 @@ void SettingsDialog::setOptions(const GenericSettings &options) this->ui->start_page->setText(this->current_options.start_page); + this->ui->search_engine->clear(); + this->ui->search_engine->setEditText(this->current_options.search_engine); + this->ui->search_engine->addItem("gemini://geminispace.info/search?%1"); + this->ui->search_engine->addItem("gemini://gus.guru/search?%1"); + this->ui->search_engine->addItem("gemini://houston.coder.town/search?%1"); + if(this->current_options.gophermap_display == GenericSettings::PlainText) { this->ui->gophermap_text->setChecked(true); } else { @@ -670,6 +676,11 @@ void SettingsDialog::on_start_page_textChanged(const QString &start_page) this->current_options.start_page = start_page; } +void SettingsDialog::on_search_engine_currentTextChanged(const QString &search_engine) +{ + this->current_options.search_engine = search_engine; +} + void SettingsDialog::on_ui_theme_currentIndexChanged(int index) { this->current_options.theme = Theme(this->ui->ui_theme->itemData(index).toInt()); diff --git a/src/dialogs/settingsdialog.hpp b/src/dialogs/settingsdialog.hpp index d515242..748d118 100644 --- a/src/dialogs/settingsdialog.hpp +++ b/src/dialogs/settingsdialog.hpp @@ -112,6 +112,8 @@ private slots: void on_start_page_textChanged(const QString &arg1); + void on_search_engine_currentTextChanged(const QString &arg1); + void on_ui_theme_currentIndexChanged(int index); void on_ui_density_currentIndexChanged(int index); diff --git a/src/dialogs/settingsdialog.ui b/src/dialogs/settingsdialog.ui index a88285e..058c64d 100644 --- a/src/dialogs/settingsdialog.ui +++ b/src/dialogs/settingsdialog.ui @@ -52,6 +52,7 @@ + @@ -67,13 +68,30 @@ + + + Search engine: + + + + + + + true + + + Enter URL with '%1' in place of query + + + + Enabled Protocols - + @@ -118,14 +136,14 @@ - + Text Rendering - + @@ -152,14 +170,14 @@ - + Enable text highlights - + @@ -186,14 +204,14 @@ - + Gopher Map - + @@ -220,14 +238,14 @@ - + Unknown Scheme - + @@ -251,14 +269,14 @@ - + Hidden files in file:// directories - + @@ -282,14 +300,14 @@ - + URL bar highlights - + @@ -313,7 +331,7 @@ - + Use typographer's quotes @@ -323,7 +341,7 @@ - + @@ -347,38 +365,38 @@ - + Max. Number of Redirections - + 5 - + Redirection Handling - + - + Network Timeout - + ms @@ -391,14 +409,14 @@ - + Additional toolbar buttons - + @@ -416,7 +434,7 @@ - + Total cache size limit @@ -426,7 +444,7 @@ - + KiB @@ -440,7 +458,7 @@ - + Cached item size threshold @@ -450,7 +468,7 @@ - + KiB @@ -464,7 +482,7 @@ - + Cached item life @@ -474,7 +492,7 @@ - + minutes @@ -1319,6 +1337,7 @@ ui_theme ui_density start_page + search_engine enable_gemini enable_gopher enable_finger -- cgit v1.2.3