2006-03-14 Murray Cumming * glom/mode_data/box_data.cc: record_new(): Do not ignore entered field data for related fields, because we just calculated them, and they are correct. Somehow or other this fixes the bug that caused calculated field values from the last-shown record to be inserted into new records. 2006-03-14 Murray Cumming * glom/utility_widgets/imageglom.cc: set_value(): When clearing the image, also clear m_pixbuf_original, so that it doesn't come back when the image is rescaled. For instance, this makes sure that picture fields are empty when adding new records on the detail view. 2006-03-14 Murray Cumming * glom/document/document_glom.cc: set_userlevel(): Add some debug output. * glom/frame_glom.cc: on_menu_userlevel_Developer(): Add some debug output, because someone has reported that they can not go to developer mode. This might help us find out exactly why. * glom/mode_data/box_data_list_related.cc: * glom/mode_data/box_data_list_related.h: init_db(): Add optional show_title parameter. * glom/utility_widgets/flowtablewithfields.cc: * glom/utility_widgets/flowtablewithfields.h: add_layout_notebook_at_position(): Support Related Records portals as direct children of Notebook parts, putting their titles in the tab instead of having an alignment tab, and instead of requiring them to be inside a group. 2006-03-14 Murray Cumming * glom/base_db.cc: * glom/base_db.h: Moved some code into report_build_records_field() and report_build_records_text(). Added report_build_records_verticalgroup(). report_build() and report_build_records(): Handle vertical groups (recursively). * glom/data_structure/layout/report_parts/Makefile.am: * glom/data_structure/layout/report_parts/layoutitem_verticalgroup.cc: * glom/data_structure/layout/report_parts/layoutitem_verticalgroup.h: Added new report part, for stacked rows of fields in one cell of a record, for fitting more stuff into one row of a report. * glom/document/document_glom.cc: Load/Save the new layout item. * glom/dialog_layout_report.cc: * xslt/print_report_to_html.xsl: Handle vertical_group and field_vertical. * glom/utility_widgets/flowtablewithfields.cc: add_layout_notebook_at_position(): Make the notebook tabs bold, so they are as visible as group titles, which is what they are really. Make sure that the notebook pages have border spacing. 2006-03-13 Murray Cumming * glom/base_db.cc: * glom/base_db.h: * glom/data_structure/layout/Makefile.am: * glom/data_structure/layout/layoutitem_notebook.cc: * glom/data_structure/layout/layoutitem_notebook.h: * glom/document/document_glom.cc: * glom/document/document_glom.h: * glom/glom.glade: * glom/layout_item_dialogs/Makefile.am: * glom/layout_item_dialogs/dialog_notebook.cc: * glom/layout_item_dialogs/dialog_notebook.h: * glom/mode_data/dialog_layout_details.cc: * glom/mode_data/dialog_layout_details.h: * glom/utility_widgets/Makefile.am: * glom/utility_widgets/flowtablewithfields.cc: * glom/utility_widgets/flowtablewithfields.h: * glom/utility_widgets/layoutwidgetbase.cc: * glom/utility_widgets/layoutwidgetbase.h: * glom/utility_widgets/notebookglom.cc: * glom/utility_widgets/notebookglom.h: * po/POTFILES.in: Added Notebook part, which has Groups as child items for tabs. 2006-03-13 Murray Cumming * glom/base_db.cc: get_table_fields_to_show_for_sequence_add_group(): When getting full field details for related fields, use get_table_used() instead of the single-related to_table, so that this works with doubly-related fields. This makes doubly-related fields work in portals. * glom/mode_data/dialog_layout_list_related.cc: on_button_edit_field(): Show fields to the to_table, not the parent table. * glom/utility_widgets/db_adddel/db_adddel.cc: get_column_index(): Use is_same_field(), so that it works for doubly-related fields too. 2006-03-13 Murray Cumming * glom/data_structure/layout/custom_title.cc: * glom/data_structure/layout/custom_title.h: Added get/set_use_custom_title(). * glom/data_structure/layout/layoutitem_field.cc: * glom/data_structure/layout/layoutitem_field.h: Added get_title_or_name_no_custom(). get_title_or_name(): Return an empty custom title if use_custom_title is set. * glom/data_structure/translatable_item.cc: * glom/data_structure/translatable_item.h: get_translatable_type_name(): Add a result for custom field titles. * glom/document/document_glom.cc: * glom/document/document_glom.h: load_after_layout_item_field(), save_before_layout_item_field(): Load/Save a bool use_custom_title attribute, to allow for empty custom titles. Added get_translatable_report_items(). get_translatable_layout_items(): Handle GroupBy group-by fields and secondary fields. * glom/layout_item_dialogs/dialog_field_layout.cc: set_field(): Show the non-custom title as the default title, so it does not change if there is a custom title. * glom/translation/window_translations.cc: Use get_translatable_report_items() to get custom titles and GroupBy fields. 2006-03-13 Murray Cumming * glom/document/document_glom.cc: load_after_layout_group(), save_before_layout_group(): For GroupBy parts, save a whole LayoutItem node for the group-by field, so we can use related fields and custom formatting for it. * glom/glom.glade: dialog_group_by: Rename the Select button for Sort Fields to Edit, to match the button for secondary fields, which also has more than one field. * glom/layout_item_dialogs/dialog_group_by.cc: * glom/layout_item_dialogs/dialog_group_by.h: Added Formatting button, to allow us, for instance, to change the title of the group-by field. 2006-03-13 Murray Cumming * glom/base_db.cc: report_build_groupby_children(): In the ORDER BY clause, use the relationship alias name, instead of the table name, to avoid getting extra records because we would not be using the join. * glom/data_structure/layout/usesrelationship.cc: * glom/data_structure/layout/usesrelationship.h: Added get_sql_table_or_join_alias_name() for convenience. * glom/utils.cc: build_sql_select_with_where_clause(): Use get_sql_table_or_join_alias_name() to simplify the code. * glom/document/document_glom.cc: load_after_layout_group(): Fill the full field details for secondary fields of GroupBy parts. * glom/layout_item_dialogs/dialog_group_by.cc: update_labels(): Show the list of secondary fields. * xslt/print_report_to_html.xsl: Only indent child group_by divs, to avoid wasting space at the left margin. 2006-03-13 Murray Cumming * glom/utility_widgets/db_adddel/db_adddel.cc: treeviewcolumn_on_cell_data(): Check the type of the GdaValue before calling get_bool, to avoid warnings about it not being bool. It seems to be null sometimes. Not sure why. 2006-03-13 Murray Cumming * glom/base_db.cc: report_build_groupby(): Use the border width also when using the group_by node for non-grouped records. * glom/layout_item_dialogs/comboentry_borderwidth.cc: Constructor add a 0.05em border width choice, for a finer line. 2006-03-13 Murray Cumming * glom/data_structure/layout/report_parts/layoutitem_groupby.cc: * glom/data_structure/layout/report_parts/layoutitem_groupby.h: Use a list of sort fields, instead of just one, for multiple sort levels. * glom/base_db.cc: * glom/dialog_layout_report.cc: * glom/document/document_glom.cc: * glom/document/document_glom.h: * glom/glom.glade: * glom/layout_item_dialogs/Makefile.am: * glom/layout_item_dialogs/dialog_group_by.cc: * glom/layout_item_dialogs/dialog_group_by.h: * glom/layout_item_dialogs/dialog_groupby_sortfields.cc: * glom/layout_item_dialogs/dialog_groupby_sortfields.h: * glom/utils.cc: Handle the lsit of sort fields. * glom/data_structure/layout/layoutitem.cc: * glom/data_structure/layout/layoutitem.h: Add get_layout_display_name() as virtual method here, so we can call it polymorphically. 2006-03-12 Murray Cumming * glom/layout_item_dialogs/dialog_groupby_secondaryfields.cc: * glom/mode_data/dialog_layout_export.cc: * glom/mode_data/dialog_layout_list.cc: * glom/mode_data/dialog_layout_list_related.cc: More removal of copy/pasted code. Using get_layout_display_name() instead. 2006-03-12 Murray Cumming * glom/data_structure/layout/layoutitem_field.cc: * glom/mode_data/dialog_layout_details.cc: on_cell_data_name(): Move the code to create the field display name (with the :: separators) into LayoutItem_Field::get_layout_display_name(), to avoid copy/paste wasteage and to make it show up properly in the Reports layout dialog. 2006-03-12 Murray Cumming * glom/combobox_relationship.cc: set_selected_relationship() Fix a crash caused by use of wrong iterator. * glom/mode_data/dialog_choose_field.cc: set_document(): Specify the related_relationship if there is one, and make sure that the full list is visible if it's needed by the current field. 2006-03-12 Murray Cumming * glom/glom.glade: * glom/combobox_relationship.cc: * glom/combobox_relationship.h: * glom/mode_data/dialog_choose_field.cc: * glom/mode_data/dialog_choose_field.h: Optionally show related relationships, to allow specifying doubly-related fields. * glom/data_structure/layout/layoutitem_field.cc: * glom/data_structure/layout/layoutitem_field.h: Added get_is_same_field() to check the name, and both relationships easily. * glom/utility_widgets/flowtablewithfields.cc: get_field(): Use get_is_same_field() to handle doubly-related fields. * glom/data_structure/layout/usesrelationship.cc: * glom/data_structure/layout/usesrelationship.h: Added get/set_related_relationship() and associated methods. Added get_sql_join_alias_name() and get_sql_join_alias_definition(), moving SQL generation code from GlomUtils::build_sql_select_with_where_clause(). * glom/utils.cc: GlomUtils::build_sql_select_with_where_clause(): Simplify by using the UsesRelationships methods. This can now support doubly-related fields by creating aliases in terms of other aliases. * glom/document/document_glom.cc: * glom/document/document_glom.h: Load/Save the related_relationship. Load layouts after all other table information has been loaded for all tables, because the layouts need the full information. * glom/data_structure/layout/fieldformatting.cc: * glom/data_structure/layout/layoutgroup.cc: * glom/data_structure/layout/layoutitem_portal.cc: * glom/mode_data/dialog_layout_details.cc: * glom/mode_data/dialog_layout_list.cc: * glom/mode_data/box_data.cc: Update appropriately. 2006-03-12 Murray Cumming * glom/base_db.cc: * glom/base_db.h: * glom/layout_item_dialogs/dialog_field_summary.cc: * glom/layout_item_dialogs/dialog_group_by.cc: * glom/layout_item_dialogs/dialog_groupby_secondaryfields.cc: * glom/mode_data/dialog_layout_details.cc: * glom/mode_data/dialog_layout_details.h: * glom/mode_data/dialog_layout_export.cc: * glom/mode_data/dialog_layout_list.cc: * glom/mode_data/dialog_layout_list_related.cc: Remove a lot of copying and pasting of near-identical offer_field_list() and offer_field_formatting() functions. Just use the one in Base_DB. Also made sure that these dialogs are always transient, by adding a Window* parameter. * glom/glom.glade: * glom/dialog_layout_report.cc: * glom/dialog_layout_report.h: Added a Formatting button. For instance, this allows the field titles to be changed (or removed) on reports. 2006-03-12 Murray Cumming * glom/base_db.cc: * glom/data_structure/layout/layoutgroup.cc: * glom/data_structure/layout/layoutgroup.h: Added get/set_border_width() for use when creating reports, for some slight formatting choice. * glom/document/document_glom.cc: * glom/document/document_glom.h: load_after_layout_group(), save_before_layout_group(): Handle the border_width. * glom/glom.glade: * glom/layout_item_dialogs/dialog_group_by.cc: * glom/layout_item_dialogs/dialog_group_by.h: Allow the user to choose a border width for the rows in the group. * glom/layout_item_dialogs/Makefile.am: * glom/layout_item_dialogs/comboentry_borderwidth.cc: * glom/layout_item_dialogs/comboentry_borderwidth.h: New widget for choosing the border width. * glom/mode_data/dialog_layout_details.cc: * glom/mode_data/dialog_layout_details.h: Simplify the if/ifelse blocks that deal with layout parts. * xslt/print_report_to_html.xsl: Reduce copy/paste by using xsl::variables (though those xsl::variable blocks are copy/pasted). Use xsl::variables to apply a border-width style to td and the HTML blocks, depending on the border_width of the group-by. Add a horizontal line after the group-by titles. 2006-03-11 Murray Cumming * glom/data_structure/layout/layoutitem_field.cc: get_layout_display_name(): Return the name even if the full details cache is invalid. * glom/document/document_glom.cc: load_after(): Fill the full field details when loading report items, so that they show up in the report when it is edited. 2006-03-11 Murray Cumming * glom/dialog_layout_report.cc: enable_buttons(): Enable the Add button even if the item can not be a parent of the new item, so that the new item can become a sibling instead, if parent would allow that. 2006-03-11 Murray Cumming * glom/base_db.cc: report_build_records(): Instead of generating different node names for numeric field headings and field values, just add a field_type attribute. * xslt/print_report_to_html.xsl: In and : Use xls:choose to do align="right" if the node has a field_type="numeric" attribute. 2006-03-11 Murray Cumming * glom/base_db.cc: * glom/base_db.h: report_build_groupby(): Move child record generation into new report_build_groupby_children() method. Output child records even if there is no group_by field in the GroupBy part, so users can use it just to sort records, though that's a bit of a hack. I think adding an explicit SortBy part would confuse things, because it might not be clear what group of records are being sorted. But maybe it would work. * xslt/print_report_to_html.xsl: In : Do not print the group-by field title and value (with the : separator) if there is no group-by field, to avoid a lone :. 2006-03-11 Murray Cumming * glom/dialog_layout_report.cc: set_report(), get_report(): Allow non-group LayoutItems at the top level, instead of putting them inside an automatically-created group. 2006-03-10 Murray Cumming * po/POTFILES.in: Added data_structure/layout/layoutitem_text.cc 2006-03-09 Murray Cumming * glom/box_reports.cc: on_adddel_Add(): Set the new report name in the row key, so we know what row to edit in subsequent steps. 2006-03-09 Murray Cumming * glom/data_structure/layout/layoutgroup.cc: * glom/data_structure/layout/layoutgroup.h: Added get_items_count(). * glom/dialog_layout_report.cc: get_original_report_name(): Do not crash if there are top-level fields. Still need to handle this properly though. * glom/utility_widgets/datawidget.cc: set_editable(): Call set_sensitive() on ComboBoxes, because the menu still changes the value if we just call set_editable on its Entry. 2006-03-09 Murray Cumming * glom/base_db.cc: * glom/base_db.h: report_build_records() takes a vector of LayoutItem instead of LayoutItem_Field, so it can handle text items. So text objects now work on record rows of reports. 2006-03-09 Murray Cumming * glom/base_db.cc: * glom/base_db.h: Added offer_textobject(). * glom/data_structure/layout/Makefile.am: * glom/data_structure/layout/layoutitem_text.cc: * glom/data_structure/layout/layoutitem_text.h: Added Text layout part, for adding arbitrary text or empty text with a title, to a details layout. Does not work on reports yet. * glom/data_structure/translatable_item.cc: * glom/data_structure/translatable_item.h: get_translatable_type_name(): Update. * glom/dialog_layout_report.cc: Constructor: Add the Text object as a possible part to add. * glom/document/document_glom.cc: * glom/document/document_glom.h: load_after_group(), save_before_group(): Handle the text object layout part. * glom/glom.glade: * glom/mode_data/dialog_layout_details.cc: * glom/mode_data/dialog_layout_details.h: Added Add Text button and handled it. * glom/mode_design/Makefile.am: * glom/mode_design/dialog_textobject.h * glom/mode_design/dialog_textobject.cc: New dialog for editing the text object. * glom/utility_widgets/Makefile.am: * glom/utility_widgets/flowtablewithfields.cc: * glom/utility_widgets/flowtablewithfields.h: add_layout_item_at_position(): Add a LabelGlom for text objects. * glom/utility_widgets/labelglom.cc: * glom/utility_widgets/labelglom.h: New widget for the text object.