changeset 19619:f9a944b9e1cb gui-release

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
author Torsten <ttl@justmail.de>
date Sat, 17 Jan 2015 09:33:15 +0100
parents 6561179c6c22
children 7bb80c927af5
files libgui/src/main-window.cc libgui/src/main-window.h libgui/src/settings-dialog.cc libgui/src/settings-dialog.ui
diffstat 4 files changed, 54 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- 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 ()));
         }
 
--- 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
--- 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() );
 
--- 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 @@
       </size>
      </property>
      <property name="currentIndex">
-      <number>1</number>
+      <number>3</number>
      </property>
      <widget class="QWidget" name="tab_general">
       <property name="enabled">
@@ -1528,6 +1528,24 @@
               </layout>
              </item>
              <item>
+              <layout class="QGridLayout" name="gridLayout_15">
+               <item row="0" column="0">
+                <widget class="QCheckBox" name="terminal_focus_command">
+                 <property name="text">
+                  <string>Set focus to terminal when running a command from within another widget</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="1" column="0">
+                <widget class="QCheckBox" name="terminal_print_dbg_location">
+                 <property name="text">
+                  <string>Print debug location in terminal window in addition to the marker in the editor</string>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </item>
+             <item>
               <widget class="Line" name="line_7">
                <property name="orientation">
                 <enum>Qt::Horizontal</enum>
@@ -1561,13 +1579,6 @@
               </widget>
              </item>
              <item>
-              <widget class="QCheckBox" name="terminal_focus_command">
-               <property name="text">
-                <string>Set focus to terminal when running a command from within another widget</string>
-               </property>
-              </widget>
-             </item>
-             <item>
               <widget class="Line" name="line_6">
                <property name="orientation">
                 <enum>Qt::Horizontal</enum>