Localize quit confirm button text (#264)

This commit is contained in:
Micah Lee 2016-04-11 10:08:24 -07:00
parent cb3d39fb4f
commit 229603eb7d
2 changed files with 6 additions and 5 deletions

View File

@ -46,5 +46,7 @@
"gui_download_progress_starting": "{0:s}, %p% (Computing ETA)",
"gui_download_progress_eta": "{0:s}, ETA: {1:s}, %p%",
"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"
}

View File

@ -246,13 +246,12 @@ class OnionShareGui(QtWidgets.QMainWindow):
def closeEvent(self, e):
if self.server_status.status != self.server_status.STATUS_STOPPED:
dialog = QtWidgets.QMessageBox()
dialog.setWindowTitle("OnionShare")
dialog.setText(strings._('gui_quit_warning', True))
quit_button = dialog.addButton("Quit", QtWidgets.QMessageBox.YesRole)
dont_quit_button = dialog.addButton("Don't Quit", QtWidgets.QMessageBox.NoRole)
#dialog.setStandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No)
quit_button = dialog.addButton(strings._('gui_quit_warning_quit', True), QtWidgets.QMessageBox.YesRole)
dont_quit_button = dialog.addButton(strings._('gui_quit_warning_dont_quit', True), QtWidgets.QMessageBox.NoRole)
dialog.setDefaultButton(dont_quit_button)
reply = dialog.exec_()
print("reply: {}".format(reply))
# Quit
if reply == 0: