Browse Source

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.
adaptive-webui-19844
Vladimir Golovnev 2 years ago committed by GitHub
parent
commit
ebad387c1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/gui/torrentcategorydialog.cpp
  2. 28
      src/gui/torrentcategorydialog.ui

3
src/gui/torrentcategorydialog.cpp

@ -133,6 +133,9 @@ QString TorrentCategoryDialog::categoryName() const @@ -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

28
src/gui/torrentcategorydialog.ui

@ -29,13 +29,10 @@ @@ -29,13 +29,10 @@
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<widget class="FileSystemPathComboEdit" name="comboSavePath" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<item row="0" column="0">
<widget class="QLabel" name="labelCategoryName">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
@ -49,10 +46,13 @@ @@ -49,10 +46,13 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="labelCategoryName">
<property name="text">
<string>Name:</string>
<item row="1" column="1">
<widget class="FileSystemPathComboEdit" name="comboSavePath" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
@ -173,6 +173,12 @@ @@ -173,6 +173,12 @@
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>textCategoryName</tabstop>
<tabstop>comboSavePath</tabstop>
<tabstop>comboUseDownloadPath</tabstop>
<tabstop>comboDownloadPath</tabstop>
</tabstops>
<resources/>
<connections>
<connection>

Loading…
Cancel
Save