From 2100573a1407b7914b3dd5a0f8d3d5cdbc449da3 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Mon, 7 Mar 2022 09:04:59 +0100 Subject: [PATCH] some minor UX tweaks for feed/category dialogs --- resources/desktop/com.github.rssguard.appdata.xml | 2 +- src/librssguard/database/databasequeries.cpp | 2 +- src/librssguard/services/abstract/gui/formcategorydetails.cpp | 2 ++ src/librssguard/services/standard/gui/standardfeeddetails.cpp | 4 ++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/desktop/com.github.rssguard.appdata.xml b/resources/desktop/com.github.rssguard.appdata.xml index 44aaa380f..c6c49720b 100644 --- a/resources/desktop/com.github.rssguard.appdata.xml +++ b/resources/desktop/com.github.rssguard.appdata.xml @@ -26,7 +26,7 @@ https://github.com/sponsors/martinrotter - + none diff --git a/src/librssguard/database/databasequeries.cpp b/src/librssguard/database/databasequeries.cpp index ebf52f87d..662c4575a 100644 --- a/src/librssguard/database/databasequeries.cpp +++ b/src/librssguard/database/databasequeries.cpp @@ -1940,7 +1940,7 @@ void DatabaseQueries::createOverwriteCategory(const QSqlDatabase& db, Category* if (category->id() <= 0) { // We need to insert category first. if (category->sortOrder() < 0) { - q.exec(QSL("SELECT MAX(ordr) FROM Categories WHERE account_id = :account_id AND parent_id = :parent_id;")); + q.prepare(QSL("SELECT MAX(ordr) FROM Categories WHERE account_id = :account_id AND parent_id = :parent_id;")); q.bindValue(QSL(":account_id"), account_id); q.bindValue(QSL(":parent_id"), parent_id); diff --git a/src/librssguard/services/abstract/gui/formcategorydetails.cpp b/src/librssguard/services/abstract/gui/formcategorydetails.cpp index c7019249c..826758c38 100644 --- a/src/librssguard/services/abstract/gui/formcategorydetails.cpp +++ b/src/librssguard/services/abstract/gui/formcategorydetails.cpp @@ -88,6 +88,8 @@ void FormCategoryDetails::loadCategoryData() { m_ui->m_txtTitle->lineEdit()->setText(m_category->title()); m_ui->m_txtDescription->lineEdit()->setText(m_category->description()); m_ui->m_btnIcon->setIcon(m_category->icon()); + + m_ui->m_txtTitle->lineEdit()->setFocus(); } void FormCategoryDetails::apply() { diff --git a/src/librssguard/services/standard/gui/standardfeeddetails.cpp b/src/librssguard/services/standard/gui/standardfeeddetails.cpp index c0966852f..2766e15ee 100644 --- a/src/librssguard/services/standard/gui/standardfeeddetails.cpp +++ b/src/librssguard/services/standard/gui/standardfeeddetails.cpp @@ -21,6 +21,9 @@ StandardFeedDetails::StandardFeedDetails(QWidget* parent) : QWidget(parent) { m_ui.setupUi(this); + m_ui.m_txtPostProcessScript->textEdit()->setTabChangesFocus(true); + m_ui.m_txtSource->textEdit()->setTabChangesFocus(true); + m_ui.m_txtTitle->lineEdit()->setPlaceholderText(tr("Feed title")); m_ui.m_txtTitle->lineEdit()->setToolTip(tr("Set title for your feed.")); m_ui.m_txtDescription->lineEdit()->setPlaceholderText(tr("Feed description")); @@ -334,6 +337,7 @@ void StandardFeedDetails::prepareForNewFeed(RootItem* parent_to_select, const QS } m_ui.m_txtSource->setFocus(); + m_ui.m_txtSource->textEdit()->selectAll(); } void StandardFeedDetails::setExistingFeed(StandardFeed* feed) {