# HG changeset patch # User Torsten Lilge # Date 1552243886 -3600 # Node ID ce972086bfd6cd48f33e5e02e3e450494dea111f # Parent 69722280102ceeb61f3db97df446ad83ac5f20cc save & run action in editor now also continues in debug mode (bug #44730) * file-editor.cc (handle_enter_debug_mode): run action stays enabled but the tooltip is updated, prevent ambigous shortcuts; (handle_exit_debug_mode): back to normal tooltip; (request_run_file): Check for debug maode and emit new signal for requesting dbcont if it is; (construct): new menu name containing continue, connect new signal to the slot of the dbcont action in main_window * file-editor.h: new signal request_dbcont_signal diff -r 69722280102c -r ce972086bfd6 libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Sun Mar 10 18:25:25 2019 +0100 +++ b/libgui/src/m-editor/file-editor.cc Sun Mar 10 19:51:26 2019 +0100 @@ -149,14 +149,20 @@ void file_editor::handle_enter_debug_mode (void) { - m_run_action->setEnabled (false); - m_run_action->setShortcut (QKeySequence ()); + QSettings *settings = resource_manager::get_settings (); + QString sc_run = settings->value ("shortcuts/editor_run:run_file").toString (); + QString sc_cont = settings->value ("shortcuts/main_debug:continue").toString (); + + if (sc_run == sc_cont) + m_run_action->setShortcut (QKeySequence ()); // prevent ambigous shortcuts + + m_run_action->setToolTip (tr ("Continue")); // update tool tip } void file_editor::handle_exit_debug_mode (void) { - m_run_action->setEnabled (true); shortcut_manager::set_shortcut (m_run_action, "editor_run:run_file"); + m_run_action->setToolTip (tr ("Save File and Run")); // update tool tip } void file_editor::check_actions (void) @@ -541,7 +547,10 @@ void file_editor::request_run_file (bool) { - emit fetab_run_file (m_tab_widget->currentWidget ()); + if ((Fisdebugmode ())(0).is_true ()) + emit request_dbcont_signal (); + else + emit fetab_run_file (m_tab_widget->currentWidget ()); } void file_editor::request_step_into_file () @@ -2025,7 +2034,7 @@ m_run_action = add_action (_run_menu, resource_manager::icon ("system-run"), - tr ("Save File and Run"), + tr ("Save File and Run / Continue"), SLOT (request_run_file (bool))); m_run_selection_action @@ -2120,6 +2129,9 @@ main_win (), SLOT (process_settings_dialog_request (const QString&))); + connect (this, SIGNAL (request_dbcont_signal (void)), + main_win (), SLOT (debug_continue (void))); + connect (m_mru_file_menu, SIGNAL (triggered (QAction *)), this, SLOT (request_mru_open_file (QAction *))); diff -r 69722280102c -r ce972086bfd6 libgui/src/m-editor/file-editor.h --- a/libgui/src/m-editor/file-editor.h Sun Mar 10 18:25:25 2019 +0100 +++ b/libgui/src/m-editor/file-editor.h Sun Mar 10 19:51:26 2019 +0100 @@ -177,6 +177,7 @@ void file_loaded_signal (void); void editor_tabs_changed_signal (bool); + void request_dbcont_signal (void); public slots: