Commit d125b35c authored by Murray Cumming's avatar Murray Cumming
Browse files

Box_Data_Portal: Make m_parent_table private and add accessors.

parent 0758587c
......@@ -83,7 +83,7 @@ bool Box_Data_Calendar_Related::init_db_details(const Glib::ustring& parent_tabl
{
//std::cout << "debug: " << G_STRFUNC << ": " << parent_table << std::endl;
m_parent_table = parent_table;
set_parent_table(parent_table);
const auto portal = get_portal();
if(portal)
......@@ -401,7 +401,7 @@ void Box_Data_Calendar_Related::prepare_layout_dialog(Dialog_Layout* dialog)
}
else
{
related_dialog->init_with_tablename(m_layout_name, m_layout_platform, get_document(), m_parent_table);
related_dialog->init_with_tablename(m_layout_name, m_layout_platform, get_document(), get_parent_table());
}
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
......
......@@ -79,7 +79,7 @@ bool Box_Data_List_Related::init_db_details(const std::shared_ptr<const LayoutIt
bool Box_Data_List_Related::init_db_details(const Glib::ustring& parent_table, bool show_title)
{
m_parent_table = parent_table;
set_parent_table(parent_table);
const auto portal = get_portal();
if(portal)
......@@ -381,7 +381,7 @@ void Box_Data_List_Related::prepare_layout_dialog(Dialog_Layout* dialog)
return;
}
related_dialog->init_with_portal(m_layout_name, m_layout_platform, get_document(), portal, m_parent_table);
related_dialog->init_with_portal(m_layout_name, m_layout_platform, get_document(), portal, get_parent_table());
}
#endif // !GLOM_ENABLE_CLIENT_ONLY
......
......@@ -388,5 +388,15 @@ void Box_Data_Portal::set_find_mode(bool val)
m_find_mode = val;
}
Glib::ustring Box_Data_Portal::get_parent_table() const
{
return m_parent_table;
}
void Box_Data_Portal::set_parent_table(const Glib::ustring& parent_table)
{
m_parent_table = parent_table;
}
} //namespace Glom
......@@ -92,6 +92,9 @@ public:
*/
virtual void set_find_mode(bool val = true);
Glib::ustring get_parent_table() const;
void set_parent_table(const Glib::ustring& parent_table);
protected:
type_vecConstLayoutFields get_fields_to_show() const override;
......@@ -122,16 +125,13 @@ protected:
Gtk::Frame m_Frame;
Gtk::Label m_Label;
public:
const Glib::ustring &get_parent() const {
return m_parent_table;
}
protected:
private:
Glib::ustring m_parent_table; //A duplicate of the from_table in the poral, but only when get_portal() is not null.
// m_key_field and m_key_value are the field and its value in this table that
// must match another field in the parent table.
public:
std::shared_ptr<Field> m_key_field;
Gnome::Gda::Value m_key_value;
......
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