Commit 5ab54a27 authored by Murray Cumming's avatar Murray Cumming Committed by Murray Cumming
Browse files

Depend on latest libgdamm.

2005-07-25  Murray Cumming  <murrayc@murrayc.com>

        * configure.in: Depend on latest libgdamm.
        * glom/utility_widgets/imageglom.cc:
        * glom/data_structure/field.cc: Change for latest libgdamm
        API change.
        * glom/document/document_glom.cc:
        * glom/document/document_glom.h: Remove unused
        set_relationship_data_layout_groups().
        * glom/mode_data/box_data_details.cc: on_flowtable_layout_changed():
        Actually save the new layout in the document. For instance, really
        save portal layout changes.
parent fee8651f
2005-07-25 Murray Cumming <murrayc@murrayc.com>
* configure.in: Depend on latest libgdamm.
* glom/utility_widgets/imageglom.cc:
* glom/data_structure/field.cc: Change for latest libgdamm
API change.
* glom/document/document_glom.cc:
* glom/document/document_glom.h: Remove unused
set_relationship_data_layout_groups().
* glom/mode_data/box_data_details.cc: on_flowtable_layout_changed():
Actually save the new layout in the document. For instance, really
save portal layout changes.
2005-07-25 Murray Cumming <murrayc@murrayc.com>
* glom/utility_widgets/db_adddel/cellrenderer_button.cc:
......
......@@ -32,7 +32,7 @@ AC_LANG_CPLUSPLUS
# Checks for libraries
# We need libgnome only for gnome_help_display().:
PKG_CHECK_MODULES(GLOM, bakery-2.4 >= 2.3.14 gnome-vfsmm-2.6 >= 2.11.1 libgnomecanvasmm-2.6 >= 2.10.0 libgdamm-2.0 >= 1.3.4 libgnome-2.0 >= 2.6.0 gthread-2.0 gtkmm-2.4 >= 2.6.1 libxslt >= 1.1.10 iso-codes pygtk-2.0 >= 2.6.0 pygda-1.2)
PKG_CHECK_MODULES(GLOM, bakery-2.4 >= 2.3.14 gnome-vfsmm-2.6 >= 2.11.1 libgnomecanvasmm-2.6 >= 2.10.0 libgdamm-2.0 >= 1.3.7 libgnome-2.0 >= 2.6.0 gthread-2.0 gtkmm-2.4 >= 2.6.1 libxslt >= 1.1.10 iso-codes pygtk-2.0 >= 2.6.0 pygda-1.2)
AC_SUBST(GLOM_CFLAGS)
AC_SUBST(GLOM_LIBS)
......
......@@ -247,7 +247,7 @@ Glib::ustring Field::sql(const Gnome::Gda::Value& value) const
if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_BINARY)
{
long buffer_size = 0;
const gpointer buffer = value.get_binary(&buffer_size);
const gpointer buffer = value.get_binary(buffer_size);
str = "'" + GlomConversions::get_escaped_binary_data((guint8*)buffer, buffer_size) + "'::bytea";
}
......
......@@ -52,7 +52,7 @@ public:
void remove_all_items();
void debug(guint level = 0) const;
virtual void debug(guint level = 0) const;
Glib::ustring m_title;
guint m_columns_count;
......
......@@ -142,3 +142,9 @@ void LayoutItem_Portal::change_related_relationship_name(const Glib::ustring& /*
{
}
void LayoutItem_Portal::debug(guint level) const
{
g_warning("LayoutItem_Portal::debug: level = %d", level);
LayoutGroup::debug(level);
}
......@@ -46,6 +46,8 @@ public:
virtual void change_relationship_name(const Glib::ustring& table_name, const Glib::ustring& name, const Glib::ustring& name_new);
virtual void change_related_relationship_name(const Glib::ustring& table_name, const Glib::ustring& name, const Glib::ustring& name_new);
virtual void debug(guint level = 0) const;
Relationship m_relationship; //Public, for more efficient access.
......
......@@ -823,17 +823,9 @@ Document_Glom::type_mapLayoutGroupSequence Document_Glom::get_data_layout_groups
return type_mapLayoutGroupSequence(); //not found
}
void Document_Glom::set_relationship_data_layout_groups(const Glib::ustring& layout_name, const Relationship& relationship, const type_mapLayoutGroupSequence& groups)
void Document_Glom::set_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const type_mapLayoutGroupSequence& groups)
{
//TODO: Use an actual relationship_name instead of concatenating:
set_data_layout_groups(layout_name + "_related_" + relationship.get_name(), relationship.get_from_table(), groups, relationship.get_to_table());
}
void Document_Glom::set_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const type_mapLayoutGroupSequence& groups, const Glib::ustring& table_name)
{
Glib::ustring child_table_name = table_name;
if(child_table_name.empty())
child_table_name = parent_table_name;
Glib::ustring child_table_name = parent_table_name; //TODO: Remove this cruft.
//g_warning("Document_Glom::set_data_layout_groups(): ADDING layout for table %s (child_table=%s), for layout %s", parent_table_name.c_str(), child_table_name.c_str(), layout_name.c_str());
......@@ -1729,7 +1721,9 @@ bool Document_Glom::save_before()
xmlpp::Element* nodeGroups = nodeReport->add_child(GLOM_NODE_DATA_LAYOUT_GROUPS);
save_before_layout_group(nodeGroups, iter->second.m_layout_group);
}
nodeTable->add_child_text("\n\n"); //Make it a bit easier to read,
}
} //for m_tables
......@@ -1753,7 +1747,7 @@ bool Document_Glom::save_before()
nodeGroup->set_attribute(GLOM_ATTRIBUTE_NAME, group_info.m_name);
set_node_attribute_value_as_bool(nodeGroup, GLOM_ATTRIBUTE_DEVELOPER, group_info.m_developer);
//The privilieges for each table, for this group:
//The privileges for each table, for this group:
for(GroupInfo::type_map_table_privileges::const_iterator iter = group_info.m_map_privileges.begin(); iter != group_info.m_map_privileges.end(); ++iter)
{
xmlpp::Element* nodeTablePrivs = nodeGroups->add_child(GLOM_NODE_TABLE_PRIVS);
......
......@@ -106,9 +106,7 @@ public:
typedef std::map<guint, LayoutGroup> type_mapLayoutGroupSequence;
virtual type_mapLayoutGroupSequence get_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name) const;
virtual void set_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const type_mapLayoutGroupSequence& groups, const Glib::ustring& table_name = Glib::ustring());
virtual void set_relationship_data_layout_groups(const Glib::ustring& layout_name, const Relationship& relationship, const type_mapLayoutGroupSequence& groups);
virtual void set_data_layout_groups(const Glib::ustring& layout_name, const Glib::ustring& parent_table_name, const type_mapLayoutGroupSequence& groups);
/**
* @para The layout_name, such as "details", "list".
......
......@@ -166,7 +166,7 @@ void Box_Data_Details::create_layout()
m_FlowTable.set_table(m_strTableName); //This allows portals to get full Relationship information
//This map of layout groups will also contain the field information from the database:
Document_Glom::type_mapLayoutGroupSequence layout_groups = get_data_layout_groups("details");
Document_Glom::type_mapLayoutGroupSequence layout_groups = get_data_layout_groups(m_layout_name);
for(Document_Glom::type_mapLayoutGroupSequence::const_iterator iter = layout_groups.begin(); iter != layout_groups.end(); ++iter)
{
......@@ -446,6 +446,11 @@ void Box_Data_Details::on_flowtable_layout_changed()
Document_Glom::type_mapLayoutGroupSequence layout_groups;
m_FlowTable.get_layout_groups(layout_groups);
//Store it in the document:
Document_Glom* document = get_document();
if(document)
document->set_data_layout_groups(m_layout_name, m_strTableName, layout_groups);
//Build the view again from the new layout:
create_layout();
......@@ -802,7 +807,7 @@ void Box_Data_Details::print_layout()
//The groups:
xmlpp::Element* nodeParent = nodeRoot;
Document_Glom::type_mapLayoutGroupSequence layout_groups = get_data_layout_groups("details");
Document_Glom::type_mapLayoutGroupSequence layout_groups = get_data_layout_groups(m_layout_name);
for(Document_Glom::type_mapLayoutGroupSequence::const_iterator iter = layout_groups.begin(); iter != layout_groups.end(); ++iter)
{
const LayoutGroup& layout_group = iter->second;
......
......@@ -318,11 +318,11 @@ void Box_Data_List_Related::on_dialog_layout_hide()
LayoutItem_Portal* pLayoutItem = dynamic_cast<LayoutItem_Portal*>(get_layout_item());
if(pLayoutItem)
{
/*
*pLayoutItem = m_portal;
g_warning("Box_Data_List_Related::opLayoutItem->m_map_items.size()=%d", pLayoutItem->m_map_items.size());
pLayoutItem->debug();
*/
signal_layout_changed().emit(); //TODO: Check whether it has really changed.
}
}
......
......@@ -668,6 +668,17 @@ void FlowTableWithFields::add_layoutwidgetbase(LayoutWidgetBase* layout_widget,
void FlowTableWithFields::on_layoutwidget_changed()
{
g_warning("FlowTableWithFields::on_layoutwidget_changed");
LayoutGroup* pLayoutItem = dynamic_cast<LayoutGroup*>(get_layout_item());
if(pLayoutItem)
{
//Update tha LayoutItem by looking at the child widgets:
get_layout_group(*pLayoutItem);
g_warning("FlowTableWithFields::on_layoutwidget_changed size()=%d", pLayoutItem->m_map_items.size());
pLayoutItem->debug();
}
//Forward the signal to the container:
signal_layout_changed().emit();
}
......
......@@ -124,7 +124,7 @@ void ImageGlom::set_value(const Gnome::Gda::Value& value)
if(value.get_value_type() == Gnome::Gda::VALUE_TYPE_BINARY)
{
glong size = 0;
const gpointer pData = value.get_binary(&size);
const gpointer pData = value.get_binary(size);
if(size && pData)
{
//libgda does not currently properly unescape binary data,
......
Supports Markdown
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