summaryrefslogtreecommitdiff
path: root/desktop/src/onionshare/widgets.py
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/src/onionshare/widgets.py')
-rw-r--r--desktop/src/onionshare/widgets.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/desktop/src/onionshare/widgets.py b/desktop/src/onionshare/widgets.py
index 1d256782..b396c43f 100644
--- a/desktop/src/onionshare/widgets.py
+++ b/desktop/src/onionshare/widgets.py
@@ -130,13 +130,17 @@ class QRCodeDialog(QtWidgets.QDialog):
A dialog showing a QR code.
"""
- def __init__(self, common, text):
+ def __init__(self, common, title, text):
super(QRCodeDialog, self).__init__()
self.common = common
self.common.log("QrCode", "__init__")
+ self.qr_label_title = QtWidgets.QLabel(self)
+ self.qr_label_title.setText(title)
+ self.qr_label_title.setAlignment(QtCore.Qt.AlignCenter)
+
self.qr_label = QtWidgets.QLabel(self)
self.qr_label.setPixmap(qrcode.make(text, image_factory=Image).pixmap())
self.qr_label.setScaledContents(True)
@@ -145,6 +149,7 @@ class QRCodeDialog(QtWidgets.QDialog):
self.setWindowTitle(strings._("gui_qr_code_dialog_title"))
self.setWindowIcon(QtGui.QIcon(GuiCommon.get_resource_path("images/logo.png")))
layout = QtWidgets.QVBoxLayout(self)
+ layout.addWidget(self.qr_label_title)
layout.addWidget(self.qr_label)
self.exec_()