[glom] More fixes for the Frame label issue.



commit 6f2feb747fb3c40fe72ffb0c1590c84649f2c66c
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Oct 28 09:43:31 2011 +0200

    More fixes for the Frame label issue.
    
    * glom/mode_data/box_data_list_related.cc: Only set or unset the Gtk::Frame
    label if it is or isn't there already, to avoid a warning.
    * glom/mode_data/box_data_portal.[h|cc]: Remove the unused implementation
    of one init_db_details() method, making it pure virtual instead.

 ChangeLog                               |    9 ++++++++
 glom/mode_data/box_data_list_related.cc |    6 ++++-
 glom/mode_data/box_data_portal.cc       |   34 -------------------------------
 glom/mode_data/box_data_portal.h        |    2 +-
 4 files changed, 15 insertions(+), 36 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 107d232..ee68089 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-10-28  Murray Cumming  <murrayc murrayc com>
+
+	More fixes for the Frame label issue.
+
+	* glom/mode_data/box_data_list_related.cc: Only set or unset the Gtk::Frame 
+	label if it is or isn't there already, to avoid a warning.
+	* glom/mode_data/box_data_portal.[h|cc]: Remove the unused implementation 
+	of one init_db_details() method, making it pure virtual instead.
+
 2011-10-27  Murray Cumming  <murrayc murrayc com>
 
 	Notebook: Avoid truncating related records buttons.
diff --git a/glom/mode_data/box_data_list_related.cc b/glom/mode_data/box_data_list_related.cc
index ad5bd7b..e1b0a54 100644
--- a/glom/mode_data/box_data_list_related.cc
+++ b/glom/mode_data/box_data_list_related.cc
@@ -92,13 +92,17 @@ bool Box_Data_List_Related::init_db_details(const Glib::ustring& parent_table, b
     m_Label.set_markup(Utils::bold_message(title));
     m_Label.show();
 
+    if(!(m_Frame.get_label_widget()))
+      m_Frame.set_label_widget(m_Label);
+
     m_Alignment.set_padding(Utils::DEFAULT_SPACING_SMALL /* top */, 0, Utils::DEFAULT_SPACING_LARGE /* left */, 0);
   }
   else
   {
     m_Label.set_markup(Glib::ustring());
     m_Label.hide();
-    m_Frame.unset_label(); //Otherwise the allocation is calculated wrong. TODO: Investigate in GTK+.
+    if(m_Frame.get_label_widget())
+      m_Frame.unset_label(); //Otherwise the allocation is calculated wrong. TODO: Investigate in GTK+.
 
     m_Alignment.set_padding(0.0f, 0.0f, 0.0f, 0.0f); //The box itself has padding of 6.
   }
diff --git a/glom/mode_data/box_data_portal.cc b/glom/mode_data/box_data_portal.cc
index c95d3da..6660d63 100644
--- a/glom/mode_data/box_data_portal.cc
+++ b/glom/mode_data/box_data_portal.cc
@@ -131,40 +131,6 @@ Glib::ustring Box_Data_Portal::get_title_singular() const
   return relationship_title;
 }
 
-//TODO: Is this base class implementation actually called by anything?
-bool Box_Data_Portal::init_db_details(const Glib::ustring& parent_table, bool show_title)
-{
-  m_parent_table = parent_table;
-
-  if(m_portal)
-    LayoutWidgetBase::m_table_name = m_portal->get_table_used(Glib::ustring() /* parent table_name, not used. */);
-  else
-    LayoutWidgetBase::m_table_name = Glib::ustring();
-
-  Base_DB_Table::m_table_name = LayoutWidgetBase::m_table_name;
-
-  if(show_title)
-  {
-    m_Label.set_markup(Utils::bold_message( get_title() ));
-    m_Label.show();
-
-    m_Alignment.set_padding(Utils::DEFAULT_SPACING_SMALL /* top */, 0, Utils::DEFAULT_SPACING_LARGE /* left */, 0);
-  }
-  else
-  {
-    m_Label.set_markup(Glib::ustring());
-    m_Label.hide();
-
-    m_Alignment.set_padding(0.0f, 0.0f, 0.0f, 0.0f); //The box itself has padding of 6.
-  }
-
-  m_key_field = get_fields_for_table_one_field(LayoutWidgetBase::m_table_name, m_portal->get_to_field_used());
-
-  FoundSet found_set;
-  found_set.m_table_name = LayoutWidgetBase::m_table_name;
-  return Box_Data::init_db_details(found_set, m_layout_platform); //Calls create_layout() and fill_from_database().
-}
-
 bool Box_Data_Portal::refresh_data_from_database_with_foreign_key(const Gnome::Gda::Value& foreign_key_value)
 {
   m_key_value = foreign_key_value;
diff --git a/glom/mode_data/box_data_portal.h b/glom/mode_data/box_data_portal.h
index 188093b..f718294 100644
--- a/glom/mode_data/box_data_portal.h
+++ b/glom/mode_data/box_data_portal.h
@@ -52,7 +52,7 @@ public:
 
   /** Use this if no portal is yet defined, so the user can use the context menu to define a portal.
    */
-  virtual bool init_db_details(const Glib::ustring& parent_table, bool show_title = true);
+  virtual bool init_db_details(const Glib::ustring& parent_table, bool show_title = true) = 0;
 
   /** Update a portal if a relevant value in its parent table has changed.
    *



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