From ebad387c1aad0934ae6055a45a442d74bd26ecac Mon Sep 17 00:00:00 2001 From: Vladimir Golovnev Date: Sun, 25 Dec 2022 16:14:59 +0300 Subject: [PATCH] Apply correct tab order to Category options dialog Also pre-select (sub)category name for editing when dialog is opened for creating new (sub)category. PR #18270. Closes #18265. --- src/gui/torrentcategorydialog.cpp | 3 +++ src/gui/torrentcategorydialog.ui | 28 +++++++++++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/gui/torrentcategorydialog.cpp b/src/gui/torrentcategorydialog.cpp index 34cdce354..ccbc3bd62 100644 --- a/src/gui/torrentcategorydialog.cpp +++ b/src/gui/torrentcategorydialog.cpp @@ -133,6 +133,9 @@ QString TorrentCategoryDialog::categoryName() const void TorrentCategoryDialog::setCategoryName(const QString &categoryName) { m_ui->textCategoryName->setText(categoryName); + + const int subcategoryNameStart = categoryName.lastIndexOf(u"/") + 1; + m_ui->textCategoryName->setSelection(subcategoryNameStart, (categoryName.size() - subcategoryNameStart)); } BitTorrent::CategoryOptions TorrentCategoryDialog::categoryOptions() const diff --git a/src/gui/torrentcategorydialog.ui b/src/gui/torrentcategorydialog.ui index 7eaaa7909..2a9c785ef 100644 --- a/src/gui/torrentcategorydialog.ui +++ b/src/gui/torrentcategorydialog.ui @@ -29,13 +29,10 @@ - - - - - 0 - 0 - + + + + Name: @@ -49,10 +46,13 @@ - - - - Name: + + + + + 0 + 0 + @@ -173,6 +173,12 @@ 1 + + textCategoryName + comboSavePath + comboUseDownloadPath + comboDownloadPath +