[glom] Do not hide table-specific menu items in Operator mode.



commit 82468aa967b197698fad7010853c0d0e7dfb83ad
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jun 23 00:11:44 2011 +0200

    Do not hide table-specific menu items in Operator mode.
    
    * glom/application.cc: update_table_sensitive_ui().

 ChangeLog           |    6 ++++++
 glom/application.cc |   12 +++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9b3624a..560301f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-23  Murray Cumming  <murrayc murrayc com>
+
+	Do not hide table-specific menu items in Operator mode.
+
+	* glom/application.cc: update_table_sensitive_ui().
+
 2011-06-22  Murray Cumming  <murrayc murrayc com>
 
 	Main Window: Combine the top two rows of widgets.
diff --git a/glom/application.cc b/glom/application.cc
index 6f0d3df..33e5f4e 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -460,10 +460,6 @@ void Application::init_menus()
   m_listTableSensitiveActions.push_back(action);
 #endif
 
-  //"Mode" menu:
-  action =  Gtk::Action::create("Glom_Menu_Mode", _("_Mode"));
-  m_refActionGroup_Others->add(action);
-
   //We remember this action, so that it can be explicitly activated later.
   m_action_mode_find = Gtk::ToggleAction::create("GlomAction_Menu_Mode_Toggle", _("_Find"), "", false);
   m_refActionGroup_Others->add(m_action_mode_find,  Gtk::AccelKey("<control>F"),
@@ -1385,8 +1381,14 @@ void Application::update_table_sensitive_ui()
   for(type_listActions::iterator iter = m_listTableSensitiveActions.begin(); iter != m_listTableSensitiveActions.end(); ++iter)
   {
     Glib::RefPtr<Gtk::Action> action = *iter;
+ 
+    bool sensitive = has_table;
+
+    const bool is_developer_item = 
+      (std::find(m_listDeveloperActions.begin(), m_listDeveloperActions.end(), action) != m_listDeveloperActions.end());
+    if(is_developer_item)
+      sensitive = sensitive && (userlevel == AppState::USERLEVEL_DEVELOPER);
 
-    const bool sensitive = (userlevel == AppState::USERLEVEL_DEVELOPER) && has_table;
     action->set_sensitive(sensitive);
   }
 }



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