From e084c88a21a57a41d1e157b9c3d54b76001fe9ae Mon Sep 17 00:00:00 2001 From: Marko Mecina <marko.mecina@univie.ac.at> Date: Wed, 31 Jan 2024 18:07:26 +0100 Subject: [PATCH] add confirmation dialog on run_all_lines --- Ccs/editor.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Ccs/editor.py b/Ccs/editor.py index f923b5c..85d06a0 100644 --- a/Ccs/editor.py +++ b/Ccs/editor.py @@ -29,6 +29,8 @@ cfg = confignator.get_config() pixmap_folder = cfg.get('ccs-paths', 'pixmap') action_folder = cfg.get('ccs-paths', 'actions') +VERIFY_EXEC_NO_BP = True + def group_scripts(fname, scrptdict): """ @@ -1691,6 +1693,18 @@ class CcsEditor(Gtk.Window): def on_button_run_all_nobreak(self, widget): + if VERIFY_EXEC_NO_BP: + confirm_run_all = Gtk.MessageDialog(title='Confirm execution') + confirm_run_all.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OK, Gtk.ResponseType.OK) + confirm_run_all.set_markup('\nExecute ignoring breakpoints?') + confirm = confirm_run_all.run() + + if confirm != Gtk.ResponseType.OK: + confirm_run_all.destroy() + return + + confirm_run_all.destroy() + view = self._get_active_view() textbuffer = view.get_buffer() -- GitLab