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:
Changes:
BUILD.md
| ... |
... |
@@ -12,7 +12,7 @@ Then install dependencies, build a package, and install: |
|
12
|
12
|
### Debian, Ubuntu, Linux Mint, etc.
|
|
13
|
13
|
|
|
14
|
14
|
```sh
|
|
15
|
|
-sudo apt install build-essential dh-python python3-all python3-stdeb python3-pyqt5 python3-gpg python3-requests python3-socks python3-packaging gnupg2 tor
|
|
|
15
|
+sudo apt install build-essential dh-python python3-all python3-stdeb python3-pyside6.qtcore python3-gpg python3-requests python3-socks python3-packaging gnupg2 tor
|
|
16
|
16
|
./build_deb.sh
|
|
17
|
17
|
sudo dpkg -i deb_dist/torbrowser-launcher_*.deb
|
|
18
|
18
|
```
|
| ... |
... |
@@ -20,7 +20,7 @@ sudo dpkg -i deb_dist/torbrowser-launcher_*.deb |
|
20
|
20
|
### Red Hat, Fedora, CentOS, etc.
|
|
21
|
21
|
|
|
22
|
22
|
```sh
|
|
23
|
|
-sudo dnf install rpm-build python3-qt5 python3-gpg python3-requests python3-pysocks python3-packaging gnupg2 tor
|
|
|
23
|
+sudo dnf install rpm-build python3-pyside6 python3-gpg python3-requests python3-pysocks python3-packaging gnupg2 tor
|
|
24
|
24
|
./build_rpm.sh
|
|
25
|
25
|
sudo yum install dist/torbrowser-launcher-*.rpm
|
|
26
|
26
|
```
|
build_rpm.sh
| ... |
... |
@@ -6,7 +6,7 @@ VERSION=$(cat share/torbrowser-launcher/version) |
|
6
|
6
|
rm -r build dist
|
|
7
|
7
|
|
|
8
|
8
|
# build binary package
|
|
9
|
|
-python3 setup.py bdist_rpm --requires="python3-qt5, python3-gpg, python3-requests, python3-pysocks, python3-packaging, gnupg2, dbus-glib"
|
|
|
9
|
+python3 setup.py bdist_rpm --requires="python3-pyside6, python3-gpg, python3-requests, python3-pysocks, python3-packaging, gnupg2, dbus-glib"
|
|
10
|
10
|
|
|
11
|
11
|
# install it
|
|
12
|
12
|
echo ""
|
setup.py
| ... |
... |
@@ -124,7 +124,7 @@ Browser. |
|
124
|
124
|
install_requires=[
|
|
125
|
125
|
"gpg",
|
|
126
|
126
|
"packaging",
|
|
127
|
|
- "PyQt5",
|
|
|
127
|
+ "PySide6",
|
|
128
|
128
|
"requests",
|
|
129
|
129
|
"PySocks",
|
|
130
|
130
|
],
|
stdeb.cfg
|
1
|
1
|
[DEFAULT]
|
|
2
|
2
|
Package3: torbrowser-launcher
|
|
3
|
|
-Depends3: python3-pyqt5, python3-gpg, python3-requests, python3-socks, python3-packaging, gnupg2
|
|
|
3
|
+Depends3: python3-pyside6.qtcore, python3-gpg, python3-requests, python3-socks, python3-packaging, gnupg2
|
|
4
|
4
|
Build-Depends: dh-python, python3-pyqt5, python3-gpg, python3-requests, python3-socks, python3-packaging, gnupg2
|
|
5
|
5
|
Recommends: tor
|
|
6
|
|
-Suite: bionic |
|
|
6
|
+Suite: oracular |
torbrowser_launcher/__init__.py
| ... |
... |
@@ -32,7 +32,7 @@ import sys |
|
32
|
32
|
import argparse
|
|
33
|
33
|
import signal
|
|
34
|
34
|
|
|
35
|
|
-from PyQt5 import QtCore, QtWidgets
|
|
|
35
|
+from PySide6 import QtWidgets
|
|
36
|
36
|
|
|
37
|
37
|
from .common import Common, SHARE
|
|
38
|
38
|
from .settings import Settings
|
| ... |
... |
@@ -45,7 +45,6 @@ class Application(QtWidgets.QApplication): |
|
45
|
45
|
"""
|
|
46
|
46
|
|
|
47
|
47
|
def __init__(self):
|
|
48
|
|
- self.setAttribute(QtCore.Qt.AA_X11InitThreads, True)
|
|
49
|
48
|
QtWidgets.QApplication.__init__(self, sys.argv)
|
|
50
|
49
|
self.installEventFilter(self)
|
|
51
|
50
|
|
| ... |
... |
@@ -95,11 +94,11 @@ def main(): |
|
95
|
94
|
gui = Launcher(common, app, url_list)
|
|
96
|
95
|
|
|
97
|
96
|
# Center the window
|
|
98
|
|
- desktop = app.desktop()
|
|
|
97
|
+ screen_size = app.primaryScreen().size()
|
|
99
|
98
|
window_size = gui.size()
|
|
100
|
99
|
gui.move(
|
|
101
|
|
- (desktop.width() - window_size.width()) // 2,
|
|
102
|
|
- (desktop.height() - window_size.height()) // 2,
|
|
|
100
|
+ (screen_size.width() - window_size.width()) // 2,
|
|
|
101
|
+ (screen_size.height() - window_size.height()) // 2,
|
|
103
|
102
|
)
|
|
104
|
103
|
gui.show()
|
|
105
|
104
|
|
torbrowser_launcher/launcher.py
| ... |
... |
@@ -40,7 +40,7 @@ import shutil |
|
40
|
40
|
import xml.etree.ElementTree as ET
|
|
41
|
41
|
from packaging import version
|
|
42
|
42
|
|
|
43
|
|
-from PyQt5 import QtCore, QtWidgets, QtGui
|
|
|
43
|
+from PySide6 import QtCore, QtWidgets, QtGui
|
|
44
|
44
|
|
|
45
|
45
|
|
|
46
|
46
|
class TryStableException(Exception):
|
| ... |
... |
@@ -532,9 +532,9 @@ class DownloadThread(QtCore.QThread): |
|
532
|
532
|
Download a file in a separate thread.
|
|
533
|
533
|
"""
|
|
534
|
534
|
|
|
535
|
|
- progress_update = QtCore.pyqtSignal(int, int)
|
|
536
|
|
- download_complete = QtCore.pyqtSignal()
|
|
537
|
|
- download_error = QtCore.pyqtSignal(str, str)
|
|
|
535
|
+ progress_update = QtCore.Signal(int, int)
|
|
|
536
|
+ download_complete = QtCore.Signal()
|
|
|
537
|
+ download_error = QtCore.Signal(str, str)
|
|
538
|
538
|
|
|
539
|
539
|
def __init__(self, common, url, path):
|
|
540
|
540
|
super(DownloadThread, self).__init__()
|
| ... |
... |
@@ -615,8 +615,8 @@ class VerifyThread(QtCore.QThread): |
|
615
|
615
|
Verify the signature in a separate thread
|
|
616
|
616
|
"""
|
|
617
|
617
|
|
|
618
|
|
- success = QtCore.pyqtSignal()
|
|
619
|
|
- error = QtCore.pyqtSignal(str)
|
|
|
618
|
+ success = QtCore.Signal()
|
|
|
619
|
+ error = QtCore.Signal(str)
|
|
620
|
620
|
|
|
621
|
621
|
def __init__(self, common):
|
|
622
|
622
|
super(VerifyThread, self).__init__()
|
| ... |
... |
@@ -657,8 +657,8 @@ class ExtractThread(QtCore.QThread): |
|
657
|
657
|
Extract the tarball in a separate thread
|
|
658
|
658
|
"""
|
|
659
|
659
|
|
|
660
|
|
- success = QtCore.pyqtSignal()
|
|
661
|
|
- error = QtCore.pyqtSignal()
|
|
|
660
|
+ success = QtCore.Signal()
|
|
|
661
|
+ error = QtCore.Signal()
|
|
662
|
662
|
|
|
663
|
663
|
def __init__(self, common):
|
|
664
|
664
|
super(ExtractThread, self).__init__()
|
torbrowser_launcher/settings.py
| ... |
... |
@@ -30,7 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE. |
|
30
|
30
|
import subprocess
|
|
31
|
31
|
import shutil
|
|
32
|
32
|
|
|
33
|
|
-from PyQt5 import QtCore, QtWidgets, QtGui
|
|
|
33
|
+from PySide6 import QtCore, QtWidgets, QtGui
|
|
34
|
34
|
|
|
35
|
35
|
|
|
36
|
36
|
class Settings(QtWidgets.QMainWindow):
|
|