[nemiver/monitor-variable: 4/6] Better control of when to allow variable monitoring



commit 3f30481be1ad97d8f1a2baeb4c6ce4da96b39a5d
Author: Dodji Seketeli <dodji seketeli org>
Date:   Mon May 28 21:56:47 2012 +0200

    Better control of when to allow variable monitoring
    
    	* src/persp/dbgperspective/nmv-var-inspector-dialog.cc
    	(VarInspectorDialog::Priv::on_var_name_changed_signal): Do not
    	enable/disable the "add to monitor" button based on the presence
    	of an expression/name in the "variable name" entry field.
    	(VarInspectorDialog::Priv::on_variable_inspected): Enable the "add
    	to monitor" button only when the expression has been inspected.
    	(VarInspectorDialog::Priv::on_variable_inspector_cleared): Disable
    	the "add to monitor" button when the inspector has been cleared.

 .../dbgperspective/nmv-var-inspector-dialog.cc     |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/persp/dbgperspective/nmv-var-inspector-dialog.cc b/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
index b4553f6..e241685 100644
--- a/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
+++ b/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
@@ -316,13 +316,10 @@ public:
         THROW_IF_FAIL (inspect_button);
 
         UString var_name = var_name_entry->get_entry ()->get_text ();
-        if (var_name == "") {
+        if (var_name == "")
             inspect_button->set_sensitive (false);
-            add_to_monitor_button->set_sensitive (false);
-        } else {
+        else
             inspect_button->set_sensitive (true);
-            add_to_monitor_button->set_sensitive (true);
-        }
 
         // this handler is called when any text is changed in the entry or when
         // an item is selected from the combobox.  We don't want to inspect any
@@ -340,12 +337,14 @@ public:
     void
     on_variable_inspected (const IDebugger::VariableSafePtr)
     {
+        add_to_monitor_button->set_sensitive (true);
     }
 
     /// Handler called when the variable inspector is cleared.
     void
     on_variable_inspector_cleared ()
     {
+        add_to_monitor_button->set_sensitive (false);
     }
 
     void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]