
asciiwolf pushed to branch main at The Tor Project / Applications / torbrowser-launcher Commits: 35b3fbb2 by zefr0x at 2024-11-01T15:59:58+00:00 Migrate code from PyQt5 to PySide6 - - - - - b0962da4 by BTD Master at 2024-11-01T16:07:43+00:00 Install PySide6 in builds and documentation - - - - - e1497bc6 by asciiwolf at 2025-07-10T19:06:48+00:00 Merge branch 'migrate_to_qt6' into 'main' Migrate to Qt6 Closes #2 See merge request tpo/applications/torbrowser-launcher!19 - - - - - 7 changed files: - BUILD.md - build_rpm.sh - setup.py - stdeb.cfg - torbrowser_launcher/__init__.py - torbrowser_launcher/launcher.py - torbrowser_launcher/settings.py Changes: ===================================== BUILD.md ===================================== @@ -12,7 +12,7 @@ Then install dependencies, build a package, and install: ### Debian, Ubuntu, Linux Mint, etc. ```sh -sudo apt install build-essential dh-python python3-all python3-stdeb python3-pyqt5 python3-gpg python3-requests python3-socks python3-packaging gnupg2 tor +sudo apt install build-essential dh-python python3-all python3-stdeb python3-pyside6.qtcore python3-gpg python3-requests python3-socks python3-packaging gnupg2 tor ./build_deb.sh sudo dpkg -i deb_dist/torbrowser-launcher_*.deb ``` @@ -20,7 +20,7 @@ sudo dpkg -i deb_dist/torbrowser-launcher_*.deb ### Red Hat, Fedora, CentOS, etc. ```sh -sudo dnf install rpm-build python3-qt5 python3-gpg python3-requests python3-pysocks python3-packaging gnupg2 tor +sudo dnf install rpm-build python3-pyside6 python3-gpg python3-requests python3-pysocks python3-packaging gnupg2 tor ./build_rpm.sh sudo yum install dist/torbrowser-launcher-*.rpm ``` ===================================== build_rpm.sh ===================================== @@ -6,7 +6,7 @@ VERSION=$(cat share/torbrowser-launcher/version) rm -r build dist # build binary package -python3 setup.py bdist_rpm --requires="python3-qt5, python3-gpg, python3-requests, python3-pysocks, python3-packaging, gnupg2, dbus-glib" +python3 setup.py bdist_rpm --requires="python3-pyside6, python3-gpg, python3-requests, python3-pysocks, python3-packaging, gnupg2, dbus-glib" # install it echo "" ===================================== setup.py ===================================== @@ -124,7 +124,7 @@ Browser. install_requires=[ "gpg", "packaging", - "PyQt5", + "PySide6", "requests", "PySocks", ], ===================================== stdeb.cfg ===================================== @@ -1,6 +1,6 @@ [DEFAULT] Package3: torbrowser-launcher -Depends3: python3-pyqt5, python3-gpg, python3-requests, python3-socks, python3-packaging, gnupg2 +Depends3: python3-pyside6.qtcore, python3-gpg, python3-requests, python3-socks, python3-packaging, gnupg2 Build-Depends: dh-python, python3-pyqt5, python3-gpg, python3-requests, python3-socks, python3-packaging, gnupg2 Recommends: tor -Suite: bionic +Suite: oracular ===================================== torbrowser_launcher/__init__.py ===================================== @@ -32,7 +32,7 @@ import sys import argparse import signal -from PyQt5 import QtCore, QtWidgets +from PySide6 import QtWidgets from .common import Common, SHARE from .settings import Settings @@ -45,7 +45,6 @@ class Application(QtWidgets.QApplication): """ def __init__(self): - self.setAttribute(QtCore.Qt.AA_X11InitThreads, True) QtWidgets.QApplication.__init__(self, sys.argv) self.installEventFilter(self) @@ -95,11 +94,11 @@ def main(): gui = Launcher(common, app, url_list) # Center the window - desktop = app.desktop() + screen_size = app.primaryScreen().size() window_size = gui.size() gui.move( - (desktop.width() - window_size.width()) // 2, - (desktop.height() - window_size.height()) // 2, + (screen_size.width() - window_size.width()) // 2, + (screen_size.height() - window_size.height()) // 2, ) gui.show() ===================================== torbrowser_launcher/launcher.py ===================================== @@ -40,7 +40,7 @@ import shutil import xml.etree.ElementTree as ET from packaging import version -from PyQt5 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui class TryStableException(Exception): @@ -532,9 +532,9 @@ class DownloadThread(QtCore.QThread): Download a file in a separate thread. """ - progress_update = QtCore.pyqtSignal(int, int) - download_complete = QtCore.pyqtSignal() - download_error = QtCore.pyqtSignal(str, str) + progress_update = QtCore.Signal(int, int) + download_complete = QtCore.Signal() + download_error = QtCore.Signal(str, str) def __init__(self, common, url, path): super(DownloadThread, self).__init__() @@ -615,8 +615,8 @@ class VerifyThread(QtCore.QThread): Verify the signature in a separate thread """ - success = QtCore.pyqtSignal() - error = QtCore.pyqtSignal(str) + success = QtCore.Signal() + error = QtCore.Signal(str) def __init__(self, common): super(VerifyThread, self).__init__() @@ -657,8 +657,8 @@ class ExtractThread(QtCore.QThread): Extract the tarball in a separate thread """ - success = QtCore.pyqtSignal() - error = QtCore.pyqtSignal() + success = QtCore.Signal() + error = QtCore.Signal() def __init__(self, common): super(ExtractThread, self).__init__() ===================================== torbrowser_launcher/settings.py ===================================== @@ -30,7 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE. import subprocess import shutil -from PyQt5 import QtCore, QtWidgets, QtGui +from PySide6 import QtCore, QtWidgets, QtGui class Settings(QtWidgets.QMainWindow): View it on GitLab: https://gitlab.torproject.org/tpo/applications/torbrowser-launcher/-/compare... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/torbrowser-launcher/-/compare... You're receiving this email because of your account on gitlab.torproject.org.
participants (1)
-
asciiwolf (@asciiwolf)