Skip to content

Commit 5ab5dd9

Browse files
authored
Merge pull request #294 from 4ntsy/avoid_back
fix: Avoid back when the script is running
2 parents 29a1eca + 340e5b1 commit 5ab5dd9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

p3/app/term_view.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,11 @@ def _run_next_script(self):
135135
self.vbox_main.button_run.set_image(Gtk.Image.new_from_icon_name("emblem-ok-symbolic", Gtk.IconSize.BUTTON))
136136
self.vbox_main.progress_bar.set_text(done_text)
137137
self.vbox_main.button_run.connect("clicked", self.on_done_clicked)
138-
138+
self.parent._script_running = False
139139
self.vbox_main.button_run.set_sensitive(True)
140140
return
141141

142+
self.parent._script_running = True
142143
current_script = self.script_queue.pop(0)
143144
self.vbox_main._update_header_labels(current_script)
144145

p3/app/window.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def __init__(self, application, translations, *args, **kwargs):
130130
# Initialize drag-and-drop but don't enable it by default
131131
self._setup_drag_and_drop()
132132

133+
self._script_running = False
134+
133135
GLib.idle_add(self._check_updates)
134136

135137
def _check_updates(self):
@@ -1550,7 +1552,7 @@ def on_back_button_clicked(self, widget):
15501552
return
15511553

15521554
# Check if a script is currently running
1553-
if self.main_stack.get_visible_child_name() == "running_scripts":
1555+
if self._script_running:
15541556
# Show warning dialog before cancelling the running script
15551557
if not self._show_cancel_script_warning_dialog():
15561558
return # User cancelled the operation

0 commit comments

Comments
 (0)