mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Localize quit confirm button text (#264)
This commit is contained in:
parent
cb3d39fb4f
commit
229603eb7d
@ -46,5 +46,7 @@
|
|||||||
"gui_download_progress_starting": "{0:s}, %p% (Computing ETA)",
|
"gui_download_progress_starting": "{0:s}, %p% (Computing ETA)",
|
||||||
"gui_download_progress_eta": "{0:s}, ETA: {1:s}, %p%",
|
"gui_download_progress_eta": "{0:s}, ETA: {1:s}, %p%",
|
||||||
"version_string": "Onionshare {0:s} | https://onionshare.org/",
|
"version_string": "Onionshare {0:s} | https://onionshare.org/",
|
||||||
"gui_quit_warning": "Are you sure you want to quit?\nThe URL you are sharing won't exist anymore."
|
"gui_quit_warning": "Are you sure you want to quit?\nThe URL you are sharing won't exist anymore.",
|
||||||
|
"gui_quit_warning_quit": "Quit",
|
||||||
|
"gui_quit_warning_dont_quit": "Don't Quit"
|
||||||
}
|
}
|
||||||
|
@ -246,13 +246,12 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||||||
def closeEvent(self, e):
|
def closeEvent(self, e):
|
||||||
if self.server_status.status != self.server_status.STATUS_STOPPED:
|
if self.server_status.status != self.server_status.STATUS_STOPPED:
|
||||||
dialog = QtWidgets.QMessageBox()
|
dialog = QtWidgets.QMessageBox()
|
||||||
|
dialog.setWindowTitle("OnionShare")
|
||||||
dialog.setText(strings._('gui_quit_warning', True))
|
dialog.setText(strings._('gui_quit_warning', True))
|
||||||
quit_button = dialog.addButton("Quit", QtWidgets.QMessageBox.YesRole)
|
quit_button = dialog.addButton(strings._('gui_quit_warning_quit', True), QtWidgets.QMessageBox.YesRole)
|
||||||
dont_quit_button = dialog.addButton("Don't Quit", QtWidgets.QMessageBox.NoRole)
|
dont_quit_button = dialog.addButton(strings._('gui_quit_warning_dont_quit', True), QtWidgets.QMessageBox.NoRole)
|
||||||
#dialog.setStandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
|
|
||||||
dialog.setDefaultButton(dont_quit_button)
|
dialog.setDefaultButton(dont_quit_button)
|
||||||
reply = dialog.exec_()
|
reply = dialog.exec_()
|
||||||
print("reply: {}".format(reply))
|
|
||||||
|
|
||||||
# Quit
|
# Quit
|
||||||
if reply == 0:
|
if reply == 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user