mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Reintroduce the titles in the QR codes to help differentiate them
This commit is contained in:
parent
cb144e218a
commit
30b12cac55
@ -485,13 +485,21 @@ class ServerStatus(QtWidgets.QWidget):
|
||||
"""
|
||||
Show a QR code of the onion URL.
|
||||
"""
|
||||
self.qr_code_dialog = QRCodeDialog(self.common, self.get_url())
|
||||
self.qr_code_dialog = QRCodeDialog(
|
||||
self.common,
|
||||
strings._("gui_qr_label_url_title"),
|
||||
self.get_url()
|
||||
)
|
||||
|
||||
def show_client_auth_qr_code_button_clicked(self):
|
||||
"""
|
||||
Show a QR code of the private key
|
||||
"""
|
||||
self.qr_code_dialog = QRCodeDialog(self.common, self.app.auth_string)
|
||||
self.qr_code_dialog = QRCodeDialog(
|
||||
self.common,
|
||||
strings._("gui_qr_label_auth_string_title"),
|
||||
self.app.auth_string
|
||||
)
|
||||
|
||||
def start_server(self):
|
||||
"""
|
||||
|
@ -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_()
|
||||
|
Loading…
Reference in New Issue
Block a user