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
void TorrentCategoryDialog::setCategoryName(const QString &categoryName) void TorrentCategoryDialog::setCategoryName(const QString &categoryName)
{ {
m_ui->textCategoryName->setText(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 BitTorrent::CategoryOptions TorrentCategoryDialog::categoryOptions() const

28
src/gui/torrentcategorydialog.ui

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

Loading…
Cancel
Save