]> git.lizzy.rs Git - torbrowser-launcher.git/commitdiff
Add icons to settings buttons
authorMicah Lee <micah@micahflee.com>
Thu, 22 Mar 2018 18:22:22 +0000 (11:22 -0700)
committerMicah Lee <micah@micahflee.com>
Thu, 22 Mar 2018 18:22:22 +0000 (11:22 -0700)
torbrowser_launcher/__init__.py
torbrowser_launcher/common.py
torbrowser_launcher/launcher.py
torbrowser_launcher/settings.py

index ccd4e33df33ad6cfb7f6550ce91eaf1226b7e4a0..c22b3367b648b922c4f359d446d9d3af3bdfcc95 100644 (file)
@@ -34,7 +34,7 @@ from PyQt5 import QtCore, QtWidgets
 
 from .common import Common, SHARE
 from .settings import Settings
-from .launcher import Launcher
+#from .launcher import Launcher
 
 
 class Application(QtWidgets.QApplication):
@@ -71,11 +71,11 @@ def main():
 
     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_())
 
index 6039d3f7e174f2d706831880f0c853da1fe68653..5642f4d3df211503f8f18f20f24bab71d6e0013d 100644 (file)
@@ -52,7 +52,7 @@ gettext.install('torbrowser-launcher')
 #  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):
index f289363c64928f41d3662b1943a4e0f926d7e621..b51d23d3fbcec9fe4b059e72e9c07f86223e868e 100644 (file)
@@ -77,8 +77,10 @@ class DownloadErrorException(Exception):
 
 
 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
 
index 70c8651a63e330ef7046446b2201fa08d2bd67ea..6c222c645bd53e02e3e36d42efcf6b8c2371b5f9 100644 (file)
@@ -35,10 +35,11 @@ class Settings(QtWidgets.QMainWindow):
     """
     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"))
@@ -92,13 +93,13 @@ class Settings(QtWidgets.QMainWindow):
 
         # 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()
@@ -136,13 +137,13 @@ class Settings(QtWidgets.QMainWindow):
 
         # 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()