[nemiver] Don't enable contextual menu in popup tip
- From: Dodji Seketeli <dodji src gnome org>
- To: svn-commits-list gnome org
- Subject: [nemiver] Don't enable contextual menu in popup tip
- Date: Tue, 2 Jun 2009 17:03:55 -0400 (EDT)
commit 6afdd1f7e7886f85a9fd24737228439088477d30
Author: Dodji Seketeli <dodji redhat com>
Date: Tue Jun 2 22:47:33 2009 +0200
Don't enable contextual menu in popup tip
* src/persp/dbgperspective/nmv-var-inspector-dialog.cc:
(VarInspectorDialog::Priv::build_dialog): Enable contextual the menu.
* src/persp/dbgperspective/nmv-var-inspector2.cc:
(VarInspector2::enable_contextual_menu,
VarInspector2::is_contextual_menu_enabled): New methods.
(VarInspector2::Priv::Priv): By default, disalow contextual menu.
(VarInspector2::Priv::on_button_press_signal): Show the contextual
menu only if we are allowed to.
---
.../dbgperspective/nmv-var-inspector-dialog.cc | 1 +
src/persp/dbgperspective/nmv-var-inspector2.cc | 20 +++++++++++++++++++-
src/persp/dbgperspective/nmv-var-inspector2.h | 2 ++
3 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/src/persp/dbgperspective/nmv-var-inspector-dialog.cc b/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
index d485f1c..d188059 100644
--- a/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
+++ b/src/persp/dbgperspective/nmv-var-inspector-dialog.cc
@@ -106,6 +106,7 @@ public:
"inspectorwidgetbox");
#ifdef WITH_VAROBJS
var_inspector.reset (new VarInspector2 (debugger, perspective));
+ var_inspector->enable_contextual_menu (true);
#else
var_inspector.reset (new VarInspector (debugger));
#endif // WITH_VAROBJS
diff --git a/src/persp/dbgperspective/nmv-var-inspector2.cc b/src/persp/dbgperspective/nmv-var-inspector2.cc
index bb866b2..f80646d 100644
--- a/src/persp/dbgperspective/nmv-var-inspector2.cc
+++ b/src/persp/dbgperspective/nmv-var-inspector2.cc
@@ -54,6 +54,7 @@ class VarInspector2::Priv : public sigc::trackable {
bool requested_variable;
bool requested_type;
bool expand_variable;
+ bool enable_contextual_menu;
IDebuggerSafePtr debugger;
// Variable that is being inspected
// at a given point in time
@@ -458,7 +459,9 @@ class VarInspector2::Priv : public sigc::trackable {
NEMIVER_TRY
// right-clicking should pop up a context menu
- if ((a_event->type == GDK_BUTTON_PRESS) && (a_event->button == 3)) {
+ if (a_event->type == GDK_BUTTON_PRESS
+ && a_event->button == 3
+ && enable_contextual_menu) {
popup_var_inspector_menu (a_event);
}
@@ -570,6 +573,7 @@ public:
requested_variable (false),
requested_type (false),
expand_variable (false),
+ enable_contextual_menu (false),
debugger (a_debugger),
perspective (a_perspective),
var_inspector_menu (0),
@@ -636,6 +640,20 @@ VarInspector2::get_variable () const
}
void
+VarInspector2::enable_contextual_menu (bool a_flag)
+{
+ THROW_IF_FAIL (m_priv);
+ m_priv->enable_contextual_menu = a_flag;
+}
+
+bool
+VarInspector2::is_contextual_menu_enabled () const
+{
+ THROW_IF_FAIL (m_priv);
+ return m_priv->enable_contextual_menu;
+}
+
+void
VarInspector2::clear ()
{
THROW_IF_FAIL (m_priv);
diff --git a/src/persp/dbgperspective/nmv-var-inspector2.h b/src/persp/dbgperspective/nmv-var-inspector2.h
index 33dbec3..b49bca7 100644
--- a/src/persp/dbgperspective/nmv-var-inspector2.h
+++ b/src/persp/dbgperspective/nmv-var-inspector2.h
@@ -59,6 +59,8 @@ public:
void inspect_variable (const UString &a_variable_name,
bool a_expand = false);
IDebugger::VariableSafePtr get_variable () const;
+ void enable_contextual_menu (bool a_flag);
+ bool is_contextual_menu_enabled () const;
void clear ();
};//end class VarInspector2
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]