# HG changeset patch # User Torsten # Date 1421483595 -3600 # Node ID f9a944b9e1cbcfcc3408e9cb825355e9aa5d282d # Parent 6561179c6c2243019228a905864cb38dafc23300 provide a user preference for printing the debug location in the terminal * main-window.cc (notice_settings): get new preference from settings file; (execute_command_callback): set next breakpoint quiet if desired; (execute_debug_callback): set next breakpoint quiet only if desired * main-window.h: new class attribute storing the preference * settings-dialog.cc (constructor): get new preference from settings file and initialize the new checkbox, put terminal related settings together; (write_changed_settings): write state of checkbox into settings file; * settings-dialog.ui: new checkbox for printing debug location in terminal tab diff -r 6561179c6c22 -r f9a944b9e1cb libgui/src/main-window.cc --- a/libgui/src/main-window.cc Tue Jan 13 21:46:18 2015 +0100 +++ b/libgui/src/main-window.cc Sat Jan 17 09:33:15 2015 +0100 @@ -750,6 +750,9 @@ configure_shortcuts (); set_global_shortcuts (command_window_has_focus ()); + _suppress_dbg_location = + ! settings->value ("terminal/print_debug_location", false).toBool (); + resource_manager::update_network_settings (); } @@ -2030,6 +2033,7 @@ command_editor::redisplay (); // We are executing inside the command editor event loop. Force // the current line to be returned for processing. + Fdb_next_breakpoint_quiet (ovl (_suppress_dbg_location)); command_editor::accept_line (); } @@ -2086,19 +2090,19 @@ if (debug == "step") { - Fdb_next_breakpoint_quiet (); + Fdb_next_breakpoint_quiet (ovl (_suppress_dbg_location)); Fdbstep (); } else if (debug == "cont") { - Fdb_next_breakpoint_quiet (); + Fdb_next_breakpoint_quiet (ovl (_suppress_dbg_location)); Fdbcont (); } else if (debug == "quit") Fdbquit (); else { - Fdb_next_breakpoint_quiet (); + Fdb_next_breakpoint_quiet (ovl (_suppress_dbg_location)); Fdbstep (ovl (debug.toStdString ())); } diff -r 6561179c6c22 -r f9a944b9e1cb libgui/src/main-window.h --- a/libgui/src/main-window.h Tue Jan 13 21:46:18 2015 +0100 +++ b/libgui/src/main-window.h Sat Jan 17 09:33:15 2015 +0100 @@ -404,6 +404,7 @@ QMutex _dbg_queue_mutex; bool _prevent_readline_conflicts; + bool _suppress_dbg_location; }; class news_reader : public QObject diff -r 6561179c6c22 -r f9a944b9e1cb libgui/src/settings-dialog.cc --- a/libgui/src/settings-dialog.cc Tue Jan 13 21:46:18 2015 +0100 +++ b/libgui/src/settings-dialog.cc Sat Jan 17 09:33:15 2015 +0100 @@ -256,6 +256,31 @@ settings->value ("terminal/fontSize", 10).toInt ()); ui->terminal_history_buffer->setValue ( settings->value ("terminal/history_buffer",1000).toInt ()); + ui->terminal_cursorBlinking->setChecked ( + settings->value ("terminal/cursorBlinking",true).toBool ()); + ui->terminal_cursorUseForegroundColor->setChecked ( + settings->value ("terminal/cursorUseForegroundColor",true).toBool ()); + ui->terminal_focus_command->setChecked ( + settings->value ("terminal/focus_after_command",false).toBool ()); + ui->terminal_print_dbg_location->setChecked ( + settings->value ("terminal/print_debug_location",false).toBool ()); + + QString cursorType + = settings->value ("terminal/cursorType", "ibeam").toString (); + + QStringList items; + items << QString ("0") << QString ("1") << QString ("2"); + ui->terminal_cursorType->addItems (items); + ui->terminal_cursorType->setItemText (0, tr ("IBeam Cursor")); + ui->terminal_cursorType->setItemText (1, tr ("Block Cursor")); + ui->terminal_cursorType->setItemText (2, tr ("Underline Cursor")); + + if (cursorType == "ibeam") + ui->terminal_cursorType->setCurrentIndex (0); + else if (cursorType == "block") + ui->terminal_cursorType->setCurrentIndex (1); + else if (cursorType == "underline") + ui->terminal_cursorType->setCurrentIndex (2); // file browser ui->showFileSize->setChecked ( @@ -284,29 +309,6 @@ ui->useProxyServer->setChecked ( settings->value ("useProxyServer", false).toBool ()); ui->proxyHostName->setText (settings->value ("proxyHostName").toString ()); - ui->terminal_cursorBlinking->setChecked ( - settings->value ("terminal/cursorBlinking",true).toBool ()); - ui->terminal_cursorUseForegroundColor->setChecked ( - settings->value ("terminal/cursorUseForegroundColor",true).toBool ()); - ui->terminal_focus_command->setChecked ( - settings->value ("terminal/focus_after_command",false).toBool ()); - - QString cursorType - = settings->value ("terminal/cursorType", "ibeam").toString (); - - QStringList items; - items << QString ("0") << QString ("1") << QString ("2"); - ui->terminal_cursorType->addItems (items); - ui->terminal_cursorType->setItemText (0, tr ("IBeam Cursor")); - ui->terminal_cursorType->setItemText (1, tr ("Block Cursor")); - ui->terminal_cursorType->setItemText (2, tr ("Underline Cursor")); - - if (cursorType == "ibeam") - ui->terminal_cursorType->setCurrentIndex (0); - else if (cursorType == "block") - ui->terminal_cursorType->setCurrentIndex (1); - else if (cursorType == "underline") - ui->terminal_cursorType->setCurrentIndex (2); int currentIndex = 0; QString proxyTypeString = settings->value ("proxyType").toString (); @@ -748,6 +750,8 @@ ui->terminal_cursorUseForegroundColor->isChecked ()); settings->setValue ("terminal/focus_after_command", ui->terminal_focus_command->isChecked ()); + settings->setValue ("terminal/print_debug_location", + ui->terminal_print_dbg_location->isChecked ()); settings->setValue ("terminal/history_buffer", ui->terminal_history_buffer->value() ); diff -r 6561179c6c22 -r f9a944b9e1cb libgui/src/settings-dialog.ui --- a/libgui/src/settings-dialog.ui Tue Jan 13 21:46:18 2015 +0100 +++ b/libgui/src/settings-dialog.ui Sat Jan 17 09:33:15 2015 +0100 @@ -32,7 +32,7 @@ - 1 + 3 @@ -1528,6 +1528,24 @@ + + + + + Set focus to terminal when running a command from within another widget + + + + + + + Print debug location in terminal window in addition to the marker in the editor + + + + + + Qt::Horizontal @@ -1561,13 +1579,6 @@ - - - Set focus to terminal when running a command from within another widget - - - - Qt::Horizontal