From 3467358663a99c57b7a8b99355b5c9be9f27366e Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 10 Oct 2021 01:17:25 +0800 Subject: [PATCH 1/2] GHA CI: Switch to pre-commit framework for checking file health Now users are able to run the same checks on their local development environment. https://pre-commit.com/ --- .github/workflows/check_translation_tag.py | 68 +++++++++++++++++ .github/workflows/ci_file_health.yaml | 7 +- .github/workflows/file_health.sh | 85 ---------------------- .pre-commit-config.yaml | 55 ++++++++++++++ 4 files changed, 125 insertions(+), 90 deletions(-) create mode 100755 .github/workflows/check_translation_tag.py delete mode 100755 .github/workflows/file_health.sh create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/check_translation_tag.py b/.github/workflows/check_translation_tag.py new file mode 100755 index 000000000..34705f74d --- /dev/null +++ b/.github/workflows/check_translation_tag.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python3 + +# A pre-commit hook for detecting problematic tags +# Copyright (C) 2021 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 typing import Optional, Sequence +import argparse +import re + +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) + + error_msg = "" + regex = re.compile(r"\s*") + + for filename in args.filenames: + line_counter = 1 + error_buffer = "" + + with open(filename) as file: + try: + for line in file: + if (match := regex.match(line)) is not None: + error_buffer += str(f"Defect file: \"{filename}\"\n" + f"Line: {line_counter}\n" + f"Column span: {match.span()}\n" + f"Part: \"{match.group()}\"\n\n") + line_counter += 1 + + except UnicodeDecodeError as error: + # not a text file, skip + continue + + error_msg += error_buffer + + if len(error_msg) > 0: + print(error_msg) + return 1 + + return 0 + +if __name__ == '__main__': + exit(main()) diff --git a/.github/workflows/ci_file_health.yaml b/.github/workflows/ci_file_health.yaml index 07bd98ec2..739a7ea46 100644 --- a/.github/workflows/ci_file_health.yaml +++ b/.github/workflows/ci_file_health.yaml @@ -11,10 +11,7 @@ jobs: uses: actions/checkout@v2 - name: Install tools - run: | - sudo apt update - sudo apt install zsh + uses: actions/setup-python@v2 - name: Check files - run: | - ./.github/workflows/file_health.sh + uses: pre-commit/action@v2.0.3 diff --git a/.github/workflows/file_health.sh b/.github/workflows/file_health.sh deleted file mode 100755 index eb21d0054..000000000 --- a/.github/workflows/file_health.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env zsh - -set -o nounset - -# Assumption: file names don't contain `:` (for the `cut` invocation). -# Safe to assume, as such a character in a filename would cause trouble on Windows, a platform we support - -# any regression turn this non-zero -regressions=0 - -# exclusions (these are just grep extended regular expressions to match against paths relative to the root of the repository) -exclusions_nonutf8='(.*(7z|gif|ic(ns|o)|png|qm|zip))' -exclusions_bom='src/base/unicodestrings.h' -exclusions_tw='(*.ts)|src/webui/www/private/scripts/lib/*' -exclusions_trailing_newline='configure' -exclusions_no_lf='(*.ts)|(.*svg)|compile_commands.json|src/webui/www/private/scripts/lib/*' - -echo -e "\n*** Detect files not encoded in UTF-8 ***\n" - -find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \ - | grep -v -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \ - | grep -E -v -e "${exclusions_nonutf8}" \ - | tee >(echo -e "--> Files not encoded in UTF-8: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \ - | xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0' -regressions=$((regressions+$?)) - -echo -e "\n*** Detect files encoded in UTF-8 with BOM ***\n" - -grep --exclude-dir={.git,build} -rIl $'\xEF\xBB\xBF' | sort \ - | grep -E -v -e "${exclusions_bom}" \ - | tee >(echo -e "--> Files encoded in UTF-8 with BOM: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \ - | xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0' -regressions=$((regressions+$?)) - -echo -e "\n*** Detect usage of CR byte ***\n" - -grep --exclude-dir={.git,build} -rIlU $'\x0D' | sort \ - | tee >(echo -e "--> Usage of CR byte: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \ - | xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0' -regressions=$((regressions+$?)) - -echo -e "\n*** Detect trailing whitespace in lines ***\n" - -grep --exclude-dir={.git,build} -rIl "[[:blank:]]$" | sort \ - | grep -E -v -e "${exclusions_tw}" \ - | tee >(echo -e "--> Trailing whitespace in lines: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \ - | xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0'; -regressions=$((regressions+$?)) - -echo -e "\n*** Detect too many trailing newlines ***\n" - -find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \ - | grep -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \ - | grep -E -v -e "${exclusions_trailing_newline}" \ - | xargs -L1 -I my_input bash -c 'test "$(tail -q -c2 "my_input" | hexdump -C | grep "0a 0a")" && echo "my_input"' \ - | tee >(echo -e "--> Too many trailing newlines: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \ - | xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0' -regressions=$((regressions+$?)) - -echo -e "\n*** Detect no trailing newline ***\n" - -find . -path ./build -prune -false -o -path ./.git -prune -false -o -type f -exec file --mime {} \; | sort \ - | grep -e "charset=us-ascii" -e "charset=utf-8" | cut -d ":" -f 1 \ - | grep -E -v -e "${exclusions_no_lf}" \ - | xargs -L1 -I my_input bash -c 'test "$(tail -q -c1 "my_input" | hexdump -C | grep "0a")" || echo "my_input"' \ - | tee >(echo -e "--> No trailing newline: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \ - | xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0' -regressions=$((regressions+$?)) - -echo -e "\n*** Detect translation closing tag in new line ***\n" - -grep --exclude-dir={.git,build} -nri "^" | sort \ - | cut -d ":" -f 1,2 \ - | tee >(echo -e "--> Translation closing tag in new line: found" "$(wc -l < /dev/stdin)" "regression(s)\n") \ - | xargs -I my_input -0 bash -c 'echo "my_input"; test "$(echo -n "my_input" | wc -l)" -eq 0' -regressions=$((regressions+$?)) - -if [ "$regressions" -ne 0 ]; then - regressions=1 - echo "\nFile health regressions found. Please fix them (or add them as exclusions)." -else - echo "All OK, no file health regressions found." -fi - -exit $regressions; diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..ced7adbf5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,55 @@ +repos: + - repo: local + hooks: + - id: check-translation-tag + name: Check newline characters in tag + entry: .github/workflows/check_translation_tag.py + language: script + types_or: + - ts + + - repo: https://github.com/pre-commit/pre-commit-hooks.git + rev: v4.0.1 + hooks: + - id: check-json + name: Check JSON files + + - id: check-yaml + name: Check YAML files + + - id: fix-byte-order-marker + name: Check file encoding (UTF-8 without BOM) + exclude: | + (?x)^( + src/base/unicodestrings.h + )$ + + - id: mixed-line-ending + name: Check line ending character (LF) + args: ["--fix=lf"] + exclude: | + (?x)^( + compile_commands.json | + src/webui/www/private/scripts/lib/.* + )$ + + - id: end-of-file-fixer + name: Check trailing newlines + exclude: | + (?x)^( + compile_commands.json | + configure | + src/webui/www/private/scripts/lib/.* + )$ + exclude_types: + - svg + - ts + + - id: trailing-whitespace + name: Check trailing whitespaces + exclude: | + (?x)^( + src/webui/www/private/scripts/lib/.* + )$ + exclude_types: + - ts From 7087565d924dc189553fe3d1e466a03f1be44cb6 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 10 Oct 2021 00:14:18 +0800 Subject: [PATCH 2/2] Fix typo --- src/gui/mainwindow.cpp | 18 +++++------ src/gui/mainwindow.h | 2 +- src/gui/optionsdialog.cpp | 34 ++++++++++---------- src/gui/optionsdialog.h | 4 +-- src/gui/optionsdialog.ui | 16 ++++----- src/gui/search/searchwidget.cpp | 6 ++-- src/webui/www/private/views/preferences.html | 10 +++--- 7 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 864a808a2..51d380aa4 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -415,7 +415,7 @@ MainWindow::MainWindow(QWidget *parent) hide(); if (!pref->minimizeToTrayNotified()) { - showNotificationBaloon(tr("qBittorrent is minimized to tray"), tr("This behavior can be changed in the settings. You won't be reminded again.")); + showNotificationBalloon(tr("qBittorrent is minimized to tray"), tr("This behavior can be changed in the settings. You won't be reminded again.")); pref->setMinimizeToTrayNotified(true); } } @@ -857,26 +857,26 @@ void MainWindow::balloonClicked() void MainWindow::addTorrentFailed(const QString &error) const { - showNotificationBaloon(tr("Error"), tr("Failed to add torrent: %1").arg(error)); + showNotificationBalloon(tr("Error"), tr("Failed to add torrent: %1").arg(error)); } // called when a torrent was added void MainWindow::torrentNew(BitTorrent::Torrent *const torrent) const { if (isTorrentAddedNotificationsEnabled()) - showNotificationBaloon(tr("Torrent added"), tr("'%1' was added.", "e.g: xxx.avi was added.").arg(torrent->name())); + showNotificationBalloon(tr("Torrent added"), tr("'%1' was added.", "e.g: xxx.avi was added.").arg(torrent->name())); } // called when a torrent has finished void MainWindow::finishedTorrent(BitTorrent::Torrent *const torrent) const { - showNotificationBaloon(tr("Download completed"), tr("'%1' has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(torrent->name())); + showNotificationBalloon(tr("Download completed"), tr("'%1' has finished downloading.", "e.g: xxx.avi has finished downloading.").arg(torrent->name())); } // Notification when disk is full void MainWindow::fullDiskError(BitTorrent::Torrent *const torrent, const QString &msg) const { - showNotificationBaloon(tr("I/O Error", "i.e: Input/Output Error") + showNotificationBalloon(tr("I/O Error", "i.e: Input/Output Error") , tr("An I/O error occurred for torrent '%1'.\n Reason: %2" , "e.g: An error occurred for torrent 'xxx.avi'.\n Reason: disk is full.").arg(torrent->name(), msg)); } @@ -993,7 +993,7 @@ void MainWindow::askRecursiveTorrentDownloadConfirmation(BitTorrent::Torrent *co void MainWindow::handleDownloadFromUrlFailure(const QString &url, const QString &reason) const { // Display a message box - showNotificationBaloon(tr("URL download error") + showNotificationBalloon(tr("URL download error") , tr("Couldn't download file at URL '%1', reason: %2.").arg(url, reason)); } @@ -1203,7 +1203,7 @@ void MainWindow::closeEvent(QCloseEvent *e) QTimer::singleShot(0, this, &QWidget::hide); if (!pref->closeToTrayNotified()) { - showNotificationBaloon(tr("qBittorrent is closed to tray"), tr("This behavior can be changed in the settings. You won't be reminded again.")); + showNotificationBalloon(tr("qBittorrent is closed to tray"), tr("This behavior can be changed in the settings. You won't be reminded again.")); pref->setCloseToTrayNotified(true); } return; @@ -1303,7 +1303,7 @@ bool MainWindow::event(QEvent *e) QTimer::singleShot(0, this, &QWidget::hide); if (!pref->minimizeToTrayNotified()) { - showNotificationBaloon(tr("qBittorrent is minimized to tray"), tr("This behavior can be changed in the settings. You won't be reminded again.")); + showNotificationBalloon(tr("qBittorrent is minimized to tray"), tr("This behavior can be changed in the settings. You won't be reminded again.")); pref->setMinimizeToTrayNotified(true); } return true; @@ -1666,7 +1666,7 @@ void MainWindow::reloadTorrentStats(const QVector &torren } } -void MainWindow::showNotificationBaloon(const QString &title, const QString &msg) const +void MainWindow::showNotificationBalloon(const QString &title, const QString &msg) const { if (!isNotificationsEnabled()) return; diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 12d56ed83..b0a962ccf 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -105,7 +105,7 @@ public: void activate(); void cleanup(); - void showNotificationBaloon(const QString &title, const QString &msg) const; + void showNotificationBalloon(const QString &title, const QString &msg) const; private slots: void showFilterContextMenu(const QPoint &); diff --git a/src/gui/optionsdialog.cpp b/src/gui/optionsdialog.cpp index ad5607dcb..ff64a6445 100644 --- a/src/gui/optionsdialog.cpp +++ b/src/gui/optionsdialog.cpp @@ -421,8 +421,8 @@ OptionsDialog::OptionsDialog(QWidget *parent) connect(m_ui->checkLimitTransportOverhead, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkLimitLocalPeerRate, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); // Bittorrent tab - connect(m_ui->checkMaxConnecs, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); - connect(m_ui->checkMaxConnecsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); + connect(m_ui->checkMaxConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); + connect(m_ui->checkMaxConnectionsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkMaxUploads, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkMaxUploadsPerTorrent, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->spinMaxConnec, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); @@ -446,7 +446,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) connect(m_ui->comboProxyType, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton); connect(m_ui->textProxyIP, &QLineEdit::textChanged, this, &ThisType::enableApplyButton); connect(m_ui->spinProxyPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); - connect(m_ui->checkProxyPeerConnecs, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); + connect(m_ui->checkProxyPeerConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->isProxyOnlyForTorrents, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); connect(m_ui->checkProxyAuth, &QGroupBox::toggled, this, &ThisType::enableApplyButton); connect(m_ui->textProxyUsername, &QLineEdit::textChanged, this, &ThisType::enableApplyButton); @@ -796,12 +796,12 @@ void OptionsDialog::saveOptions() proxyConfigManager->setProxyOnlyForTorrents(m_ui->isProxyOnlyForTorrents->isChecked()); proxyConfigManager->setProxyConfiguration(proxyConf); - session->setProxyPeerConnectionsEnabled(m_ui->checkProxyPeerConnecs->isChecked()); + session->setProxyPeerConnectionsEnabled(m_ui->checkProxyPeerConnections->isChecked()); // End Connection preferences // Bittorrent preferences - session->setMaxConnections(getMaxConnecs()); - session->setMaxConnectionsPerTorrent(getMaxConnecsPerTorrent()); + session->setMaxConnections(getMaxConnections()); + session->setMaxConnectionsPerTorrent(getMaxConnectionsPerTorrent()); session->setMaxUploads(getMaxUploads()); session->setMaxUploadsPerTorrent(getMaxUploadsPerTorrent()); session->setDHTEnabled(isDHTEnabled()); @@ -1076,28 +1076,28 @@ void OptionsDialog::loadOptions() if (intValue > 0) { // enable - m_ui->checkMaxConnecs->setChecked(true); + m_ui->checkMaxConnections->setChecked(true); m_ui->spinMaxConnec->setEnabled(true); m_ui->spinMaxConnec->setValue(intValue); } else { // disable - m_ui->checkMaxConnecs->setChecked(false); + m_ui->checkMaxConnections->setChecked(false); m_ui->spinMaxConnec->setEnabled(false); } intValue = session->maxConnectionsPerTorrent(); if (intValue > 0) { // enable - m_ui->checkMaxConnecsPerTorrent->setChecked(true); + m_ui->checkMaxConnectionsPerTorrent->setChecked(true); m_ui->spinMaxConnecPerTorrent->setEnabled(true); m_ui->spinMaxConnecPerTorrent->setValue(intValue); } else { // disable - m_ui->checkMaxConnecsPerTorrent->setChecked(false); + m_ui->checkMaxConnectionsPerTorrent->setChecked(false); m_ui->spinMaxConnecPerTorrent->setEnabled(false); } intValue = session->maxUploads(); @@ -1162,7 +1162,7 @@ void OptionsDialog::loadOptions() m_ui->textProxyUsername->setText(proxyConf.username); m_ui->textProxyPassword->setText(proxyConf.password); - m_ui->checkProxyPeerConnecs->setChecked(session->isProxyPeerConnectionsEnabled()); + m_ui->checkProxyPeerConnections->setChecked(session->isProxyPeerConnectionsEnabled()); m_ui->isProxyOnlyForTorrents->setChecked(proxyConfigManager->isProxyOnlyForTorrents()); enableProxy(m_ui->comboProxyType->currentIndex()); @@ -1382,17 +1382,17 @@ int OptionsDialog::getMaxSeedingMinutes() const } // Return max connections number -int OptionsDialog::getMaxConnecs() const +int OptionsDialog::getMaxConnections() const { - if (!m_ui->checkMaxConnecs->isChecked()) + if (!m_ui->checkMaxConnections->isChecked()) return -1; return m_ui->spinMaxConnec->value(); } -int OptionsDialog::getMaxConnecsPerTorrent() const +int OptionsDialog::getMaxConnectionsPerTorrent() const { - if (!m_ui->checkMaxConnecsPerTorrent->isChecked()) + if (!m_ui->checkMaxConnectionsPerTorrent->isChecked()) return -1; return m_ui->spinMaxConnecPerTorrent->value(); @@ -1498,7 +1498,7 @@ void OptionsDialog::enableProxy(const int index) m_ui->textProxyIP->setEnabled(true); m_ui->lblProxyPort->setEnabled(true); m_ui->spinProxyPort->setEnabled(true); - m_ui->checkProxyPeerConnecs->setEnabled(true); + m_ui->checkProxyPeerConnections->setEnabled(true); if (index >= 2) { // SOCKS5 or HTTP m_ui->checkProxyAuth->setEnabled(true); @@ -1518,7 +1518,7 @@ void OptionsDialog::enableProxy(const int index) m_ui->textProxyIP->setEnabled(false); m_ui->lblProxyPort->setEnabled(false); m_ui->spinProxyPort->setEnabled(false); - m_ui->checkProxyPeerConnecs->setEnabled(false); + m_ui->checkProxyPeerConnections->setEnabled(false); m_ui->isProxyOnlyForTorrents->setEnabled(false); m_ui->checkProxyAuth->setEnabled(false); } diff --git a/src/gui/optionsdialog.h b/src/gui/optionsdialog.h index 35a9280ce..d921bd380 100644 --- a/src/gui/optionsdialog.h +++ b/src/gui/optionsdialog.h @@ -144,8 +144,8 @@ private: int getPort() const; bool isUPnPEnabled() const; // Bittorrent options - int getMaxConnecs() const; - int getMaxConnecsPerTorrent() const; + int getMaxConnections() const; + int getMaxConnectionsPerTorrent() const; int getMaxUploads() const; int getMaxUploadsPerTorrent() const; bool isDHTEnabled() const; diff --git a/src/gui/optionsdialog.ui b/src/gui/optionsdialog.ui index a877c59b7..1ead64f3f 100644 --- a/src/gui/optionsdialog.ui +++ b/src/gui/optionsdialog.ui @@ -1525,7 +1525,7 @@ Manual: Various torrent properties (e.g. save path) must be assigned manually - + Maximum number of connections per torrent: @@ -1535,7 +1535,7 @@ Manual: Various torrent properties (e.g. save path) must be assigned manually - + Global maximum number of connections: @@ -1701,7 +1701,7 @@ Manual: Various torrent properties (e.g. save path) must be assigned manually - + false @@ -3502,9 +3502,9 @@ Use ';' to split multiple entries. Can use wildcard '*'. lineEditAutoRun scrollArea_3 randomButton - checkMaxConnecs + checkMaxConnections spinMaxConnec - checkMaxConnecsPerTorrent + checkMaxConnectionsPerTorrent spinMaxConnecPerTorrent checkMaxUploadsPerTorrent spinMaxUploadsPerTorrent @@ -3513,7 +3513,7 @@ Use ';' to split multiple entries. Can use wildcard '*'. comboProxyType textProxyIP spinProxyPort - checkProxyPeerConnecs + checkProxyPeerConnections isProxyOnlyForTorrents checkProxyAuth textProxyUsername @@ -3558,7 +3558,7 @@ Use ';' to split multiple entries. Can use wildcard '*'. - checkMaxConnecs + checkMaxConnections toggled(bool) spinMaxConnec setEnabled(bool) @@ -3574,7 +3574,7 @@ Use ';' to split multiple entries. Can use wildcard '*'. - checkMaxConnecsPerTorrent + checkMaxConnectionsPerTorrent toggled(bool) spinMaxConnecPerTorrent setEnabled(bool) diff --git a/src/gui/search/searchwidget.cpp b/src/gui/search/searchwidget.cpp index fda9e1763..5c0dcc5a1 100644 --- a/src/gui/search/searchwidget.cpp +++ b/src/gui/search/searchwidget.cpp @@ -304,7 +304,7 @@ void SearchWidget::on_searchButton_clicked() { if (!Utils::ForeignApps::pythonInfo().isValid()) { - m_mainWindow->showNotificationBaloon(tr("Search Engine"), tr("Please install Python to use the Search Engine.")); + m_mainWindow->showNotificationBalloon(tr("Search Engine"), tr("Please install Python to use the Search Engine.")); return; } @@ -373,9 +373,9 @@ void SearchWidget::tabStatusChanged(QWidget *tab) if (m_mainWindow->isNotificationsEnabled() && (m_mainWindow->currentTabWidget() != this)) { if (m_activeSearchTab->status() == SearchJobWidget::Status::Error) - m_mainWindow->showNotificationBaloon(tr("Search Engine"), tr("Search has failed")); + m_mainWindow->showNotificationBalloon(tr("Search Engine"), tr("Search has failed")); else - m_mainWindow->showNotificationBaloon(tr("Search Engine"), tr("Search has finished")); + m_mainWindow->showNotificationBalloon(tr("Search Engine"), tr("Search has finished")); } m_activeSearchTab = nullptr; diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index 380d3c11b..1b4fd1cf9 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -400,8 +400,8 @@
- - + +
QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog] @@ -1457,7 +1457,7 @@ // Speed tab const updateSchedulingEnabled = function() { - const isLimitSchedulingEnabled = $('limit_sheduling_checkbox').getProperty('checked'); + const isLimitSchedulingEnabled = $('limitSchedulingCheckbox').getProperty('checked'); $('schedule_from_hour').setProperty('disabled', !isLimitSchedulingEnabled); $('schedule_from_min').setProperty('disabled', !isLimitSchedulingEnabled); $('schedule_to_hour').setProperty('disabled', !isLimitSchedulingEnabled); @@ -1797,7 +1797,7 @@ $('limit_lan_peers_checkbox').setProperty('checked', pref.limit_lan_peers); // Scheduling - $('limit_sheduling_checkbox').setProperty('checked', pref.scheduler_enabled); + $('limitSchedulingCheckbox').setProperty('checked', pref.scheduler_enabled); $('schedule_from_hour').setProperty('value', time_padding(pref.schedule_from_hour)); $('schedule_from_min').setProperty('value', time_padding(pref.schedule_from_min)); $('schedule_to_hour').setProperty('value', time_padding(pref.schedule_to_hour)); @@ -2142,7 +2142,7 @@ settings.set('limit_lan_peers', $('limit_lan_peers_checkbox').getProperty('checked')); // Scheduler - const scheduling_enabled = $('limit_sheduling_checkbox').getProperty('checked'); + const scheduling_enabled = $('limitSchedulingCheckbox').getProperty('checked'); settings.set('scheduler_enabled', scheduling_enabled); if (scheduling_enabled) { settings.set('schedule_from_hour', $('schedule_from_hour').getProperty('value').toInt());