Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate code from PyQt5 to PySide6 #720

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ def create_mo_files():
install_requires=[
"gpg",
"packaging",
"PyQt5",
"PySide6",
"requests",
"PySocks",
],
9 changes: 4 additions & 5 deletions torbrowser_launcher/__init__.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
import argparse
import signal

from PyQt5 import QtCore, QtWidgets
from PySide6 import QtWidgets

from .common import Common, SHARE
from .settings import Settings
@@ -44,7 +44,6 @@ class Application(QtWidgets.QApplication):
"""

def __init__(self):
self.setAttribute(QtCore.Qt.AA_X11InitThreads, True)
QtWidgets.QApplication.__init__(self, sys.argv)
self.installEventFilter(self)

@@ -87,11 +86,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()

16 changes: 8 additions & 8 deletions torbrowser_launcher/launcher.py
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@
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):
@@ -531,9 +531,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__()
@@ -614,8 +614,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__()
@@ -656,8 +656,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__()
2 changes: 1 addition & 1 deletion torbrowser_launcher/settings.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
import subprocess
import shutil

from PyQt5 import QtCore, QtWidgets, QtGui
from PySide6 import QtCore, QtWidgets, QtGui


class Settings(QtWidgets.QMainWindow):