glom r1528 - in trunk: . glom glom/libglom glom/mode_data glom/utility_widgets glom/utility_widgets/adddel glom/utility_widgets/db_adddel



Author: murrayc
Date: Mon Apr  7 11:16:24 2008
New Revision: 1528
URL: http://svn.gnome.org/viewvc/glom?rev=1528&view=rev

Log:
2008-04-07  Murray Cumming  <murrayc murrayc com>

* glom/main.cc (Glom.OptionGroup, main): Use atexit(__libc_freeres) 
to maybe help valgrind to detect leaks.
* glom/mode_data/flowtablewithfields.cc Added TODO comments about 
possible widget leaks.
* glom/utility_widgets/adddel/adddel.cc
* glom/utility_widgets/adddel/adddel.h: Use UIManager instead of 
MenuElems, because it seems less leaky.

Modified:
   trunk/ChangeLog
   trunk/glom/base_db.cc
   trunk/glom/libglom/connectionpool.cc
   trunk/glom/main.cc
   trunk/glom/mode_data/flowtablewithfields.cc
   trunk/glom/utility_widgets/adddel/adddel.cc
   trunk/glom/utility_widgets/adddel/adddel.h
   trunk/glom/utility_widgets/db_adddel/db_adddel.cc
   trunk/glom/utility_widgets/flowtable.cc
   trunk/glom/utility_widgets/flowtable.h
   trunk/glom/utility_widgets/layoutwidgetutils.cc
   trunk/glom/utility_widgets/layoutwidgetutils.h

Modified: trunk/glom/base_db.cc
==============================================================================
--- trunk/glom/base_db.cc	(original)
+++ trunk/glom/base_db.cc	Mon Apr  7 11:16:24 2008
@@ -314,7 +314,7 @@
     }
     else if(data_model_tables)
     {
-      std::cout << "debug: data_model_tables refcount=" << G_OBJECT(data_model_tables->gobj())->ref_count << std::endl;
+      //std::cout << "debug: data_model_tables refcount=" << G_OBJECT(data_model_tables->gobj())->ref_count << std::endl;
       const int rows = data_model_tables->get_n_rows();
       for(int i = 0; i < rows; ++i)
       {

Modified: trunk/glom/libglom/connectionpool.cc
==============================================================================
--- trunk/glom/libglom/connectionpool.cc	(original)
+++ trunk/glom/libglom/connectionpool.cc	Mon Apr  7 11:16:24 2008
@@ -371,6 +371,8 @@
             if(glib_error.get())
               break;
 #endif
+            //std::cout << "m_refGdaConnection refcount=" << G_OBJECT(m_refGdaConnection->gobj())->ref_count << std::endl;
+
             //g_warning("ConnectionPool: connection opened");
 
             //Remember what port is working:

Modified: trunk/glom/main.cc
==============================================================================
--- trunk/glom/main.cc	(original)
+++ trunk/glom/main.cc	Mon Apr  7 11:16:24 2008
@@ -83,9 +83,15 @@
 
 } //namespace Glom
 
+extern "C" void __libc_freeres(void);
+
 int 
 main(int argc, char* argv[])
 {
+  //Force some cleanup at exit,
+  //to help valgrind to detect memory leaks:
+  atexit(__libc_freeres);
+
   // TODO: I am not sure why, but this does not work. PYTHONPATH is set
   // correctly according to getenv(), but python still does not look in it.
   // For now, the installer installs all the python stuff directly into the 

Modified: trunk/glom/mode_data/flowtablewithfields.cc
==============================================================================
--- trunk/glom/mode_data/flowtablewithfields.cc	(original)
+++ trunk/glom/mode_data/flowtablewithfields.cc	Mon Apr  7 11:16:24 2008
@@ -178,7 +178,7 @@
 
   if(true)//!fields.empty() && !group_name.empty())
   {
-    Gtk::Frame* frame = Gtk::manage( new Gtk::Frame );
+    Gtk::Frame* frame = Gtk::manage( new Gtk::Frame ); //TODO_leak: This is possibly leaked, according to valgrind. 
 
     if(!group->get_title().empty())
     {
@@ -191,7 +191,7 @@
     frame->set_shadow_type(Gtk::SHADOW_NONE); //HIG-style
     frame->show();
 
-    Gtk::Alignment* alignment = Gtk::manage( new Gtk::Alignment );
+    Gtk::Alignment* alignment = Gtk::manage( new Gtk::Alignment ); //TODO_leak: This is possibly leaked, according to valgrind.
 
     if(!group->get_title().empty()) //Don't indent if it has no title, to allow use of groups just for positioning.
       alignment->set_padding(Glom::Utils::DEFAULT_SPACING_SMALL, 0, 6, 0); //Use left-padding of 6 even on Maemo because indentation is important.
@@ -207,11 +207,11 @@
     flow_table->set_padding(Utils::DEFAULT_SPACING_SMALL);
     flow_table->show();
     
-    Gtk::EventBox* event_box = Gtk::manage( new Gtk::EventBox() );
+    Gtk::EventBox* event_box = Gtk::manage( new Gtk::EventBox() ); //TODO_Leak: Valgrind says this is possibly leaked.
     event_box->add(*flow_table);
-		event_box->set_visible_window (false);
-		event_box->signal_button_press_event().connect (sigc::mem_fun (*flow_table,
-																																	 &FlowTableWithFields::on_button_press_event));
+    event_box->set_visible_window(false);
+    event_box->signal_button_press_event().connect (sigc::mem_fun (*flow_table,
+      &FlowTableWithFields::on_button_press_event));
     event_box->show();
     
     alignment->add(*event_box);
@@ -441,7 +441,7 @@
   info.m_field = layoutitem_field;
 
   //Add the entry or checkbox (handled by the DataWidget)
-  DataWidget* pDataWidget = Gtk::manage(new DataWidget(layoutitem_field, table_name, get_document()) );
+  DataWidget* pDataWidget = Gtk::manage(new DataWidget(layoutitem_field, table_name, get_document()) ); //TODO_Leak: Possibly leaked, according to valgrind.
   add_layoutwidgetbase(pDataWidget, add_before);
   add_view(pDataWidget); //So it can get the document.
 

Modified: trunk/glom/utility_widgets/adddel/adddel.cc
==============================================================================
--- trunk/glom/utility_widgets/adddel/adddel.cc	(original)
+++ trunk/glom/utility_widgets/adddel/adddel.cc	Mon Apr  7 11:16:24 2008
@@ -77,8 +77,7 @@
 
 AddDel::AddDel()
 : m_col_key(0),
-  m_pColumnHeaderPopup(0),
-  m_allow_column_chooser(false),
+  m_pMenuPopup(0),
   m_auto_add(true),
   m_allow_add(true),
   m_allow_delete(true)
@@ -90,8 +89,7 @@
 AddDel::AddDel(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& /* refGlade */)
 : Gtk::VBox(cobject),
   m_col_key(0),
-  m_pColumnHeaderPopup(0),
-  m_allow_column_chooser(false),
+  m_pMenuPopup(0),
   m_auto_add(true),
   m_allow_add(true),
   m_allow_delete(true)
@@ -238,28 +236,58 @@
 
 void AddDel::setup_menu()
 {
-  //Clear existing menu items:
-  m_MenuPopup.items().clear();
+  m_refActionGroup = Gtk::ActionGroup::create();
+  m_refActionGroup->add(Gtk::Action::create("ContextMenu", "Context Menu") );
 
-  //Add new menu items:
-  Gtk::Menu_Helpers::MenuElem menuItem_Edit(_("Edit"));
-  m_MenuPopup.items().push_back(menuItem_Edit);
-  m_MenuPopup.items().back().signal_activate().connect(sigc::mem_fun(*this, &AddDel::on_MenuPopup_activate_Edit));
+  m_refContextEdit = Gtk::Action::create("ContextEdit", Gtk::Stock::EDIT);
+  m_refActionGroup->add(m_refContextEdit,
+    sigc::mem_fun(*this, &AddDel::on_MenuPopup_activate_Edit) );
 
   if(get_allow_user_actions())
   {
-    Gtk::Menu_Helpers::MenuElem menuItem_Delete(_("Delete"));
-    m_MenuPopup.items().push_back(menuItem_Delete);
-    m_MenuPopup.items().back().signal_activate().connect(sigc::mem_fun(*this, &AddDel::on_MenuPopup_activate_Delete));
+    m_refContextDelete =  Gtk::Action::create("ContextDelete", Gtk::Stock::DELETE);
+    m_refActionGroup->add(m_refContextDelete,
+      sigc::mem_fun(*this, &AddDel::on_MenuPopup_activate_Delete) );
   }
-  
-  if(m_allow_column_chooser)
+
+  m_refUIManager = Gtk::UIManager::create();
+
+  m_refUIManager->insert_action_group(m_refActionGroup);
+
+  //TODO: add_accel_group(m_refUIManager->get_accel_group());
+
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  try
   {
-    Gtk::Menu_Helpers::MenuElem menuitem_ChooseColumns(_("Choose columns"));
-    m_MenuPopup.items().push_back(menuitem_ChooseColumns);
-    m_MenuPopup.items().back().signal_activate().connect(sigc::mem_fun(*this, &AddDel::on_MenuPopup_activate_ChooseColumns));
-  }
+#endif
+    Glib::ustring ui_info = 
+        "<ui>"
+        "  <popup name='ContextMenu'>"
+        "    <menuitem action='ContextEdit'/>"
+        "    <menuitem action='ContextDelete'/>"
+        "  </popup>"
+        "</ui>";
 
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+    m_refUIManager->add_ui_from_string(ui_info);
+  }
+  catch(const Glib::Error& ex)
+  {
+    std::cerr << "building menus failed: " <<  ex.what();
+  }
+#else
+  std::auto_ptr<Glib::Error> error;
+  m_refUIManager->add_ui_from_string(ui_info, error);
+  if(error.get() != NULL)
+  {
+    std::cerr << "building menus failed: " << error->what();
+  }
+#endif //GLIBMM_EXCEPTIONS_ENABLED
+
+  //Get the menu:
+  m_pMenuPopup = dynamic_cast<Gtk::Menu*>( m_refUIManager->get_widget("/ContextMenu") ); 
+  if(!m_pMenuPopup)
+    g_warning("menu not found");
 }
 
 bool AddDel::on_button_press_event_Popup(GdkEventButton *event)
@@ -269,14 +297,14 @@
   if(mods & GDK_BUTTON3_MASK)
   {
     //Give user choices of actions on this item:
-    m_MenuPopup.popup(event->button, event->time);
+    m_pMenuPopup->popup(event->button, event->time);
   }
   else
   {
     if(event->type == GDK_2BUTTON_PRESS)
     {
       //Double-click means edit.
-      //Disable this, because it is confusing when single-click activates editable cells too. on_MenuPopup_activate_Edit();
+      //Disable this, because it is confusing when single-click activates editable cells too.
     }
   }
 
@@ -1349,27 +1377,6 @@
   on_button_press_event_Popup(event);
 }
 
-bool AddDel::on_treeview_columnheader_button_press_event(GdkEventButton* event)
-{
-  //If this is a right-click with the mouse:
-  if( (event->type == GDK_BUTTON_PRESS) && (event->button == 3) )
-  {
-    if(m_pColumnHeaderPopup)
-    {
-      m_pColumnHeaderPopup->popup(event->button, event->time);
-      return true; //It has been handled.
-    }
-    else
-    {
-      //Default popup:
-      //TODO: We might want to disable this sometimes, because it could be useless sometimes.
-      
-    }
-  }
-
-  return false;
-}
-
 bool AddDel::on_treeview_column_drop(Gtk::TreeView* /* treeview */, Gtk::TreeViewColumn* /* column */, Gtk::TreeViewColumn* /* prev_column */, Gtk::TreeViewColumn* /* next_column */)
 {
   return true;
@@ -1394,8 +1401,6 @@
   //Save the extra ID, using the title if the column_id is empty:
   pViewColumn->set_column_id( (column_id.empty() ? title : column_id) );
 
-  //TODO pViewColumn->signal_button_press_event().connect( sigc::mem_fun(*this, &AddDel::on_treeview_columnheader_button_press_event) );
-
   return cols_count;
 }
 
@@ -1431,16 +1436,6 @@
   return m_vecColumnIDs;
 }
 
-void AddDel::set_column_header_popup(Gtk::Menu& popup)
-{
-  m_pColumnHeaderPopup = &popup;
-}
-
- void AddDel::set_allow_column_chooser(bool value)
-{
-  m_allow_column_chooser = value;
-}
-
 void AddDel::set_auto_add(bool value)
 {
   m_auto_add = value;

Modified: trunk/glom/utility_widgets/adddel/adddel.h
==============================================================================
--- trunk/glom/utility_widgets/adddel/adddel.h	(original)
+++ trunk/glom/utility_widgets/adddel/adddel.h	Mon Apr  7 11:16:24 2008
@@ -78,8 +78,6 @@
   virtual void set_allow_add(bool val = true);
   virtual void set_allow_delete(bool val = true);
 
-  void set_allow_column_chooser(bool value = true);
-
   virtual Gtk::TreeModel::iterator add_item(const Glib::ustring& strKey); //Return index of new row.
 
   /** Get an iterator to the blank row in which the user should add data for the new row.
@@ -243,8 +241,6 @@
 
   virtual void on_treeview_button_press_event(GdkEventButton* event);
 
-  virtual bool on_treeview_columnheader_button_press_event(GdkEventButton* event);
-
   /** Set the menu to popup when the user right-clicks on the column titles.
    * This method does not take ownership of the Gtk::Menu.
    */
@@ -282,8 +278,6 @@
   typedef std::vector<AddDelColumnInfo> type_ColumnTypes;
   type_ColumnTypes m_ColumnTypes;
 
-  Gtk::Menu m_MenuPopup;
-
   bool m_bAllowUserActions;
 
   bool m_bPreventUserSignals;
@@ -292,8 +286,11 @@
   type_vecStrings m_vecColumnIDs; //We give each ViewColumn a special ID, so we know where they are after a reorder.
 
   Glib::ustring m_strTextActiveCell; //value before the change
-  Gtk::Menu* m_pColumnHeaderPopup;
-  bool m_allow_column_chooser;
+  Gtk::Menu* m_pMenuPopup;
+  Glib::RefPtr<Gtk::ActionGroup> m_refActionGroup;
+  Glib::RefPtr<Gtk::UIManager> m_refUIManager;
+  Glib::RefPtr<Gtk::Action> m_refContextEdit, m_refContextDelete;
+
   bool m_auto_add;
   bool m_allow_add;
   bool m_allow_delete;

Modified: trunk/glom/utility_widgets/db_adddel/db_adddel.cc
==============================================================================
--- trunk/glom/utility_widgets/db_adddel/db_adddel.cc	(original)
+++ trunk/glom/utility_widgets/db_adddel/db_adddel.cc	Mon Apr  7 11:16:24 2008
@@ -251,7 +251,7 @@
   m_refActionGroup->add(m_refContextLayout,
     sigc::mem_fun(*this, &DbAddDel::on_MenuPopup_activate_layout) );
 
-  //TODO: This does not work until this widget is in a container in the window:s
+  //TODO: This does not work until this widget is in a container in the window:
   App_Glom* pApp = get_application();
   if(pApp)
   {

Modified: trunk/glom/utility_widgets/flowtable.cc
==============================================================================
--- trunk/glom/utility_widgets/flowtable.cc	(original)
+++ trunk/glom/utility_widgets/flowtable.cc	Mon Apr  7 11:16:24 2008
@@ -292,7 +292,7 @@
 #endif // !defined(GLIBMM_VFUNCS_ENABLED) || !defined(GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED)
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
-	m_current_dnd_item(0),
+  m_current_dnd_item(0),
   m_dnd_in_progress(false),
 #endif // !GLOM_ENABLE_CLIENT_ONLY
   m_columns_count(1),
@@ -351,7 +351,7 @@
 void FlowTable::add(Gtk::Widget& first, Gtk::Widget& second, bool expand_second)
 {
   FlowTableItem item (&first, &second, this);
-	
+  
   item.m_expand_second = expand_second; //Expand to fill the width for all of the second item.
   m_children.push_back(item);
   gtk_widget_set_parent(GTK_WIDGET (item.m_first->gobj()), GTK_WIDGET(gobj()));
@@ -368,16 +368,16 @@
 
 void FlowTable::insert_before(Gtk::Widget& first, Gtk::Widget& before, bool expand)
 {
-	FlowTableItem item(&first, this);
-	item.m_expand_first_full = expand;
-	insert_before (item, before);
+  FlowTableItem item(&first, this);
+  item.m_expand_first_full = expand;
+  insert_before (item, before);
 }
 
 void FlowTable::insert_before(Gtk::Widget& first, Gtk::Widget& second, Gtk::Widget& before, bool expand_second)
 {
-	FlowTableItem item(&first, &second, this);
-	item.m_expand_second = expand_second;
-	insert_before (item, before);
+  FlowTableItem item(&first, &second, this);
+  item.m_expand_second = expand_second;
+  insert_before (item, before);
 }
 
 void FlowTable::insert_before(FlowTableItem& item, Gtk::Widget& before)
@@ -418,9 +418,9 @@
   }
  
   gtk_widget_set_parent(GTK_WIDGET (item.m_first->gobj()), GTK_WIDGET(gobj()));
-	if (item.m_second)
+  if (item.m_second)
   {
-	  gtk_widget_set_parent(GTK_WIDGET (item.m_second->gobj()), GTK_WIDGET(gobj()));
+    gtk_widget_set_parent(GTK_WIDGET (item.m_second->gobj()), GTK_WIDGET(gobj()));
   }
   if (pos == m_children.end())
   {
@@ -436,7 +436,7 @@
       dynamic_cast<FlowTable*>(&child))
     return;
   
-	// Call this method recursive for all (real) children
+  // Call this method recursive for all (real) children
   Gtk::Container* container = dynamic_cast<Gtk::Container*>(&child);
   if (container)
   {
@@ -453,7 +453,7 @@
     std::list<Gtk::TargetEntry> new_targets;
     new_targets.push_back(Gtk::TargetEntry(egg_tool_palette_get_drag_target_item()));
     Glib::RefPtr<Gtk::TargetList> targets =
-			child.drag_dest_get_target_list ();
+      child.drag_dest_get_target_list ();
     // The widget has already a default drag destination - add more targets
     if (targets)
     {
@@ -463,7 +463,7 @@
     else
       child.drag_dest_set(new_targets, Gtk::DEST_DEFAULT_ALL,
                           Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
-							
+              
     // It's important to connect this one BEFORE
     child.signal_drag_motion().connect (sigc::bind<Gtk::Widget*>(sigc::mem_fun (*this, &FlowTable::on_child_drag_motion), &child),
                                         false);
@@ -1155,7 +1155,7 @@
   
   m_current_dnd_item = dnd_get_item(x, y);  
   LayoutWidgetBase* above = dnd_find_datawidget();
-	
+  
   // above might be 0 here...
   on_dnd_add_placeholder(above);
   change_dnd_status(true);
@@ -1211,7 +1211,7 @@
   int column_width;
   get_column_height (0, m_children.size(), column_width);
   int column = 0;
-	
+  
   if (column_width != 0)
     column = drag_x / column_width;
   
@@ -1245,7 +1245,7 @@
     
     if (drag_y < (rect.get_y() + rect.get_height()))
     {
-			return &(*cur_item);
+      return &(*cur_item);
     }
   }
   
@@ -1263,7 +1263,7 @@
   LayoutWidgetBase* above = 0;
   if(m_current_dnd_item)
   {
-		if(m_current_dnd_item->m_first)
+    if(m_current_dnd_item->m_first)
     {
       Gtk::Alignment* alignment = dynamic_cast <Gtk::Alignment*>(m_current_dnd_item->m_first);
       if (alignment)
@@ -1294,19 +1294,18 @@
                                      Gtk::Widget* child)
 {
   type_vecChildren::iterator cur_child;
-	for (cur_child = m_children.begin();
-			 cur_child != m_children.end(); cur_child++)
-	{
+  for (cur_child = m_children.begin(); cur_child != m_children.end(); cur_child++)
+  {
     // The widget was added directly to the FlowTable
-		if (cur_child->m_first == child || 
-				cur_child->m_second == child)
+    if (cur_child->m_first == child || 
+        cur_child->m_second == child)
     {
       break;
     }
     // The parent of the widget was added to the FlowTable
     else if (cur_child->m_first == child->get_parent() ||
              cur_child->m_second == child->get_parent())
-		{
+    {
       break;
     }
     Gtk::Bin* bin = dynamic_cast<Gtk::Bin*>(cur_child->m_second);
@@ -1317,7 +1316,7 @@
           bin->get_child() == child->get_parent())
         break;
     }
-	}
+  }
   if (cur_child != m_children.end())
     m_current_dnd_item = &(*cur_child);
   else
@@ -1336,7 +1335,7 @@
   on_dnd_remove_placeholder ();
   
   LayoutWidgetBase* above = dnd_find_datawidget();
-	
+  
   // above might be 0 here...
   on_dnd_add_placeholder(above);
   change_dnd_status(true);

Modified: trunk/glom/utility_widgets/flowtable.h
==============================================================================
--- trunk/glom/utility_widgets/flowtable.h	(original)
+++ trunk/glom/utility_widgets/flowtable.h	Mon Apr  7 11:16:24 2008
@@ -40,7 +40,7 @@
   void insert_before(Gtk::Widget& first, Gtk::Widget& second, Gtk::Widget& before, bool expand_second);
   void insert_before(Gtk::Widget& first, Gtk::Widget& before, bool expand);
 
-	virtual void remove(Gtk::Widget& first); //override
+  virtual void remove(Gtk::Widget& first); //override
 
   void set_columns_count(guint value);
 

Modified: trunk/glom/utility_widgets/layoutwidgetutils.cc
==============================================================================
--- trunk/glom/utility_widgets/layoutwidgetutils.cc	(original)
+++ trunk/glom/utility_widgets/layoutwidgetutils.cc	Mon Apr  7 11:16:24 2008
@@ -28,7 +28,7 @@
 {
   
 LayoutWidgetUtils::LayoutWidgetUtils() :
-    m_pPopupMenuUtils(0)
+  m_pPopupMenuUtils(0)
 {
   m_refActionGroup = Gtk::ActionGroup::create();
 
@@ -48,9 +48,9 @@
   m_refUIManager = Gtk::UIManager::create();
 	
   m_refActionGroup->add(m_refUtilProperties,
-						sigc::mem_fun(*this, &LayoutWidgetUtils::on_menu_properties_activate) );
+    sigc::mem_fun(*this, &LayoutWidgetUtils::on_menu_properties_activate) );
   m_refActionGroup->add(m_refUtilDetails,
-						sigc::mem_fun(*this, &LayoutWidgetUtils::on_menu_details_activate) );
+    sigc::mem_fun(*this, &LayoutWidgetUtils::on_menu_details_activate) );
     
   m_refUIManager->insert_action_group(m_refActionGroup);
 
@@ -75,7 +75,6 @@
   m_pPopupMenuUtils = dynamic_cast<Gtk::Menu*>( m_refUIManager->get_widget("/UtilMenu") ); 
   if(!m_pPopupMenuUtils)
     g_warning("menu not found");
-
 }
 
 } // namespace Glom

Modified: trunk/glom/utility_widgets/layoutwidgetutils.h
==============================================================================
--- trunk/glom/utility_widgets/layoutwidgetutils.h	(original)
+++ trunk/glom/utility_widgets/layoutwidgetutils.h	Mon Apr  7 11:16:24 2008
@@ -15,9 +15,9 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with glom.  If not, write to:
- * 	The Free Software Foundation, Inc.,
- * 	51 Franklin Street, Fifth Floor
- * 	Boston, MA  02110-1301, USA.
+ *   The Free Software Foundation, Inc.,
+ *   51 Franklin Street, Fifth Floor
+ *   Boston, MA  02110-1301, USA.
  */
 
 #ifndef _GLOM_LAYOUT_WIDGET_UTILS_H_
@@ -30,23 +30,24 @@
 
 class LayoutWidgetUtils //: public sigc::trackable 
 {
-  public:
-	LayoutWidgetUtils();
-	virtual ~LayoutWidgetUtils();
+public:
+  LayoutWidgetUtils();
+  virtual ~LayoutWidgetUtils();
   
-  protected:
-	void setup_util_menu();
-	Gtk::Menu* m_pPopupMenuUtils;
-	
-	virtual void on_menu_properties_activate() = 0;
-	// It's not really important to implement this though you should deactivate
-	// the menu item then
-	virtual void on_menu_details_activate() {};
-	
-	Glib::RefPtr<Gtk::Action> m_refUtilProperties;
-	Glib::RefPtr<Gtk::Action> m_refUtilDetails;
-	Glib::RefPtr<Gtk::ActionGroup> m_refActionGroup;
-	Glib::RefPtr<Gtk::UIManager> m_refUIManager;
+protected:
+  void setup_util_menu();
+  Gtk::Menu* m_pPopupMenuUtils;
+  
+  virtual void on_menu_properties_activate() = 0;
+
+  // It's not really important to implement this though you should deactivate
+  // the menu item then. TODO: Does something need to be done here? murrayc.
+  virtual void on_menu_details_activate() {};
+  
+  Glib::RefPtr<Gtk::Action> m_refUtilProperties;
+  Glib::RefPtr<Gtk::Action> m_refUtilDetails;
+  Glib::RefPtr<Gtk::ActionGroup> m_refActionGroup;
+  Glib::RefPtr<Gtk::UIManager> m_refUIManager;
 };
 
 } // namespace Glom



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