From c887a6f7d87f37b8689c3e7a0a801af52d2fd28e Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 13 Dec 2024 16:21:22 +0800 Subject: [PATCH 1/4] GHA CI: add checks for grid items order Now all items under `QGridLayout` are required to be sorted. This allow us to omit tabstop order. The tabstop order will follow the layout order. The script can be invoked to fix wrong grid items order in .ui files: ```console python check_grid_items_order.py file.ui ``` --- .github/workflows/ci_python.yaml | 4 +- .../pre-commit/check_grid_items_order.py | 93 +++++++++++++++++++ .../pre-commit/check_translation_tag.py | 6 +- .pre-commit-config.yaml | 6 ++ 4 files changed, 105 insertions(+), 4 deletions(-) create mode 100755 .github/workflows/helper/pre-commit/check_grid_items_order.py diff --git a/.github/workflows/ci_python.yaml b/.github/workflows/ci_python.yaml index 268dd1ecf32c..e3183da5ad89 100644 --- a/.github/workflows/ci_python.yaml +++ b/.github/workflows/ci_python.yaml @@ -34,7 +34,7 @@ jobs: - name: Lint code (auxiliary scripts) run: | pyflakes $PY_FILES - bandit --skip B314,B405 $PY_FILES + bandit --skip B101,B314,B405 $PY_FILES - name: Format code (auxiliary scripts) run: | @@ -61,7 +61,7 @@ jobs: echo $PY_FILES echo "PY_FILES=$PY_FILES" >> "$GITHUB_ENV" - - name: Check typings (search engine) + - name: Check typings (search engine) run: | MYPYPATH="src/searchengine/nova3" \ mypy \ diff --git a/.github/workflows/helper/pre-commit/check_grid_items_order.py b/.github/workflows/helper/pre-commit/check_grid_items_order.py new file mode 100755 index 000000000000..30d6fd057107 --- /dev/null +++ b/.github/workflows/helper/pre-commit/check_grid_items_order.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 + +# A pre-commit hook for checking items order in grid layouts +# Copyright (C) 2024 Mike Tzou (Chocobo1) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# In addition, as a special exception, the copyright holders give permission to +# link this program with the OpenSSL project's "OpenSSL" library (or with +# modified versions of it that use the same license as the "OpenSSL" library), +# and distribute the linked executables. You must obey the GNU General Public +# License in all respects for all of the code used other than "OpenSSL". If you +# modify file(s), you may extend this exception to your version of the file(s), +# but you are not obligated to do so. If you do not wish to do so, delete this +# exception statement from your version. + +from collections.abc import Callable, Sequence +from typing import Optional +import argparse +import re +import xml.etree.ElementTree as ElementTree +import sys + + +def traversePostOrder(root: ElementTree.Element, visitFunc: Callable[[ElementTree.Element], None]) -> None: + stack = [(root, False)] + + while len(stack) > 0: + (element, visit) = stack.pop() + if visit: + visitFunc(element) + else: + stack.append((element, True)) + stack.extend((child, False) for child in reversed(element)) + + +def modifyElement(element: ElementTree.Element) -> None: + def getSortKey(e: ElementTree.Element) -> tuple[int, int]: + if e.tag == 'item': + return (int(e.attrib['row']), int(e.attrib['column'])) + return (-1, -1) # don't care + + if element.tag == 'layout' and element.attrib['class'] == 'QGridLayout' and len(element) > 0: + element[:] = sorted(element, key=getSortKey) + + # workaround_2a: ElementTree will unescape `"` and we need to escape it back + if element.tag == 'string' and element.text is not None: + element.text = element.text.replace('"', '"') + + +def main(argv: Optional[Sequence[str]] = None) -> int: + parser = argparse.ArgumentParser() + parser.add_argument('filenames', nargs='*', help='Filenames to check') + args = parser.parse_args(argv) + + for filename in args.filenames: + with open(filename, 'r+') as f: + orig = f.read() + root = ElementTree.fromstring(orig) + traversePostOrder(root, modifyElement) + ElementTree.indent(root, ' ') + + # workaround_1: cannot use `xml_declaration=True` since it uses single quotes instead of Qt preferred double quotes + ret = f'\n{ElementTree.tostring(root, 'unicode')}\n' + + # workaround_2b: ElementTree will turn `"` into `&quot;`, so revert it back + ret = ret.replace('&quot;', '"') + + # workaround_3: Qt prefers no whitespaces in self-closing tags + ret = re.sub('<(.+) +/>', r'<\1/>', ret) + + if ret != orig: + f.seek(0) + f.write(ret) + f.truncate() + + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/.github/workflows/helper/pre-commit/check_translation_tag.py b/.github/workflows/helper/pre-commit/check_translation_tag.py index f3d4457e2a03..4be80df492dd 100755 --- a/.github/workflows/helper/pre-commit/check_translation_tag.py +++ b/.github/workflows/helper/pre-commit/check_translation_tag.py @@ -26,9 +26,11 @@ # but you are not obligated to do so. If you do not wish to do so, delete this # exception statement from your version. -from typing import Optional, Sequence +from collections.abc import Sequence +from typing import Optional import argparse import re +import sys def main(argv: Optional[Sequence[str]] = None) -> int: @@ -67,4 +69,4 @@ def main(argv: Optional[Sequence[str]] = None) -> int: if __name__ == '__main__': - exit(main()) + sys.exit(main()) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a4c84ea2d418..e0bc4565d670 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,12 @@ repos: - repo: local hooks: + - id: check-grid-order + name: Check items order in grid layouts + entry: .github/workflows/helper/pre-commit/check_grid_items_order.py + language: script + files: \.ui$ + - id: check-translation-tag name: Check newline characters in tag entry: .github/workflows/helper/pre-commit/check_translation_tag.py From 0a36171999c9edf81f6266ee475c8df4a3af0620 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 14 Dec 2024 02:53:01 +0800 Subject: [PATCH 2/4] Sort grid items properly Supersedes #21856. --- .../pre-commit/check_grid_items_order.py | 2 + src/gui/aboutdialog.ui | 152 ++-- src/gui/addnewtorrentdialog.ui | 96 +-- src/gui/banlistoptionsdialog.ui | 6 - src/gui/ipsubnetwhitelistoptionsdialog.ui | 6 - src/gui/optionsdialog.ui | 692 +++++++----------- src/gui/properties/propertieswidget.ui | 306 ++++---- src/gui/rss/automatedrssdownloader.ui | 64 +- src/gui/statsdialog.ui | 88 +-- src/gui/torrentcategorydialog.ui | 6 - src/gui/torrentcreatordialog.ui | 45 +- src/gui/torrentoptionsdialog.ui | 87 +-- src/gui/torrentsharelimitswidget.ui | 117 ++- 13 files changed, 697 insertions(+), 970 deletions(-) diff --git a/.github/workflows/helper/pre-commit/check_grid_items_order.py b/.github/workflows/helper/pre-commit/check_grid_items_order.py index 30d6fd057107..0ab3d6715d30 100755 --- a/.github/workflows/helper/pre-commit/check_grid_items_order.py +++ b/.github/workflows/helper/pre-commit/check_grid_items_order.py @@ -82,6 +82,8 @@ def main(argv: Optional[Sequence[str]] = None) -> int: ret = re.sub('<(.+) +/>', r'<\1/>', ret) if ret != orig: + print(f'Tip: run this script to apply the fix: `python {__file__} {filename}`', file=sys.stderr) + f.seek(0) f.write(ret) f.truncate() diff --git a/src/gui/aboutdialog.ui b/src/gui/aboutdialog.ui index a0efa8f4995a..67d583ba36c7 100644 --- a/src/gui/aboutdialog.ui +++ b/src/gui/aboutdialog.ui @@ -90,23 +90,17 @@ Current maintainer - - + + - Greece + Name: - - + + - <a href="mailto:sledgehammer999@qbittorrent.org">sledgehammer999@qbittorrent.org</a> - - - true - - - Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse + Sledgehammer999 @@ -117,24 +111,30 @@ - - + + - E-mail: + Greece - - + + - Name: + E-mail: - - + + - Sledgehammer999 + <a href="mailto:sledgehammer999@qbittorrent.org">sledgehammer999@qbittorrent.org</a> + + + true + + + Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse @@ -160,10 +160,10 @@ Original author - - + + - France + Name: @@ -174,23 +174,17 @@ - - + + - <a href="mailto:chris@qbittorrent.org">chris@qbittorrent.org</a> - - - true - - - Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse + Nationality: - - + + - Name: + France @@ -201,10 +195,16 @@ - - + + - Nationality: + <a href="mailto:chris@qbittorrent.org">chris@qbittorrent.org</a> + + + true + + + Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse @@ -365,15 +365,28 @@ - - + + + + Qt: + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse - - + + + + Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse + + + + + Qt::Orientation::Horizontal @@ -385,10 +398,10 @@ - - + + - Qt: + Libtorrent: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter @@ -398,19 +411,26 @@ - - - - Libtorrent: - - - Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - + + Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse + + + + Qt::Orientation::Horizontal + + + + 0 + 0 + + + + @@ -424,33 +444,13 @@ - - - - Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse - - - - - + + Qt::TextInteractionFlag::LinksAccessibleByMouse|Qt::TextInteractionFlag::TextSelectableByMouse - - - - Qt::Orientation::Horizontal - - - - 0 - 0 - - - - diff --git a/src/gui/addnewtorrentdialog.ui b/src/gui/addnewtorrentdialog.ui index 33711e2c9a79..71c3b141005b 100644 --- a/src/gui/addnewtorrentdialog.ui +++ b/src/gui/addnewtorrentdialog.ui @@ -378,19 +378,64 @@ Torrent information - - + + - Info hash v1: + Size: + + + + Date: + + + + + + + Info hash v1: + + + + + + + Qt::TextInteractionFlag::TextSelectableByMouse + + + + + + + Info hash v2: + + + + + + + Qt::TextInteractionFlag::TextSelectableByMouse + + + + + + + Comment: + + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + + + @@ -447,51 +492,6 @@ - - - - Comment: - - - Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop - - - - - - - Size: - - - - - - - Qt::TextInteractionFlag::TextSelectableByMouse - - - - - - - Date: - - - - - - - Info hash v2: - - - - - - - Qt::TextInteractionFlag::TextSelectableByMouse - - - diff --git a/src/gui/banlistoptionsdialog.ui b/src/gui/banlistoptionsdialog.ui index 33d91fe4d53b..51abbf6dd48d 100644 --- a/src/gui/banlistoptionsdialog.ui +++ b/src/gui/banlistoptionsdialog.ui @@ -102,12 +102,6 @@ - - bannedIPList - txtIP - buttonBanIP - buttonDeleteIP - diff --git a/src/gui/ipsubnetwhitelistoptionsdialog.ui b/src/gui/ipsubnetwhitelistoptionsdialog.ui index 1452eaea00b1..962055d36b8c 100644 --- a/src/gui/ipsubnetwhitelistoptionsdialog.ui +++ b/src/gui/ipsubnetwhitelistoptionsdialog.ui @@ -86,12 +86,6 @@ - - whitelistedIPSubnetList - txtIPSubnet - buttonWhitelistIPSubnet - buttonDeleteIPSubnet - diff --git a/src/gui/optionsdialog.ui b/src/gui/optionsdialog.ui index 91bac21fc247..7b35d605276a 100644 --- a/src/gui/optionsdialog.ui +++ b/src/gui/optionsdialog.ui @@ -361,6 +361,19 @@ + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + @@ -397,19 +410,6 @@ - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - @@ -1518,8 +1518,18 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - - + + + + Sender + + + From: + + + + + @@ -1531,6 +1541,9 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. + + + @@ -1541,19 +1554,6 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - - - - - - - Sender - - - From: - - - @@ -1824,26 +1824,6 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.Connections Limits - - - - 500 - - - 4 - - - - - - - Maximum number of connections per torrent: - - - true - - - @@ -1870,6 +1850,29 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + Maximum number of connections per torrent: + + + true + + + @@ -1883,13 +1886,6 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - - - - Maximum number of upload slots per torrent: - - - @@ -1907,18 +1903,22 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - - - - Qt::Orientation::Horizontal + + + + Maximum number of upload slots per torrent: - - - 40 - 20 - + + + + + + 500 - + + 4 + + @@ -1985,7 +1985,7 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - <html><head/><body><p>If &quot;mixed mode&quot; is enabled I2P torrents are allowed to also get peers from other sources than the tracker, and connect to regular IPs, not providing any anonymization. This may be useful if the user is not interested in the anonymization of I2P, but still wants to be able to connect to I2P peers.</p></body></html> + <html><head/><body><p>If "mixed mode" is enabled I2P torrents are allowed to also get peers from other sources than the tracker, and connect to regular IPs, not providing any anonymization. This may be useful if the user is not interested in the anonymization of I2P, but still wants to be able to connect to I2P peers.</p></body></html> Mixed mode @@ -2294,6 +2294,16 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'.Global Rate Limits + + + + + + + Upload: + + + @@ -2313,6 +2323,26 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + Download: + + + @@ -2332,11 +2362,46 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. + + + + + + + Alternative Rate Limits + + - + + + + + + Upload: + + + + + + + + + + KiB/s + + + 2000000 + + + QAbstractSpinBox::StepType::AdaptiveDecimalStepType + + + 10 + + - + Qt::Orientation::Horizontal @@ -2348,29 +2413,13 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - - - - Upload: - - - - + Download: - - - - - - - Alternative Rate Limits - - @@ -2390,9 +2439,6 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - - - @@ -2415,17 +2461,20 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - - + + true hh:mm + + false + @@ -2442,26 +2491,36 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - - + + true hh:mm - - false - + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + @@ -2494,68 +2553,9 @@ readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - - - - KiB/s - - - 2000000 - - - QAbstractSpinBox::StepType::AdaptiveDecimalStepType - - - 10 - - - - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - Upload: - - - - - - - Download: - - - @@ -2839,6 +2839,19 @@ Disable encryption: Only connect to peers without protocol encryption + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + @@ -2879,19 +2892,6 @@ Disable encryption: Only connect to peers without protocol encryption - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - @@ -2904,6 +2904,13 @@ Disable encryption: Only connect to peers without protocol encryption false + + + + Download rate threshold: + + + @@ -2920,6 +2927,26 @@ Disable encryption: Only connect to peers without protocol encryption + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + Upload rate threshold: + + + @@ -2936,33 +2963,13 @@ Disable encryption: Only connect to peers without protocol encryption - - - - Upload rate threshold: - - - - - + + - Download rate threshold: + Torrent inactivity timer: - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - @@ -2979,13 +2986,6 @@ Disable encryption: Only connect to peers without protocol encryption - - - - Torrent inactivity timer: - - - @@ -3208,26 +3208,6 @@ Disable encryption: Only connect to peers without protocol encryption - - - - sec - - - 2147483646 - - - 2 - - - - - - - Same host request delay: - - - @@ -3257,13 +3237,23 @@ Disable encryption: Only connect to peers without protocol encryption - - + + + + Same host request delay: + + + + + + + sec + 2147483646 - 100 + 2 @@ -3274,6 +3264,16 @@ Disable encryption: Only connect to peers without protocol encryption + + + + 2147483646 + + + 100 + + + @@ -3462,12 +3462,8 @@ Specify an IPv4 or IPv6 address. You can specify "0.0.0.0" for any IPv false - - - - Key: - - + + @@ -3476,12 +3472,22 @@ Specify an IPv4 or IPv6 address. You can specify "0.0.0.0" for any IPv - - + + + + + + Key: + + + + + + @@ -3492,12 +3498,6 @@ Specify an IPv4 or IPv6 address. You can specify "0.0.0.0" for any IPv - - - - - - @@ -3574,6 +3574,16 @@ Specify an IPv4 or IPv6 address. You can specify "0.0.0.0" for any IPv + + + + Never + + + 2147483647 + + + @@ -3587,16 +3597,6 @@ Specify an IPv4 or IPv6 address. You can specify "0.0.0.0" for any IPv - - - - Never - - - 2147483647 - - - @@ -3967,206 +3967,6 @@ Use ';' to split multiple entries. Can use wildcard '*'. 1 - - tabOption - tabSelection - comboLanguage - comboStyle - comboColorScheme - checkUseCustomTheme - customThemeFilePath - checkUseSystemIcon - buttonCustomizeUITheme - confirmDeletion - checkAltRowColors - checkHideZero - comboHideZero - actionTorrentDlOnDblClBox - actionTorrentFnOnDblClBox - checkBoxHideZeroStatusFilters - checkStartup - checkShowSplash - windowStateComboBox - checkProgramExitConfirm - checkProgramAutoExitConfirm - checkShowSystray - checkMinimizeToSysTray - checkCloseToSystray - comboTrayIcon - checkAssociateTorrents - checkAssociateMagnetLinks - checkProgramUpdates - checkPreventFromSuspendWhenDownloading - checkPreventFromSuspendWhenSeeding - checkFileLog - textFileLogPath - checkFileLogBackup - spinFileLogSize - checkFileLogDelete - spinFileLogAge - comboFileLogAgeType - checkBoxPerformanceWarning - scrollArea - checkAdditionDialog - checkAdditionDialogFront - contentLayoutComboBox - checkAddToQueueTop - checkAddStopped - stopConditionComboBox - checkMergeTrackers - checkConfirmMergeTrackers - deleteTorrentBox - deleteCancelledTorrentBox - checkPreallocateAll - checkAppendqB - checkUnwantedFolder - checkRecursiveDownload - comboSavingMode - comboTorrentCategoryChanged - comboCategoryDefaultPathChanged - comboCategoryChanged - checkUseSubcategories - checkUseCategoryPaths - textSavePath - checkUseDownloadPath - textDownloadPath - checkExportDir - textExportDir - checkExportDirFin - textExportDirFin - scanFoldersView - addWatchedFolderButton - editWatchedFolderButton - removeWatchedFolderButton - groupExcludedFileNames - textExcludedFileNames - groupMailNotification - senderEmailTxt - lineEditDestEmail - lineEditSmtpServer - checkSmtpSSL - groupMailNotifAuth - mailNotifUsername - mailNotifPassword - sendTestEmail - groupBoxRunOnAdded - lineEditRunOnAdded - groupBoxRunOnFinished - lineEditRunOnFinished - autoRunConsole - scrollArea_2 - comboProtocol - spinPort - randomButton - checkUPnP - checkMaxConnections - spinMaxConnec - checkMaxConnectionsPerTorrent - spinMaxConnecPerTorrent - checkMaxUploads - spinMaxUploads - checkMaxUploadsPerTorrent - spinMaxUploadsPerTorrent - groupI2P - textI2PHost - spinI2PPort - checkI2PMixed - comboProxyType - textProxyIP - spinProxyPort - checkProxyHostnameLookup - checkProxyAuth - textProxyUsername - textProxyPassword - checkProxyBitTorrent - checkProxyPeerConnections - checkProxyRSS - checkProxyMisc - checkIPFilter - textFilterPath - IpFilterRefreshBtn - banListButton - checkIpFilterTrackers - scrollArea_3 - spinUploadLimit - spinDownloadLimit - spinUploadLimitAlt - spinDownloadLimitAlt - groupBoxSchedule - timeEditScheduleFrom - timeEditScheduleTo - comboBoxScheduleDays - checkLimituTPConnections - checkLimitTransportOverhead - checkLimitLocalPeerRate - scrollArea_9 - checkDHT - checkPeX - checkLSD - comboEncryption - checkAnonymousMode - spinBoxMaxActiveCheckingTorrents - checkEnableQueueing - spinMaxActiveDownloads - spinMaxActiveUploads - spinMaxActiveTorrents - checkIgnoreSlowTorrentsForQueueing - spinDownloadRateForSlowTorrents - spinUploadRateForSlowTorrents - spinSlowTorrentsInactivityTimer - checkMaxRatio - spinMaxRatio - checkMaxSeedingMinutes - spinMaxSeedingMinutes - checkMaxInactiveSeedingMinutes - spinMaxInactiveSeedingMinutes - comboRatioLimitAct - checkEnableAddTrackers - textTrackers - scrollArea_4 - checkRSSEnable - spinRSSRefreshInterval - spinRSSFetchDelay - spinRSSMaxArticlesPerFeed - checkRSSAutoDownloaderEnable - btnEditRules - checkSmartFilterDownloadRepacks - textSmartEpisodeFilters - scrollArea_5 - checkWebUI - textWebUIAddress - spinWebUIPort - checkWebUIUPnP - checkWebUIHttps - textWebUIHttpsCert - textWebUIHttpsKey - textWebUIUsername - textWebUIPassword - checkBypassLocalAuth - checkBypassAuthSubnetWhitelist - IPSubnetWhitelistButton - spinBanCounter - spinBanDuration - spinSessionTimeout - groupAltWebUI - textWebUIRootFolder - checkClickjacking - checkCSRFProtection - checkSecureCookie - groupHostHeaderValidation - textServerDomains - groupWebUIAddCustomHTTPHeaders - textWebUICustomHTTPHeaders - groupEnableReverseProxySupport - textTrustedReverseProxiesList - checkDynDNS - comboDNSService - registerDNSBtn - domainNameTxt - DNSUsernameTxt - DNSPasswordTxt - scrollArea_7 - diff --git a/src/gui/properties/propertieswidget.ui b/src/gui/properties/propertieswidget.ui index 564a88c82749..dd21f6fefb41 100644 --- a/src/gui/properties/propertieswidget.ui +++ b/src/gui/properties/propertieswidget.ui @@ -85,6 +85,13 @@ + + + + Qt::TextFormat::PlainText + + + @@ -114,6 +121,13 @@ + + + + Qt::TextFormat::PlainText + + + @@ -127,20 +141,6 @@ - - - - Qt::TextFormat::PlainText - - - - - - - Qt::TextFormat::PlainText - - - @@ -163,21 +163,8 @@ 4 - - - - - 0 - 0 - - - - Qt::TextFormat::PlainText - - - - - + + 0 @@ -185,15 +172,15 @@ - Upload Speed: + Time Active: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + 0 @@ -205,8 +192,8 @@ - - + + 0 @@ -214,44 +201,44 @@ - Peers: + ETA: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + - + 0 0 - - Connections: - - - Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + Qt::TextFormat::PlainText - - + + - + 0 0 - - Qt::TextFormat::PlainText + + Connections: + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + 0 @@ -263,8 +250,8 @@ - - + + 0 @@ -272,50 +259,44 @@ - Download Limit: + Downloaded: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + - + 0 0 - - Share Ratio: - - - Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + Qt::TextFormat::PlainText - - + + 0 0 - - Ratio / Time Active (in months), indicates how popular the torrent is - - Popularity: + Uploaded: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + 0 @@ -327,8 +308,24 @@ - - + + + + + 0 + 0 + + + + Seeds: + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + 0 @@ -340,8 +337,8 @@ - - + + 0 @@ -349,31 +346,28 @@ - Downloaded: + Download Speed: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + - + 0 0 - - Upload Limit: - - - Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + Qt::TextFormat::PlainText - - + + 0 @@ -381,15 +375,15 @@ - Last Seen Complete: + Upload Speed: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + 0 @@ -401,8 +395,24 @@ - - + + + + + 0 + 0 + + + + Peers: + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + + + + 0 @@ -414,8 +424,8 @@ - - + + 0 @@ -423,15 +433,15 @@ - Reannounce In: + Download Limit: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + 0 @@ -443,8 +453,8 @@ - - + + 0 @@ -452,39 +462,39 @@ - Seeds: + Upload Limit: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + - + 0 0 - - Download Speed: - - - Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + Qt::TextFormat::PlainText - - + + - + 0 0 - - Qt::TextFormat::PlainText + + Wasted: + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter @@ -501,37 +511,37 @@ - - + + - + 0 0 - - Qt::TextFormat::PlainText + + Share Ratio: + + + Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + 0 0 - - Ratio / Time Active (in months), indicates how popular the torrent is - Qt::TextFormat::PlainText - - + + 0 @@ -539,28 +549,15 @@ - Uploaded: + Reannounce In: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - - - - 0 - 0 - - - - Qt::TextFormat::PlainText - - - - - + + 0 @@ -572,8 +569,8 @@ - - + + 0 @@ -581,15 +578,15 @@ - Time Active: + Last Seen Complete: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + 0 @@ -601,35 +598,38 @@ - - + + 0 0 + + Ratio / Time Active (in months), indicates how popular the torrent is + - ETA: + Popularity: Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter - - + + - + 0 0 - - Wasted: + + Ratio / Time Active (in months), indicates how popular the torrent is - - Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTrailing|Qt::AlignmentFlag::AlignVCenter + + Qt::TextFormat::PlainText diff --git a/src/gui/rss/automatedrssdownloader.ui b/src/gui/rss/automatedrssdownloader.ui index 72bad112f743..ad54a0eb01ce 100644 --- a/src/gui/rss/automatedrssdownloader.ui +++ b/src/gui/rss/automatedrssdownloader.ui @@ -182,22 +182,11 @@ - - - - Must Not Contain: - - - - - - - Episode Filter: - - + + - - + + 18 @@ -206,6 +195,16 @@ + + + + Must Not Contain: + + + + + + @@ -216,11 +215,18 @@ - - + + + + Episode Filter: + + - - + + + + + 18 @@ -239,12 +245,6 @@ - - - - - - @@ -427,20 +427,6 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also - - renameRuleBtn - removeRuleBtn - addRuleBtn - ruleList - lineContains - lineNotContains - lineEFilter - spinIgnorePeriod - listFeeds - matchingArticlesTree - importBtn - exportBtn - diff --git a/src/gui/statsdialog.ui b/src/gui/statsdialog.ui index 444843a2c4bc..acb2767cc4ad 100644 --- a/src/gui/statsdialog.ui +++ b/src/gui/statsdialog.ui @@ -20,29 +20,15 @@ User statistics - - - - TextLabel - - - - - - - Connected peers: - - - - - + + - All-time share ratio: + All-time upload: - - + + TextLabel @@ -62,6 +48,13 @@ + + + + All-time share ratio: + + + @@ -76,15 +69,22 @@ - - + + - All-time upload: + TextLabel - - + + + + Connected peers: + + + + + TextLabel @@ -113,17 +113,17 @@ - - + + - TextLabel + Total buffer size: - - + + - Total buffer size: + TextLabel @@ -136,24 +136,24 @@ Performance statistics - - + + - TextLabel + Write cache overload: - - + + TextLabel - - + + - TextLabel + Read cache overload: @@ -171,10 +171,10 @@ - - + + - Write cache overload: + TextLabel @@ -185,10 +185,10 @@ - - + + - Read cache overload: + TextLabel diff --git a/src/gui/torrentcategorydialog.ui b/src/gui/torrentcategorydialog.ui index 3191232a7d97..804af09dd3dd 100644 --- a/src/gui/torrentcategorydialog.ui +++ b/src/gui/torrentcategorydialog.ui @@ -173,12 +173,6 @@ 1 - - textCategoryName - comboSavePath - comboUseDownloadPath - comboDownloadPath - diff --git a/src/gui/torrentcreatordialog.ui b/src/gui/torrentcreatordialog.ui index 3a7d47beefa5..f4a5bf65e293 100644 --- a/src/gui/torrentcreatordialog.ui +++ b/src/gui/torrentcreatordialog.ui @@ -313,6 +313,13 @@ Fields + + + + Tracker URLs: + + + @@ -337,20 +344,6 @@ - - - - false - - - - - - - Tracker URLs: - - - @@ -358,6 +351,13 @@ + + + + false + + + @@ -413,23 +413,6 @@ 1 - - textInputPath - addFileButton - addFolderButton - comboTorrentFormat - comboPieceSize - buttonCalcTotalPieces - checkPrivate - checkStartSeeding - checkIgnoreShareLimits - checkOptimizeAlignment - spinPaddedFileSizeLimit - trackersList - URLSeedsList - txtComment - lineEditSource - diff --git a/src/gui/torrentoptionsdialog.ui b/src/gui/torrentoptionsdialog.ui index 835dcc6b8f5f..9fcb65d5240f 100644 --- a/src/gui/torrentoptionsdialog.ui +++ b/src/gui/torrentoptionsdialog.ui @@ -52,6 +52,13 @@ + + + + Category: + + + @@ -71,13 +78,6 @@ - - - - Category: - - - @@ -86,15 +86,22 @@ Torrent Speed Limits - - + + - Download: + Upload: - - + + + + Qt::Orientation::Horizontal + + + + + @@ -109,8 +116,22 @@ - - + + + + Download: + + + + + + + Qt::Orientation::Horizontal + + + + + @@ -132,27 +153,6 @@ - - - - Upload: - - - - - - - Qt::Orientation::Horizontal - - - - - - - Qt::Orientation::Horizontal - - - @@ -256,23 +256,6 @@ 1 - - checkAutoTMM - savePath - checkUseDownloadPath - downloadPath - comboCategory - sliderUploadLimit - spinUploadLimit - sliderDownloadLimit - spinDownloadLimit - torrentShareLimitsBox - checkDisableDHT - checkSequential - checkDisablePEX - checkFirstLastPieces - checkDisableLSD - diff --git a/src/gui/torrentsharelimitswidget.ui b/src/gui/torrentsharelimitswidget.ui index a532b03640ca..9ada9ed67acf 100644 --- a/src/gui/torrentsharelimitswidget.ui +++ b/src/gui/torrentsharelimitswidget.ui @@ -13,8 +13,15 @@ - - + + + + Ratio: + + + + + -1 @@ -35,52 +42,6 @@ - - - - false - - - min - - - 9999999 - - - 1440 - - - - - - - Ratio: - - - - - - - Inactive seeding time: - - - - - - - false - - - min - - - 9999999 - - - 1440 - - - @@ -97,6 +58,13 @@ + + + + Seeding time: + + + @@ -119,8 +87,31 @@ - - + + + + false + + + min + + + 9999999 + + + 1440 + + + + + + + Inactive seeding time: + + + + + -1 @@ -141,10 +132,19 @@ - - - - Seeding time: + + + + false + + + min + + + 9999999 + + + 1440 @@ -208,15 +208,6 @@ - - comboBoxRatioMode - spinBoxRatioValue - comboBoxSeedingTimeMode - spinBoxSeedingTimeValue - comboBoxInactiveSeedingTimeMode - spinBoxInactiveSeedingTimeValue - comboBoxAction - From 85c4ddf6167f5f5d810fa73a14a76ab077a074c7 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sat, 14 Dec 2024 22:36:05 +0800 Subject: [PATCH 3/4] Make links accessible by keyboard --- src/gui/aboutdialog.ui | 3 +++ src/gui/addnewtorrentdialog.ui | 2 +- src/gui/optionsdialog.ui | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/gui/aboutdialog.ui b/src/gui/aboutdialog.ui index 67d583ba36c7..68e2bf43b696 100644 --- a/src/gui/aboutdialog.ui +++ b/src/gui/aboutdialog.ui @@ -75,6 +75,9 @@ true + + Qt::TextInteractionFlag::LinksAccessibleByKeyboard|Qt::TextInteractionFlag::LinksAccessibleByMouse + diff --git a/src/gui/addnewtorrentdialog.ui b/src/gui/addnewtorrentdialog.ui index 71c3b141005b..7e17af2d6453 100644 --- a/src/gui/addnewtorrentdialog.ui +++ b/src/gui/addnewtorrentdialog.ui @@ -484,7 +484,7 @@ true - Qt::TextInteractionFlag::TextBrowserInteraction + Qt::TextInteractionFlag::TextSelectableByKeyboard|Qt::TextInteractionFlag::TextSelectableByMouse diff --git a/src/gui/optionsdialog.ui b/src/gui/optionsdialog.ui index 7b35d605276a..eb2e6181182b 100644 --- a/src/gui/optionsdialog.ui +++ b/src/gui/optionsdialog.ui @@ -2750,6 +2750,9 @@ Disable encryption: Only connect to peers without protocol encryption true + + Qt::TextInteractionFlag::LinksAccessibleByKeyboard|Qt::TextInteractionFlag::LinksAccessibleByMouse + @@ -3496,6 +3499,9 @@ Specify an IPv4 or IPv6 address. You can specify "0.0.0.0" for any IPv true + + Qt::TextInteractionFlag::LinksAccessibleByKeyboard|Qt::TextInteractionFlag::LinksAccessibleByMouse + @@ -3696,6 +3702,9 @@ Specify an IPv4 or IPv6 address. You can specify "0.0.0.0" for any IPv true + + Qt::TextInteractionFlag::LinksAccessibleByKeyboard|Qt::TextInteractionFlag::LinksAccessibleByMouse + @@ -3817,7 +3826,13 @@ Use ';' to split multiple entries. Can use wildcard '*'. - <html><head/><body><p><a href="https://github.com/qbittorrent/qBittorrent/wiki#reverse-proxy-setup-for-webui-access"><span style=" text-decoration: underline; color:#0000ff;">Reverse proxy setup examples</span></a></p></body></html> + <a href=https://github.com/qbittorrent/qBittorrent/wiki#reverse-proxy-setup-for-webui-access>Reverse proxy setup examples</a> + + + true + + + Qt::TextInteractionFlag::LinksAccessibleByKeyboard|Qt::TextInteractionFlag::LinksAccessibleByMouse From 7886ca65f9e455ad07e0ba66c2a8e4df52766623 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 15 Dec 2024 00:33:27 +0800 Subject: [PATCH 4/4] Make tab key switch focus These fields do not expect tab characters. --- src/gui/optionsdialog.ui | 18 ++++++++++++++++-- src/gui/properties/peersadditiondialog.ui | 3 +++ src/gui/torrentcreatordialog.ui | 9 +++++++++ src/gui/trackersadditiondialog.ui | 3 +++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/gui/optionsdialog.ui b/src/gui/optionsdialog.ui index eb2e6181182b..80b5eff8c681 100644 --- a/src/gui/optionsdialog.ui +++ b/src/gui/optionsdialog.ui @@ -1496,6 +1496,9 @@ readme.txt: filter exact file name. ?.txt: filter 'a.txt', 'b.txt' but not 'aa.txt'. readme[0-9].txt: filter 'readme1.txt', 'readme2.txt' but not 'readme10.txt'. + + true + QPlainTextEdit::LineWrapMode::NoWrap @@ -3136,7 +3139,11 @@ Disable encryption: Only connect to peers without protocol encryption - + + + true + + @@ -3326,7 +3333,11 @@ Disable encryption: Only connect to peers without protocol encryption - + + + true + + @@ -3785,6 +3796,9 @@ Use ';' to split multiple entries. Can use wildcard '*'. + + true + QPlainTextEdit::LineWrapMode::NoWrap diff --git a/src/gui/properties/peersadditiondialog.ui b/src/gui/properties/peersadditiondialog.ui index ed9641be650a..fcc39159af60 100644 --- a/src/gui/properties/peersadditiondialog.ui +++ b/src/gui/properties/peersadditiondialog.ui @@ -23,6 +23,9 @@ + + true + QTextEdit::LineWrapMode::NoWrap diff --git a/src/gui/torrentcreatordialog.ui b/src/gui/torrentcreatordialog.ui index f4a5bf65e293..6a3eb33be6e7 100644 --- a/src/gui/torrentcreatordialog.ui +++ b/src/gui/torrentcreatordialog.ui @@ -325,6 +325,9 @@ You can separate tracker tiers / groups with an empty line. + + true + false @@ -339,6 +342,9 @@ + + true + false @@ -353,6 +359,9 @@ + + true + false diff --git a/src/gui/trackersadditiondialog.ui b/src/gui/trackersadditiondialog.ui index 7776016e635b..75c57445904e 100644 --- a/src/gui/trackersadditiondialog.ui +++ b/src/gui/trackersadditiondialog.ui @@ -23,6 +23,9 @@ + + true + QTextEdit::LineWrapMode::NoWrap