Commit d1591613 authored by Murray Cumming's avatar Murray Cumming Committed by Murray Cumming
Browse files

Added init_db_details() method overloads that take a parent table instead

2008-09-05  Murray Cumming  <murrayc@murrayc.com>

* glom/mode_data/box_data_calendar_related.cc:
* glom/mode_data/box_data_calendar_related.h:
* glom/mode_data/box_data_list_related.cc:
* glom/mode_data/box_data_list_related.h:
* glom/mode_data/box_data_portal.cc:
* glom/mode_data/box_data_portal.h: Added init_db_details() 
method overloads that take a parent table instead of a 
portal, to use when no relationship has been chosen yet.
* glom/mode_data/dialog_layout_calendar_related.cc:
* glom/mode_data/dialog_layout_calendar_related.h:
Added set_document() that takes a table instead of a portal, 
as the other portal layout dialogs do already.
* glom/mode_data/flowtablewithfields.cc:
Specify a from table name instead of a portal when 
no relationship has been chosen yet.
* glom/mode_data/dialog_layout_list_related.cc: Cope with a 
a null portal, so the user can choose the relationship on this
dialog without choosing the relationship separately first.
* glom/mode_data/dialog_layout_details.cc: Do not ask for the 
relationship whenever adding a portal.

* glom/libglom/utils.cc:
* glom/libglom/utils.h: Added show_window_until_hide().
* glom/mode_design/print_layouts/canvas_print_layout.cc:
* glom/mode_design/print_layouts/canvas_print_layout.h:
Block when showing the layout dialog for a portal.

svn path=/trunk/; revision=1679
parent 088cd37d
2008-09-05 Murray Cumming <murrayc@murrayc.com>
* glom/mode_data/box_data_calendar_related.cc:
* glom/mode_data/box_data_calendar_related.h:
* glom/mode_data/box_data_list_related.cc:
* glom/mode_data/box_data_list_related.h:
* glom/mode_data/box_data_portal.cc:
* glom/mode_data/box_data_portal.h: Added init_db_details()
method overloads that take a parent table instead of a
portal, to use when no relationship has been chosen yet.
* glom/mode_data/dialog_layout_calendar_related.cc:
* glom/mode_data/dialog_layout_calendar_related.h:
Added set_document() that takes a table instead of a portal,
as the other portal layout dialogs do already.
* glom/mode_data/flowtablewithfields.cc:
Specify a from table name instead of a portal when
no relationship has been chosen yet.
* glom/mode_data/dialog_layout_list_related.cc: Cope with a
a null portal, so the user can choose the relationship on this
dialog without choosing the relationship separately first.
* glom/mode_data/dialog_layout_details.cc: Do not ask for the
relationship whenever adding a portal.
* glom/libglom/utils.cc:
* glom/libglom/utils.h: Added show_window_until_hide().
* glom/mode_design/print_layouts/canvas_print_layout.cc:
* glom/mode_design/print_layouts/canvas_print_layout.h:
Block when showing the layout dialog for a portal.
2008-09-03 Murray Cumming <murrayc@murrayc.com>
* glom/libglom/data_structure/layout/layoutitem_portal.cc
......
......@@ -897,4 +897,37 @@ void Utils::show_ok_dialog(const Glib::ustring& title, const Glib::ustring& mess
dialog.run();
}
namespace
{
static void on_window_hide(Glib::RefPtr<Glib::MainLoop> main_loop, sigc::connection handler_connection)
{
handler_connection.disconnect(); //This should release a main_loop reference.
main_loop->quit();
//main_loop should be destroyed soon, because nothing else is using it.
}
} //anonymous namespace.
void Utils::show_window_until_hide(Gtk::Window* window)
{
if(!window)
return;
Glib::RefPtr<Glib::MainLoop> main_loop = Glib::MainLoop::create(false /* not running */);
//Stop the main_loop when the window is hidden:
sigc::connection handler_connection; //TODO: There seems to be a crash if this is on the same line.
handler_connection = window->signal_hide().connect(
sigc::bind(
sigc::ptr_fun(&on_window_hide),
main_loop, handler_connection
) );
window->show();
main_loop->run(); //Run and block until it is stopped by the hide signal handler.
}
} //namespace Glom
......@@ -107,6 +107,8 @@ void show_help(const Glib::ustring& id = Glib::ustring());
void show_ok_dialog(const Glib::ustring& title, const Glib::ustring& message, Gtk::Window& parent, Gtk::MessageType message_type);
void show_window_until_hide(Gtk::Window* window);
} //namespace Utils
} //namespace Glom
......
......@@ -65,17 +65,37 @@ void Box_Data_Calendar_Related::enable_buttons()
//m_calendar.set_allow_view_details(view_details_possible); //Don't allow the user to go to a record in a hidden table.
}
bool Box_Data_Calendar_Related::init_db_details(const sharedptr<const LayoutItem_CalendarPortal>& portal, bool show_title)
bool Box_Data_Calendar_Related::init_db_details(const sharedptr<const LayoutItem_Portal>& portal, bool show_title)
{
m_portal = glom_sharedptr_clone(portal);
//This calls the other method overload:
return Box_Data_Portal::init_db_details(portal, show_title);
}
LayoutWidgetBase::m_table_name = m_portal->get_table_used(Glib::ustring() /* parent table_name, not used. */);
Base_DB_Table::m_table_name = LayoutWidgetBase::m_table_name;
bool Box_Data_Calendar_Related::init_db_details(const Glib::ustring& parent_table, bool show_title)
{
//std::cout << "DEBUG: Box_Data_Calendar_Related::init_db_details(): " << parent_table << std::endl;
const Glib::ustring relationship_title = m_portal->get_title_used(Glib::ustring() /* parent title - not relevant */);
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;
//TODO: This is duplicated in box_data_related_list.cc and box_data_portal.cc. Just use code from the base class?
if(show_title)
{
Glib::ustring relationship_title;
if(m_portal && m_portal->get_has_relationship_name())
relationship_title = m_portal->get_title_used(Glib::ustring() /* parent title - not relevant */);
else
{
//Note to translators: This text is shown instead of a table title, when the table has not yet been chosen.
relationship_title = _("Undefined Table");
}
m_Label.set_markup(Bakery::App_Gtk::util_bold_message(relationship_title));
m_Label.show();
......@@ -89,7 +109,10 @@ bool Box_Data_Calendar_Related::init_db_details(const sharedptr<const LayoutItem
m_Alignment.set_padding(0, 0, 0, 0); //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());
if(m_portal)
m_key_field = get_fields_for_table_one_field(LayoutWidgetBase::m_table_name, m_portal->get_to_field_used());
else
m_key_field.clear();
enable_buttons();
......@@ -248,7 +271,7 @@ void Box_Data_Calendar_Related::on_record_added(const Gnome::Gda::Value& primary
sharedptr<Field> field_primary_key; //TODO: = m_calendar.get_key_field();
//Create the link by setting the foreign key
if(m_key_field)
if(m_key_field && m_portal)
{
Glib::ustring strQuery = "UPDATE \"" + m_portal->get_table_used(Glib::ustring() /* not relevant */) + "\"";
strQuery += " SET \"" + /* get_table_name() + "." +*/ m_key_field->get_name() + "\" = " + m_key_field->sql(m_key_value);
......@@ -334,7 +357,16 @@ void Box_Data_Calendar_Related::prepare_layout_dialog(Dialog_Layout* dialog)
g_assert(related_dialog != NULL);
sharedptr<LayoutItem_CalendarPortal> derived_portal = sharedptr<LayoutItem_CalendarPortal>::cast_dynamic(m_portal);
related_dialog->set_document(m_layout_name, get_document(), derived_portal);
if(derived_portal && derived_portal->get_has_relationship_name())
{
std::cout << "DEBUG: Box_Data_Calendar_Related::(): portal was not null" << std::endl;
related_dialog->set_document(m_layout_name, get_document(), derived_portal);
}
else
{
std::cout << "DEBUG: Box_Data_Calendar_Related::(): m_parent_table=" << m_parent_table << std::endl;
related_dialog->set_document(m_layout_name, get_document(), m_parent_table);
}
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
......@@ -349,7 +381,7 @@ Glib::ustring Box_Data_Calendar_Related::on_calendar_details(guint year, guint m
sharedptr<LayoutItem_CalendarPortal> derived_portal = sharedptr<LayoutItem_CalendarPortal>::cast_dynamic(m_portal);
if(!derived_portal)
{
std::cout << "DEBUG: Box_Data_Calendar_Related::on_calendar_details(): date_field is NULL" << std::endl;
//std::cout << "DEBUG: Box_Data_Calendar_Related::on_calendar_details(): date_field is NULL" << std::endl;
return Glib::ustring();
}
......
......@@ -42,7 +42,11 @@ public:
/**
* @param portal: The full portal details
*/
virtual bool init_db_details(const sharedptr<const LayoutItem_CalendarPortal>& portal, bool show_title = true);
virtual bool init_db_details(const sharedptr<const LayoutItem_Portal>& portal, bool show_title = true);
/** 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);
protected:
virtual bool fill_from_database(); //Override.
......
......@@ -61,15 +61,32 @@ void Box_Data_List_Related::enable_buttons()
bool Box_Data_List_Related::init_db_details(const sharedptr<const LayoutItem_Portal>& portal, bool show_title)
{
m_portal = glom_sharedptr_clone(portal);
//This calls the other method overload:
return Box_Data_Portal::init_db_details(portal, show_title);
}
bool Box_Data_List_Related::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();
LayoutWidgetBase::m_table_name = m_portal->get_table_used(Glib::ustring() /* parent table_name, not used. */);
Base_DB_Table::m_table_name = LayoutWidgetBase::m_table_name;
const Glib::ustring relationship_title = m_portal->get_title_used(Glib::ustring() /* parent title - not relevant */);
if(show_title)
{
Glib::ustring relationship_title;
if(m_portal && m_portal->get_has_relationship_name())
relationship_title = m_portal->get_title_used(Glib::ustring() /* parent title - not relevant */);
else
{
//Note to translators: This text is shown instead of a table title, when the table has not yet been chosen.
relationship_title = _("Undefined Table");
}
m_Label.set_markup(Bakery::App_Gtk::util_bold_message(relationship_title));
m_Label.show();
......@@ -83,7 +100,11 @@ bool Box_Data_List_Related::init_db_details(const sharedptr<const LayoutItem_Por
m_Alignment.set_padding(0, 0, 0, 0); //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());
if(m_portal)
m_key_field = get_fields_for_table_one_field(LayoutWidgetBase::m_table_name, m_portal->get_to_field_used());
else
m_key_field.clear();
//Prevent impossible multiple related records:
const bool single_related = (m_key_field && (m_key_field->get_unique_key() || m_key_field->get_primary_key()));
......@@ -129,7 +150,7 @@ bool Box_Data_List_Related::fill_from_database()
}
//Prevent addition of new records if that is what the relationship specifies:
if(allow_add && m_portal->get_relationship())
if(allow_add && m_portal && m_portal->get_relationship())
allow_add = m_portal->get_relationship()->get_auto_create();
m_AddDel.set_allow_add(allow_add);
......@@ -252,7 +273,7 @@ void Box_Data_List_Related::on_adddel_record_added(const Gtk::TreeModel::iterato
sharedptr<Field> field_primary_key = m_AddDel.get_key_field();
//Create the link by setting the foreign key
if(m_key_field)
if(m_key_field && m_portal)
{
Glib::ustring strQuery = "UPDATE \"" + m_portal->get_table_used(Glib::ustring() /* not relevant */) + "\"";
strQuery += " SET \"" + /* get_table_name() + "." +*/ m_key_field->get_name() + "\" = " + m_key_field->sql(m_key_value);
......@@ -322,7 +343,11 @@ void Box_Data_List_Related::prepare_layout_dialog(Dialog_Layout* dialog)
{
Dialog_Layout_List_Related* related_dialog = dynamic_cast<Dialog_Layout_List_Related*>(dialog);
g_assert(related_dialog != NULL);
related_dialog->set_document(m_layout_name, get_document(), m_portal);
if(m_portal && m_portal->get_has_relationship_name())
related_dialog->set_document(m_layout_name, get_document(), m_portal);
else
related_dialog->set_document(m_layout_name, get_document(), m_parent_table);
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
......
......@@ -40,6 +40,10 @@ public:
*/
virtual bool init_db_details(const sharedptr<const LayoutItem_Portal>& portal, bool show_title = true);
/** 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);
protected:
virtual bool fill_from_database(); //Override.
......
......@@ -55,13 +55,37 @@ bool Box_Data_Portal::init_db_details(const sharedptr<const LayoutItem_Portal>&
{
m_portal = glom_sharedptr_clone(portal);
LayoutWidgetBase::m_table_name = m_portal->get_table_used(Glib::ustring() /* parent table_name, not used. */);
Glib::ustring parent_table;
if(m_portal)
parent_table = m_portal->get_from_table();
return init_db_details(parent_table, show_title);
}
//TODO: Is this base class implemenation 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;
const Glib::ustring relationship_title = m_portal->get_title_used(Glib::ustring() /* parent title - not relevant */);
if(show_title)
{
//TODO: This same code is in box_data_related_list.cc. Remove the duplication.
Glib::ustring relationship_title;
if(m_portal && m_portal->get_has_relationship_name())
relationship_title = m_portal->get_title_used(Glib::ustring() /* parent title - not relevant */);
else
{
//Note to translators: This text is shown instead of a table title, when the table has not yet been chosen.
relationship_title = _("Undefined Table");
}
m_Label.set_markup(Bakery::App_Gtk::util_bold_message(relationship_title));
m_Label.show();
......@@ -86,7 +110,7 @@ bool Box_Data_Portal::refresh_data_from_database_with_foreign_key(const Gnome::G
{
m_key_value = foreign_key_value;
if(m_key_field)
if(m_key_field && m_portal)
{
if(!Conversions::value_is_empty(m_key_value))
{
......@@ -172,7 +196,7 @@ void Box_Data_Portal::on_record_added(const Gnome::Gda::Value& primary_key_value
Box_Data_Portal::type_vecLayoutFields Box_Data_Portal::get_fields_to_show() const
{
const Document_Glom* document = get_document();
if(document)
if(document && m_portal)
{
Document_Glom::type_list_layout_groups mapGroups;
mapGroups.push_back(m_portal);
......@@ -224,6 +248,9 @@ void Box_Data_Portal::get_suitable_table_to_view_details(Glib::ustring& table_na
//Initialize output parameters:
table_name = Glib::ustring();
if(!m_portal)
return;
//Check whether a relationship was specified:
bool navigation_relationship_main = false;
sharedptr<const UsesRelationship> navigation_relationship = m_portal->get_navigation_relationship_specific(navigation_relationship_main);
......
......@@ -43,6 +43,10 @@ public:
*/
virtual bool init_db_details(const sharedptr<const LayoutItem_Portal>& portal, bool show_title = true);
/** 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);
/** Update a portal if a relevant value in its parent table has changed.
*
* @param foreign_key_value: The value that should be found in this table.
......@@ -89,6 +93,7 @@ protected:
Gtk::Label m_Label;
sharedptr<LayoutItem_Portal> m_portal;
Glib::ustring m_parent_table; //A duplicate of the from_table in m_portal, but only when m_portal is not null.
sharedptr<Field> m_key_field;
Gnome::Gda::Value m_key_value;
......
......@@ -89,22 +89,36 @@ Dialog_Layout_Calendar_Related::~Dialog_Layout_Calendar_Related()
{
}
void Dialog_Layout_Calendar_Related::set_document(const Glib::ustring& layout, Document_Glom* document, const sharedptr<const LayoutItem_CalendarPortal>& portal)
{
m_portal = glom_sharedptr_clone(portal);
Glib::ustring from_table;
if(portal)
from_table = portal->get_from_table();
set_document(layout, document, from_table);
}
void Dialog_Layout_Calendar_Related::set_document(const Glib::ustring& layout, Document_Glom* document, const Glib::ustring& from_table)
{
if(!m_portal)
{
m_portal = sharedptr<LayoutItem_CalendarPortal>::create(); //The rest of the class assumes that this is not null.
}
type_vecLayoutFields empty_fields; //Just to satisfy the base class.
Dialog_Layout::set_document(layout, document, portal->get_relationship()->get_from_table(), empty_fields);
//m_table_name is now actually the parent_table_name.
m_portal = glom_sharedptr_clone(portal);
Dialog_Layout::set_document(layout, document, from_table, empty_fields);
//m_table_name is now actually the parent_table_name.
update_ui();
}
void Dialog_Layout_Calendar_Related::update_ui(bool including_relationship_list)
{
if(!m_portal || !(m_portal->get_relationship()))
return;
m_modified = false;
const Glib::ustring related_table_name = m_portal->get_table_used(Glib::ustring() /* parent table - not relevant*/);
......@@ -119,12 +133,18 @@ void Dialog_Layout_Calendar_Related::update_ui(bool including_relationship_list)
bool show_child_relationships = m_checkbutton_show_child_relationships->get_active();
//For the showing of child relationships if necessary:
if(!show_child_relationships && m_portal->get_related_relationship())
if(!show_child_relationships && m_portal && m_portal->get_related_relationship())
{
show_child_relationships = true;
}
m_combo_relationship->set_relationships(document, m_portal->get_relationship()->get_from_table(), show_child_relationships, false /* don't show parent table */); //We don't show the optional parent table because portal use _only_ relationships, of course.
Glib::ustring from_table;
if(m_portal->get_has_relationship_name())
from_table = m_portal->get_relationship()->get_from_table();
else
from_table = m_table_name;
m_combo_relationship->set_relationships(document, from_table, show_child_relationships, false /* don't show parent table */); //We don't show the optional parent table because portal use _only_ relationships, of course.
if(show_child_relationships != m_checkbutton_show_child_relationships->get_active())
{
......@@ -133,12 +153,15 @@ void Dialog_Layout_Calendar_Related::update_ui(bool including_relationship_list)
}
//Set the table name and title:
sharedptr<LayoutItem_CalendarPortal> portal_temp = m_portal;
//sharedptr<LayoutItem_CalendarPortal> portal_temp = m_portal;
m_combo_relationship->set_selected_relationship(m_portal->get_relationship(), m_portal->get_related_relationship());
Document_Glom::type_list_layout_groups mapGroups;
mapGroups.push_back(m_portal);
document->fill_layout_field_details(related_table_name, mapGroups); //Update with full field information.
if(m_portal)
{
mapGroups.push_back(m_portal);
document->fill_layout_field_details(related_table_name, mapGroups); //Update with full field information.
}
//Show the field layout
//typedef std::list< Glib::ustring > type_listStrings;
......
......@@ -43,6 +43,9 @@ public:
* @param table_fields: The actual fields in the table, in case the document does not yet know about them all.
*/
virtual void set_document(const Glib::ustring& layout, Document_Glom* document, const sharedptr<const LayoutItem_CalendarPortal>& portal);
virtual void set_document(const Glib::ustring& layout, Document_Glom* document, const Glib::ustring& parent_table);
virtual void update_ui(bool including_relationships_list = true);
sharedptr<Relationship> get_relationship() const;
......
......@@ -764,16 +764,18 @@ void Dialog_Layout_Details::on_button_add_related()
{
Gtk::TreeModel::iterator parent = get_selected_group_parent();
/* We don't need to ask this because the portal layout dialog can now handle an empty portal:
sharedptr<Relationship> relationship = offer_relationship_list();
if(relationship)
{
*/
Gtk::TreeModel::iterator iter = append_appropriate_row();
if(iter)
{
Gtk::TreeModel::Row row = *iter;
sharedptr<LayoutItem_Portal> portal = sharedptr<LayoutItem_Portal>::create();
portal->set_relationship(relationship);
//portal->set_relationship(relationship);
row[m_model_items->m_columns.m_col_layout_item] = portal;
//Scroll to, and select, the new row:
......@@ -785,7 +787,9 @@ void Dialog_Layout_Details::on_button_add_related()
m_modified = true;
}
/*
}
*/
enable_buttons();
}
......@@ -794,16 +798,18 @@ void Dialog_Layout_Details::on_button_add_related_calendar()
{
Gtk::TreeModel::iterator parent = get_selected_group_parent();
/* We don't need to ask this because the portal layout dialog can now handle an empty portal:
sharedptr<Relationship> relationship = offer_relationship_list();
if(relationship)
{
*/
Gtk::TreeModel::iterator iter = append_appropriate_row();
if(iter)
{
Gtk::TreeModel::Row row = *iter;
sharedptr<LayoutItem_Portal> portal = sharedptr<LayoutItem_CalendarPortal>::create();
portal->set_relationship(relationship);
//portal->set_relationship(relationship);
row[m_model_items->m_columns.m_col_layout_item] = portal;
//Scroll to, and select, the new row:
......@@ -815,7 +821,7 @@ void Dialog_Layout_Details::on_button_add_related_calendar()
m_modified = true;
}
}
//}
enable_buttons();
}
......
......@@ -81,6 +81,11 @@ Dialog_Layout_List_Related::~Dialog_Layout_List_Related()
void Dialog_Layout_List_Related::set_document(const Glib::ustring& layout, Document_Glom* document, const Glib::ustring& from_table)
{
if(!m_portal)
{
m_portal = sharedptr<LayoutItem_Portal>::create(); //The rest of the class assumes that this is not null.
}
type_vecLayoutFields empty_fields; //Just to satisfy the base class.
Dialog_Layout::set_document(layout, document, from_table, empty_fields);
//m_table_name is now actually the parent_table_name.
......@@ -101,8 +106,8 @@ void Dialog_Layout_List_Related::set_document(const Glib::ustring& layout, Docum
void Dialog_Layout_List_Related::update_ui(bool including_relationship_list)
{
if(!m_portal || !(m_portal->get_relationship()))
return;
if(!m_portal)
return;
m_modified = false;
......@@ -123,7 +128,13 @@ void Dialog_Layout_List_Related::update_ui(bool including_relationship_list)
show_child_relationships = true;
}
m_combo_relationship->set_relationships(document, m_portal->get_relationship()->get_from_table(), show_child_relationships, false /* don't show parent table */); //We don't show the optional parent table because portal use _only_ relationships, of course.
Glib::ustring from_table;
if(m_portal->get_has_relationship_name())
from_table = m_portal->get_relationship()->get_from_table();
else
from_table = m_table_name;
m_combo_relationship->set_relationships(document, from_table, show_child_relationships, false /* don't show parent table */); //We don't show the optional parent table because portal use _only_ relationships, of course.
if(show_child_relationships != m_checkbutton_show_child_relationships->get_active())
{
......@@ -132,15 +143,18 @@ void Dialog_Layout_List_Related::update_ui(bool including_relationship_list)
}
//Set the table name and title:
sharedptr<LayoutItem_Portal> portal_temp = m_portal;
m_combo_relationship->set_selected_relationship(m_portal->get_relationship(), m_portal->get_related_relationship());
//sharedptr<LayoutItem_Portal> portal_temp = m_portal;
Document_Glom::type_list_layout_groups mapGroups;
mapGroups.push_back(m_portal);
document->fill_layout_field_details(related_table_name, mapGroups); //Update with full field information.
if(m_portal)
{
m_combo_relationship->set_selected_relationship(m_portal->get_relationship(), m_portal->get_related_relationship());
//Show the field layout
//typedef std::list< Glib::ustring > type_listStrings;
mapGroups.push_back(m_portal);
document->fill_layout_field_details(related_table_name, mapGroups); //Update with full field information.
//Show the field layout
//typedef std::list< Glib::ustring > type_listStrings;
}
m_model_items->clear();
......@@ -240,6 +254,7 @@ void Dialog_Layout_List_Related::save_to_document()
//Add the fields to the portal:
//The code that created this dialog must read m_portal back out again.
m_portal->remove_all_items();
guint field_sequence = 1; //0 means no sequence
......
......@@ -248,27 +248,32 @@ Box_Data_List_Related* FlowTableWithFields::create_related(const sharedptr<Layou
Document_Glom* pDocument = static_cast<Document_Glom*>(get_document());
if(pDocument)
{