Commit 6f2feb74 authored by Murray Cumming's avatar Murray Cumming
Browse files

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.
parent 50bdded9
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.
......
......@@ -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.
}
......
......@@ -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;
......
......@@ -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.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment