fix buttons in dialog
This commit is contained in:
16
bigtext.py
16
bigtext.py
@@ -332,17 +332,19 @@ class InnerBigText(QWidget):
|
|||||||
_("data selection"),
|
_("data selection"),
|
||||||
_(
|
_(
|
||||||
"You have selected <b>{0}</b> of data.").format(bytes_human_readable))
|
"You have selected <b>{0}</b> of data.").format(bytes_human_readable))
|
||||||
you_sure.setStandardButtons(QMessageBox.StandardButton.Cancel)
|
you_sure.setStandardButtons(QMessageBox.Cancel)
|
||||||
you_sure.addButton(QPushButton(_("Copy {0} to Clipboard").format(bytes_human_readable)),
|
copy_btn = you_sure.addButton(_("Copy {0} to Clipboard").format(bytes_human_readable),
|
||||||
QMessageBox.ButtonRole.AcceptRole)
|
QMessageBox.ActionRole)
|
||||||
you_sure.addButton(QPushButton(_("Write to File")), QMessageBox.ActionRole)
|
write_btn = you_sure.addButton(_("Write to File"), QMessageBox.ActionRole)
|
||||||
you_sure.setDefaultButton(QMessageBox.StandardButton.Cancel)
|
you_sure.setDefaultButton(QMessageBox.StandardButton.Cancel)
|
||||||
result = you_sure.exec()
|
you_sure.exec()
|
||||||
if result == 1: # second custom button has the number 1
|
if you_sure.clickedButton() == write_btn:
|
||||||
self._copy_selection_to_file()
|
self._copy_selection_to_file()
|
||||||
|
return
|
||||||
|
|
||||||
if result == QMessageBox.StandardButton.Cancel:
|
if you_sure.clickedButton() != copy_btn:
|
||||||
# abort
|
# abort
|
||||||
|
print("abort")
|
||||||
return
|
return
|
||||||
|
|
||||||
selected_text = self.model.read_range(start, end)
|
selected_text = self.model.read_range(start, end)
|
||||||
|
|||||||
Reference in New Issue
Block a user