from .common import Common, SHARE
from .settings import Settings
-from .launcher import Launcher
+#from .launcher import Launcher
class Application(QtWidgets.QApplication):
if settings:
# Settings mode
- gui = Settings(common)
+ gui = Settings(common, app)
else:
# Launcher mode
- gui = Launcher(common, url_list)
+ gui = Launcher(common, app, url_list)
sys.exit(app.exec_())
# 2. The second must be an integer between [0, 15], inclusive
# 3. The third must be an uppercased hex-encoded 160-bit fingerprint
gnupg_import_ok_pattern = re.compile(
- "(\[GNUPG\:\]) (IMPORT_OK) ([0-9]|[1]?[0-5]) ([A-F0-9]{40})")
+ b"(\[GNUPG\:\]) (IMPORT_OK) ([0-9]|[1]?[0-5]) ([A-F0-9]{40})")
class Common(object):
class Launcher:
- def __init__(self, common, url_list):
+ def __init__(self, common, app, url_list):
self.common = common
+ self.app = app
+
self.url_list = url_list
self.force_redownload = False
"""
Settings window.
"""
- def __init__(self, common):
+ def __init__(self, common, app):
super(Settings, self).__init__()
self.common = common
+ self.app = app
# Set up the window
self.setWindowTitle(_("Tor Browser Launcher Settings"))
# Install button
install_button = QtWidgets.QPushButton(_("Install Tor Browser"))
+ install_button.setIcon(self.style().standardIcon(QtWidgets.QStyle.SP_DialogApplyButton))
install_button.clicked.connect(self.install)
- # TODO: add apply icon
# Reinstall buttons
reinstall_button = QtWidgets.QPushButton(_("Reinstall Tor Browser"))
+ reinstall_button.setIcon(self.style().standardIcon(QtWidgets.QStyle.SP_DialogApplyButton))
reinstall_button.clicked.connect(self.reinstall)
- # TODO: add apply icon
if(self.common.settings['installed']):
install_button.hide()
# Save & Exit button
self.save_exit_button = QtWidgets.QPushButton(_("Save & Exit"))
+ self.save_exit_button.setIcon(self.style().standardIcon(QtWidgets.QStyle.SP_DialogApplyButton))
self.save_exit_button.clicked.connect(self.save_exit)
- # TODO: add apply icon
# Cancel button
self.cancel_button = QtWidgets.QPushButton(_("Cancel"))
+ self.cancel_button.setIcon(self.style().standardIcon(QtWidgets.QStyle.SP_DialogCancelButton))
self.cancel_button.clicked.connect(self.close)
- # TODO: add cancel icon
# Buttons layout
buttons_layout = QtWidgets.QHBoxLayout()