[nemiver/monitor-variable: 5/6] Add functionality control to VarInspectorDialog
- From: Dodji Seketeli <dodji src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nemiver/monitor-variable: 5/6] Add functionality control to VarInspectorDialog
- Date: Mon, 28 May 2012 21:58:34 +0000 (UTC)
commit c9dfe5c126d520e1fbe84fca2644658bf7dcb688
Author: Dodji Seketeli <dodji seketeli org>
Date: Mon May 28 14:20:28 2012 +0200
Add functionality control to VarInspectorDialog
* src/persp/dbgperspective/nmv-var-inspector-dialog.h
(VarInspectorDialog::FunctionalityFlags): New enum.
(VarInspectorDialog::functionality_mask): New accessors.
* src/persp/dbgperspective/nmv-var-inspector-dialog.cc
(VarInspectorDialog::Priv::fun_mask): New member.
(VarInspectorDialog::Priv::Priv): Initialize it.
(VarInspectorDialog::Priv::functionality_mask): New accessors.
(VarInspectorDialog::Priv::on_var_name_changed_signal): Inspect
button is now controlled by FUNCTIONALITY_EXPR_INSPECTOR flag.
(VarInspectorDialog::Priv::on_variable_inspected): Add to monitor
button is now controlled by FUNCTIONALITY_EXPR_MONITOR_PICKER
flag.
(VarInspectorDialog::functionality_mask): New accessors.
.../dbgperspective/nmv-var-inspector-dialog.cc | 47 ++++++++++++++++++-
.../dbgperspective/nmv-var-inspector-dialog.h | 28 +++++++++++-
2 files changed, 70 insertions(+), 5 deletions(-)
---
diff --git a/src/persp/dbgperspective/nmv-var-inspector-dialog.cc b/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
index e241685..9ccb59c 100644
--- a/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
+++ b/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
@@ -58,6 +58,8 @@ class VarInspectorDialog::Priv {
IDebugger &debugger;
IPerspective &perspective;
sigc::signal<void, IDebugger::VariableSafePtr> expr_monitoring_requested;
+ // Functionality mask
+ unsigned fun_mask;
Priv ();
public:
@@ -71,7 +73,8 @@ public:
dialog (a_dialog),
gtkbuilder (a_gtkbuilder),
debugger (a_debugger),
- perspective (a_perspective)
+ perspective (a_perspective),
+ fun_mask (FUNCTIONALITY_ALL)
{
LOG_FUNCTION_SCOPE_NORMAL_DD;
build_dialog ();
@@ -300,6 +303,22 @@ public:
/*a_allow_dups=*/false);
}
+ /// Set the functionality mask. It's a mask made of the bits
+ /// addressed by VarInspector::FunctionalityFlags.
+ void
+ functionality_mask (int a_mask)
+ {
+ fun_mask = a_mask;
+ }
+
+ /// Return the functionality mask. It's a mask made of the bits
+ /// addressed by VarInspector::FunctionalityFlags.
+ unsigned
+ functionality_mask ()
+ {
+ return fun_mask;
+ }
+
//************************
//<signal handlers>
//*************************
@@ -318,7 +337,8 @@ public:
UString var_name = var_name_entry->get_entry ()->get_text ();
if (var_name == "")
inspect_button->set_sensitive (false);
- else
+ else if (functionality_mask ()
+ & FUNCTIONALITY_EXPR_INSPECTOR)
inspect_button->set_sensitive (true);
// this handler is called when any text is changed in the entry or when
@@ -337,7 +357,8 @@ public:
void
on_variable_inspected (const IDebugger::VariableSafePtr)
{
- add_to_monitor_button->set_sensitive (true);
+ if ((functionality_mask () & FUNCTIONALITY_EXPR_MONITOR_PICKER))
+ add_to_monitor_button->set_sensitive (true);
}
/// Handler called when the variable inspector is cleared.
@@ -467,4 +488,24 @@ VarInspectorDialog::expr_monitoring_requested ()
return m_priv->expr_monitoring_requested;
}
+/// Set the functionality mask. It's a mask made of the bits
+/// addressed by VarInspector::FunctionalityFlags.
+void
+VarInspectorDialog::functionality_mask (int a_mask)
+{
+ THROW_IF_FAIL (m_priv);
+
+ m_priv->functionality_mask (a_mask);
+}
+
+/// Return the functionality mask. It's a mask made of the bits
+/// addressed by VarInspector::FunctionalityFlags.
+unsigned
+VarInspectorDialog::functionality_mask ()
+{
+ THROW_IF_FAIL (m_priv);
+
+ return m_priv->functionality_mask ();
+}
+
NEMIVER_END_NAMESPACE (nemiver)
diff --git a/src/persp/dbgperspective/nmv-var-inspector-dialog.h b/src/persp/dbgperspective/nmv-var-inspector-dialog.h
index 65cb78b..d5178c4 100644
--- a/src/persp/dbgperspective/nmv-var-inspector-dialog.h
+++ b/src/persp/dbgperspective/nmv-var-inspector-dialog.h
@@ -44,6 +44,26 @@ class VarInspectorDialog : public Dialog {
SafePtr<Priv> m_priv;
public:
+
+ /// These flags control the fonctionnalities that are enabled to
+ /// be used with the current instance of VarInspectorDialog.
+ enum FunctionalityFlags {
+ FUNCTIONALITY_NONE = 0,
+ /// When this bit is set, the inspector allows the user to
+ /// inspect expressions. Thus the "inspect" button is made
+ /// clickable.
+ FUNCTIONALITY_EXPR_INSPECTOR = 1,
+ /// When this bit is set, the inspect allows the user to send
+ /// the inspected expression to the expression (or variable)
+ /// monitor.
+ FUNCTIONALITY_EXPR_MONITOR_PICKER = 1 << 1,
+ // This one should be the last one, and should contain all the
+ // flags above.
+ FUNCTIONALITY_ALL =
+ (FUNCTIONALITY_EXPR_INSPECTOR
+ | FUNCTIONALITY_EXPR_MONITOR_PICKER)
+ };
+
VarInspectorDialog (IDebugger &a_debugger,
IPerspective &a_perspective);
virtual ~VarInspectorDialog ();
@@ -57,10 +77,14 @@ public:
VarInspector& inspector () const;
void set_history (const std::list<UString> &);
void get_history (std::list<UString> &) const;
-
- // Signals
+ void functionality_mask (int functionality_mask);
+ unsigned functionality_mask ();
+
+ // <Signals>
sigc::signal<void, IDebugger::VariableSafePtr>& expr_monitoring_requested ();
+
+ // </Signals>
};//end class VarInspectorDialog
NEMIVER_END_NAMESPACE (nemiver)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]