Skip to content

Commit 9a559c8

Browse files
macevhiczMHendricks
authored andcommitted
Display tab name when confirming closing it.
1 parent 5eaba56 commit 9a559c8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

preditor/gui/group_tab_widget/grouped_tab_widget.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,18 @@ def close_tab(self, index):
5050
self, 'Tab can not be closed.', msg, QMessageBox.StandardButton.Ok
5151
)
5252
return
53+
54+
workbox = self.widget(index)
55+
name = workbox.__workbox_name__()
56+
msg = (
57+
f"Would you like to donate the contents of tab\n{name}\nto the "
58+
"/dev/null fund for wayward code?"
59+
)
60+
5361
ret = QMessageBox.question(
5462
self,
5563
'Donate to the cause?',
56-
"Would you like to donate this tabs contents to the /dev/null fund "
57-
"for wayward code?",
64+
msg,
5865
QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.Cancel,
5966
)
6067
if ret == QMessageBox.StandardButton.Yes:

0 commit comments

Comments
 (0)