[glom/glom-1-16] Merged the feature_choices_show_all branch.



commit 8a2458a7b4ed35fec289c59706fe2738ac57d53c
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Aug 6 17:52:08 2010 +0200

    Merged the feature_choices_show_all branch.

 ChangeLog                                          |  170 ++++-
 Makefile.am                                        |    4 +-
 Makefile_tests.am                                  |   16 +-
 configure.ac                                       |   21 +-
 glom/application.cc                                |    3 +
 glom/base_db.cc                                    |    2 +-
 glom/glom_developer.glade                          |   19 +
 .../data_structure/layout/fieldformatting.cc       |   52 +-
 .../data_structure/layout/fieldformatting.h        |   18 +-
 glom/libglom/document/document.cc                  |   19 +-
 glom/libglom/utils.cc                              |  252 +++---
 glom/libglom/utils.h                               |   11 +-
 glom/mode_data/box_data_portal.h                   |    1 -
 glom/mode_data/datawidget/combo.cc                 |   66 +-
 glom/mode_data/datawidget/combo.h                  |   12 +-
 .../mode_data/datawidget/combo_as_radio_buttons.cc |   16 +-
 glom/mode_data/datawidget/combo_as_radio_buttons.h |    6 +-
 glom/mode_data/datawidget/combochoices.cc          |  159 +++-
 glom/mode_data/datawidget/combochoices.h           |   30 +-
 .../datawidget/combochoiceswithtreemodel.cc        |   10 +-
 .../datawidget/combochoiceswithtreemodel.h         |    6 +-
 glom/mode_data/datawidget/comboentry.cc            |   70 +-
 glom/mode_data/datawidget/comboentry.h             |   18 +-
 glom/mode_data/datawidget/datawidget.cc            |   68 +-
 glom/mode_data/flowtablewithfields.cc              |  265 ++++---
 glom/mode_data/flowtablewithfields.h               |   57 +-
 .../layout/layout_item_dialogs/box_formatting.cc   |   14 +-
 .../layout/layout_item_dialogs/box_formatting.h    |    1 +
 glom/utility_widgets/db_adddel/db_adddel.cc        |  332 +++++---
 glom/utility_widgets/db_adddel/db_adddel.h         |   82 +-
 po/es.po                                           |  973 +++++++++++---------
 31 files changed, 1700 insertions(+), 1073 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6c3cddc..b0f2939 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,163 @@
+2010-08-06  Murray Cumming  <murrayc murrayc-desktop>
+
+	Formatting: Add get_choices_related() overload to reduce copy/pasted code.
+
+	* glom/libglom/data_structure/layout/fieldformatting.[h|cc]:
+  Added a get_choices_related() overload that returns the LayoutItem_Fields
+  instead of just the field names. This reduces the copy/pasted code in the
+  callers, and makes it easier to support related fields in future.
+	* glom/libglom/utils.[h|cc]:
+	* glom/mode_data/datawidget/combochoices.[h|cc]:
+	* glom/utility_widgets/db_adddel/db_adddel.cc: Adapted and made necessary
+  const corrections.
+
+2010-08-06  Murray Cumming  <murrayc murrayc com>
+
+	Choices: Fix !show-all lists.
+
+	* glom/mode_data/datawidget/combochoices.[h|cc]:
+  refresh_data_from_database_with_foreign_key(): Add a document parameter,
+  used to update the cached choices information if necessary.
+	* glom/mode_data/flowtablewithfields.cc: set_field_value(): Adapted.
+
+2010-08-06  Murray Cumming  <murrayc murrayc com>
+
+	Document loading: Show an error dialog even for unexpected errors.
+
+	* glom/application.cc: on_document_load(): Don't just fail silently when
+  there is an unexpected error, for instance if the postgres data directory
+  is missing.
+
+2010-08-06  Murray Cumming  <murrayc murrayc com>
+
+	Utils::get_choice_values(): Reduce copy/pasted code.
+
+	* glom/libglom/utils.[h|cc]: build_sql_select_with_key(): Add a sort_clause
+  parameter.
+  get_choice_values(field): Rename this to get_choice_values_all() and change
+  the implementation to just call the other get_choice_values(). Add
+  a Document* parameter so we can do that.
+  get_choice_values(document, field, ...): Sort the list by the first field.
+  This should probably be an option in the developer-mode UI.
+	* glom/mode_data/datawidget/combo.h:
+	* glom/mode_data/datawidget/combochoices.[h|cc]:
+	* glom/mode_data/datawidget/comboentry.h:
+	* glom/utility_widgets/db_adddel/db_adddel.cc:
+  get_choice_values(): Adapt to the change, by adding a Document* parameter.
+	* glom/base_db.cc: Adapt.
+
+2010-08-06  Murray Cumming  <murrayc murrayc com>
+
+	DbAddDel: Avoid some copy/pasting of code to append items to choices cells.
+
+	* glom/utility_widgets/db_adddel/db_adddel.[h|cc]: Added set_cell_choices(),
+  using it in refresh_cell_choices_data_from_database_with_foreign_key() and
+  construct_specified_columns_cellrenderer().
+
+2010-08-06  David King  <davidk openismus com>
+
+	Minor build system cleanup
+
+	* configure.ac: Drop unnecessary AC_DISABLE_STATIC. Use AS_IF rather
+	than shell if...fi. Add a TODO.
+	* Makefile.am:
+	* Makefile_tests.am: Take advantage of dependencies to reduce
+	duplication of linker flags.
+
+2010-08-06  Murray Cumming  <murrayc murrayc com>
+
+	List: Choices with !show_all: Update the list when the from_field changes.
+
+	* glom/libglom/utils.[h|cc]: Added a get_choice_values() overload that
+	takes the foreign_key.
+	* glom/utility_widgets/db_adddel/db_adddel.[h|cc]: Added get_choice_index()
+	to get the affected choice lists when a field value changes.
+	Added refresh_cell_choices_data_from_database_with_foreign_key() to update
+	these lists.
+	set_value(): Use these methods to update choice lists when appropriate,
+	as already happens in the Details view.
+
+2010-08-05  Murray Cumming  <murrayc murrayc com>
+
+	List view: When a value is edited, update other instances of the same field.
+
+	* glom/utility_widgets/db_adddel/db_adddel.[h|cc]:
+	get_data_model_column_index(): Add a including_specified_field_layout bool
+	parameter, used in a new set_value() method overload that has a
+	set_specified_field_layout bool parameter.
+	user_changed(): Call set_value() to show the new value in any other
+	instances of the same field.
+	The details view already does this.
+
+2010-08-04  Murray Cumming  <murrayc murrayc com>>
+
+	Simplified some code.
+
+	* glom/mode_data/flowtablewithfields.[h|cc]: set_value(), set_other_value():
+  Avoid copy/pasting of the code.
+
+2010-08-04  Murray Cumming  <murrayc murrayc com>
+
+	Details: Choices with !show_all: Update the list when the from_field changes.
+
+	* glom/libglom/data_structure/layout/fieldformatting.[h|cc]: Renamed
+	set/get_choices() to set/get_choices_related().
+	* glom/libglom/utils.cc:
+	* glom/libglom/document/document.cc:
+	* glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:
+	* glom/utility_widgets/db_adddel/db_adddel.cc: Adapted.
+
+	* glom/mode_data/datawidget/combochoices.[h|cc]: Remove the non-default
+	constructor that took a second field.
+	Move set_choices_with_second() to private.
+	Add set_choices_related() and matching member variables.
+	Add refresh_data_from_database_with_foreign_key(), like the one in
+	Box_Data_RelatedRecords, which gets the related values and calls
+	set_choices_with_second().
+	* glom/mode_data/datawidget/combo.[h|cc]:
+	* glom/mode_data/datawidget/combo_as_radio_buttons.[h|cc]:
+	* glom/mode_data/datawidget/combochoiceswithtreemodel.[h|cc]:
+	* glom/mode_data/datawidget/comboentry.[h|cc]: Adapt to the changed
+	ComboChoices base API.
+	* glom/mode_data/datawidget/datawidget.cc:
+	create_combo_widget_for_field(): Do not take the second field as a parameter,
+	because that is now specified later.
+	Constructor: Simplify the code now that ComboChoices does more of the work.
+	* glom/mode_data/flowtablewithfields.cc: set_field_value(),
+	set_other_field_value(): Call refresh_data_from_database_with_foreign_key() on
+	the choice widgets as they already does on the portals, to refresh the list of
+	possible values.
+
+2010-08-02  Murray Cumming  <murrayc murrayc com>
+
+	FlowTableWithFields: Added get_choices_widgets(from_field).
+
+	* glom/mode_data/datawidget/datawidget.cc: Constructor: Only fill the
+	choices list at this point if show_all is set.
+	* glom/mode_data/flowtablewithfields.[h|cc]: Addef get_choices_widgets(),
+	like the existing get_portals() methods.
+
+2010-08-02  Murray Cumming  <murrayc murrayc com>
+
+	Field Formatting: Related Choices: Add a Show All checkbox.
+
+	* glom/glom_developer.glade:
+	* glom/libglom/data_structure/layout/fieldformatting.[h|cc]:
+	* glom/mode_design/layout/layout_item_dialogs/box_formatting.[h|cc]:
+	Add a Show All checkbox to the Related Choices section, so the developer
+	may choose to restrict the choices depending on the relationship. The default
+	(the previous behaviour) is to show all records from the related table.
+	* glom/libglom/document/document.cc: save_before_layout_item_formatting(),
+	save_after_layout_item_formatting(): Store the new bool in the document.
+	* glom/libglom/utils.cc:
+	* glom/mode_data/datawidget/datawidget.cc:
+	* glom/utility_widgets/db_adddel/db_adddel.cc: Adapt the code to build, though
+	the behaviour has not changed yet.
+
 2010-07-27  Murray Cumming  <murrayc murrayc com>
 
 	Fix the tests build after the merge.
-	
+
 	* tests/test_selfhosting_new_empty.cc: Fix the use of Utils::.
 
 2010-07-27  Murray Cumming  <murrayc murrayc com>
@@ -19,18 +175,6 @@
 	* win32/build-installer:
 	* win32/glom.iss.in: Change mentions of 1.14 to 1.16.
 
-2010-07-27  Murray Cumming  <murrayc murrayc com>
-
-	Adapt to recent gtkmm-3.0 API changes.
-	
-	 * glom/bakery/app_withdoc_gtk.cc: Remove use of Gtk::RecentManager::set_limit().
-	 * glom/dialog_existing_or_new.[h|cc]:
-	 * glom/frame_glom.[h|cc]:
-	 * glom/mode_data/notebook_data..[h|cc]:
-	 * glom/mode_design/report_layout/dialog_layout_report.[h|cc]:
-	 * glom/notebook_glom.[h|cc]: Replace use of GtkNotebookPage with Gtk::Widget* 
-	in switch_page signal handlers.
-
 2010-07-25  Murray Cumming  <murrayc murrayc com>
 
 	Allow unique fields with same name in multiple tables.
diff --git a/Makefile.am b/Makefile.am
index 8655596..e0470ac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-## Copyright (c) 2009-2010  Openismus GmbH  <http://www.openismus.com/>
+## Copyright (c) 2009, 2010  Openismus GmbH  <http://www.openismus.com/>
 ##
 ## This file is part of Glom.
 ##
@@ -68,7 +68,7 @@ glom_python_embed_python_module_glom_1_16_la_SOURCES =		\
 
 glom_python_embed_python_module_glom_1_16_la_LIBADD = \
 	glom/libglom/libglom-$(GLOM_ABI_VERSION).la \
-	$(LIBGLOM_LIBS) $(PYTHON_LIBS) $(BOOST_PYTHON_LIBS)
+	$(PYTHON_LIBS) $(BOOST_PYTHON_LIBS)
 
 if HOST_WIN32
 pymod_ldflags = -module -avoid-version -no-undefined -shrext .pyd
diff --git a/Makefile_tests.am b/Makefile_tests.am
index abce977..cdb43d2 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -1,4 +1,4 @@
-## Copyright (c) 2009  Openismus GmbH  <http://www.openismus.com/>
+## Copyright (c) 2009, 2010  Openismus GmbH  <http://www.openismus.com/>
 ##
 ## This file is part of Glom.
 ##
@@ -69,8 +69,8 @@ dist_noinst_SCRIPTS = tests/test_dtd_file_validation.sh \
 
 #TESTS_ENVIRONMENT=which valgrind && valgrind --tool=memcheck --leak-check=full --leak-resolution=high --trace-children=yes --num-callers=30
 
-LIBGLOM_LA = glom/libglom/libglom-$(GLOM_ABI_VERSION).la $(LIBGLOM_LIBS)
-tests_ldadd = $(LIBGLOM_LA)
+# This also links to the libraries in LIBGLOM_LIBS
+tests_ldadd = glom/libglom/libglom-$(GLOM_ABI_VERSION).la
 
 glom_libglom_test_connectionpool_SOURCES = glom/libglom/test_connectionpool.cc
 glom_libglom_example_document_load_SOURCES = glom/libglom/example_document_load.cc
@@ -136,14 +136,14 @@ glom_utility_widgets_test_flowtable_LDADD = $(GLOM_LIBS)
 #	glom/utility_widgets/test_flowtable_dnd.cc
 
 tests_glade_toplevels_instantiation_SOURCES = tests/glade_toplevels_instantiation.cc
-tests_glade_toplevels_instantiation_LDADD = $(tests_ldadd) $(LIBGLOM_LIBS) $(GLOM_LIBS)
+tests_glade_toplevels_instantiation_LDADD = $(tests_ldadd) $(GLOM_LIBS)
 
 
 glom_test_pyembed_LDADD = $(LIBGLOM_LIBS) $(PYTHON_LIBS)
 
 tests_test_parsing_time_LDADD = $(tests_ldadd)
-tests_test_document_load_LDADD = $(tests_ldadd) $(LIBGLOM_LIBS)
-tests_test_document_autosave_LDADD = $(tests_ldadd) $(LIBGLOM_LIBS)
+tests_test_document_load_LDADD = $(tests_ldadd)
+tests_test_document_autosave_LDADD = $(tests_ldadd)
 tests_test_signal_reemit_LDADD = $(LIBGLOM_LIBS)
 tests_test_load_python_library_LDADD = $(LIBGLOM_LIBS) -ldl
 tests_test_python_module_LDADD = $(tests_ldadd) $(PYTHON_LIBS)
@@ -152,8 +152,8 @@ tests_test_python_execute_func_bad_syntax_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(
 tests_test_python_execute_func_date_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
 tests_test_python_execute_func_change_result_type_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
 tests_test_python_execute_script_LDADD = $(tests_ldadd) $(GLOM_LIBS) $(PYTHON_LIBS)
-tests_import_test_parsing_LDADD = $(LIBGLOM_LIBS) $(GLOM_LIBS)
-tests_import_test_signals_LDADD = $(LIBGLOM_LIBS) $(GLOM_LIBS)
+tests_import_test_parsing_LDADD = $(GLOM_LIBS)
+tests_import_test_signals_LDADD = $(GLOM_LIBS)
 tests_test_glade_derived_instantiation_LDADD = $(glom_all_libs)
 tests_test_selfhosting_new_empty_LDADD = $(glom_all_libs)
 tests_test_selfhosting_new_from_example_LDADD = $(glom_all_libs)
diff --git a/configure.ac b/configure.ac
index 427deb2..c188545 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-## Copyright (c) 2009  Openismus GmbH  <http://www.openismus.com/>
+## Copyright (c) 2009, 2010  Openismus GmbH  <http://www.openismus.com/>
 ##
 ## This file is part of Glom.
 ##
@@ -33,7 +33,6 @@ AC_PROG_CXX
 
 LT_PREREQ([2.2.0])
 LT_INIT([disable-static win32-dll])
-AC_DISABLE_STATIC
 
 # Used for the install directories for headers.  The same number is used in
 # the library name, which must be kept in sync, but variables can't be used
@@ -260,17 +259,19 @@ AS_IF([test "x$ENABLE_DOCUMENTATION" != xno],
      [],
      [AC_MSG_ERROR([The documentation build is enabled, but the sphinx-build tool could not be found.])])])
 
-# Check for tar and gzip (used by tar via -z) because we use these when creating backups.
-# TODO: This lets us provide a path via a configure option, but we just use Glib::find_program_in_path(), ignoring that.
+# Check for tar and gzip (used by tar via -z) because we use these when
+# creating backups.
+# TODO: This lets us provide a path via a configure option, but we just use
+# Glib::find_program_in_path(), ignoring that.
+# TODO: This should check for GNU tar, as GNU tar features are used during the
+# backup process.
 AC_CHECK_PROG([GLOM_TAR], [tar], [yes], [no])
-if test "$GLOM_TAR" = no ; then
-	AC_MSG_ERROR([tar not found. Glom needs this to create backup files.])
-fi
+AS_IF([test "$GLOM_TAR" = no],
+  [AC_MSG_ERROR([tar not found. Glom needs this to create backup files.])])
 
 AC_CHECK_PROG([GLOM_GZIP], [gzip], [yes], [no])
-if test "$GLOM_GZIP" = no ; then
-	AC_MSG_ERROR([gzip not found. Glom needs this to create backup files.])
-fi
+AS_IF([test "$GLOM_GZIP" = no],
+  [AC_MSG_ERROR([gzip not found. Glom needs this to create backup files.])])
 
 AC_CONFIG_FILES([Makefile
                  docs/user-guide/Makefile
diff --git a/glom/application.cc b/glom/application.cc
index 4116864..20e09f7 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -1226,6 +1226,9 @@ bool Application::on_document_load()
         }
         else if(!test)
         {
+          //std::cerr might show some hints, but we don't want to confront the user with them:
+          //TODO: Actually complain about specific stuff such as missing data, because the user might really play with the file system.
+          Frame_Glom::show_ok_dialog(_("Problem Loading Document"), _("Glom could not load the document."), *this, Gtk::MESSAGE_ERROR);
           std::cerr << "Application::on_document_load(): unexpected error." << std::endl;
         }
       }
diff --git a/glom/base_db.cc b/glom/base_db.cc
index 8990d38..2528fba 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -1296,7 +1296,7 @@ Gnome::Gda::Value Base_DB::get_field_value_in_database(const LayoutFieldInRecord
   sharedptr<const LayoutItem_Field> layout_item = field_in_record.m_field;
   list_fields.push_back(layout_item);
   Glib::RefPtr<Gnome::Gda::SqlBuilder> sql_query = Utils::build_sql_select_with_key(field_in_record.m_table_name,
-      list_fields, field_in_record.m_key, field_in_record.m_key_value, 1);
+    list_fields, field_in_record.m_key, field_in_record.m_key_value, type_sort_clause(), 1);
 
   Glib::RefPtr<const Gnome::Gda::DataModel> data_model = DbUtils::query_execute_select(sql_query);
   if(data_model)
diff --git a/glom/glom_developer.glade b/glom/glom_developer.glade
index c199df7..cab328c 100644
--- a/glom/glom_developer.glade
+++ b/glom/glom_developer.glade
@@ -6818,6 +6818,25 @@ Which user should be added to this group?</property>
                                     <property name="y_options"></property>
                                   </packing>
                                 </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <object class="GtkCheckButton" id="checkbutton_choices_related_show_all">
+                                    <property name="label" translatable="yes">Show all records</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="tooltip_text" translatable="yes">If this option is selected then the choices will list values from all records in the related table. If this option is not selected then the choices will list values only from related records.</property>
+                                    <property name="draw_indicator">True</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">3</property>
+                                    <property name="bottom_attach">4</property>
+                                  </packing>
+                                </child>
                               </object>
                             </child>
                           </object>
diff --git a/glom/libglom/data_structure/layout/fieldformatting.cc b/glom/libglom/data_structure/layout/fieldformatting.cc
index 9644914..3c02151 100644
--- a/glom/libglom/data_structure/layout/fieldformatting.cc
+++ b/glom/libglom/data_structure/layout/fieldformatting.cc
@@ -21,6 +21,7 @@
 #include "fieldformatting.h"
 #include <libglom/data_structure/layout/fieldformatting.h>
 #include <libglom/data_structure/glomconversions.h>
+#include <libglom/document/document.h>
 #include <glibmm/i18n.h>
 
 const guint MULTILINE_TEXT_DEFAULT_HEIGHT_LINES = 6;
@@ -35,7 +36,8 @@ FieldFormatting::FieldFormatting()
   m_choices_related(false),
   m_text_format_multiline(false),
   m_text_multiline_height_lines(MULTILINE_TEXT_DEFAULT_HEIGHT_LINES),
-  m_horizontal_alignment(HORIZONTAL_ALIGNMENT_AUTO)
+  m_horizontal_alignment(HORIZONTAL_ALIGNMENT_AUTO),
+  m_choices_related_show_all(false)
 {
 }
 
@@ -54,7 +56,8 @@ FieldFormatting::FieldFormatting(const FieldFormatting& src)
   m_text_color_background(src.m_text_color_background),
   m_horizontal_alignment(src.m_horizontal_alignment),
   m_choices_related_field(src.m_choices_related_field),
-  m_choices_related_field_second(src.m_choices_related_field_second)
+  m_choices_related_field_second(src.m_choices_related_field_second),
+  m_choices_related_show_all(src.m_choices_related_show_all)
 {
 }
 
@@ -77,8 +80,9 @@ bool FieldFormatting::operator==(const FieldFormatting& src) const
     (m_text_multiline_height_lines == src.m_text_multiline_height_lines) &&
     (m_text_font == src.m_text_font) &&
     (m_text_color_foreground == src.m_text_color_foreground) &&
-    (m_text_color_background == src.m_text_color_background) && 
-    (m_horizontal_alignment == src.m_horizontal_alignment);
+    (m_text_color_background == src.m_text_color_background) &&
+    (m_horizontal_alignment == src.m_horizontal_alignment) &&
+    (m_choices_related_show_all == src.m_choices_related_show_all);
 }
 
 
@@ -95,6 +99,7 @@ FieldFormatting& FieldFormatting::operator=(const FieldFormatting& src)
   m_choices_related = src.m_choices_related;
   m_choices_related_field = src.m_choices_related_field;
   m_choices_related_field_second = src.m_choices_related_field_second;
+  m_choices_related_show_all = src.m_choices_related_show_all;
 
   m_text_format_multiline = src.m_text_format_multiline;
   m_text_multiline_height_lines = src.m_text_multiline_height_lines;
@@ -231,22 +236,55 @@ void FieldFormatting::set_has_related_choices(bool val)
   m_choices_related = val;
 }
 
-void FieldFormatting::get_choices(sharedptr<const Relationship>& relationship, Glib::ustring& field, Glib::ustring& field_second) const
+void FieldFormatting::get_choices_related(sharedptr<const Relationship>& relationship, Glib::ustring& field, Glib::ustring& field_second, bool& show_all) const
 {
   relationship = get_relationship();
 
   field = m_choices_related_field;
   field_second = m_choices_related_field_second;
+  show_all = m_choices_related_show_all;
 
   //g_warning("FieldFormatting::get_choices, %s, %s, %s", m_choices_related_relationship->c_str(), m_choices_related_field.c_str(), m_choices_related_field_second.c_str());
 }
 
-void FieldFormatting::set_choices(const sharedptr<const Relationship>& relationship, const Glib::ustring& field, const Glib::ustring& field_second)
+void FieldFormatting::set_choices_related(const sharedptr<const Relationship>& relationship, const Glib::ustring& field, const Glib::ustring& field_second, bool show_all)
 {
   set_relationship(relationship);
 
   m_choices_related_field = field;
   m_choices_related_field_second = field_second;
+  m_choices_related_show_all = show_all;
+}
+
+void FieldFormatting::get_choices_related(const Document* document, sharedptr<const Relationship>& relationship, sharedptr<const LayoutItem_Field>& field, sharedptr<const LayoutItem_Field>& field_second, bool& show_all) const
+{
+  //Initialize output parameters:
+  field.clear();
+  field_second.clear();
+
+  Glib::ustring choice_field, choice_second;
+  get_choices_related(relationship, choice_field, choice_second, show_all);
+
+  if(!relationship)
+    return;
+
+  if(choice_field.empty())
+    return;
+
+  const Glib::ustring to_table = relationship->get_to_table();
+
+  sharedptr<LayoutItem_Field> temp = sharedptr<LayoutItem_Field>::create();
+  sharedptr<const Field> field_details = document->get_field(to_table, choice_field);
+  temp->set_full_field_details(field_details);
+  field = temp;
+
+  if(!choice_second.empty())
+  {
+    sharedptr<LayoutItem_Field> temp = sharedptr<LayoutItem_Field>::create();
+    sharedptr<const Field> field_details = document->get_field(to_table, choice_second);
+    temp->set_full_field_details(field_details);
+    field_second = temp;
+  }
 }
 
 void FieldFormatting::change_field_name(const Glib::ustring& table_name, const Glib::ustring& field_name, const Glib::ustring& field_name_new)
@@ -258,7 +296,7 @@ void FieldFormatting::change_field_name(const Glib::ustring& table_name, const G
        m_choices_related_field = field_name_new;
 
     if(m_choices_related_field_second == field_name)
-       m_choices_related_field_second = field_name_new; 
+       m_choices_related_field_second = field_name_new;
   }
 }
 
diff --git a/glom/libglom/data_structure/layout/fieldformatting.h b/glom/libglom/data_structure/layout/fieldformatting.h
index e709128..b9e5a55 100644
--- a/glom/libglom/data_structure/layout/fieldformatting.h
+++ b/glom/libglom/data_structure/layout/fieldformatting.h
@@ -30,6 +30,9 @@
 namespace Glom
 {
 
+class Document;
+class LayoutItem_Field;
+
 //TODO: This should probably be renamed to Formatting, because it is used for static text items too.
 class FieldFormatting : public UsesRelationship //The UsesRelationship base has the relationship for the choices.
 {
@@ -54,9 +57,9 @@ public:
   virtual type_list_values get_choices_custom() const;
   virtual void set_choices_custom(const type_list_values& choices);
 
-  /** Discover whether the entered data should only be one of the available 
+  /** Discover whether the entered data should only be one of the available
    * choices.
-   * @param [out] as_radio_buttons: Whether the choices should be displayed as 
+   * @param [out] as_radio_buttons: Whether the choices should be displayed as
    * radio buttons instead of a combo box.
    */
   bool get_choices_restricted(bool& as_radio_buttons) const;
@@ -65,8 +68,11 @@ public:
    */
   void set_choices_restricted(bool val = true, bool as_radio_buttons = false);
 
-  void get_choices(sharedptr<const Relationship>& relationship_name, Glib::ustring& field, Glib::ustring& field_second) const;
-  void set_choices(const sharedptr<const Relationship>& relationship_name, const Glib::ustring& field, const Glib::ustring& field_second);
+  void get_choices_related(sharedptr<const Relationship>& relationship_name, Glib::ustring& field, Glib::ustring& field_second, bool& show_all) const;
+  void set_choices_related(const sharedptr<const Relationship>& relationship_name, const Glib::ustring& field, const Glib::ustring& field_second, bool show_all);
+
+
+  void get_choices_related(const Document* document, sharedptr<const Relationship>& relationship_name, sharedptr<const LayoutItem_Field>& field, sharedptr<const LayoutItem_Field>& field_second, bool& show_all) const;
 
   /** Get whether the text should be displayed with multiple lines in the
    * details view. Text is displayed with a single line in the list view.
@@ -161,11 +167,9 @@ private:
   HorizontalAlignment m_horizontal_alignment;
 
   Glib::ustring m_choices_related_field, m_choices_related_field_second;
+  bool m_choices_related_show_all;
 };
 
 } //namespace Glom
 
 #endif //GLOM_DATASTRUCTURE_FIELDFORMATTING_H
-
-
-
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index 7cf2f31..b2cc40c 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -198,6 +198,7 @@ namespace Glom
 #define GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_RELATIONSHIP "choices_related_relationship"
 #define GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_FIELD "choices_related_field"
 #define GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_SECOND "choices_related_second"
+#define GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_SHOW_ALL "choices_related_show_all"
 
 #define GLOM_NODE_TRANSLATIONS_SET "trans_set"
 #define GLOM_NODE_TRANSLATION "trans"
@@ -1992,10 +1993,17 @@ void Document::load_after_layout_item_formatting(const xmlpp::Element* element,
     const Glib::ustring relationship_name = get_node_attribute_value(element, GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_RELATIONSHIP);
     if(!relationship_name.empty())
     {
+      bool show_all = get_node_attribute_value_as_bool(element, GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_SHOW_ALL);
+      if(get_document_format_version() < 6)
+      {
+        show_all = true; //This was the behaviour before this checkbox existed.
+      }
+      
       sharedptr<Relationship> relationship = get_relationship(table_name, relationship_name);
-      format.set_choices(relationship,
+      format.set_choices_related(relationship,
         get_node_attribute_value(element, GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_FIELD),
-        get_node_attribute_value(element, GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_SECOND) );
+        get_node_attribute_value(element, GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_SECOND),
+        show_all);
       //Full details are updated in filled-in ().
     }
   }
@@ -2994,11 +3002,13 @@ void Document::save_before_layout_item_formatting(xmlpp::Element* nodeItem, cons
 
     sharedptr<const Relationship> choice_relationship;
     Glib::ustring choice_field, choice_second;
-    format.get_choices(choice_relationship, choice_field, choice_second);
+    bool choice_show_all = false;
+    format.get_choices_related(choice_relationship, choice_field, choice_second, choice_show_all);
 
     set_node_attribute_value(nodeItem, GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_RELATIONSHIP, glom_get_sharedptr_name(choice_relationship));
     set_node_attribute_value(nodeItem, GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_FIELD, choice_field);
     set_node_attribute_value(nodeItem, GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_SECOND, choice_second);
+    set_node_attribute_value_as_bool(nodeItem, GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_SHOW_ALL, choice_show_all);
   }
 }
 
@@ -4189,8 +4199,9 @@ guint Document::get_latest_known_document_format_version()
   // Version 3: (Glom 1.10). Support for the old one-big-string example_rows format was removed, and we now use (unquoted) non-postgres libgda escaping.
   // Version 4: (Glom 1.12). Portal navigation options were simplified, with a "none" option. network_sharing was added, defaulting to off.
   // Version 5: (Glom 1.14). Extra layout item formatting options were added, plus a startup script.
+  // Version 6: (Glom 1.16). Extra show_all option for choices that show related records.
 
-  return 5;
+  return 6;
 }
 
 std::vector<Glib::ustring> Document::get_library_module_names() const
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index bc6d11c..e4669a2 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -136,11 +136,11 @@ Glib::ustring Utils::string_replace(const Glib::ustring& src, const Glib::ustrin
 {
   if(search_for.empty())
   {
-    std::cerr << "Utils::string_replace(): search_for was empty." << std::endl;
+    std::cerr << G_STRFUNC << ": search_for was empty." << std::endl;
     return src;
   }
 
-  //std::cout << "debug: Utils::string_replace(): src=" << src << ", search_for=" << search_for << ", replace_with=" << replace_with << std::endl;
+  //std::cout << "debug: " << G_STRFUNC << ": src=" << src << ", search_for=" << search_for << ", replace_with=" << replace_with << std::endl;
 
   std::string result = src;
 
@@ -342,11 +342,15 @@ void Utils::build_sql_select_add_fields_to_get(const Glib::RefPtr<Gnome::Gda::Sq
     }
     else
     {
-      const Gnome::Gda::SqlBuilder::Id id = builder->select_add_field(layout_item->get_name(), parent);
+      const Glib::ustring field_name = layout_item->get_name();
+      if(!field_name.empty())
+      {
+        const Gnome::Gda::SqlBuilder::Id id = builder->select_add_field(field_name, parent);
 
-      //Avoid duplicate records with doubly-related fields:
-      if(extra_join)
-        builder->select_group_by(id);
+        //Avoid duplicate records with doubly-related fields:
+        if(extra_join)
+          builder->select_group_by(id);
+      }
     }
 
 
@@ -355,7 +359,7 @@ void Utils::build_sql_select_add_fields_to_get(const Glib::RefPtr<Gnome::Gda::Sq
 
   if(!one_added)
   {
-    std::cerr << "Utils::build_sql_select_fields_to_get(): No fields added: fieldsToGet.size()=" << fieldsToGet.size() << std::endl;
+    std::cerr << G_STRFUNC << ": No fields added: fieldsToGet.size()=" << fieldsToGet.size() << std::endl;
     return;
   }
 }
@@ -363,58 +367,67 @@ void Utils::build_sql_select_add_fields_to_get(const Glib::RefPtr<Gnome::Gda::Sq
 
 Glib::RefPtr<Gnome::Gda::SqlBuilder> Utils::build_sql_select_with_where_clause(const Glib::ustring& table_name, const type_vecConstLayoutFields& fieldsToGet, const Gnome::Gda::SqlExpr& where_clause, const sharedptr<const Relationship>& extra_join, const type_sort_clause& sort_clause, guint limit)
 {
+  Glib::RefPtr<Gnome::Gda::SqlBuilder> builder;
+
   //Build the whole SQL statement:
-  Glib::RefPtr<Gnome::Gda::SqlBuilder> builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
-  builder->select_add_target(table_name);
+  try
+  {
+    builder = Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
+    builder->select_add_target(table_name);
 
-  //Add the fields to SELECT, plus the tables that they are selected FROM.
-  //We tell it whether extra_join is empty, so it can do an extra GROUP BY if necessary.
-  //TODO: Try to use DISTINCT instead, with a proper test case.
-  Utils::build_sql_select_add_fields_to_get(builder, table_name, fieldsToGet, sort_clause, extra_join /* bool */);
+    //Add the fields to SELECT, plus the tables that they are selected FROM.
+    //We tell it whether extra_join is empty, so it can do an extra GROUP BY if necessary.
+    //TODO: Try to use DISTINCT instead, with a proper test case.
+    Utils::build_sql_select_add_fields_to_get(builder, table_name, fieldsToGet, sort_clause, extra_join /* bool */);
 
-  if(extra_join)
-  {
-    sharedptr<UsesRelationship> uses_relationship = sharedptr<UsesRelationship>::create();
-    uses_relationship->set_relationship(extra_join);
-    builder_add_join(builder, uses_relationship);
-  }
+    if(extra_join)
+    {
+      sharedptr<UsesRelationship> uses_relationship = sharedptr<UsesRelationship>::create();
+      uses_relationship->set_relationship(extra_join);
+      builder_add_join(builder, uses_relationship);
+    }
 
-  //Add the WHERE clause:
-  if(!where_clause.empty())
-  {
-    const int id = builder->import_expression(where_clause);
-    builder->set_where(id);
-  }
+    //Add the WHERE clause:
+    if(!where_clause.empty())
+    {
+      const int id = builder->import_expression(where_clause);
+      builder->set_where(id);
+    }
 
-  //Sort clause:
-  if(!sort_clause.empty())
-  {
-   for(type_sort_clause::const_iterator iter = sort_clause.begin(); iter != sort_clause.end(); ++iter)
+    //Sort clause:
+    if(!sort_clause.empty())
     {
-      sharedptr<const LayoutItem_Field> layout_item = iter->first;
-      if(layout_item)
+      for(type_sort_clause::const_iterator iter = sort_clause.begin(); iter != sort_clause.end(); ++iter)
       {
-        const bool ascending = iter->second;
+        sharedptr<const LayoutItem_Field> layout_item = iter->first;
+        if(layout_item)
+        {
+          const bool ascending = iter->second;
 
-        //TODO: Avoid the need for the "."
-        builder->select_order_by(
-          builder->add_field_id(layout_item->get_name(), layout_item->get_sql_table_or_join_alias_name(table_name)),
-          ascending);
+          //TODO: Avoid the need for the "."
+          builder->select_order_by(
+            builder->add_field_id(layout_item->get_name(), layout_item->get_sql_table_or_join_alias_name(table_name)),
+            ascending);
+        }
       }
     }
-  }
 
-  //LIMIT clause:
-  if(limit > 0)
+    //LIMIT clause:
+    if(limit > 0)
+    {
+      builder->select_set_limit(limit);
+    }
+  }
+  catch(const Glib::Error& ex)
   {
-    builder->select_set_limit(limit);
+    std::cerr << G_STRFUNC << ": Exception: " << ex.what() << std::endl;
   }
 
   return builder;
 }
 
 
-Glib::RefPtr<Gnome::Gda::SqlBuilder> Utils::build_sql_select_with_key(const Glib::ustring& table_name, const type_vecLayoutFields& fieldsToGet, const sharedptr<const Field>& key_field, const Gnome::Gda::Value& key_value, guint limit)
+Glib::RefPtr<Gnome::Gda::SqlBuilder> Utils::build_sql_select_with_key(const Glib::ustring& table_name, const type_vecLayoutFields& fieldsToGet, const sharedptr<const Field>& key_field, const Gnome::Gda::Value& key_value, const type_sort_clause& sort_clause, guint limit)
 {
   //TODO_Performance:
   type_vecConstLayoutFields constFieldsToGet;
@@ -423,7 +436,7 @@ Glib::RefPtr<Gnome::Gda::SqlBuilder> Utils::build_sql_select_with_key(const Glib
     constFieldsToGet.push_back(*iter);
   }
 
-  return build_sql_select_with_key(table_name, constFieldsToGet, key_field, key_value, limit);
+  return build_sql_select_with_key(table_name, constFieldsToGet, key_field, key_value, sort_clause, limit);
 }
 
 Gnome::Gda::SqlExpr Utils::build_simple_where_expression(const Glib::ustring& table_name, const sharedptr<const Field>& key_field, const Gnome::Gda::Value& key_value)
@@ -450,108 +463,133 @@ Gnome::Gda::SqlExpr Utils::build_combined_where_expression(const Gnome::Gda::Sql
   return builder->export_expression(id);
 }
 
-Glib::RefPtr<Gnome::Gda::SqlBuilder> Utils::build_sql_select_with_key(const Glib::ustring& table_name, const type_vecConstLayoutFields& fieldsToGet, const sharedptr<const Field>& key_field, const Gnome::Gda::Value& key_value, guint limit)
+Glib::RefPtr<Gnome::Gda::SqlBuilder> Utils::build_sql_select_with_key(const Glib::ustring& table_name, const type_vecConstLayoutFields& fieldsToGet, const sharedptr<const Field>& key_field, const Gnome::Gda::Value& key_value, const type_sort_clause& sort_clause, guint limit)
 {
-  if(!Conversions::value_is_empty(key_value)) //If there is a record to show:
+  //We choose instead to have no where clause in this case,
+  //because that is useful to some callers:
+  //if(Conversions::value_is_empty(key_value)) //If there is a record to show:
+  //  return Glib::RefPtr<Gnome::Gda::SqlBuilder>();
+
+  Gnome::Gda::SqlExpr where_clause;
+  if(!Conversions::value_is_empty(key_value) && key_field)
   {
-    const Gnome::Gda::SqlExpr where_clause = build_simple_where_expression(table_name, key_field, key_value);
-    return Utils::build_sql_select_with_where_clause(table_name, fieldsToGet, where_clause,
-      sharedptr<const Relationship>(), type_sort_clause(), limit);
+    where_clause = build_simple_where_expression(table_name, key_field, key_value);
   }
 
-  return Glib::RefPtr<Gnome::Gda::SqlBuilder>();
+  return Utils::build_sql_select_with_where_clause(table_name, fieldsToGet, where_clause,
+    sharedptr<const Relationship>(), sort_clause, limit);
+}
+
+Utils::type_list_values_with_second Utils::get_choice_values_all(const Document* document, const sharedptr<const LayoutItem_Field>& field, sharedptr<const LayoutItem_Field>& layout_choice_first, sharedptr<const LayoutItem_Field>& layout_choice_second)
+{
+  return get_choice_values(document, field,
+    Gnome::Gda::Value() /* means get all with no WHERE clause */,
+    layout_choice_first, layout_choice_second);
 }
 
-Utils::type_list_values_with_second Utils::get_choice_values(const sharedptr<const LayoutItem_Field>& field)
+Utils::type_list_values_with_second Utils::get_choice_values(const Document* document, const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& foreign_key_value, sharedptr<const LayoutItem_Field>& layout_choice_first, sharedptr<const LayoutItem_Field>& layout_choice_second)
 {
-  type_list_values_with_second list_values;
+  //Initialize output parameters:
+  layout_choice_first = sharedptr<LayoutItem_Field>();
+  layout_choice_second = sharedptr<LayoutItem_Field>();
+
+  //TODO: Reduce duplication between this and get_choice_values(field).
+
+  type_list_values_with_second result;
 
+  //We allows this, so this method can be used to get all records in a related table:
+  /*
+  if(Conversions::value_is_empty(foreign_key_value))
+  {
+    std::cout << G_STRFUNC << "debug: foreign_key_value is empty." << std::endl;
+    return result;
+  }
+  */
+
+  const FieldFormatting& format = field->get_formatting_used();
   sharedptr<const Relationship> choice_relationship;
   Glib::ustring choice_field, choice_second;
-  field->get_formatting_used().get_choices(choice_relationship, choice_field, choice_second);
+  bool choice_show_all = false;
+  format.get_choices_related(document, choice_relationship, layout_choice_first, layout_choice_second, choice_show_all);
+
   if(!choice_relationship)
   {
-    //std::cout <<" debug: field has no choices: " << field->get_name() << std::endl;
-    return list_values;
+    std::cerr << G_STRFUNC << ": !choice_relationship." << std::endl;
+    return result;
   }
 
+  Utils::type_vecConstLayoutFields fields;
+  fields.push_back(layout_choice_first);
+  if(layout_choice_second)
+    fields.push_back(layout_choice_second);
+
   const Glib::ustring to_table = choice_relationship->get_to_table();
-  if(to_table.empty())
+  sharedptr<Field> to_field = document->get_field(to_table, choice_relationship->get_to_field());
+
+  if(!to_field)
   {
-    g_warning("get_choice_values(): table_name is null. relationship name = %s", glom_get_sharedptr_name(choice_relationship).c_str());
-    return list_values;
+    std::cerr << G_STRFUNC << ": to_field is null." << std::endl;
   }
 
-  const bool with_second = !choice_second.empty();
+  type_sort_clause sort_clause;
+  sort_clause.push_back( type_pair_sort_field(layout_choice_first, true /* ascending */));
 
-  //Get possible values from database, sorted by the first column.
-  Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
-      Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
-  const guint choice_field_id = builder->select_add_field(choice_field, to_table);
-  builder->select_add_target(to_table);
+  //TODO: Support related relationships (in the UI too):
+  Glib::RefPtr<Gnome::Gda::SqlBuilder> builder = Utils::build_sql_select_with_key(
+    to_table,
+    fields,
+    to_field,
+    foreign_key_value,
+    sort_clause);
 
-  if(with_second)
-    builder->select_add_field(choice_second, to_table);
+  if(!builder)
+  {
+    std::cerr << G_STRFUNC << ": builder is null." << std::endl;
+    return result;
+  }
 
-  builder->select_order_by(choice_field_id);
+  //TODO: builder->select_order_by(choice_field_id);
 
-  //std::cout << "debug: get_choice_values(): query: " << sql_query << std::endl;
-  //Connect to database:
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  //Connect to database and get the related values:
   sharedptr<SharedConnection> connection = ConnectionPool::get_instance()->connect();
-#else
-  std::auto_ptr<ExceptionConnection> conn_error;
-  sharedptr<SharedConnection> connection = ConnectionPool::get_instance()->connect(conn_error);
-  if(conn_error.get())
-    return list_values;
-#endif
 
   if(!connection)
-    return list_values;
+  {
+    std::cerr << G_STRFUNC << ": connection is null." << std::endl;
+    return result;
+  }
 
   const std::string sql_query =
-    sqlbuilder_get_full_query(builder);
-  //std::cout << "get_choice_values: Executing SQL: " << sql_query << std::endl;
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
+    Utils::sqlbuilder_get_full_query(builder);
+  //std::cout << "debug: sql_query=" << sql_query << std::endl;
   Glib::RefPtr<Gnome::Gda::DataModel> datamodel = connection->get_gda_connection()->statement_execute_select(sql_query);
-#else
-  std::auto_ptr<Glib::Error> error;
-  Glib::RefPtr<Gnome::Gda::DataModel> datamodel = connection->get_gda_connection()->statement_execute_select(sql_query, Gnome::Gda::STATEMENT_MODEL_RANDOM_ACCESS, error);
-#endif
 
   if(datamodel)
   {
     const guint count = datamodel->get_n_rows();
-    //std::cout << "  result: count=" << count << std::endl;
+    const guint cols_count = datamodel->get_n_columns();
     for(guint row = 0; row < count; ++row)
     {
 
       std::pair<Gnome::Gda::Value, Gnome::Gda::Value> itempair;
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
       itempair.first = datamodel->get_value_at(0, row);
 
-      if(with_second)
+      if(layout_choice_second && (cols_count > 1))
         itempair.second = datamodel->get_value_at(1, row);
-#else
-      itempair.first = datamodel->get_value_at(0, row, error);
-
-      if(with_second)
-        itempair.second = datamodel->get_value_at(1, row, error);
-#endif
 
-      list_values.push_back(itempair);
+      result.push_back(itempair);
     }
   }
   else
   {
-      std::cerr << "Glom  get_choice_values(): Error while executing SQL" << std::endl <<
+      std::cerr << G_STRFUNC << ": Error while executing SQL" << std::endl <<
                    "  " <<  sql_query << std::endl;
+      return result;
   }
 
-  return list_values;
+  return result;
 }
 
-
 Glib::ustring Utils::create_name_from_title(const Glib::ustring& title)
 {
   Glib::ustring result = string_replace(title, " ", "");
@@ -636,10 +674,10 @@ Glib::ustring Utils::create_local_image_uri(const Gnome::Gda::Value& value)
       }
     }
     else
-       std::cerr << "Utils::create_local_image_uri(): binary GdaValue contains no data." << std::endl;
+       std::cerr << G_STRFUNC << ": binary GdaValue contains no data." << std::endl;
   }
   //else
-  //  std::cerr << "Utils::create_local_image_uri(): type != BINARY" << std::endl;
+  //  std::cerr << G_STRFUNC << ": type != BINARY" << std::endl;
 
   if(result.empty())
     result = "/tmp/glom_report_image_invalid.png";
@@ -690,7 +728,7 @@ Glib::ustring Utils::title_from_string(const Glib::ustring& text)
 
 Utils::type_vec_strings Utils::string_separate(const Glib::ustring& str, const Glib::ustring& separator, bool ignore_quoted_separator)
 {
-  //std::cout << "Utils::string_separate(): separator=" << separator << std::endl;
+  //std::cout << "debug: " << G_STRFUNC << ": separator=" << separator << std::endl;
 
   type_vec_strings result;
 
@@ -877,7 +915,6 @@ bool Utils::file_exists(const Glib::ustring& uri)
     // Try to examine the input file.
     Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(uri);
 
-#ifdef GLIBMM_EXCEPTIONS_ENABLED
     try
     {
       return file->query_exists();
@@ -886,9 +923,6 @@ bool Utils::file_exists(const Glib::ustring& uri)
     {
       return false; //Something went wrong. It does not exist.
     }
-#else
-      return file->query_exists();
-#endif
   }
 }
 
@@ -911,11 +945,11 @@ std::string Utils::sqlbuilder_get_full_query(
   }
   catch(const Glib::Exception& ex)
   {
-    std::cerr << "sqlbuilder_get_full_query(): exception while parsing query: " << ex.what() << std::endl;
+    std::cerr << G_STRFUNC << ": exception while parsing query: " << ex.what() << std::endl;
   }
   catch(const std::exception& ex)
   {
-    std::cerr << "sqlbuilder_get_full_query(): exception while parsing query: " << ex.what() << std::endl;
+    std::cerr << G_STRFUNC << ": exception while parsing query: " << ex.what() << std::endl;
   }
 
   //Convert to something that std::cout should be able to handle.
@@ -940,15 +974,15 @@ std::string Utils::sqlbuilder_get_full_query(
   }
   catch(const Gnome::Gda::SqlError& ex)
   {
-    std::cerr << "sqlbuilder_get_full_query(): SqlError exception while getting query: " << ex.what() << std::endl;
+    std::cerr << G_STRFUNC << ": SqlError exception while getting query: " << ex.what() << std::endl;
   }
   catch(const Glib::Exception& ex)
   {
-    std::cerr << "sqlbuilder_get_full_query(): exception (" << typeid(ex).name() << ") while getting query: " << ex.what() << std::endl;
+    std::cerr << G_STRFUNC << ": exception (" << typeid(ex).name() << ") while getting query: " << ex.what() << std::endl;
   }
   catch(const std::exception& ex)
   {
-    std::cerr << "sqlbuilder_get_full_query(): exception (" << typeid(ex).name() << ") while getting query: " << ex.what() << std::endl;
+    std::cerr << G_STRFUNC << ": exception (" << typeid(ex).name() << ") while getting query: " << ex.what() << std::endl;
   }
 
   //Convert to something that std::cout should be able to handle.
@@ -960,7 +994,7 @@ std::string Utils::sqlbuilder_get_full_query(
   return std::string(buf.get());
 }
 
-Gnome::Gda::SqlExpr Utils::get_find_where_clause_quick(Document* document, const Glib::ustring& table_name, const Gnome::Gda::Value& quick_search)
+Gnome::Gda::SqlExpr Utils::get_find_where_clause_quick(const Document* document, const Glib::ustring& table_name, const Gnome::Gda::Value& quick_search)
 {
   Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
     Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
@@ -968,7 +1002,7 @@ Gnome::Gda::SqlExpr Utils::get_find_where_clause_quick(Document* document, const
 
   if(!document)
   {
-    std::cerr << "Utils::get_find_where_clause_quick(): document was null." << std::endl;
+    std::cerr << G_STRFUNC << ": document was null." << std::endl;
     return Gnome::Gda::SqlExpr();
   }
 
diff --git a/glom/libglom/utils.h b/glom/libglom/utils.h
index 72429c5..13339c6 100644
--- a/glom/libglom/utils.h
+++ b/glom/libglom/utils.h
@@ -88,11 +88,15 @@ Glib::RefPtr<Gnome::Gda::SqlBuilder> build_sql_select_with_where_clause(
   const type_sort_clause& sort_clause = type_sort_clause(),
   guint limit = 0);
 
+/**
+ * @param key_value If this is empty then all records in the tables will be retrieved.
+ */
 Glib::RefPtr<Gnome::Gda::SqlBuilder> build_sql_select_with_key(
   const Glib::ustring& table_name,
   const type_vecLayoutFields& fieldsToGet,
   const sharedptr<const Field>& key_field,
   const Gnome::Gda::Value& key_value,
+  const type_sort_clause& sort_clause = type_sort_clause(),
   guint limit = 0);
 
 /** Just a version of build_sql_select_with_key() that takes a list of const fields.
@@ -102,13 +106,16 @@ Glib::RefPtr<Gnome::Gda::SqlBuilder> build_sql_select_with_key(
   const type_vecConstLayoutFields& fieldsToGet,
   const sharedptr<const Field>& key_field,
   const Gnome::Gda::Value& key_value,
+  const type_sort_clause& sort_clause = type_sort_clause(),
   guint limit = 0);
 
-Gnome::Gda::SqlExpr get_find_where_clause_quick(Document* document, const Glib::ustring& table_name, const Gnome::Gda::Value& quick_search);
+Gnome::Gda::SqlExpr get_find_where_clause_quick(const Document* document, const Glib::ustring& table_name, const Gnome::Gda::Value& quick_search);
 
 
 typedef std::list< std::pair<Gnome::Gda::Value, Gnome::Gda::Value> > type_list_values_with_second;
-type_list_values_with_second get_choice_values(const sharedptr<const LayoutItem_Field>& field);
+type_list_values_with_second get_choice_values_all(const Document* document, const sharedptr<const LayoutItem_Field>& field, sharedptr<const LayoutItem_Field>& layout_choice_first, sharedptr<const LayoutItem_Field>& layout_choice_second);
+
+type_list_values_with_second get_choice_values(const Document* document, const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& foreign_key_value, sharedptr<const LayoutItem_Field>& layout_choice_first, sharedptr<const LayoutItem_Field>& layout_choice_second);
 
 /// Get the full query string suitable for use with std::cout.
 std::string sqlbuilder_get_full_query(
diff --git a/glom/mode_data/box_data_portal.h b/glom/mode_data/box_data_portal.h
index ad4189d..13e0421 100644
--- a/glom/mode_data/box_data_portal.h
+++ b/glom/mode_data/box_data_portal.h
@@ -60,7 +60,6 @@ public:
   /** 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.
-   * @param from_table_primary_key_value The primary key of the parent record's table, used to associate new related records.
    */
   bool refresh_data_from_database_with_foreign_key(const Gnome::Gda::Value& foreign_key_value);
 
diff --git a/glom/mode_data/datawidget/combo.cc b/glom/mode_data/datawidget/combo.cc
index 49ec46e..6283ece 100644
--- a/glom/mode_data/datawidget/combo.cc
+++ b/glom/mode_data/datawidget/combo.cc
@@ -38,17 +38,8 @@ namespace DataWidgetChildren
 {
 
 ComboGlom::ComboGlom()
-: ComboChoicesWithTreeModel()
-{
-#ifndef GLOM_ENABLE_CLIENT_ONLY
-  setup_menu();
-#endif // !GLOM_ENABLE_CLIENT_ONLY
-
-  init();
-}
-
-ComboGlom::ComboGlom(const sharedptr<LayoutItem_Field>& field_second)
-: ComboChoicesWithTreeModel(field_second)
+: ComboChoicesWithTreeModel(),
+  m_cell_second(0)
 {
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   setup_menu();
@@ -66,7 +57,7 @@ void ComboGlom::init()
   //Maemo:
   set_selector(m_maemo_selector);
   m_maemo_selector.set_model(0, m_refModel);
-  
+
   Glib::RefPtr<Hildon::TouchSelectorColumn> column =
     m_maemo_selector.append_text_column(m_refModel);
   column->set_property("text-column", 0); // TODO: Add a TextSelectorColumn::set_text_column() method?
@@ -74,17 +65,18 @@ void ComboGlom::init()
   column->pack_start(m_Columns.m_col_first, false);
   #endif //GLOM_ENABLE_MAEMO
 
+  //if(m_glom_type == Field::TYPE_NUMERIC)
+   // get_entry()->set_alignment(1.0); //Align numbers to the right.
+}
 
+ComboGlom::~ComboGlom()
+{
+}
 
-  #ifndef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
-  #ifndef GLOM_ENABLE_MAEMO
-  signal_changed().connect(sigc::mem_fun(*this, &ComboGlom::on_changed));
-  #else
-  m_maemo_selector.signal_changed().connect(sigc::mem_fun(*this, &ComboGlom::on_changed));
-  #endif // GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
-  #endif //GLOM_ENABLE_MAEMO
-
-  if(m_with_second)
+void ComboGlom::set_choices_related(const Document* document, const sharedptr<const Relationship>& relationship, const Glib::ustring& field, const Glib::ustring& field_second, bool show_all)
+{
+  //Add the extra cell if necessary:
+  if(!m_cell_second && !field_second.empty())
   {
     #ifndef GLOM_ENABLE_MAEMO
     //We don't use this convenience method, because we want more control over the renderer.
@@ -92,30 +84,22 @@ void ComboGlom::init()
     //(well, maybe set_cell_data_func(), but that's a bit awkward.)
     //pack_start(m_Columns.m_col_second);
 
-    Gtk::CellRenderer* cell_second = Gtk::manage(new Gtk::CellRendererText);
-    cell_second->set_property("xalign", 0.0);
+    m_cell_second = Gtk::manage(new Gtk::CellRendererText);
+    m_cell_second->set_property("xalign", 0.0);
 
     //Use the renderer:
-    pack_start(*cell_second);
+    pack_start(*m_cell_second);
 
     //Make the renderer render the column:
-    #ifdef GLIBMM_PROPERTIES_ENABLED
-    add_attribute(cell_second->_property_renderable(), m_Columns.m_col_second);
-    #else
-    add_attribute(*cell_second, cell_second->_property_renderable(), m_Columns.m_col_second);
-    #endif
+    add_attribute(m_cell_second->_property_renderable(), m_Columns.m_col_second);
+    std::cout << "debug: Added second column." << std::endl;
     #else
     //Maemo:
     column->pack_start(m_Columns.m_col_second);
     #endif //GLOM_ENABLE_MAEMO
   }
 
-  //if(m_glom_type == Field::TYPE_NUMERIC)
-   // get_entry()->set_alignment(1.0); //Align numbers to the right.
-}
-
-ComboGlom::~ComboGlom()
-{
+  ComboChoicesWithTreeModel::set_choices_related(document, relationship, field, field_second, show_all);
 }
 
 void ComboGlom::check_for_change()
@@ -168,7 +152,7 @@ void ComboGlom::set_value(const Gnome::Gda::Value& value)
     if(!cell)
       return;
 
-    const Glib::ustring fg_color = 
+    const Glib::ustring fg_color =
     layout_item->get_formatting_used().get_text_format_color_foreground_to_use(value);
     if(fg_color.empty())
     {
@@ -204,7 +188,7 @@ void ComboGlom::set_text(const Glib::ustring& text)
   {
     g_warning("ComboGlom::set_text(): no item found for: %s", text.c_str());
   }
-  
+
   //Not found, so mark it as blank:
   #ifndef GLOM_ENABLE_MAEMO
   unset_active();
@@ -231,7 +215,7 @@ Glib::ustring ComboGlom::get_text() const
   ComboGlom* unconst = const_cast<ComboGlom*>(this);
   Gtk::TreeModel::iterator iter = unconst->get_selected();
   #endif //GLOM_ENABLE_MAEMO
-  
+
   if(iter)
   {
     Gtk::TreeModel::Row row = *iter;
@@ -291,12 +275,10 @@ Application* ComboGlom::get_application()
 void ComboGlom::on_changed()
 #else
 void ComboGlom::on_changed(int /* column */)
-#endif 
+#endif
 {
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
   //Call base class:
   Gtk::ComboBox::on_changed();
-#endif // GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
 
   //This signal is emitted for every key press, but sometimes it's just to say that the active item has changed to "no active item",
   //if the text is not in the dropdown list:
@@ -305,7 +287,7 @@ void ComboGlom::on_changed(int /* column */)
   #else
   Gtk::TreeModel::iterator iter = get_selected();
   #endif //GLOM_ENABLE_MAEMO
-  
+
   if(iter)
   {
     //This is either a choice from the dropdown menu, or someone has typed in something that is in the drop-down menu.
diff --git a/glom/mode_data/datawidget/combo.h b/glom/mode_data/datawidget/combo.h
index 4620fb5..c48c96c 100644
--- a/glom/mode_data/datawidget/combo.h
+++ b/glom/mode_data/datawidget/combo.h
@@ -42,7 +42,7 @@ namespace DataWidgetChildren
  * Use this when the user should only be allowed to enter values that are in the choices.
  */
 class ComboGlom
-: 
+:
 #ifndef GLOM_ENABLE_MAEMO
   public Gtk::ComboBox,
 #else
@@ -55,9 +55,6 @@ public:
   ///You must call set_layout_item() to specify the field type and formatting of the main column.
   ComboGlom();
 
-  ///You must call set_layout_item() to specify the field type and formatting of the main column.
-  explicit ComboGlom(const sharedptr<LayoutItem_Field>& field_second);
-
   virtual ~ComboGlom();
 
   virtual void set_read_only(bool read_only = true);
@@ -75,6 +72,8 @@ public:
 
   virtual Gnome::Gda::Value get_value() const;
 
+  virtual void set_choices_related(const Document* document, const sharedptr<const Relationship>& relationship, const Glib::ustring& field, const Glib::ustring& field_second, bool show_all);
+
 private:
   void init();
 
@@ -97,14 +96,15 @@ private:
 
   Glib::ustring m_old_text;
   //Gnome::Gda::Value m_value; //The last-stored value. We have this because the displayed value might be unparseable.
-  
+
   #ifdef GLOM_ENABLE_MAEMO
   Hildon::TouchSelector m_maemo_selector;
   #endif
+
+  Gtk::CellRenderer* m_cell_second;
 };
 
 } //namespace DataWidetChildren
 } //namespace Glom
 
 #endif //GLOM_UTILITY_WIDGETS_COMBOENTRY_GLOM_H
-
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.cc b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
index d8864c6..af464e2 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.cc
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
@@ -45,19 +45,9 @@ ComboAsRadioButtons::ComboAsRadioButtons()
   init();
 }
 
-ComboAsRadioButtons::ComboAsRadioButtons(const sharedptr<LayoutItem_Field>& field_second)
-: ComboChoices(field_second)
-{
-#ifndef GLOM_ENABLE_CLIENT_ONLY
-  setup_menu();
-#endif // !GLOM_ENABLE_CLIENT_ONLY
-
-  init();
-}
-
 void ComboAsRadioButtons::init()
 {
-  if(m_with_second)
+  if(m_related_field_second)
   {
     //TODO
   }
@@ -86,9 +76,9 @@ void ComboAsRadioButtons::set_choices_with_second(const type_list_values_with_se
     {
       const Glib::ustring value_first = Conversions::get_text_for_gda_value(layout_item->get_glom_type(), iter->first, layout_item->get_formatting_used().m_numeric_format);
       Glib::ustring title = value_first;
-      if(m_with_second)
+      if(m_related_field_second)
       {
-        const Glib::ustring value_second = Conversions::get_text_for_gda_value(m_layoutitem_second->get_glom_type(), iter->second, m_layoutitem_second->get_formatting_used().m_numeric_format);
+        const Glib::ustring value_second = Conversions::get_text_for_gda_value(m_related_field_second->get_glom_type(), iter->second, m_related_field_second->get_formatting_used().m_numeric_format);
         title += " - " + value_second; //TODO: Find a better way to join them?
       }
       
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.h b/glom/mode_data/datawidget/combo_as_radio_buttons.h
index 1f62689..c3a63dc 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.h
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.h
@@ -46,13 +46,9 @@ public:
   ///You must call set_layout_item() to specify the field type and formatting of the main column.
   ComboAsRadioButtons();
 
-  ///You must call set_layout_item() to specify the field type and formatting of the main column.
-  explicit ComboAsRadioButtons(const sharedptr<LayoutItem_Field>& field_second);
-
   virtual ~ComboAsRadioButtons();
   
   virtual void set_choices(const FieldFormatting::type_list_values& list_values);
-  virtual void set_choices_with_second(const type_list_values_with_second& list_values);
 
   virtual void set_read_only(bool read_only = true);
 
@@ -72,6 +68,8 @@ public:
 private:
   void init();
 
+  virtual void set_choices_with_second(const type_list_values_with_second& list_values);
+
   void on_radiobutton_toggled();
 
   void check_for_change();
diff --git a/glom/mode_data/datawidget/combochoices.cc b/glom/mode_data/datawidget/combochoices.cc
index 55e3b58..3d6f00f 100644
--- a/glom/mode_data/datawidget/combochoices.cc
+++ b/glom/mode_data/datawidget/combochoices.cc
@@ -20,6 +20,9 @@
 
 #include "combochoices.h"
 #include <libglom/data_structure/glomconversions.h>
+#include <libglom/document/document.h>
+#include <libglom/connectionpool.h>
+#include <libglom/utils.h>
 #include <glibmm/i18n.h>
 //#include <sstream> //For stringstream
 
@@ -35,25 +38,165 @@ namespace DataWidgetChildren
 {
 
 ComboChoices::ComboChoices()
-: m_with_second(false)
+: m_related_show_all(false)
 {
   init();
 }
 
-ComboChoices::ComboChoices(const sharedptr<LayoutItem_Field>& field_second)
-: m_with_second(true),
-  m_layoutitem_second(field_second)
+void ComboChoices::init()
 {
-  init();
 }
 
-void ComboChoices::init()
+ComboChoices::~ComboChoices()
 {
 }
 
-ComboChoices::~ComboChoices()
+bool ComboChoices::refresh_data_from_database_with_foreign_key(const Document* document, const Gnome::Gda::Value& foreign_key_value)
+{
+  //Get the choice information, then cache it:
+  if(!m_related_relationship || !m_related_field)
+  {
+    sharedptr<LayoutItem_Field> layout_item = sharedptr<LayoutItem_Field>::cast_dynamic(get_layout_item());
+    if(!layout_item)
+    {
+      return false;
+    }
+
+    //TODO: Avoid repeating this tedious code in so many places:
+    const FieldFormatting& format = layout_item->get_formatting_used();
+    format.get_choices_related(document, m_related_relationship, m_related_field, m_related_field_second, m_related_show_all);
+
+    if(!m_related_relationship)
+    {
+      std::cerr << G_STRFUNC << ": !m_related_relationship." << std::endl;
+      return false;
+    }
+  }
+
+  if(!m_related_field)
+  {
+    std::cerr << G_STRFUNC << ": !m_related_field." << std::endl;
+    return false;
+  }
+
+  if(Conversions::value_is_empty(foreign_key_value))
+  {
+    //Clear the choices list:
+    type_list_values_with_second list_values;
+    set_choices_with_second(list_values);
+    return true;
+  }
+
+  if(m_related_show_all)
+  {
+    //The list should be set in set_choices_related() instead.
+    std::cerr << G_STRFUNC << ": Called with m_related_show_all=true." << std::endl;
+    return false;
+  }
+
+  Utils::type_vecConstLayoutFields fields;
+  fields.push_back(m_related_field);
+  if(m_related_field_second)
+    fields.push_back(m_related_field_second);
+
+  //std::cout << G_STRFUNC << "debug: m_related_field=" << m_related_field->get_name() << ", m_related_field_second" << m_related_field_second->get_name() << std::endl;
+
+  if(!m_related_to_field)
+  {
+    std::cerr << G_STRFUNC << ": m_related_to_field is null." << std::endl;
+  }
+
+  //TODO: Support related relationships (in the UI too):
+  Glib::RefPtr<Gnome::Gda::SqlBuilder> builder = Utils::build_sql_select_with_key(
+    m_related_relationship->get_to_table(),
+    fields,
+    m_related_to_field,
+    foreign_key_value);
+
+  if(!builder)
+  {
+    std::cerr << G_STRFUNC << ": builder is null." << std::endl;
+    return false;
+  }
+
+  //TODO: builder->select_order_by(choice_field_id);
+
+  //Connect to database and get the related values:
+  sharedptr<SharedConnection> connection = ConnectionPool::get_instance()->connect();
+
+  if(!connection)
+  {
+    std::cerr << G_STRFUNC << ": connection is null." << std::endl;
+    return false;
+  }
+
+  const std::string sql_query =
+    Utils::sqlbuilder_get_full_query(builder);
+  //std::cout << "get_choice_values: Executing SQL: " << sql_query << std::endl;
+  Glib::RefPtr<Gnome::Gda::DataModel> datamodel = connection->get_gda_connection()->statement_execute_select(sql_query);
+
+  if(datamodel)
+  {
+    type_list_values_with_second list_values;
+
+    const guint count = datamodel->get_n_rows();
+    const guint cols_count = datamodel->get_n_columns();
+    //std::cout << "  result: count=" << count << std::endl;
+    for(guint row = 0; row < count; ++row)
+    {
+
+      std::pair<Gnome::Gda::Value, Gnome::Gda::Value> itempair;
+      itempair.first = datamodel->get_value_at(0, row);
+
+      if(m_related_field_second && (cols_count > 1))
+        itempair.second = datamodel->get_value_at(1, row);
+
+      list_values.push_back(itempair);
+    }
+
+    const Gnome::Gda::Value old_value = get_value();
+    set_choices_with_second(list_values);
+    set_value(old_value); //Try to preserve the value, even in iter-based ComboBoxes.
+  }
+  else
+  {
+      std::cerr << G_STRFUNC << ": Error while executing SQL" << std::endl <<
+                   "  " <<  sql_query << std::endl;
+      return false;
+  }
+
+  return true;
+}
+
+void ComboChoices::set_choices_related(const Document* document, const sharedptr<const Relationship>& relationship, const Glib::ustring& /* field */, const Glib::ustring& /* field_second */, bool show_all)
 {
+  //Note that field_second is used in derived classes.
+
+  m_related_relationship = relationship;
+  m_related_show_all = show_all;
+
+  m_related_field.clear();
+  m_related_field_second.clear();
+  if(m_related_relationship)
+  {
+    const Glib::ustring to_table = m_related_relationship->get_to_table();
+    m_related_to_field = document->get_field(to_table, m_related_relationship->get_to_field());
+  }
+
+  type_list_values_with_second list_values;
+
+  //Set the values now because if it will be the same regardless of the foreign key value.
+  //Otherwise show them when refresh_data_from_database_with_foreign_key() is called.
+  if(relationship && show_all)
+  {
+    sharedptr<LayoutItem_Field> layout_item = sharedptr<LayoutItem_Field>::cast_dynamic(get_layout_item());
+    list_values = Utils::get_choice_values_all(document, layout_item, m_related_field, m_related_field_second);
+  }
+
+  const Gnome::Gda::Value old_value = get_value();
+  set_choices_with_second(list_values);
+  set_value(old_value); //Try to preserve the value, even in iter-based ComboBoxes.
 }
 
-} //namespace DataWidetChildren
+} //namespace DataWidgetChildren
 } //namespace Glom
diff --git a/glom/mode_data/datawidget/combochoices.h b/glom/mode_data/datawidget/combochoices.h
index a31054a..762e80b 100644
--- a/glom/mode_data/datawidget/combochoices.h
+++ b/glom/mode_data/datawidget/combochoices.h
@@ -28,6 +28,8 @@
 namespace Glom
 {
 
+class Document;
+
 namespace DataWidgetChildren
 {
 
@@ -46,19 +48,37 @@ public:
 
   virtual void set_choices(const FieldFormatting::type_list_values& list_values) = 0;
 
-  typedef std::list< std::pair<Gnome::Gda::Value, Gnome::Gda::Value> > type_list_values_with_second;
-  virtual void set_choices_with_second(const type_list_values_with_second& list_values) = 0;
+  /**
+   * See also refresh_data_from_database_with_foreign_key().
+   * @param relationship Just to save some extra lookup in the format, from get_layout_item().
+   * @param field Just to save some extra lookup in the format, from get_layout_item().
+   * @param field_second Just to save some extra lookup in the format, from get_layout_item().
+   */
+  virtual void set_choices_related(const Document* document, const sharedptr<const Relationship>& relationship, const Glib::ustring& field, const Glib::ustring& field_second, bool show_all);
+
+  /** Update a choices widget's list of related choices if a relevant value in its parent table has changed.
+   *
+   * @param foreign_key_value: The value that should be found in this table.
+   */
+  bool refresh_data_from_database_with_foreign_key(const Document* document, const Gnome::Gda::Value& foreign_key_value);
 
 protected:
   void init();
 
-  bool m_with_second;
-  sharedptr<const LayoutItem_Field> m_layoutitem_second;
+  typedef std::list< std::pair<Gnome::Gda::Value, Gnome::Gda::Value> > type_list_values_with_second;
+  virtual void set_choices_with_second(const type_list_values_with_second& list_values) = 0;
+
   //Gnome::Gda::Value m_value; //The last-stored value. We have this because the displayed value might be unparseable.
+
+  //These are used if it is related choices:
+  sharedptr<const Relationship> m_related_relationship;
+  sharedptr<const Field> m_related_to_field; //To avoid retrieving it each time.
+  sharedptr<const LayoutItem_Field> m_related_field;
+  sharedptr<const LayoutItem_Field> m_related_field_second;
+  bool m_related_show_all;
 };
 
 } //namespace DataWidetChildren
 } //namespace Glom
 
 #endif //GLOM_UTILITY_WIDGETS_COMBO_CHOICES_H
-
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
index 09cba5f..6cf8ac6 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
@@ -39,12 +39,6 @@ ComboChoicesWithTreeModel::ComboChoicesWithTreeModel()
   init();
 }
 
-ComboChoicesWithTreeModel::ComboChoicesWithTreeModel(const sharedptr<LayoutItem_Field>& field_second)
-: ComboChoices(field_second)
-{
-  init();
-}
-
 void ComboChoicesWithTreeModel::init()
 {
   ComboChoices::init();
@@ -69,9 +63,9 @@ void ComboChoicesWithTreeModel::set_choices_with_second(const type_list_values_w
     {
       row[m_Columns.m_col_first] = Conversions::get_text_for_gda_value(layout_item->get_glom_type(), iter->first, layout_item->get_formatting_used().m_numeric_format);
 
-      if(m_with_second && m_layoutitem_second)
+      if(m_related_field_second)
       {
-        row[m_Columns.m_col_second] = Conversions::get_text_for_gda_value(m_layoutitem_second->get_glom_type(), iter->second, m_layoutitem_second->get_formatting_used().m_numeric_format);
+        row[m_Columns.m_col_second] = Conversions::get_text_for_gda_value(m_related_field_second->get_glom_type(), iter->second, m_related_field_second->get_formatting_used().m_numeric_format);
       }
     }
   }
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.h b/glom/mode_data/datawidget/combochoiceswithtreemodel.h
index 4fc23cf..8cad4e8 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.h
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.h
@@ -35,17 +35,15 @@ public:
   ///You must call set_layout_item() to specify the field type and formatting of the main column.
   explicit ComboChoicesWithTreeModel();
 
-  ///You must call set_layout_item() to specify the field type and formatting of the main column.
-  explicit ComboChoicesWithTreeModel(const sharedptr<LayoutItem_Field>& field_second);
-
   virtual ~ComboChoicesWithTreeModel();
 
   virtual void set_choices(const FieldFormatting::type_list_values& list_values);
-  virtual void set_choices_with_second(const type_list_values_with_second& list_values);
 
 protected:
   void init();
 
+  virtual void set_choices_with_second(const type_list_values_with_second& list_values);
+
   //Tree model columns:
   class ModelColumns : public Gtk::TreeModel::ColumnRecord
   {
diff --git a/glom/mode_data/datawidget/comboentry.cc b/glom/mode_data/datawidget/comboentry.cc
index af30e37..051fc65 100644
--- a/glom/mode_data/datawidget/comboentry.cc
+++ b/glom/mode_data/datawidget/comboentry.cc
@@ -42,17 +42,8 @@ namespace DataWidgetChildren
 {
 
 ComboEntry::ComboEntry()
-: ComboChoicesWithTreeModel()
-{
-#ifndef GLOM_ENABLE_CLIENT_ONLY
-  setup_menu();
-#endif // !GLOM_ENABLE_CLIENT_ONLY
-
-  init();
-}
-
-ComboEntry::ComboEntry(const sharedptr<LayoutItem_Field>& field_second)
-: ComboChoicesWithTreeModel(field_second)
+: ComboChoicesWithTreeModel(),
+  m_cell_second(0)
 {
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   setup_menu();
@@ -87,7 +78,7 @@ void ComboEntry::init()
 #else
   //Maemo:
   set_selector(m_maemo_selector);
- 
+
   //We don't use append_text_column(), because we want to specify no expand.
   //Glib::RefPtr<Hildon::TouchSelectorColumn> column =
   //  m_maemo_selector.append_text_column(m_refModel);
@@ -95,15 +86,15 @@ void ComboEntry::init()
   //  m_maemo_selector.append_column(m_refModel);
   Glib::RefPtr<Hildon::TouchSelectorColumn> column = Glib::wrap(hildon_touch_selector_append_column(
     HILDON_TOUCH_SELECTOR(m_maemo_selector.gobj()), GTK_TREE_MODEL(Glib::unwrap(m_refModel)), 0, static_cast<char*>(0)), true);
-      
+
   column->pack_start(m_Columns.m_col_first, false);
   //Only in the latest hildonmm: column->set_text_column(m_Columns.m_col_first);
   column->set_property("text_column", 0);
-  
+
   //Only in the latest hildonmm: m_maemo_selector->set_text_column(m_Columns.m_col_first);
   m_maemo_selector.set_text_column(0);
 
-  
+
   //m_maemo_selector.set_model(0, m_refModel);
   //m_maemo_selector.set_text_column(0);
 #endif
@@ -115,16 +106,15 @@ void ComboEntry::init()
 
   get_entry()->signal_focus_out_event().connect(sigc::mem_fun(*this, &ComboEntry::on_entry_focus_out_event), false);
   get_entry()->signal_activate().connect(sigc::mem_fun(*this, &ComboEntry::on_entry_activate));
+}
 
-#ifndef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
-  #ifndef GLOM_ENABLE_MAEMO
-  signal_changed().connect(sigc::mem_fun(*this, &ComboEntry::on_changed));
-  #else
-  m_maemo_selector.signal_changed().connect(sigc::mem_fun(*this, &ComboEntry::on_changed));
-  #endif
-#endif // GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
+ComboEntry::~ComboEntry()
+{
+}
 
-  if(m_with_second)
+void ComboEntry::set_choices_related(const Document* document, const sharedptr<const Relationship>& relationship, const Glib::ustring& field, const Glib::ustring& field_second, bool show_all)
+{
+  if(!m_cell_second && !field_second.empty())
   {
     #ifndef GLOM_ENABLE_MAEMO
     //We don't use this convenience method, because we want more control over the renderer.
@@ -132,26 +122,20 @@ void ComboEntry::init()
     //(well, maybe set_cell_data_func(), but that's a bit awkward.)
     //pack_start(m_Columns.m_col_second);
 
-    Gtk::CellRenderer* cell_second = Gtk::manage(new Gtk::CellRendererText);
-    cell_second->set_property("xalign", 0.0);
+    m_cell_second = Gtk::manage(new Gtk::CellRendererText);
+    m_cell_second->set_property("xalign", 0.0);
 
     //Use the renderer:
-    pack_start(*cell_second);
+    pack_start(*m_cell_second);
 
     //Make the renderer render the column:
-    #ifdef GLIBMM_PROPERTIES_ENABLED
-    add_attribute(cell_second->_property_renderable(), m_Columns.m_col_second);
-    #else
-    add_attribute(*cell_second, cell_second->_property_renderable(), m_Columns.m_col_second);
-    #endif
+    add_attribute(m_cell_second->_property_renderable(), m_Columns.m_col_second);
     #else //GLOM_ENABLE_MAEMO
     column->pack_start(m_Columns.m_col_second, false);
     #endif //GLOM_ENABLE_MAEMO
   }
-}
 
-ComboEntry::~ComboEntry()
-{
+  ComboChoicesWithTreeModel::set_choices_related(document, relationship, field, field_second, show_all);
 }
 
 void ComboEntry::set_layout_item(const sharedptr<LayoutItem>& layout_item, const Glib::ustring& table_name)
@@ -163,7 +147,7 @@ void ComboEntry::set_layout_item(const sharedptr<LayoutItem>& layout_item, const
     return;
 
   //Horizontal Alignment:
-  FieldFormatting::HorizontalAlignment alignment = 
+  FieldFormatting::HorizontalAlignment alignment =
     FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT;
   sharedptr<LayoutItem_Field> layout_field =
     sharedptr<LayoutItem_Field>::cast_dynamic(layout_item);
@@ -171,7 +155,7 @@ void ComboEntry::set_layout_item(const sharedptr<LayoutItem>& layout_item, const
     alignment = layout_field->get_formatting_used_horizontal_alignment();
 
   const float x_align = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? 0.0 : 1.0);
-  get_entry()->set_alignment(x_align); 
+  get_entry()->set_alignment(x_align);
 }
 
 void ComboEntry::check_for_change()
@@ -181,7 +165,7 @@ void ComboEntry::check_for_change()
     //Don't allow editing via the menu either, if the Entry is non-editable.
 
     //Give the user some kind of warning.
-    //We could just remove the menu (by using a normal Entry for read-only fields with choices), 
+    //We could just remove the menu (by using a normal Entry for read-only fields with choices),
     //but I think that the choice is a useful recognisable visual hint about the field,
     //which shouldn't change sometimes just because the field is read-only.
     Gtk::Window* top_level_window = get_application();
@@ -233,7 +217,7 @@ bool ComboEntry::on_entry_focus_out_event(GdkEventFocus* /* event */)
 }
 
 void ComboEntry::on_entry_activate()
-{ 
+{
   //Call base class:
   //get_entry()->on_activate();
 
@@ -265,7 +249,7 @@ void ComboEntry::set_value(const Gnome::Gda::Value& value)
     if(!entry)
       return;
 
-    const Glib::ustring fg_color = 
+    const Glib::ustring fg_color =
     layout_item->get_formatting_used().get_text_format_color_foreground_to_use(value);
     if(!fg_color.empty())
       entry->modify_text(Gtk::STATE_NORMAL, Gdk::Color(fg_color));
@@ -277,7 +261,7 @@ void ComboEntry::set_value(const Gnome::Gda::Value& value)
 void ComboEntry::set_text(const Glib::ustring& text)
 {
   m_old_text = text;
-  
+
   #if GLOM_ENABLE_MAEMO
   for(Gtk::TreeModel::iterator iter = m_refModel->children().begin(); iter != m_refModel->children().end(); ++iter)
   {
@@ -349,12 +333,10 @@ Application* ComboEntry::get_application()
 void ComboEntry::on_changed()
 #else
 void ComboEntry::on_changed(int /* column */)
-#endif 
+#endif
 {
-#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
   //Call base class:
   Gtk::ComboBoxEntry::on_changed();
-#endif // GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
 
   //This signal is emitted for every key press, but sometimes it's just to say that the active item has changed to "no active item",
   //if the text is not in the dropdown list:
@@ -363,7 +345,7 @@ void ComboEntry::on_changed(int /* column */)
   #else
   Gtk::TreeModel::iterator iter = get_selected();
   #endif //GLOM_ENABLE_MAEMO
-  
+
   if(iter)
   {
     //This is either a choice from the dropdown menu, or someone has typed in something that is in the drop-down menu.
diff --git a/glom/mode_data/datawidget/comboentry.h b/glom/mode_data/datawidget/comboentry.h
index 8f7bff7..bbff22f 100644
--- a/glom/mode_data/datawidget/comboentry.h
+++ b/glom/mode_data/datawidget/comboentry.h
@@ -43,7 +43,7 @@ namespace DataWidgetChildren
  * including values that are not in the choices.
  */
 class ComboEntry
-: 
+:
 #ifndef GLOM_ENABLE_MAEMO
   public Gtk::ComboBoxEntry,
 #else
@@ -55,9 +55,6 @@ public:
   ///You must call set_layout_item() to specify the field type and formatting of the main column.
   ComboEntry();
 
-  ///You must call set_layout_item() to specify the field type and formatting of the main column.
-  explicit ComboEntry(const sharedptr<LayoutItem_Field>& field_second);
-
   virtual ~ComboEntry();
 
   //Override this so we can store the text to compare later.
@@ -74,6 +71,8 @@ public:
 
   virtual void set_read_only(bool read_only = true);
 
+  virtual void set_choices_related(const Document* document, const sharedptr<const Relationship>& relationship, const Glib::ustring& field, const Glib::ustring& field_second, bool show_all);
+
 private:
   void init();
 
@@ -84,7 +83,7 @@ private:
   virtual void on_entry_activate(); //From Gtk::Entry.
   virtual bool on_entry_focus_out_event(GdkEventFocus* event); //From Gtk::Widget
 
-  
+
   #ifndef GLOM_ENABLE_MAEMO
   // Note that this is a normal signal handler when glibmm was complied
   // without default signal handlers
@@ -92,7 +91,7 @@ private:
   #else
   void on_changed(int column);
   #endif //GLOM_ENABLE_MAEMO
-  
+
 
   virtual void check_for_change();
 
@@ -101,20 +100,21 @@ private:
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 
   virtual Application* get_application();
-  
+
   Gtk::Entry* get_entry();
   const Gtk::Entry* get_entry() const;
 
   Glib::ustring m_old_text;
   //Gnome::Gda::Value m_value; //The last-stored value. We have this because the displayed value might be unparseable.
-   
+
   #ifdef GLOM_ENABLE_MAEMO
   Hildon::TouchSelectorEntry m_maemo_selector;
   #endif
+
+  Gtk::CellRenderer* m_cell_second;
 };
 
 } //namespace DataWidetChildren
 } //namespace Glom
 
 #endif //GLOM_UTILITY_WIDGETS_COMBOENTRY_GLOM_H
-
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index 63d26de..936743e 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -46,7 +46,7 @@
 namespace Glom
 {
 
-static DataWidgetChildren::ComboChoices* create_combo_widget_for_field(const sharedptr<LayoutItem_Field>& field, const sharedptr<LayoutItem_Field>& layout_item_second = sharedptr<LayoutItem_Field>())
+static DataWidgetChildren::ComboChoices* create_combo_widget_for_field(const sharedptr<LayoutItem_Field>& field)
 {
   DataWidgetChildren::ComboChoices* result = 0;
   bool as_radio_buttons = false; //TODO: Use this.
@@ -54,12 +54,12 @@ static DataWidgetChildren::ComboChoices* create_combo_widget_for_field(const sha
   if(restricted)
   {
     if(as_radio_buttons)
-      result = Gtk::manage(new DataWidgetChildren::ComboAsRadioButtons(layout_item_second));
+      result = Gtk::manage(new DataWidgetChildren::ComboAsRadioButtons());
     else
-      result = Gtk::manage(new DataWidgetChildren::ComboGlom(layout_item_second));
+      result = Gtk::manage(new DataWidgetChildren::ComboGlom());
   }
   else
-    result = Gtk::manage(new DataWidgetChildren::ComboEntry(layout_item_second));
+    result = Gtk::manage(new DataWidgetChildren::ComboEntry());
 
   return result;
 }
@@ -127,35 +127,15 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
       }
       else if(field->get_formatting_used().get_has_related_choices())
       {
+        combo = create_combo_widget_for_field(field);
+        combo->set_layout_item( get_layout_item(), table_name);
+
         sharedptr<const Relationship> choice_relationship;
         Glib::ustring choice_field, choice_second;
-        field->get_formatting_used().get_choices(choice_relationship, choice_field, choice_second);
-        if(choice_relationship && !choice_field.empty())
-        {
-          const Glib::ustring to_table = choice_relationship->get_to_table();
-
-          const bool with_second = !choice_second.empty();
-
-          if(with_second && document)
-          {
-            sharedptr<Field> field_second = document->get_field(to_table, choice_second);
-
-            sharedptr<LayoutItem_Field> layout_field_second = sharedptr<LayoutItem_Field>::create();
-            layout_field_second->set_full_field_details(field_second);
-            //We use the default formatting for this field->
-
-            combo = create_combo_widget_for_field(field, layout_field_second);
-          }
-          else
-          {
-            combo = create_combo_widget_for_field(field);
-          }
+        bool choice_show_all = false;
+        field->get_formatting_used().get_choices_related(choice_relationship, choice_field, choice_second, choice_show_all);
 
-          //set_choices() needs this, for the numeric layout:
-          combo->set_layout_item( get_layout_item(), table_name);
-
-          combo->set_choices_with_second( Utils::get_choice_values(field) );
-        }
+        combo->set_choices_related(document, choice_relationship, choice_field, choice_second, choice_show_all);
       }
       else
       {
@@ -203,7 +183,7 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
   {
     //Use the text formatting:
     apply_formatting(*m_child, field);
-    
+
     bool child_added = false; //Don't use an extra container unless necessary.
 
     //Check whether the field controls a relationship,
@@ -211,14 +191,14 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
     const bool field_used_in_relationship_to_one = document->get_field_used_in_relationship_to_one(table_name, field);
     //std::cout << "DEBUG: table_name=" << table_name << ", table_used=" << field->get_table_used(table_name) << ", field=" << field->get_name() << ", field_used_in_relationship_to_one=" << field_used_in_relationship_to_one << std::endl;
 
-    //Check whether the field identifies a record in another table 
+    //Check whether the field identifies a record in another table
     //just because it is a primary key in that table:
     bool field_is_related_primary_key = false;
     if(document)
       field->set_full_field_details( document->get_field(field->get_table_used(table_name), field->get_name()) ); //Otherwise get_primary_key() returns false always.
     sharedptr<const Field> field_info = field->get_full_field_details();
-    field_is_related_primary_key = 
-      field->get_has_relationship_name() && 
+    field_is_related_primary_key =
+      field->get_has_relationship_name() &&
       field_info && field_info->get_primary_key();
     //std::cout <<   "DEBUG: field->get_has_relationship_name()=" << field->get_has_relationship_name() << ", field_info->get_primary_key()=" <<  field_info->get_primary_key() << ", field_is_related_primary_key=" << field_is_related_primary_key << std::endl;
 
@@ -246,7 +226,7 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
       #else
       Gtk::Button* button_date = Gtk::manage(new Hildon::Button(Gtk::Hildon::SIZE_FINGER_HEIGHT, Hildon::BUTTON_ARRANGEMENT_HORIZONTAL, _("..."), ""));
       #endif
-      button_date->set_tooltip_text(_("Choose a date from an on-screen calendar.")); 
+      button_date->set_tooltip_text(_("Choose a date from an on-screen calendar."));
       button_date->show();
       hbox_parent->pack_start(*button_date);
       button_date->signal_clicked().connect(sigc::mem_fun(*this, &DataWidget::on_button_choose_date));
@@ -265,14 +245,14 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
       m_button_go_to_details->signal_clicked().connect(sigc::mem_fun(*this, &DataWidget::on_button_open_details));
 
       //Add a button to make it easier to choose an ID for this field.
-      //Don't add this for simple related primary key fields, because they 
+      //Don't add this for simple related primary key fields, because they
       //can generally not be edited via another table's layout.
       if(field_used_in_relationship_to_one)
       {
         #ifndef GLOM_ENABLE_MAEMO
         Gtk::Button* button_select = Gtk::manage(new Gtk::Button(Gtk::Stock::FIND));
         #else
-        Gtk::Button* button_select = Gtk::manage(new Hildon::Button(Gtk::Hildon::SIZE_FINGER_HEIGHT, 
+        Gtk::Button* button_select = Gtk::manage(new Hildon::Button(Gtk::Hildon::SIZE_FINGER_HEIGHT,
            Hildon::BUTTON_ARRANGEMENT_HORIZONTAL, _("Find"), ""));
         #endif
         button_select->set_tooltip_text(_("Enter search criteria to identify records in the other table, to choose an ID for this field."));
@@ -338,7 +318,7 @@ void DataWidget::set_value(const Gnome::Gda::Value& value)
 
 void DataWidget::update_go_to_details_button_sensitivity()
 {
-  //If there is a Go-To-Details "Open" button, only enable it if there is 
+  //If there is a Go-To-Details "Open" button, only enable it if there is
   //an ID:
   if(m_button_go_to_details)
   {
@@ -388,12 +368,12 @@ void DataWidget::set_child_size_by_field(const sharedptr<const LayoutItem_Field>
     int height = -1; //auto.
     if((glom_type == Field::TYPE_TEXT) && (field->get_formatting_used().get_text_format_multiline()))
     {
-      #ifndef GLOM_ENABLE_MAEMO 
+      #ifndef GLOM_ENABLE_MAEMO
       int example_width = 0;
       int example_height = 0;
       Glib::RefPtr<Pango::Layout> refLayout = create_pango_layout("example"); //TODO: Use different text, according to the current locale, or allow the user to choose an example?
       refLayout->get_pixel_size(example_width, example_height);
-      
+
       if(example_height > 0)
         height = example_height * field->get_formatting_used().get_text_format_multiline_height_lines();
       #else
@@ -401,7 +381,7 @@ void DataWidget::set_child_size_by_field(const sharedptr<const LayoutItem_Field>
       //TODO: Expansion only happens if both are -1, and vertical expansion never happens.
       //See bug https://bugs.maemo.org/show_bug.cgi?id=5515
       width = -1;
-      height = -1; 
+      height = -1;
       #endif //GLOM_ENABLE_MAEMO
     }
 
@@ -463,7 +443,7 @@ bool DataWidget::on_button_press_event(GdkEventButton *event)
     pApp->add_developer_action(m_refContextAddRelatedRecords);
     pApp->add_developer_action(m_refContextAddGroup);
 
-    pApp->update_userlevel_ui(); //Update our action's sensitivity. 
+    pApp->update_userlevel_ui(); //Update our action's sensitivity.
 
     //Only show this popup in developer mode, so operators still see the default GtkEntry context menu.
     //TODO: It would be better to add it somehow to the standard context menu.
@@ -496,7 +476,7 @@ sharedptr<LayoutItem_Field> DataWidget::offer_field_list(const Glib::ustring& ta
 sharedptr<LayoutItem_Field> DataWidget::offer_field_list(const Glib::ustring& table_name, const sharedptr<const LayoutItem_Field>& start_field, Document* document, Application* app)
 {
   sharedptr<LayoutItem_Field> result;
-  
+
   Dialog_ChooseField* dialog = 0;
   Utils::get_glade_widget_derived_with_warning(dialog);
 
@@ -618,7 +598,7 @@ const Gtk::Widget* DataWidget::get_data_child_widget() const
 {
   return m_child;
 }
- 
+
  DataWidget::type_signal_open_details_requested DataWidget::signal_open_details_requested()
  {
    return m_signal_open_details_requested;
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 2707d2d..f455957 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -21,6 +21,7 @@
 #include "flowtablewithfields.h"
 #include <glom/mode_data/datawidget/datawidget.h>
 #include <glom/mode_data/buttonglom.h>
+#include <glom/mode_data/datawidget/combochoices.h>
 #include <glom/utility_widgets/notebookglom.h>
 #include <glom/utility_widgets/notebooklabelglom.h>
 #include <glom/utility_widgets/imageglom.h>
@@ -40,8 +41,8 @@
 #include <glibmm/i18n.h>
 
 namespace Glom
-{	
-  
+{
+
 FlowTableWithFields::Info::Info()
 : m_first(0),
   m_first_eventbox(0),
@@ -97,7 +98,7 @@ void FlowTableWithFields::set_table(const Glib::ustring& table_name)
 
 void FlowTableWithFields::add_layout_item(const sharedptr<LayoutItem>& item)
 {
-  add_layout_item_at_position(item, m_list_layoutwidgets.end()); 
+  add_layout_item_at_position(item, m_list_layoutwidgets.end());
 }
 
 void FlowTableWithFields::add_layout_item_at_position(const sharedptr<LayoutItem>& item, const type_list_layoutwidgets::iterator& add_before)
@@ -123,7 +124,7 @@ void FlowTableWithFields::add_layout_item_at_position(const sharedptr<LayoutItem
     sharedptr<LayoutItem_Portal> portal = sharedptr<LayoutItem_Portal>::cast_dynamic(item);
     if(portal)
     {
-      add_layout_portal_at_position(portal, add_before);     
+      add_layout_portal_at_position(portal, add_before);
     }
     else
     {
@@ -154,7 +155,7 @@ void FlowTableWithFields::add_layout_item_at_position(const sharedptr<LayoutItem
                 add_imageobject_at_position(layout_imageobject, m_table_name, add_before);
               else
               {
-                sharedptr<LayoutItem_Placeholder> layout_placeholder = 
+                sharedptr<LayoutItem_Placeholder> layout_placeholder =
                   sharedptr<LayoutItem_Placeholder>::cast_dynamic(item);
                 if(layout_placeholder)
                   add_placeholder_at_position(layout_placeholder, m_table_name, add_before);
@@ -179,7 +180,7 @@ void FlowTableWithFields::add_layout_group_at_position(const sharedptr<LayoutGro
 
   if(true)//!fields.empty() && !group_name.empty())
   {
-    Gtk::Frame* frame = Gtk::manage( new Gtk::Frame ); //TODO_leak: This is possibly leaked, according to valgrind. 
+    Gtk::Frame* frame = Gtk::manage( new Gtk::Frame ); //TODO_leak: This is possibly leaked, according to valgrind.
 
     if(!group->get_title().empty())
     {
@@ -210,24 +211,24 @@ void FlowTableWithFields::add_layout_group_at_position(const sharedptr<LayoutGro
     flow_table->set_table(m_table_name);
 
     flow_table->set_columns_count(group->get_columns_count());
-    
+
     //Use the parent table's padding:
     flow_table->set_column_padding(get_column_padding());
     flow_table->set_row_padding(get_row_padding());
     flow_table->show();
-    
+
     Gtk::EventBox* event_box = Gtk::manage( new Gtk::EventBox() ); //TODO_Leak: Valgrind says this is possibly leaked.
     event_box->add(*flow_table);
     event_box->set_visible_window(false);
 #ifndef GLOM_ENABLE_CLIENT_ONLY
     event_box->signal_button_press_event().connect (sigc::mem_fun (*flow_table,
       &FlowTableWithFields::on_button_press_event));
-#endif      
+#endif
     event_box->show();
-    
+
     alignment->add(*event_box);
 
-    LayoutGroup::type_list_items items = group->get_items(); 
+    LayoutGroup::type_list_items items = group->get_items();
     for(LayoutGroup::type_list_items::const_iterator iter = items.begin(); iter != items.end(); ++iter)
     {
       sharedptr<LayoutItem> item = *iter;
@@ -236,7 +237,7 @@ void FlowTableWithFields::add_layout_group_at_position(const sharedptr<LayoutGro
         flow_table->add_layout_item(item);
       }
     }
-    
+
     add(*frame, true /* expand */);
 
     m_sub_flow_tables.push_back(flow_table);
@@ -249,7 +250,7 @@ void FlowTableWithFields::add_layout_group_at_position(const sharedptr<LayoutGro
     flow_table->signal_related_record_changed().connect( sigc::mem_fun(*this, &FlowTableWithFields::on_flowtable_related_record_changed) );
     flow_table->signal_requested_related_details().connect( sigc::mem_fun(*this, &FlowTableWithFields::on_flowtable_requested_related_details) );
     flow_table->signal_script_button_clicked().connect( sigc::mem_fun(*this, &FlowTableWithFields::on_script_button_clicked) );
-    
+
     flow_table->align_child_group_labels();
   }
 }
@@ -322,7 +323,7 @@ Box_Data_Calendar_Related* FlowTableWithFields::create_related_calendar(const sh
 
     //Connect signals:
     //Just reemit this object's signal when receiving the same signal from the portal:
-    signal_connect_for_reemit_1arg(portal_box->signal_portal_record_changed(), signal_related_record_changed());    
+    signal_connect_for_reemit_1arg(portal_box->signal_portal_record_changed(), signal_related_record_changed());
 
     portal_box->signal_user_requested_details().connect( sigc::bind( sigc::mem_fun(*this, &FlowTableWithFields::on_portal_user_requested_details), portal_box));
 
@@ -340,7 +341,7 @@ void FlowTableWithFields::add_layout_portal_at_position(const sharedptr<LayoutIt
     portal_box = create_related_calendar(calendar_portal);
   else
     portal_box = create_related(portal);
-  
+
   if(portal_box)
   {
     add(*portal_box, true /* expand */);
@@ -403,15 +404,15 @@ void FlowTableWithFields::add_layout_notebook_at_position(const sharedptr<Layout
         flow_table->set_column_padding(get_column_padding());
         flow_table->set_row_padding(get_row_padding());
         flow_table->show();
-        
+
         // Put the new flowtable in an event box to catch events
         Gtk::EventBox* event_box = Gtk::manage( new Gtk::EventBox() ); //TODO_Leak: Valgrind says this is possibly leaked.
         event_box->add(*flow_table);
         event_box->set_visible_window(false);
-#ifndef GLOM_ENABLE_CLIENT_ONLY        
+#ifndef GLOM_ENABLE_CLIENT_ONLY
         event_box->signal_button_press_event().connect (sigc::mem_fun (*flow_table,
                                                                        &FlowTableWithFields::on_button_press_event));
-#endif                                                                       
+#endif
         event_box->show();
         //This doesn't work (probably because we haven't implmented it in our custom container),
         //so we put the flowtable in an alignment and give that a border instead.
@@ -424,7 +425,7 @@ void FlowTableWithFields::add_layout_notebook_at_position(const sharedptr<Layout
         notebook_widget->append_page(*alignment, *tab_label);
 
         //Add child items:
-        LayoutGroup::type_list_items items = group->get_items(); 
+        LayoutGroup::type_list_items items = group->get_items();
         for(LayoutGroup::type_list_items::const_iterator iter = items.begin(); iter != items.end(); ++iter)
         {
           sharedptr<LayoutItem> item = *iter;
@@ -527,7 +528,7 @@ void FlowTableWithFields::add_field_at_position(const sharedptr<LayoutItem_Field
   add_layoutwidgetbase(pDataWidget, add_before);
   add_view(pDataWidget); //So it can get the document.
 
-  info.m_second = pDataWidget; 
+  info.m_second = pDataWidget;
   info.m_second->show_all();
 
   //Add a label, if one is necessary:
@@ -536,7 +537,7 @@ void FlowTableWithFields::add_field_at_position(const sharedptr<LayoutItem_Field
   if(label && !label->get_text().empty())
   {
     label->set_property("xalign", 0.0); //Equivalent to Gtk::ALIGN_LEFT, but we can't use that here.
-    label->set_property("yalign", 0.5); //Equivalent ot Gtk::ALIGN_CENTER, but we can't use that here.; 
+    label->set_property("yalign", 0.5); //Equivalent ot Gtk::ALIGN_CENTER, but we can't use that here.;
 
     label->show();
   }
@@ -556,14 +557,14 @@ void FlowTableWithFields::add_field_at_position(const sharedptr<LayoutItem_Field
     if(label)
       label->set_property("yalign", 0.0); //Equivalent to Gtk::ALIGN_TOP. Center is neater next to entries, but center is silly next to large images.
   }
-  
+
   Gtk::EventBox* eventbox = Gtk::manage(new Gtk::EventBox());
   eventbox->add(*info.m_first);
   info.m_first_eventbox = eventbox; //Remember it so we can retrieve the column number later from FlowTable.
   eventbox->set_visible_window(false);
   eventbox->set_events(Gdk::ALL_EVENTS_MASK);
   eventbox->show_all();
-  
+
   Gtk::Widget* widget = dynamic_cast<Gtk::Widget*>(*add_before);
   if(widget)
     insert_before(*eventbox, *(info.m_second), *widget, expand_second);
@@ -595,18 +596,18 @@ void FlowTableWithFields::add_button_at_position(const sharedptr<LayoutItem_Butt
       layoutitem_button) );
 
   button->show();
-    
+
   add_layoutwidgetbase(button, add_before);
   //add_view(button); //So it can get the document.
-  
+
   const FieldFormatting::HorizontalAlignment alignment =
     layoutitem_button->get_formatting_used_horizontal_alignment();
   Gtk::Widget* widget_to_add = button;
   bool expand = false;
   if(alignment != FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT)
   {
-    //Put the button in a Gtk::HBox so we can have non-default alignment in 
-    //its space. Note that we will need a different technique if we ever 
+    //Put the button in a Gtk::HBox so we can have non-default alignment in
+    //its space. Note that we will need a different technique if we ever
     //support center alignment.
     Gtk::HBox* box_button = Gtk::manage(new Gtk::HBox());
     box_button->show();
@@ -614,7 +615,7 @@ void FlowTableWithFields::add_button_at_position(const sharedptr<LayoutItem_Butt
       box_button->pack_end(*button, Gtk::PACK_SHRINK);
     else
       box_button->pack_start(*button, Gtk::PACK_SHRINK);
-      
+
     widget_to_add = box_button;
     expand = true;
   }
@@ -631,20 +632,20 @@ void FlowTableWithFields::add_button_at_position(const sharedptr<LayoutItem_Butt
 void FlowTableWithFields::add_textobject_at_position(const sharedptr<LayoutItem_Text>& layoutitem_text, const Glib::ustring& table_name , const type_list_layoutwidgets::iterator& add_before)
 {
   //Add the widget:
-  
+
   const FieldFormatting::HorizontalAlignment alignment =
     layoutitem_text->get_formatting_used_horizontal_alignment();
   const Gtk::AlignmentEnum x_align = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? Gtk::ALIGN_LEFT : Gtk::ALIGN_RIGHT);
   Gtk::Alignment* alignment_label = Gtk::manage(new Gtk::Alignment());
   alignment_label->set(x_align, Gtk::ALIGN_CENTER);
   alignment_label->show();
-  
+
   const Glib::ustring text = layoutitem_text->get_text();
   DataWidgetChildren::Label* label = Gtk::manage(new DataWidgetChildren::Label(text));
   label->set_layout_item(layoutitem_text, table_name);
   label->show();
   alignment_label->add(*label);
-  
+
   apply_formatting(*label, layoutitem_text);
 
   add_layoutwidgetbase(label, add_before);
@@ -669,7 +670,7 @@ void FlowTableWithFields::add_textobject_at_position(const sharedptr<LayoutItem_
     title_label->show();
     alignment_title->add(*title_label);
     add_layoutwidgetbase(title_label, add_before);
-    
+
     Gtk::Widget* widget = dynamic_cast<Gtk::Widget*>(*add_before);
     if(widget)
       insert_before (*alignment_title, *alignment_label, *widget, true /* expand */);
@@ -686,7 +687,7 @@ void FlowTableWithFields::add_placeholder_at_position(const sharedptr<LayoutItem
     delete m_placeholder;
     m_placeholder = 0;
   }
-  
+
   //Add the widget:
   m_placeholder = Gtk::manage(new Gtk::Alignment());
   m_placeholder->set(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
@@ -782,15 +783,18 @@ void FlowTableWithFields::remove_field(const Glib::ustring& id)
 
       iter = m_listFields.erase(iter);
     }
-  } 
+  }
 }
 
 void FlowTableWithFields::set_field_value(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value)
 {
-  // TODO: Avoid duplication. Maybe we can call set_other_field_value plus
-  // set the value for field's widget directly.
+  set_field_value(field, value, true);
+}
+
+void FlowTableWithFields::set_field_value(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value, bool set_specified_field_layout)
+{
   //Set widgets which should show the value of this field:
-  type_list_widgets list_widgets = get_field(field, true);
+  type_list_widgets list_widgets = get_field(field, set_specified_field_layout);
   for(type_list_widgets::iterator iter = list_widgets.begin(); iter != list_widgets.end(); ++iter)
   {
     DataWidget* datawidget = dynamic_cast<DataWidget*>(*iter);
@@ -800,7 +804,7 @@ void FlowTableWithFields::set_field_value(const sharedptr<const LayoutItem_Field
     }
   }
 
-  //Refresh widgets which should show the related records for relationships that use this field:
+  //Refresh portal widgets which should show the related records for relationships that use this field:
   type_portals list_portals = get_portals(field /* from_key field name */);
   for(type_portals::iterator iter = list_portals.begin(); iter != list_portals.end(); ++iter)
   {
@@ -811,34 +815,25 @@ void FlowTableWithFields::set_field_value(const sharedptr<const LayoutItem_Field
       portal->refresh_data_from_database_with_foreign_key(value /* foreign key value */);
     }
   }
-}
-
-void FlowTableWithFields::set_other_field_value(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value)
-{
-  //Set widgets which should show the value of this field:
-  type_list_widgets list_widgets = get_field(field, false);
-  for(type_list_widgets::iterator iter = list_widgets.begin(); iter != list_widgets.end(); ++iter)
-  {
-    DataWidget* datawidget = dynamic_cast<DataWidget*>(*iter);
-    if(datawidget)
-    {
-      datawidget->set_value(value);
-    }
-  }
 
-  //Refresh widgets which should show the related records for relationships that use this field:
-  type_portals list_portals = get_portals(field /* from_key field name */);
-  for(type_portals::iterator iter = list_portals.begin(); iter != list_portals.end(); ++iter)
+  //Refresh choices widgets which should show the related records for relationships that use this field:
+  type_choice_widgets list_choice_widgets = get_choice_widgets(field /* from_key field name */);
+  for(type_choice_widgets::iterator iter = list_choice_widgets.begin(); iter != list_choice_widgets.end(); ++iter)
   {
-    Box_Data_Portal* portal = *iter;
-    if(portal)
+    DataWidgetChildren::ComboChoices* widget = *iter;
+    if(widget)
     {
       //g_warning("FlowTableWithFields::set_field_value: foreign_key_value=%s", value.to_string().c_str());
-      portal->refresh_data_from_database_with_foreign_key(value /* foreign key value */);
+      widget->refresh_data_from_database_with_foreign_key(get_document(), value /* foreign key value */);
     }
   }
 }
 
+void FlowTableWithFields::set_other_field_value(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value)
+{
+  set_field_value(field, value, false);
+}
+
 Gnome::Gda::Value FlowTableWithFields::get_field_value(const sharedptr<const LayoutItem_Field>& field) const
 {
   type_list_const_widgets list_widgets = get_field(field, true);
@@ -913,12 +908,70 @@ FlowTableWithFields::type_portals FlowTableWithFields::get_portals(const sharedp
   return result;
 }
 
+FlowTableWithFields::type_choice_widgets FlowTableWithFields::get_choice_widgets(const sharedptr<const LayoutItem_Field>& from_key)
+{
+  type_choice_widgets result;
+  if(!from_key)
+    return result;
+
+  const Glib::ustring from_key_name = from_key->get_name();
+
+  //Check the single-item widgets:
+  for(type_listFields::iterator iter = m_listFields.begin(); iter != m_listFields.end(); ++iter)
+  {
+    DataWidget* widget = iter->m_second;
+    if(!widget)
+      continue;
+
+    Gtk::Widget* child_widget = widget->get_data_child_widget();
+    DataWidgetChildren::ComboChoices* combochoices = dynamic_cast<DataWidgetChildren::ComboChoices*>(child_widget);
+    if(!combochoices)
+      continue;
+
+    const sharedptr<const LayoutItem> layout_item =
+      combochoices->get_layout_item();
+    const sharedptr<const LayoutItem_Field> field =
+       sharedptr<const LayoutItem_Field>::cast_dynamic(layout_item);
+    if(!field)
+      continue;
+
+    const FieldFormatting& format = field->get_formatting_used();
+
+    sharedptr<const Relationship> choice_relationship;
+    Glib::ustring choice_field, choice_second;
+    bool choice_show_all = false;
+    format.get_choices_related(choice_relationship, choice_field, choice_second, choice_show_all);
+    if(choice_show_all)
+      continue; //"Show All" choices don't use the ID field values.
+
+    if(choice_relationship->get_from_field() == from_key_name)
+      result.push_back(combochoices);
+  }
+
+  //Check the sub-flowtables:
+  for(type_sub_flow_tables::const_iterator iter = m_sub_flow_tables.begin(); iter != m_sub_flow_tables.end(); ++iter)
+  {
+    FlowTableWithFields* subtable = *iter;
+    if(subtable)
+    {
+      const type_choice_widgets sub_list = subtable->get_choice_widgets(from_key);
+      if(!sub_list.empty())
+      {
+        //Add to the main result:
+        result.insert(result.end(), sub_list.begin(), sub_list.end());
+      }
+    }
+  }
+
+  return result;
+}
+
 namespace
 {
   // Get the direct widgets represesenting a given layout item
   // from a flowtable, without considering subflowtables:
   template<typename InputIterator, typename OutputIterator>
-  void get_direct_fields(InputIterator begin, InputIterator end, OutputIterator out, const sharedptr<const LayoutItem_Field>& layout_item, bool include_item)
+  static void get_direct_fields(InputIterator begin, InputIterator end, OutputIterator out, const sharedptr<const LayoutItem_Field>& layout_item, bool include_item)
   {
     for(InputIterator iter = begin; iter != end; ++iter)
     {
@@ -1003,7 +1056,7 @@ void FlowTableWithFields::remove_all()
       delete pSub;
     }
   }
- 
+
   m_sub_flow_tables.clear();
 
 
@@ -1118,7 +1171,7 @@ void FlowTableWithFields::add_layoutwidgetbase(LayoutWidgetBase* layout_widget,
 #ifndef GLOM_ENABLE_CLIENT_ONLY
 void FlowTableWithFields::on_layoutwidget_changed()
 {
-  //Forward the signal to the container, 
+  //Forward the signal to the container,
   //so it can make sure that the change is saved in the document.
   signal_layout_changed().emit();
 }
@@ -1148,7 +1201,7 @@ void FlowTableWithFields::on_datawidget_layout_item_added(LayoutWidgetBase::enum
     return;
   }
 
-  
+
   //Create/Choose the new layout item:
   sharedptr<LayoutItem> layout_item_new;
   if(item_type == LayoutWidgetBase::TYPE_FIELD)
@@ -1157,7 +1210,7 @@ void FlowTableWithFields::on_datawidget_layout_item_added(LayoutWidgetBase::enum
     if(layout_item_field)
     {
       //TODO: privileges.
-      layout_item_new = layout_item_field; 
+      layout_item_new = layout_item_field;
     }
   }
   else if(item_type == LayoutWidgetBase::TYPE_GROUP)
@@ -1207,7 +1260,7 @@ void FlowTableWithFields::on_datawidget_layout_item_added(LayoutWidgetBase::enum
   if(layout_item_new)
   {
     layout_group->add_item(layout_item_new, layout_item);
-  
+
     //We have changed the structure itself in the document, because we are using the same structure via sharedptr.
     //So we just tell the parent widgets to rebuild the layout from the document:
     signal_layout_changed().emit(); //This should result in a complete re-layout.
@@ -1256,44 +1309,44 @@ void FlowTableWithFields::apply_size_groups_to_labels(const type_vec_sizegroups&
     Glib::RefPtr<Gtk::SizeGroup> previous_size_group = info.m_first_in_sizegroup;
     if(!label || !previous_size_group)
       continue;
-      
+
     previous_size_group->remove_widget(*label);
     info.m_first_in_sizegroup.reset();
   }
-  
+
   m_vec_size_groups = size_groups;
-  
+
   if(m_vec_size_groups.empty())
     return;
-     
+
   for(type_listFields::iterator iter = m_listFields.begin(); iter != m_listFields.end(); ++iter)
   {
     Info info = *iter;
     Gtk::Label* label = info.m_first;
     if(!label)
       continue;
-      
+
     Gtk::EventBox* label_parent = info.m_first_eventbox;
     if(!label_parent)
       continue;
-            
-    //Only align labels in the first column, because items in separate columns 
+
+    //Only align labels in the first column, because items in separate columns
     //couldn't be aligned vertically anyway, and this would cause extra space.
     //TODO: Use a different SizeGroup for items in 2nd columns?
     guint column = 0;
     const bool column_allocated = get_column_for_first_widget(*label_parent, column);
     if(!column_allocated)
-      
+
     if(column >= m_vec_size_groups.size())
       continue;
-      
+
     Glib::RefPtr<Gtk::SizeGroup> size_group = m_vec_size_groups[column];
     if(size_group && (info.m_first_in_sizegroup != size_group))
     {
       size_group->add_widget(*label);
       info.m_first_in_sizegroup = size_group; //Remember it so we can remove it later.
     }
-  } 
+  }
 }
 
 void FlowTableWithFields::align_child_group_labels()
@@ -1301,7 +1354,7 @@ void FlowTableWithFields::align_child_group_labels()
   //Don't bother if there are not >1 groups to align:
   if(m_sub_flow_tables.size() < 2)
     return;
-    
+
   //Create a size group for each column and tell all groups to use them for their labels:
   const guint max_columns = get_sub_flowtables_max_columns();
   type_vec_sizegroups vec_sizegroups(max_columns);
@@ -1309,7 +1362,7 @@ void FlowTableWithFields::align_child_group_labels()
   {
     vec_sizegroups[i] = Gtk::SizeGroup::create(Gtk::SIZE_GROUP_HORIZONTAL);
   }
-   
+
   for(type_sub_flow_tables::iterator iter = m_sub_flow_tables.begin(); iter != m_sub_flow_tables.end(); ++iter)
   {
     FlowTableWithFields* subtable = *iter;
@@ -1321,7 +1374,7 @@ void FlowTableWithFields::align_child_group_labels()
 guint FlowTableWithFields::get_sub_flowtables_max_columns() const
 {
   guint result = get_columns_count();
-  
+
   for(type_sub_flow_tables::const_iterator iter = m_sub_flow_tables.begin(); iter != m_sub_flow_tables.end(); ++iter)
   {
     const FlowTableWithFields* subtable = *iter;
@@ -1332,31 +1385,31 @@ guint FlowTableWithFields::get_sub_flowtables_max_columns() const
           result = count;
     }
   }
-  
+
   return result;
 }
-  
+
 
 void FlowTableWithFields::on_size_allocate(Gtk::Allocation& allocation)
 {
   FlowTable::on_size_allocate(allocation);
-  
+
   sharedptr<const LayoutGroup> group = get_layout_group();
   Glib::ustring group_name;
   if(group)
      group_name = group->get_name();
 
-  //The widgets have now been allocated their sizes and columns, 
+  //The widgets have now been allocated their sizes and columns,
   //so this should be able to work:
   if(m_columns_allocated_changed)
   {
     apply_size_groups_to_labels(m_vec_size_groups);
-    
+
     //Prevent unnecessary repeated (endless?) size allocation requested:
     m_columns_allocated_changed = false;
   }
 }
-  
+
 #ifndef GLOM_ENABLE_CLIENT_ONLY
 
 void FlowTableWithFields::on_dnd_add_layout_item_by_type(int item_type_num, Gtk::Widget* above_widget)
@@ -1397,8 +1450,8 @@ void FlowTableWithFields::on_dnd_add_layout_item_by_type(int item_type_num, Gtk:
 void FlowTableWithFields::on_dnd_add_layout_item_field(LayoutWidgetBase* above)
 {
   //Ask the user to choose the layout item
-  sharedptr<LayoutItem_Field> layout_item_field = 
-    DataWidget::offer_field_list(m_table_name, sharedptr<LayoutItem_Field>(), 
+  sharedptr<LayoutItem_Field> layout_item_field =
+    DataWidget::offer_field_list(m_table_name, sharedptr<LayoutItem_Field>(),
       get_document(), Application::get_application());
   if(!layout_item_field)
   {
@@ -1408,7 +1461,7 @@ void FlowTableWithFields::on_dnd_add_layout_item_field(LayoutWidgetBase* above)
 
   sharedptr<LayoutItem> item = sharedptr<LayoutItem>::cast_dynamic(layout_item_field);
   dnd_add_to_layout_group(item, above);
-  
+
   //Tell the parent to tell the document to save the layout
   signal_layout_changed().emit();
 }
@@ -1423,9 +1476,9 @@ void FlowTableWithFields::on_dnd_add_layout_notebook (LayoutWidgetBase* above)
   group->set_title(_("New Group"));
   group->set_name(_("Group"));
   notebook->m_list_items.push_back(group);
-  
+
   dnd_add_to_layout_group(item, above);
-  
+
   //Tell the parent to tell the document to save the layout
   signal_layout_changed().emit();
 }
@@ -1433,26 +1486,26 @@ void FlowTableWithFields::on_dnd_add_layout_notebook (LayoutWidgetBase* above)
 void FlowTableWithFields::on_dnd_add_layout_portal (LayoutWidgetBase* above)
 {
   sharedptr<LayoutItem_Portal> portal = get_portal_relationship();
-  
+
   if(portal)
   {
     sharedptr<LayoutItem> item = sharedptr<LayoutItem>::cast_dynamic(portal);
     dnd_add_to_layout_group(item, above);
-    
+
     //Tell the parent to tell the document to save the layout
     signal_layout_changed().emit();
   }
 }
 
 void FlowTableWithFields::on_dnd_add_layout_group(LayoutWidgetBase* above)
-{  
+{
   sharedptr<LayoutGroup> group(new LayoutGroup());
   group->set_title(_("New Group"));
   group->set_name(_("Group"));
-  
+
   sharedptr<LayoutItem> item = sharedptr<LayoutItem>::cast_dynamic(group);
   dnd_add_to_layout_group (item, above);
-  
+
   //Tell the parent to tell the document to save the layout
   signal_layout_changed().emit();
 }
@@ -1498,7 +1551,7 @@ void FlowTableWithFields::on_dnd_add_layout_item_image(LayoutWidgetBase* above)
 void FlowTableWithFields::on_dnd_add_layout_item(LayoutWidgetBase* above, const sharedptr<LayoutItem>& item)
 {
   dnd_add_to_layout_group(item, above);
-  
+
   // Don't do this here - it's done in the drag_end handler
   // signal_layout_changed().emit();
 }
@@ -1520,37 +1573,37 @@ void FlowTableWithFields::on_dnd_add_placeholder(Gtk::Widget* above_widget)
                                                             m_list_layoutwidgets.end(),
                                                             above);
   sharedptr<LayoutItem_Placeholder> placeholder_field(new LayoutItem_Placeholder);
-  sharedptr<LayoutItem> item = sharedptr<LayoutItem>::cast_dynamic(placeholder_field);  
+  sharedptr<LayoutItem> item = sharedptr<LayoutItem>::cast_dynamic(placeholder_field);
   add_layout_item_at_position(placeholder_field, cur_widget);
 
   dnd_add_to_layout_group(item, above, true /* ignore error*/);
 }
 
 void FlowTableWithFields::on_dnd_remove_placeholder()
-{ 
+{
   if(m_placeholder)
   {
     //Get the layout group that the "above" widget's layout item is in
     sharedptr<LayoutGroup> layout_group = get_layout_group();
     if(layout_group)
-    { 
+    {
       LayoutGroup::type_list_items items = layout_group->get_items();
       for (LayoutGroup::type_list_items::iterator item = items.begin();
            item != items.end(); ++item)
       {
-        sharedptr<LayoutItem_Placeholder> placeholder = 
+        sharedptr<LayoutItem_Placeholder> placeholder =
           sharedptr<LayoutItem_Placeholder>::cast_dynamic(*item);
 
         if(placeholder)
         {
           layout_group->remove_item(*item);
         }
-      }   
+      }
     }
 
     remove(*m_placeholder);
   }
-  
+
   m_placeholder = 0;
 }
 
@@ -1574,7 +1627,7 @@ bool FlowTableWithFields::dnd_add_to_layout_group(const sharedptr<LayoutItem>& i
 
     return false;
   }
-      
+
   if(layoutwidget && layoutwidget->get_layout_item())
     layout_group->add_item(item, layoutwidget->get_layout_item());
   else
@@ -1587,7 +1640,7 @@ void FlowTableWithFields::on_menu_properties_activate()
 {
   Dialog_FlowTable* dialog = 0;
   Utils::get_glade_widget_derived_with_warning(dialog);
-  
+
   dialog->set_flowtable(this);
   const int response = dialog->run();
   if(response == Gtk::RESPONSE_OK)
@@ -1599,7 +1652,7 @@ void FlowTableWithFields::on_menu_properties_activate()
   }
 
   delete dialog;
- 
+
 }
 
 void FlowTableWithFields::on_menu_delete_activate()
@@ -1650,7 +1703,7 @@ sharedptr<LayoutItem_Portal> FlowTableWithFields::get_portal_relationship()
 {
   Dialog_ChooseRelationship* dialog = 0;
   Utils::get_glade_widget_derived_with_warning(dialog);
-    
+
   Document* pDocument = static_cast<Document*>(get_document());
   dialog->set_document(pDocument, m_table_name);
   //TODO: dialog->set_transient_for(*get_app_window());
@@ -1668,7 +1721,7 @@ sharedptr<LayoutItem_Portal> FlowTableWithFields::get_portal_relationship()
       return layout_item;
     }
   }
-      
+
   delete dialog;
   return sharedptr<LayoutItem_Portal>();
 }
@@ -1680,7 +1733,7 @@ void FlowTableWithFields::set_child_widget_dnd_in_progress(Gtk::Widget* child, b
   if(!child)
     return;
 
-  base->set_dnd_in_progress(in_progress); 
+  base->set_dnd_in_progress(in_progress);
 }
 
 bool FlowTableWithFields::get_child_widget_dnd_in_progress(Gtk::Widget* child) const
diff --git a/glom/mode_data/flowtablewithfields.h b/glom/mode_data/flowtablewithfields.h
index 8cb7c38..36d781b 100644
--- a/glom/mode_data/flowtablewithfields.h
+++ b/glom/mode_data/flowtablewithfields.h
@@ -41,6 +41,7 @@
 #include <glom/utility_widgets/layoutwidgetbase.h>
 #include <glom/utility_widgets/layoutwidgetutils.h>
 #include <glom/mode_data/box_data_list_related.h>
+#include <glom/mode_data/datawidget/combochoices.h>
 #include "box_data_calendar_related.h"
 #include <glom/mode_design/layout/treestore_layout.h> //Forthe enum.
 #include <map>
@@ -52,7 +53,7 @@ namespace Glom
 class DataWidget;
 
 class FlowTableWithFields
-  : 
+  :
 #ifdef GLOM_ENABLE_CLIENT_ONLY
     public FlowTable,
     public LayoutWidgetUtils,
@@ -61,7 +62,7 @@ class FlowTableWithFields
 #endif
     public View_Composite_Glom
 {
-public: 
+public:
   FlowTableWithFields(const Glib::ustring& table_name = Glib::ustring());
   virtual ~FlowTableWithFields();
 
@@ -102,24 +103,24 @@ public:
   virtual void set_design_mode(bool value = true);
 
   virtual void remove_all();
-  
+
   typedef std::vector< Glib::RefPtr<Gtk::SizeGroup> > type_vec_sizegroups;
-    
+
   /** Apply the size groups to all field labels.
-   * By calling this method on multiple FlowTables, the field widgets in 
+   * By calling this method on multiple FlowTables, the field widgets in
    * different groups can then align.
    * @param size_groups A vector containing a size group for each possible column.
    */
   void apply_size_groups_to_labels(const type_vec_sizegroups& size_group);
-  
+
   /** Create a size group and make all the labels in child flowtables use it,
    * making them align.
    */
   void align_child_group_labels();
 
-  /** Get the layout structure, which might have changed in the child widgets since 
+  /** Get the layout structure, which might have changed in the child widgets since
    * the whole widget structure was built.
-   * for instance, if the user chose a new field for a DataWidget, 
+   * for instance, if the user chose a new field for a DataWidget,
    * or a new relationship for a portal.
    */
   void get_layout_groups(Document::type_list_layout_groups& groups);
@@ -130,7 +131,7 @@ public:
    */
   typedef sigc::signal<void, const sharedptr<const LayoutItem_Field>&, const Gnome::Gda::Value&> type_signal_field_edited;
   type_signal_field_edited signal_field_edited();
-  
+
   /** For instance,
    * void on_flowtable_field_open_details_requested(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value);
    */
@@ -154,20 +155,28 @@ public:
    */
   typedef sigc::signal<void, const sharedptr<LayoutItem_Button>&> type_signal_script_button_clicked;
   type_signal_script_button_clicked signal_script_button_clicked();
-  
+
 private:
 
+  void set_field_value(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value, bool set_specified_field_layout);
+
   // If include_item is set, then the output list will contain field's widget,
   // otherwise not.
   type_list_widgets get_field(const sharedptr<const LayoutItem_Field>& field, bool include_item);
   type_list_const_widgets get_field(const sharedptr<const LayoutItem_Field>& field, bool include_item) const;
 
-  typedef std::list< Box_Data_Portal* > type_portals;
-    
+  typedef std::list<Box_Data_Portal*> type_portals;
+
   /// Get portals whose relationships have @a from_key as the from_key.
   type_portals get_portals(const sharedptr<const LayoutItem_Field>& from_key);
-  
-  /** Examine this flow table and all child flow tables, discovering which 
+
+
+  typedef std::list<DataWidgetChildren::ComboChoices*> type_choice_widgets;
+
+  /// Get choice widgets with !show_all relationships that have @a from_key as the from_key.
+  type_choice_widgets get_choice_widgets(const sharedptr<const LayoutItem_Field>& from_key);
+
+  /** Examine this flow table and all child flow tables, discovering which
    * has the most columns.
    */
   guint get_sub_flowtables_max_columns() const;
@@ -177,7 +186,7 @@ private:
   void on_entry_edited(const Gnome::Gda::Value& value, const sharedptr<const LayoutItem_Field> field);
   void on_entry_open_details_requested(const Gnome::Gda::Value& value, const sharedptr<const LayoutItem_Field> field);
   void on_flowtable_entry_edited(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value);
-  void on_flowtable_entry_open_details_requested(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value); 
+  void on_flowtable_entry_open_details_requested(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value);
   void on_flowtable_related_record_changed(const Glib::ustring& relationship_name);
   void on_flowtable_requested_related_details(const Glib::ustring& table_name, Gnome::Gda::Value primary_key_value);
 
@@ -233,7 +242,7 @@ private:
   void add_layout_group_at_position(const sharedptr<LayoutGroup>& group, const type_list_layoutwidgets::iterator& add_before);
   void add_layout_notebook_at_position(const sharedptr<LayoutItem_Notebook>& notebook, const type_list_layoutwidgets::iterator& add_before);
   void add_layout_portal_at_position(const sharedptr<LayoutItem_Portal>& portal, const type_list_layoutwidgets::iterator& add_before);
-  
+
   virtual void on_size_allocate(Gtk::Allocation& allocation);
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
@@ -243,8 +252,8 @@ private:
   virtual void on_dnd_remove_placeholder();
   virtual void set_child_widget_dnd_in_progress(Gtk::Widget* child, bool in_progress);
   virtual bool get_child_widget_dnd_in_progress(Gtk::Widget* child) const;
-    
-  
+
+
   void on_dnd_add_layout_item_field(LayoutWidgetBase* above);
   void on_dnd_add_layout_group(LayoutWidgetBase* above);
   void on_dnd_add_layout_item_button(LayoutWidgetBase* above);
@@ -253,21 +262,21 @@ private:
   void on_dnd_add_layout_notebook(LayoutWidgetBase* above);
   void on_dnd_add_layout_portal(LayoutWidgetBase* above);
   void on_dnd_add_layout_item(LayoutWidgetBase* above, const sharedptr<LayoutItem>& item);
-  
+
   sharedptr<LayoutItem_Portal> get_portal_relationship();
 
   void dnd_notify_failed_drop();
   bool dnd_add_to_layout_group(const sharedptr<LayoutItem>& item, LayoutWidgetBase* layoutwidget, bool ignore_error = false);
-  
+
 #endif // !GLOM_ENABLE_CLIENT_ONLY
-  
+
   Box_Data_List_Related* create_related(const sharedptr<LayoutItem_Portal>& portal, bool show_title = true);
   Box_Data_Calendar_Related* create_related_calendar(const sharedptr<LayoutItem_CalendarPortal>& portal, bool show_title = true);
 
   Gtk::Alignment* m_placeholder;
-  
+
   Glib::ustring m_table_name;
-  
+
   //Size groups shared by this widget's sibling FlowTables,
   //with one group for each column.
   type_vec_sizegroups m_vec_size_groups;
@@ -279,7 +288,7 @@ private:
   type_signal_related_record_changed m_signal_related_record_changed;
   type_signal_requested_related_details m_signal_requested_related_details;
   type_signal_script_button_clicked m_signal_script_button_clicked;
-    
+
   //menu
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   virtual void on_menu_properties_activate();
diff --git a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
index 2ea2f5c..4133781 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
@@ -57,6 +57,10 @@ Box_Formatting::Box_Formatting(BaseObjectType* cobject, const Glib::RefPtr<Gtk::
   m_checkbutton_choices_restricted_as_radio_buttons(0),
   m_adddel_choices_custom(0),
   m_col_index_custom_choices(0),
+  m_combo_choices_relationship(0),
+  m_combo_choices_field(0),
+  m_combo_choices_field_second(0),
+  m_checkbutton_choices_related_show_all(0),
   m_for_print_layout(false),
   m_show_numeric(true),
   m_show_choices(true)
@@ -119,6 +123,7 @@ Box_Formatting::Box_Formatting(BaseObjectType* cobject, const Glib::RefPtr<Gtk::
   builder->get_widget_derived("combobox_choices_related_relationship", m_combo_choices_relationship);
   builder->get_widget_derived("combobox_choices_related_field", m_combo_choices_field);
   builder->get_widget_derived("combobox_choices_related_field_second", m_combo_choices_field_second);
+  builder->get_widget("checkbutton_choices_related_show_all", m_checkbutton_choices_related_show_all);
   builder->get_widget("radiobutton_choices_custom", m_radiobutton_choices_custom);
   builder->get_widget("radiobutton_choices_related", m_radiobutton_choices_related);
 
@@ -233,12 +238,14 @@ void Box_Formatting::set_formatting(const FieldFormatting& format, bool show_num
 
     sharedptr<const Relationship> choices_relationship;
     Glib::ustring choices_field, choices_field_second;
-    format.get_choices(choices_relationship, choices_field, choices_field_second);
+    bool choices_show_all = false;
+    format.get_choices_related(choices_relationship, choices_field, choices_field_second, choices_show_all);
 
     m_combo_choices_relationship->set_selected_relationship(choices_relationship);
     on_combo_choices_relationship_changed(); //Fill the combos so we can set their active items.
     m_combo_choices_field->set_selected_field(choices_field);
     m_combo_choices_field_second->set_selected_field(choices_field_second);
+    m_checkbutton_choices_related_show_all->set_active(choices_show_all);
 
     //Custom choices:
     m_adddel_choices_custom->remove_all();
@@ -306,9 +313,10 @@ bool Box_Formatting::get_formatting(FieldFormatting& format) const
       m_checkbutton_choices_restricted_as_radio_buttons->get_active());
 
     sharedptr<Relationship> choices_relationship = m_combo_choices_relationship->get_selected_relationship();
-    m_format.set_choices(choices_relationship,
+    m_format.set_choices_related(choices_relationship,
       m_combo_choices_field->get_selected_field_name(),
-      m_combo_choices_field_second->get_selected_field_name() );
+      m_combo_choices_field_second->get_selected_field_name(),
+      m_checkbutton_choices_related_show_all->get_active());
 
     //Custom choices:
     FieldFormatting::type_list_values list_choice_values;
diff --git a/glom/mode_design/layout/layout_item_dialogs/box_formatting.h b/glom/mode_design/layout/layout_item_dialogs/box_formatting.h
index ebe72d7..21db584 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.h
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.h
@@ -99,6 +99,7 @@ private:
   ComboBox_Relationship* m_combo_choices_relationship;
   ComboBox_Fields* m_combo_choices_field;
   ComboBox_Fields* m_combo_choices_field_second;
+  Gtk::CheckButton* m_checkbutton_choices_related_show_all;
 
   mutable FieldFormatting m_format;
 
diff --git a/glom/utility_widgets/db_adddel/db_adddel.cc b/glom/utility_widgets/db_adddel/db_adddel.cc
index c61a6f5..0a861bc 100644
--- a/glom/utility_widgets/db_adddel/db_adddel.cc
+++ b/glom/utility_widgets/db_adddel/db_adddel.cc
@@ -97,13 +97,13 @@ DbAddDel::DbAddDel()
   //Start with a useful default TreeModel:
   //set_columns_count(1);
   //construct_specified_columns();
-  
+
   // Give the TreeView an accessible name, to access it in LDTP
   // TODO: Maybe this should be a constructor parameter, so that multiple
   // DbAddDels in a single Window can be addressed separately.
 #ifdef GTKMM_ATKMM_ENABLED
   m_TreeView.get_accessible()->set_name(_("Table Content"));
-#endif  
+#endif
 
   #ifndef GLOM_ENABLE_MAEMO
   m_ScrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
@@ -116,11 +116,11 @@ DbAddDel::DbAddDel()
   //Do not let the treeview emit activated as soon as a row is pressed.
   //TODO: Allow this default maemo behaviour?
   g_object_set(m_TreeView.gobj(), "hildon-ui-mode", HILDON_UI_MODE_NORMAL, (void*)0);
-  
+
   //Allow get_selected() and get_active() to work:
   m_TreeView.set_column_selection_mode(Hildon::TOUCH_SELECTOR_SELECTION_MODE_SINGLE);
   pack_start(m_TreeView);
-  
+
   m_TreeView.signal_changed().connect(sigc::mem_fun(*this, &DbAddDel::on_maemo_touchselector_changed));
   #endif //GLOM_ENABLE_MAEMO
 
@@ -154,7 +154,7 @@ DbAddDel::DbAddDel()
   // Adjust sizing when style changed
   // TODO_Maemo: This calls construct_specified_columns(), which runs the SQL query again.
   //       Try to change the row and column sizes without doing that.
-  
+
   signal_style_changed().connect(sigc::mem_fun(*this, &DbAddDel::on_self_style_changed));
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 }
@@ -166,7 +166,7 @@ DbAddDel::~DbAddDel()
   if(pApp)
   {
     pApp->remove_developer_action(m_refContextLayout);
-  } 
+  }
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 }
 
@@ -281,7 +281,7 @@ void DbAddDel::setup_menu()
   if(pApp)
   {
     pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
-    pApp->update_userlevel_ui(); //Update our action's sensitivity. 
+    pApp->update_userlevel_ui(); //Update our action's sensitivity.
   }
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 
@@ -324,7 +324,7 @@ void DbAddDel::setup_menu()
 #endif //GLIBMM_EXCEPTIONS_ENABLED
 
   //Get the menu:
-  m_pMenuPopup = dynamic_cast<Gtk::Menu*>( m_refUIManager->get_widget("/ContextMenu") ); 
+  m_pMenuPopup = dynamic_cast<Gtk::Menu*>( m_refUIManager->get_widget("/ContextMenu") );
   if(!m_pMenuPopup)
     g_warning("menu not found");
 
@@ -339,7 +339,7 @@ void DbAddDel::setup_menu()
     m_refContextEdit->set_sensitive(false);
     m_refContextDelete->set_sensitive(false);
   }
- 
+
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   if(pApp)
     m_refContextLayout->set_sensitive(pApp->get_userlevel() == AppState::USERLEVEL_DEVELOPER);
@@ -355,7 +355,7 @@ bool DbAddDel::on_button_press_event_Popup(GdkEventButton *event)
   if(pApp)
   {
     pApp->add_developer_action(m_refContextLayout); //So that it can be disabled when not in developer mode.
-    pApp->update_userlevel_ui(); //Update our action's sensitivity. 
+    pApp->update_userlevel_ui(); //Update our action's sensitivity.
   }
 #endif
 
@@ -459,7 +459,7 @@ Gtk::TreeModel::iterator DbAddDel::get_item_selected() const
   #ifdef GLOM_ENABLE_MAEMO
   Hildon::TouchSelector& unconst = const_cast<Hildon::TouchSelector&>(m_TreeView);
   return unconst.get_selected(0);
-  
+
   //TODO: What would this mean?
   //See https://bugs.maemo.org/show_bug.cgi?id=4641
   // return m_TreeView.get_active();
@@ -541,7 +541,7 @@ bool DbAddDel::select_item(const Gtk::TreeModel::iterator& iter, const sharedptr
     Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = m_TreeView.get_selection();
     g_assert(refTreeSelection);
     refTreeSelection->select(iter);
-    
+
     Gtk::TreeModel::Path path = m_refListStore->get_path(iter);
 
     guint view_column_index = 0;
@@ -653,9 +653,9 @@ int DbAddDel::get_fixed_cell_height()
   {
     // Discover a suitable height, and cache it,
     // by looking at the heights of all columns:
-    // Note that this is usually calculated during construct_specified_columns(), 
+    // Note that this is usually calculated during construct_specified_columns(),
     // when all columns are known.
-    
+
     //Get a default:
     Glib::RefPtr<Pango::Layout> refLayout = create_pango_layout("example");
     int width = 0;
@@ -792,13 +792,13 @@ Gtk::CellRenderer* DbAddDel::construct_specified_columns_cellrenderer(const shar
   {
     apply_formatting(pCellRenderer, item_withformatting);
   }
-  
+
   //Set extra cellrenderer attributes, depending on the type used:
   Gtk::CellRendererText* pCellRendererText = dynamic_cast<Gtk::CellRendererText*>(pCellRenderer);
   if(pCellRendererText)
   {
-    //Use an ellipze to indicate excessive text, 
-    //so that similar values do not look equal, 
+    //Use an ellipze to indicate excessive text,
+    //so that similar values do not look equal,
     //and to avoid multi-line comments. TODO: Is there a better way to restrict the height? This doesn't actually truncate multilines anyway.
     g_object_set(pCellRendererText->gobj(), "ellipsize", PANGO_ELLIPSIZE_END, (gpointer)0);
 
@@ -844,7 +844,8 @@ Gtk::CellRenderer* DbAddDel::construct_specified_columns_cellrenderer(const shar
       {
         sharedptr<const Relationship> choice_relationship;
         Glib::ustring choice_field, choice_second;
-        item_field->get_formatting_used().get_choices(choice_relationship, choice_field, choice_second);
+        bool choice_show_all;
+        item_field->get_formatting_used().get_choices_related(choice_relationship, choice_field, choice_second, choice_show_all);
 
         if(choice_relationship && !choice_field.empty())
         {
@@ -853,29 +854,14 @@ Gtk::CellRenderer* DbAddDel::construct_specified_columns_cellrenderer(const shar
           const bool use_second = !choice_second.empty();
           pCellRendererCombo->set_use_second(use_second);
 
-          const sharedptr<LayoutItem_Field> layout_field_second = sharedptr<LayoutItem_Field>::create();
-          if(use_second)
+          //TODO: Update this when the relationship's field value changes:
+          if(choice_show_all) //Otherwise it must change whenever the relationships's ID value changes.
           {
             Document* document = get_document();
-            if(document)
-            {
-              sharedptr<Field> field_second = document->get_field(to_table, choice_second); //TODO: Actually show this in the combo:
-              layout_field_second->set_full_field_details(field_second);
-
-              //We use the default formatting for this field->
-            }
-          }
-
-          Utils::type_list_values_with_second list_values = Utils::get_choice_values(item_field);
-          for(Utils::type_list_values_with_second::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
-          {
-            const Glib::ustring first = Conversions::get_text_for_gda_value(item_field->get_glom_type(), iter->first, item_field->get_formatting_used().m_numeric_format);
-
-            Glib::ustring second;
-            if(use_second)
-              second = Conversions::get_text_for_gda_value(layout_field_second->get_glom_type(), iter->second, layout_field_second->get_formatting_used().m_numeric_format);
-
-              pCellRendererCombo->append_list_item(first, second);
+            sharedptr<const LayoutItem_Field> layout_field_first;
+            sharedptr<const LayoutItem_Field> layout_field_second;
+            Utils::type_list_values_with_second list_values = Utils::get_choice_values_all(document, item_field, layout_field_first, layout_field_second);
+            set_cell_choices(pCellRendererCombo,  layout_field_first, layout_field_second, list_values);
           }
         }
       }
@@ -990,7 +976,7 @@ void DbAddDel::construct_specified_columns()
   //Create the Gtk ColumnRecord:
 
   Gtk::TreeModel::ColumnRecord record;
-    
+
   //Database columns:
   type_model_store::type_vec_fields fields;
   {
@@ -1016,7 +1002,7 @@ void DbAddDel::construct_specified_columns()
       }
     }
   }
-  
+
   m_FieldsShown = fields; //Needed by Base_DB_Table_Data::record_new().
 
   {
@@ -1057,7 +1043,7 @@ void DbAddDel::construct_specified_columns()
       m_refListStore = Glib::RefPtr<type_model_store>();
     }
   }
- 
+
   #ifdef GLOM_ENABLE_MAEMO
   //Remove all View columns:
   while(m_TreeView.get_num_columns())
@@ -1112,11 +1098,11 @@ void DbAddDel::construct_specified_columns()
 
   bool no_columns_used = true;
   int data_model_column_index = 0; //-1 means undefined index.
-  
+
   guint column_to_expand = 0;
   const bool has_expandable_column = get_column_to_expand(column_to_expand);
   //std::cout << "DEBUG: column_to_expand=" << column_to_expand  << ", has=" << has_expandable_column << std::endl;
-  
+
   for(type_vecModelColumns::iterator iter = vecModelColumns.begin(); iter != vecModelColumns.end(); ++iter)
   {
     const DbAddDelColumnInfo& column_info = m_ColumnTypes[model_column_index];
@@ -1127,7 +1113,7 @@ void DbAddDel::construct_specified_columns()
       const Glib::ustring column_name = column_info.m_item->get_title_or_name();
       const Glib::ustring column_id = column_info.m_item->get_name();
 
-      // Whenever we are dealing with real database fields, 
+      // Whenever we are dealing with real database fields,
       // we need to know the index of the field in the query:
       int item_data_model_column_index = -1;
       sharedptr<const LayoutItem> layout_item = m_ColumnTypes[model_column_index].m_item;
@@ -1145,14 +1131,14 @@ void DbAddDel::construct_specified_columns()
         //Get the index of the field in the query, if it is a field:
         //std::cout << "debug: model_column_index=" << model_column_index << ", item_data_model_column_index=" << item_data_model_column_index << std::endl;
         const bool expand = has_expandable_column && ((int)column_to_expand == model_column_index);
-        treeview_append_column(column_name, 
-          *pCellRenderer, 
-          model_column_index, item_data_model_column_index, 
+        treeview_append_column(column_name,
+          *pCellRenderer,
+          model_column_index, item_data_model_column_index,
           expand);
 
         if(column_info.m_editable)
         {
-       
+
         }
 
         ++view_column_index;
@@ -1171,7 +1157,7 @@ void DbAddDel::construct_specified_columns()
        delete pModelColumn;
   }
 
-  
+
   if(no_columns_used)
   {
     show_hint_model();
@@ -1184,7 +1170,7 @@ void DbAddDel::construct_specified_columns()
     #endif //GLOM_ENABLE_MAEMO
   }
 
-  
+
 
   #ifndef GLOM_ENABLE_MAEMO
   m_TreeView.columns_autosize();
@@ -1231,36 +1217,45 @@ bool DbAddDel::refresh_from_database_blank()
 
 void DbAddDel::set_value(const Gtk::TreeModel::iterator& iter, const sharedptr<const LayoutItem_Field>& layout_item, const Gnome::Gda::Value& value)
 {
+  set_value(iter, layout_item, value, true /* including the specified field */);
+}
+
+void DbAddDel::set_value(const Gtk::TreeModel::iterator& iter, const sharedptr<const LayoutItem_Field>& layout_item, const Gnome::Gda::Value& value, bool set_specified_field_layout)
+{
   //g_warning("DbAddDel::set_value begin");
 
   InnerIgnore innerIgnore(this);
 
   if(!m_refListStore)
-    g_warning("DbAddDel::set_value: No model.");
-  else
   {
-    Gtk::TreeModel::Row treerow = *iter;
-    if(treerow)
-    {
-      type_list_indexes list_indexes = get_data_model_column_index(layout_item);
-      for(type_list_indexes::const_iterator iter = list_indexes.begin(); iter != list_indexes.end(); ++iter)
-      {
-        const guint treemodel_col = *iter + get_count_hidden_system_columns();
-        treerow.set_value(treemodel_col, value);
+    std::cerr << G_STRFUNC << ": No model." << std::endl;
+    return;
+  }
 
-        //Mark this row as not a placeholder because it has real data now.
-        if(!(Conversions::value_is_empty(value)))
-        {
-          //treerow.set_value(m_col_key, Glib::ustring("placeholder debug value setted"));
-          //treerow.set_value(m_col_placeholder, false);
-        }
-      }
+  //Show the value in any columns:
+  Gtk::TreeModel::Row treerow = *iter;
+  if(treerow)
+  {
+    const type_list_indexes list_indexes = get_data_model_column_index(layout_item, set_specified_field_layout);
+    for(type_list_indexes::const_iterator iter = list_indexes.begin(); iter != list_indexes.end(); ++iter)
+    {
+      const guint treemodel_col = *iter + get_count_hidden_system_columns();
+      treerow.set_value(treemodel_col, value);
     }
+  }
 
-    //Add extra blank if necessary:
-    //add_blank();
+  /// Get indexes of any columns with choices with !show_all relationships that have @a from_key as the from_key.
+  type_list_indexes list_choice_cells = get_choice_index(layout_item /* from_key field name */);
+  std::cout << "debug: list_choice_cells.size() == " << list_choice_cells.size() << std::endl;
+  for(type_list_indexes::iterator iter = list_choice_cells.begin(); iter != list_choice_cells.end(); ++iter)
+  {
+    const guint model_index = *iter;
+    refresh_cell_choices_data_from_database_with_foreign_key(model_index, value /* foreign key value */);
   }
 
+  //Add extra blank if necessary:
+  //add_blank();
+
   //g_warning("DbAddDel::set_value end");
 }
 
@@ -1269,6 +1264,73 @@ void DbAddDel::set_value_selected(const sharedptr<const LayoutItem_Field>& layou
   set_value(get_item_selected(), layout_item, value);
 }
 
+void DbAddDel::set_cell_choices(CellRendererList* cell, const sharedptr<const LayoutItem_Field>& layout_choice_first,  const sharedptr<const LayoutItem_Field>& layout_choice_second, const Utils::type_list_values_with_second& list_values)
+{
+  if(!cell)
+    return;
+
+  //Set the choices:
+  cell->remove_all_list_items();
+
+  for(Utils::type_list_values_with_second::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
+  {
+    const Glib::ustring first =
+      Conversions::get_text_for_gda_value(
+        layout_choice_first->get_glom_type(), iter->first, layout_choice_first->get_formatting_used().m_numeric_format);
+
+    Glib::ustring second;
+    if(layout_choice_second)
+    {
+      second = Conversions::get_text_for_gda_value(
+        layout_choice_second->get_glom_type(), iter->second, layout_choice_second->get_formatting_used().m_numeric_format);
+    }
+
+    cell->append_list_item(first, second);
+  }
+}
+
+void DbAddDel::refresh_cell_choices_data_from_database_with_foreign_key(guint model_index, const Gnome::Gda::Value& foreign_key_value)
+{
+  if(m_ColumnTypes.size() <= model_index)
+  {
+    std::cerr << G_STRFUNC << ": model_index is out of range: model_index=" << model_index << ", size=" << m_ColumnTypes.size() << std::endl;
+    return;
+  }
+
+  sharedptr<const LayoutItem> item = m_ColumnTypes[model_index].m_item;
+  sharedptr<const LayoutItem_Field> layout_field = sharedptr<const LayoutItem_Field>::cast_dynamic(item);
+  if(!layout_field)
+  {
+    std::cerr << G_STRFUNC << ": The layout item was not a LayoutItem_Field." << std::endl;
+    return;
+  }
+
+  guint view_column_index = 0;
+  const bool test = get_view_column_index(model_index, view_column_index);
+  if(!test)
+  {
+    std::cerr << G_STRFUNC << ": view column not found for model_column=" << model_index << std::endl;
+    return;
+  }
+
+  CellRendererList* cell =
+    dynamic_cast<CellRendererList*>( m_TreeView.get_column_cell_renderer(view_column_index) );
+  if(!cell)
+  {
+    std::cerr << G_STRFUNC << ": cell renderer not found for model_column=" << model_index << std::endl;
+    return;
+  }
+
+
+  sharedptr<const LayoutItem_Field> layout_choice_first;
+  sharedptr<const LayoutItem_Field> layout_choice_second;
+  Utils::type_list_values_with_second list_values =
+    Utils::get_choice_values(get_document(), layout_field, foreign_key_value,
+      layout_choice_first, layout_choice_second);
+
+  set_cell_choices(cell, layout_choice_first, layout_choice_second, list_values);
+}
+
 void DbAddDel::remove_all_columns()
 {
   m_ColumnTypes.clear();
@@ -1289,7 +1351,7 @@ guint DbAddDel::add_column(const sharedptr<LayoutItem>& layout_item)
     return 0; //TODO: Do something more sensible.
 
   InnerIgnore innerIgnore(this); //Stop on_treeview_columns_changed() from doing anything when it is called just because we add a new column.
-  
+
   DbAddDelColumnInfo column_info;
   column_info.m_item = layout_item;
   //column_info.m_editable = editable;
@@ -1335,7 +1397,7 @@ void DbAddDel::set_columns_ready()
   construct_specified_columns();
 }
 
-DbAddDel::type_list_indexes DbAddDel::get_data_model_column_index(const sharedptr<const LayoutItem_Field>& layout_item_field) const
+DbAddDel::type_list_indexes DbAddDel::get_data_model_column_index(const sharedptr<const LayoutItem_Field>& layout_item_field, bool including_specified_field_layout) const
 {
   //TODO_Performance: Replace all this looping by a cache/map:
 
@@ -1350,7 +1412,8 @@ DbAddDel::type_list_indexes DbAddDel::get_data_model_column_index(const sharedpt
     sharedptr<const LayoutItem_Field> field = sharedptr<const LayoutItem_Field>::cast_dynamic(iter->m_item); //TODO_Performance: This would be unnecessary if !layout_item_field
     if(field)
     {
-      if(field && field->is_same_field(layout_item_field))
+      if(field->is_same_field(layout_item_field)
+        && (including_specified_field_layout || field != layout_item_field))
       {
         list_indexes.push_back(data_model_column_index);
       }
@@ -1389,6 +1452,41 @@ DbAddDel::type_list_indexes DbAddDel::get_column_index(const sharedptr<const Lay
   return list_indexes;
 }
 
+DbAddDel::type_list_indexes DbAddDel::get_choice_index(const sharedptr<const LayoutItem_Field>& from_key)
+{
+  type_list_indexes result;
+
+  if(!from_key)
+    return result;
+
+  const Glib::ustring from_key_name = from_key->get_name();
+
+  guint index = 0;
+  for(type_ColumnTypes::const_iterator iter = m_ColumnTypes.begin(); iter != m_ColumnTypes.end(); ++iter)
+  {
+    sharedptr<const LayoutItem_Field> field = sharedptr<const LayoutItem_Field>::cast_dynamic(iter->m_item);
+    if(!field)
+       continue;
+
+    const FieldFormatting& format = field->get_formatting_used();
+
+    sharedptr<const Relationship> choice_relationship;
+    Glib::ustring choice_field, choice_second;
+    bool choice_show_all = false;
+    format.get_choices_related(choice_relationship, choice_field, choice_second, choice_show_all);
+    if(choice_relationship && !choice_show_all) //"Show All" choices don't use the ID field values.
+    {
+      if(choice_relationship->get_from_field() == from_key_name)
+        result.push_back(index);
+    }
+
+    index++;
+  }
+
+  return result;
+}
+
+
 sharedptr<const LayoutItem_Field> DbAddDel::get_column_field(guint column_index) const
 {
   if(column_index < m_ColumnTypes.size())
@@ -1411,6 +1509,7 @@ void DbAddDel::set_prevent_user_signals(bool bVal)
   m_bPreventUserSignals = bVal;
 }
 
+//This is generally used for non-database-data lists.
 void DbAddDel::set_column_choices(guint col, const type_vec_strings& vecStrings)
 {
   InnerIgnore innerIgnore(this); //Stop on_treeview_columns_changed() from doing anything when it is called just because we add new columns.
@@ -1420,7 +1519,7 @@ void DbAddDel::set_column_choices(guint col, const type_vec_strings& vecStrings)
   guint view_column_index = 0;
   const bool test = get_view_column_index(col, view_column_index);
   if(test)
-  { 
+  {
     #ifdef GLOM_ENABLE_MAEMO
     Glib::RefPtr<Hildon::TouchSelectorColumn> column = touch_selector_get_column();
     g_assert(column);
@@ -1428,7 +1527,7 @@ void DbAddDel::set_column_choices(guint col, const type_vec_strings& vecStrings)
     g_assert(!list_renderers.empty());
     CellRendererList* pCellRenderer = dynamic_cast<CellRendererList*>(list_renderers[0]);
     #else
-    CellRendererList* pCellRenderer = 
+    CellRendererList* pCellRenderer =
       dynamic_cast<CellRendererList*>( m_TreeView.get_column_cell_renderer(view_column_index) );
     #endif //GLOM_ENABLE_MAEMO
     if(pCellRenderer)
@@ -1485,7 +1584,7 @@ void DbAddDel::set_find_mode(bool val)
     construct_specified_columns();
   }
 }
-  
+
 void DbAddDel::set_allow_only_one_related_record(bool val)
 {
   m_allow_only_one_related_record = val;
@@ -1696,7 +1795,7 @@ void DbAddDel::on_treeview_cell_edited_bool(const Glib::ustring& path_string, in
     {
       //Change it back, so that we ignore it:
       row.set_value(tree_model_column_index, value_old);
-         
+
       //Signal that a new key was added:
       //We will ignore editing of bool values in the blank row. It seems like a bad way to start a new record.
       //user_added(row);
@@ -1814,7 +1913,7 @@ void DbAddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const G
                     m_TreeView.get_background_area(path, *pColumn, background_area);
 
                     Gdk::Rectangle cell_area;
-                    m_TreeView.get_cell_area(path, *pColumn, background_area); 
+                    m_TreeView.get_cell_area(path, *pColumn, background_area);
                     */
                   }
                 }
@@ -1870,8 +1969,8 @@ bool DbAddDel::on_treeview_columnheader_button_press_event(GdkEventButton* event
   //If this is a right-click with the mouse:
   if( (event->type == GDK_BUTTON_PRESS) && (event->button == 3) )
   {
-    
-    
+
+
   }
 
   return false;
@@ -1886,13 +1985,13 @@ void DbAddDel::on_treeview_column_resized(int model_column_index, DbTreeViewColu
 {
   if(!view_column)
     return;
-  
+
   //Ignore this property change signal handler if we are setting the size in code:
   if(m_bIgnoreTreeViewSignals)
     return;
 
-  //We do not save the column width if this is the last column, 
-  //because that must always be automatic, 
+  //We do not save the column width if this is the last column,
+  //because that must always be automatic,
   //because it must resize when the whole column resizes.
   std::list<const Gtk::TreeView::Column*> columns = m_TreeView.get_columns();
   const int n_view_columns = columns.size();
@@ -1906,7 +2005,7 @@ void DbAddDel::on_treeview_column_resized(int model_column_index, DbTreeViewColu
 
   if(width == -1) //Means automatic.
     return;
-    
+
   if(column_info.m_item)
       column_info.m_item->set_display_width(width);
 }
@@ -1975,16 +2074,16 @@ bool DbAddDel::get_column_to_expand(guint& column_to_expand) const
   //Initialize output parameter:
   column_to_expand = 0;
   bool result = false;
-  
-  //Discover the right-most text column: 
+
+  //Discover the right-most text column:
   guint i = 0;
   for(type_ColumnTypes::const_iterator iter = m_ColumnTypes.begin(); iter != m_ColumnTypes.end(); ++iter)
   {
     sharedptr<LayoutItem> layout_item = iter->m_item;
-           
+
     sharedptr<LayoutItem_Field> layout_item_field = sharedptr<LayoutItem_Field>::cast_dynamic(layout_item);
     if(layout_item_field)
-    {  
+    {
       //Only text columns should expand.
       //Number fields are right-aligned, so expansion is annoying.
       //Time and date fields don't vary their width much.
@@ -1997,13 +2096,13 @@ bool DbAddDel::get_column_to_expand(guint& column_to_expand) const
           column_to_expand = i;
           result = true;
         }
-        
+
       }
     }
-    
+
     ++i;
   }
-  
+
   return result;
 }
 
@@ -2011,7 +2110,7 @@ guint DbAddDel::treeview_append_column(const Glib::ustring& title, Gtk::CellRend
 {
   InnerIgnore innerIgnore(this); //see comments for InnerIgnore class
 
-  #ifndef GLOM_ENABLE_MAEMO 
+  #ifndef GLOM_ENABLE_MAEMO
   DbTreeViewColumnGlom* pViewColumn = Gtk::manage( new DbTreeViewColumnGlom(Utils::string_escape_underscores(title), cellrenderer) );
 
   //This is needed by fixed-height mode. We get critical warnings otherwise.
@@ -2020,7 +2119,7 @@ guint DbAddDel::treeview_append_column(const Glib::ustring& title, Gtk::CellRend
 
   guint cols_count = m_TreeView.append_column(*pViewColumn);
   #else
-  //Mathias Hasselmann says that this is required for the Maemo 5 style, 
+  //Mathias Hasselmann says that this is required for the Maemo 5 style,
   //though we don't know yet where that is documented. murrayc.
   cellrenderer.set_property("xpad", HILDON_MARGIN_DEFAULT);
 
@@ -2036,7 +2135,7 @@ guint DbAddDel::treeview_append_column(const Glib::ustring& title, Gtk::CellRend
   //Tell the Treeview.how to render the Gnome::Gda::Values:
   if(layout_item_field)
   {
-    pViewColumn->set_cell_data_func(cellrenderer, 
+    pViewColumn->set_cell_data_func(cellrenderer,
       sigc::bind( sigc::mem_fun(*this, &DbAddDel::treeviewcolumn_on_cell_data), model_column_index, data_model_column_index) );
   }
 
@@ -2047,9 +2146,9 @@ guint DbAddDel::treeview_append_column(const Glib::ustring& title, Gtk::CellRend
   //Allow the column to be resized:
   pViewColumn->set_resizable();
   #endif //GLOM_ENABLE_MAEMO
-  
+
   #ifndef GLOM_ENABLE_MAEMO
-  //GtkTreeView's fixed-height-mode does not allow us to have anything but 
+  //GtkTreeView's fixed-height-mode does not allow us to have anything but
   //the last column as expandable.
   //TODO: Can we get the total size and calculate a starting size instead?
   expand = false;
@@ -2078,7 +2177,7 @@ guint DbAddDel::treeview_append_column(const Glib::ustring& title, Gtk::CellRend
   #else
   if(column_width > 0) //Otherwise there's an assertion fails.
     pViewColumn->set_fixed_width(column_width); //This is the only way to set the width, so we need to set it as resizable again immediately afterwards.
-    
+
   pViewColumn->set_resizable();
   //This property is read only: pViewColumn->property_width() = column_width;
 
@@ -2260,8 +2359,8 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
   std::vector<Gtk::CellRenderer*> cells = column->get_cells();
   Gtk::CellRenderer* renderer = cells[model_column_index];
 #endif
-  
-  //std::cout << "debug: DbAddDel::treeviewcolumn_on_cell_data()" << std::endl; 
+
+  //std::cout << "debug: DbAddDel::treeviewcolumn_on_cell_data()" << std::endl;
 
   if(iter)
   {
@@ -2279,7 +2378,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
       GType debug_type = value.get_value_type();
       std::cout << "  debug: DbAddDel::treeviewcolumn_on_cell_data(): GdaValue from TreeModel::get_value(): GType=" << debug_type << std::endl;
       if(debug_type)
-         std::cout << "    GType name=\"" << g_type_name(debug_type) << "\"" << std::endl; 
+         std::cout << "    GType name=\"" << g_type_name(debug_type) << "\"" << std::endl;
       */
 
       const Field::glom_field_type type = field->get_glom_type();
@@ -2289,7 +2388,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
         {
           Gtk::CellRendererToggle* pDerived = dynamic_cast<Gtk::CellRendererToggle*>(renderer);
           if(pDerived)
-            pDerived->set_active( (value.get_value_type() == G_TYPE_BOOLEAN) && value.get_boolean() ); 
+            pDerived->set_active( (value.get_value_type() == G_TYPE_BOOLEAN) && value.get_boolean() );
 
           break;
         }
@@ -2299,7 +2398,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
           if(pDerived)
           {
             Glib::RefPtr<Gdk::Pixbuf> pixbuf = Utils::get_pixbuf_for_gda_value(value);
-         
+
             //Scale it down to a sensible size.
             if(pixbuf)
               pixbuf = Utils::image_scale_keeping_ratio(pixbuf,  get_fixed_cell_height(), pixbuf->get_width());
@@ -2326,7 +2425,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
           //Show a different color if the value is numeric, if that's specified:
           if(type == Field::TYPE_NUMERIC)
           {
-             const Glib::ustring fg_color = 
+             const Glib::ustring fg_color =
                field->get_formatting_used().get_text_format_color_foreground_to_use(value);
              if(!fg_color.empty())
                  g_object_set(pDerived->gobj(), "foreground", fg_color.c_str(), (gpointer)0);
@@ -2335,7 +2434,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
           }
 
           break;
-        } 
+        }
       }
     }
   }
@@ -2371,7 +2470,7 @@ bool DbAddDel::get_allow_view_details() const
   return m_allow_view_details;
 }
 
-#ifdef GLOM_ENABLE_CLIENT_ONLY 
+#ifdef GLOM_ENABLE_CLIENT_ONLY
 void DbAddDel::on_self_style_changed(const Glib::RefPtr<Gtk::Style>& /* style */)
 {
   // Reset fixed cell height because the font might have changed due to the new style:
@@ -2419,7 +2518,7 @@ bool DbAddDel::start_new_record()
   Gtk::TreeModel::iterator iter = get_item_placeholder();
   if(!iter)
     return false;
-  
+
   sharedptr<LayoutItem_Field> fieldToEdit;
 
   //Start editing in the primary key or the first cell if the primary key is auto-incremented (because there is no point in editing an auto-generated value)
@@ -2427,7 +2526,7 @@ bool DbAddDel::start_new_record()
   const bool bPresent = true; //get_field_primary_key_index(index_primary_key); //If there is no primary key then the default of 0 is OK.
   if(!bPresent)
     return false;
-   
+
   sharedptr<Field> fieldPrimaryKey = get_key_field();
   if(fieldPrimaryKey && fieldPrimaryKey->get_auto_increment())
   {
@@ -2463,7 +2562,7 @@ bool DbAddDel::start_new_record()
     select_item(iter); //without start_editing.
     //g_warning("start_new_record(): index_field_to_edit does not exist: %d", index_field_to_edit);
   }
-  
+
   return true;
 }
 
@@ -2564,7 +2663,12 @@ void DbAddDel::user_changed(const Gtk::TreeModel::iterator& row, guint col)
         set_entered_field_data(row, layout_field, value_old);
       }
       else
+      {
+        //Display the same value in other instances of the same field:
+        set_value(row, layout_field, field_value, false /* don't set the actually-edited cell */);
+
         signal_record_changed().emit();
+      }
     }
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
     catch(const Glib::Exception& ex)
@@ -2598,7 +2702,7 @@ void DbAddDel::user_changed(const Gtk::TreeModel::iterator& row, guint col)
     //This record probably doesn't exist yet.
     //Add new record, which will generate the primary key:
     user_added(row);
-    
+
     const Gnome::Gda::Value primaryKeyValue = get_value_key(row); //TODO_Value
     if(!(Conversions::value_is_empty(primaryKeyValue))) //If the Add succeeeded:
     {
@@ -2629,10 +2733,10 @@ void DbAddDel::user_added(const Gtk::TreeModel::iterator& row)
     dialog.set_secondary_text(_("You attempted to add a new related record, but there can only be one related record, because the relationship uses a unique key.")),
     dialog.set_transient_for(*Application::get_application());
     dialog.run();
-    
+
     return;
   }
-  
+
   //std::cout << "DbAddDel::on_adddel_user_added" << std::endl;
 
   Gnome::Gda::Value primary_key_value;
@@ -2675,7 +2779,7 @@ void DbAddDel::user_added(const Gtk::TreeModel::iterator& row)
     fill_from_database();
     return;
   }
-  
+
 
   sharedptr<LayoutItem_Field> layout_field = sharedptr<LayoutItem_Field>::create();
   layout_field->set_full_field_details(primary_key_field);
@@ -2696,7 +2800,7 @@ void DbAddDel::user_added(const Gtk::TreeModel::iterator& row)
     handle_error();
     return;
   }
-  
+
   //Save the primary key value for later use:
   set_value_key(row, primary_key_value);
 
@@ -2776,5 +2880,3 @@ Gtk::TreeModel::iterator DbAddDel::get_row_selected()
 }
 
 } //namespace Glom
-
-
diff --git a/glom/utility_widgets/db_adddel/db_adddel.h b/glom/utility_widgets/db_adddel/db_adddel.h
index 61ca867..d453c83 100644
--- a/glom/utility_widgets/db_adddel/db_adddel.h
+++ b/glom/utility_widgets/db_adddel/db_adddel.h
@@ -61,6 +61,7 @@ public:
 };
 
 class DbTreeViewColumnGlom;
+class CellRendererList;
 
 /** For adding/deleting/selecting record rows.
  */
@@ -79,26 +80,26 @@ public:
 
   virtual void set_allow_add(bool val = true);
   virtual void set_allow_delete(bool val = true);
-    
+
   /** Prevent any attempts by this class to change actual records,
    * if the widget is just being used to enter find critera.
-   * 
+   *
    * @param val True if find mode should be used.
    */
   void set_find_mode(bool val = true);
-    
+
   /** Prevent more than one record from being added,
-   * Use this if the portal is showing related records, 
+   * Use this if the portal is showing related records,
    * and if the relationship's to-field is unique or a primary key.
-   * In this case, adding a new record would require a duplicate value in that 
+   * In this case, adding a new record would require a duplicate value in that
    * unique field.
-   * When the user tries to do this, he will see an explanatory dialog from this 
+   * When the user tries to do this, he will see an explanatory dialog from this
    * widget.
-   * 
+   *
    * @param val True if multiple records  should be presented.
    */
   void set_allow_only_one_related_record(bool val = true);
-    
+
 
   //Gtk::TreeModel::iterator add_item(const Gnome::Gda::Value& valKey); //Return index of new row.
 
@@ -123,8 +124,8 @@ public:
   Gtk::TreeModel::iterator get_item_selected();
   Gtk::TreeModel::iterator get_item_selected() const; //There is no TreeModel::const_iterator
 
-  /** 
-   * @param iter The row to be selected. 
+  /**
+   * @param iter The row to be selected.
    * @param column A value returned from add_column().
    * @param start_editing Whether editing should start in the cell.
    * @result Whether the row was successfully selected.
@@ -134,14 +135,14 @@ public:
 
   guint get_count() const;
 
-  /** 
-   * @param iter The row to be changed. 
+  /**
+   * @param iter The row to be changed.
    * @param layout_item Describes the column(s) whose values should be changed.
    * @param value The new value.
    */
   virtual void set_value(const Gtk::TreeModel::iterator& iter, const sharedptr<const LayoutItem_Field>& layout_item, const Gnome::Gda::Value& value);
 
-  /** 
+  /**
    * @param col A value returned from add_column().
    * @param value The new value.
    */
@@ -205,7 +206,7 @@ public:
   void finish_editing(); //Closes active edit controls and commits the data to the cell.
   //virtual void reactivate(); //Sheet doesn't seem to update unless a cell is active.
   void set_prevent_user_signals(bool bVal = true);
-    
+
   //TODO_refactor: make private.
 
   void user_added(const Gtk::TreeModel::iterator& row);
@@ -243,41 +244,42 @@ public:
    */
   typedef sigc::signal<void, const Gtk::TreeModel::iterator&, const Gnome::Gda::Value&> type_signal_record_added;
   type_signal_record_added signal_record_added();
-    
 
-  /** Emitted when the user changed the sort order, 
+
+  /** Emitted when the user changed the sort order,
    * for instance by clicking on a column header.
    */
   typedef sigc::signal<void> type_signal_sort_clause_changed;
   type_signal_sort_clause_changed signal_sort_clause_changed();
 
- 
+
   virtual Gtk::TreeModel::iterator get_last_row();
   virtual Gtk::TreeModel::iterator get_last_row() const;
 
   virtual void set_open_button_title(const Glib::ustring& title);
-  
-  
+
+
   /** Add a new row to the list, for the user to enter record details,
    * adding the generated primary key if necessary.
    */
   bool start_new_record();
 
 private:
-  
-  
+
+  void set_value(const Gtk::TreeModel::iterator& iter, const sharedptr<const LayoutItem_Field>& layout_item, const Gnome::Gda::Value& value, bool set_specified_field_layout);
+
   //Overrides of Base_DB/Base_DB_Table methods:
   virtual void set_entered_field_data(const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value);
   virtual void set_entered_field_data(const Gtk::TreeModel::iterator& row, const sharedptr<const LayoutItem_Field>& field, const Gnome::Gda::Value& value);
   virtual Gnome::Gda::Value get_entered_field_data(const sharedptr<const LayoutItem_Field>& field) const;
   virtual Gtk::TreeModel::iterator get_row_selected();
- 
+
   //Implementations of pure virtual methods from Base_DB_Table_Data:
   virtual sharedptr<Field> get_field_primary_key() const;
   virtual Gnome::Gda::Value get_primary_key_value_selected() const;
   virtual void set_primary_key_value(const Gtk::TreeModel::iterator& row, const Gnome::Gda::Value& value);
   virtual Gnome::Gda::Value get_primary_key_value(const Gtk::TreeModel::iterator& row) const;
-      
+
   Gtk::CellRenderer* construct_specified_columns_cellrenderer(const sharedptr<LayoutItem>& layout_item, int model_column_index, int data_model_column_index);
 
   bool get_model_column_index(guint view_column_index, guint& model_column_index);
@@ -285,10 +287,15 @@ private:
 
   typedef std::list<guint> type_list_indexes;
   ///Return the column indexes of any columns that display this field.
-  virtual type_list_indexes get_column_index(const sharedptr<const LayoutItem>& layout_item) const;
+  type_list_indexes get_column_index(const sharedptr<const LayoutItem>& layout_item) const;
+
+  /// Get indexes of any columns with choices with !show_all relationships that have @a from_key as the from_key.
+  type_list_indexes get_choice_index(const sharedptr<const LayoutItem_Field>& from_key);
 
-  ///Return the query column index of any columns that display this field:
-  type_list_indexes get_data_model_column_index(const sharedptr<const LayoutItem_Field>& layout_item_field) const;
+  /** Return the query column index of any columns that display this field:
+   * @param including_specified_field_layout If false, then don't return the actual layout item itself.
+   */
+  type_list_indexes get_data_model_column_index(const sharedptr<const LayoutItem_Field>& layout_item_field, bool including_specified_field_layout = true) const;
 
 protected:
   virtual void setup_menu();
@@ -352,13 +359,13 @@ private:
   Glib::RefPtr<const Hildon::TouchSelectorColumn> touch_selector_get_column() const;
   #endif
 
-#ifdef GLOM_ENABLE_CLIENT_ONLY 
+#ifdef GLOM_ENABLE_CLIENT_ONLY
   // Don't name it on_style_changed, otherwise we would override a virtual
   // function from Gtk::Widget. We could indeed do that, but we do it with
   // a normal signal handler, because we have to do it this way anyway in
   // case default signal handlers have been disabled in glibmm.
   void on_self_style_changed(const Glib::RefPtr<Gtk::Style>& style);
-#endif //GLOM_ENABLE_CLIENT_ONLY 
+#endif //GLOM_ENABLE_CLIENT_ONLY
 
   bool get_prevent_user_signals() const;
 
@@ -383,6 +390,9 @@ private:
   //TODO: Remove this and use AppGlom::get_application() instead?
   Application* get_application();
 
+  void set_cell_choices(CellRendererList* cell, const sharedptr<const LayoutItem_Field>& layout_choice_first,  const sharedptr<const LayoutItem_Field>& layout_choice_second, const Utils::type_list_values_with_second& list_values);
+  void refresh_cell_choices_data_from_database_with_foreign_key(guint model_index, const Gnome::Gda::Value& foreign_key_value);
+
   static void apply_formatting(Gtk::CellRenderer* renderer, const sharedptr<const LayoutItem_WithFormatting>& layout_item);
 
   typedef Gtk::VBox type_base;
@@ -408,7 +418,7 @@ private:
   FoundSet m_found_set; //table, where_clause, sort_clause.
 
   bool m_column_is_sorted; //If empty, then m_column_sorted and m_column_sorted_direction should not be used.
-  bool m_column_sorted_direction; //true means ascending. 
+  bool m_column_sorted_direction; //true means ascending.
   guint m_column_sorted; //Previously-clicked (on the treeview header) column. Remember it so we can reverse the sort order on a second click.
 
 protected:
@@ -433,13 +443,13 @@ private:
   bool m_bIgnoreTreeViewSignals;
 
   type_vec_strings m_vecColumnIDs; //We give each ViewColumn a special ID, so we know where they are after a reorder.
-  
+
 protected:
   bool m_allow_add;
   bool m_allow_delete;
 
 private:
-    
+
   bool m_find_mode;
   bool m_allow_only_one_related_record;
 
@@ -463,7 +473,7 @@ private:
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   type_signal_user_requested_layout m_signal_user_requested_layout;
 #endif // !GLOM_ENABLE_CLIENT_ONLY
-    
+
   //TODO: Do this properly:
   //type_signal_user_added m_signal_record_count_changed;
 
@@ -502,17 +512,17 @@ private:
 
     Gtk::TreeModelColumn<Glib::ustring> m_col_hint;
   };
- 
+
   ModelColumnsEmptyHint m_columns_hint;
   Glib::RefPtr<Gtk::ListStore> m_model_hint;
 
   int m_fixed_cell_height;
-  
+
 private:
-  
+
   /// Discover the right-most text column, so we can make it expand.
   bool get_column_to_expand(guint& column_to_expand) const;
-  
+
   //TODO_refactor: Give these better names, and document them:
   void user_changed(const Gtk::TreeModel::iterator& row, guint col);
   void user_requested_delete(const Gtk::TreeModel::iterator& rowStart, const Gtk::TreeModel::iterator&  /* rowEnd TODO */);
diff --git a/po/es.po b/po/es.po
index 3021ae5..edee7ab 100644
--- a/po/es.po
+++ b/po/es.po
@@ -5,17 +5,16 @@
 #
 # Antonio Ognio <gnrfan gnrfan org>, 2004.
 # Francisco Javier F. Serrador <serrador cvs gnome org>, 2004, 2006.
-# Daniel Mustieles <daniel mustieles gmail com>, 2009.
-# Daniel Mustieles <daniel mustieles gmail com>, 2009.
-# Daniel Mustieles <daniel mustieles gmail com>, 2010.
+# Daniel Mustieles <daniel mustieles gmail com>, 2009, 2010.
 # Jorge González <jorgegonz svn gnome org>, 2005, 2006, 2007, 2008, 2009, 2010.
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: glom.HEAD\n"
 "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?";
 "product=glom&component=general\n"
-"POT-Creation-Date: 2010-05-12 10:05+0000\n"
-"PO-Revision-Date: 2010-05-12 19:42+0200\n"
+"POT-Creation-Date: 2010-08-04 03:24+0000\n"
+"PO-Revision-Date: 2010-08-05 14:44+0200\n"
 "Last-Translator: Jorge González <jorgegonz svn gnome org>\n"
 "Language-Team: Español <gnome-es-list gnome org>\n"
 "MIME-Version: 1.0\n"
@@ -23,206 +22,214 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: ../glom/application.cc:162
+#: ../glom/application.cc:173
 msgid "Glom: Generating Encryption Certificates"
 msgstr "Glom: Generando los certificados de cifrado"
 
-#: ../glom/application.cc:163
+#: ../glom/application.cc:174
 msgid ""
 "Please wait while Glom prepares your system for publishing over the network."
 msgstr ""
 "Espere mientras Glom prepara su sistema para publicar a través de la red."
 
-#: ../glom/application.cc:190
+#: ../glom/application.cc:206
 msgid "© 2000-2010 Murray Cumming"
 msgstr "© 2000-2010 Murray Cumming"
 
-#: ../glom/application.cc:190
+#: ../glom/application.cc:206
 msgid "A Database GUI"
 msgstr "Un IGU para bases de datos"
 
-#: ../glom/application.cc:277 ../glom/bakery/app_withdoc_gtk.cc:279
+#: ../glom/application.cc:298 ../glom/bakery/app_withdoc_gtk.cc:260
 #: ../glom/mode_design/print_layouts/window_print_layout_edit.cc:125
-#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:57
+#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:58
 msgid "_File"
 msgstr "_Archivo"
 
-#: ../glom/application.cc:278 ../glom/bakery/app_withdoc_gtk.cc:280
+#: ../glom/application.cc:299 ../glom/bakery/app_withdoc_gtk.cc:261
 msgid "_Recent Files"
 msgstr "Archivos _recientes"
 
-#: ../glom/application.cc:286
+#: ../glom/application.cc:307
 msgid "_Save as Example"
 msgstr "_Guardar como un ejemplo"
 
-#: ../glom/application.cc:293 ../glom/filechooser_export.cc:41
+#: ../glom/application.cc:314 ../glom/filechooser_export.cc:41
 msgid "_Export"
 msgstr "_Exportar"
 
-#: ../glom/application.cc:297 ../glom/glom.glade.h:30
+#: ../glom/application.cc:318 ../glom/glom.glade.h:30
 msgid "I_mport"
 msgstr "I_mportar"
 
-#: ../glom/application.cc:302
+#: ../glom/application.cc:323
 msgid "S_hared on Network"
 msgstr "Co_mpartido en red"
 
-#: ../glom/application.cc:316
+#: ../glom/application.cc:337
 msgid "_Standard"
 msgstr "E_stándar"
 
-#: ../glom/application.cc:320
+#: ../glom/application.cc:341
 msgid "_Edit Print Layouts"
 msgstr "_Editar la distribución de impresión"
 
-#: ../glom/application.cc:404 ../glom/frame_glom.cc:152
-#: ../glom/frame_glom.cc:492 ../glom/mode_data/datawidget/datawidget.cc:276
+#: ../glom/application.cc:425 ../glom/frame_glom.cc:152
+#: ../glom/frame_glom.cc:492 ../glom/mode_data/datawidget/datawidget.cc:256
 msgid "Find"
 msgstr "Buscar"
 
-#: ../glom/application.cc:404
+#: ../glom/application.cc:425
 msgid "Search for records in the table"
 msgstr "Buscar registros en la tabla"
 
-#: ../glom/application.cc:408
+#: ../glom/application.cc:429
 msgid "Add Record"
 msgstr "Añadir registros"
 
-#: ../glom/application.cc:408
+#: ../glom/application.cc:429
 msgid "Create a new record in the table"
 msgstr "Crear un registro nuevo en la tabla"
 
 #. "Tables" menu:
-#: ../glom/application.cc:424
+#: ../glom/application.cc:445
 msgid "_Tables"
 msgstr "_Tablas"
 
-#: ../glom/application.cc:434
+#: ../glom/application.cc:455
 msgid "_Edit Tables"
 msgstr "_Editar tablas"
 
-#: ../glom/application.cc:439
+#: ../glom/application.cc:460
 msgid "Add _Related Table"
 msgstr "Añadir tabla _relacionada"
 
 #. "Reports" menu:
-#: ../glom/application.cc:446
+#: ../glom/application.cc:467
 msgid "_Reports"
 msgstr "_Informes"
 
-#: ../glom/application.cc:449
+#: ../glom/application.cc:470
 msgid "_Edit Reports"
 msgstr "_Editar informes"
 
 #. "UserLevel" menu:
-#: ../glom/application.cc:458
+#: ../glom/application.cc:479
 msgid "_User Level"
 msgstr "Nivel de _usuario"
 
-#: ../glom/application.cc:461
+#: ../glom/application.cc:482
 msgctxt "User-level menu item"
 msgid "_Developer"
 msgstr "_Desarrollador"
 
-#: ../glom/application.cc:465
+#: ../glom/application.cc:486
 msgctxt "User-level menu item"
 msgid "_Operator"
 msgstr "_Operador"
 
 #. "Mode" menu:
-#: ../glom/application.cc:471
+#: ../glom/application.cc:492
 msgid "_Mode"
 msgstr "_Modo"
 
 #. We remember this action, so that it can be explicitly activated later.
-#: ../glom/application.cc:475 ../glom/frame_glom.cc:149
+#: ../glom/application.cc:496 ../glom/frame_glom.cc:149
 msgid "_Find"
 msgstr "_Buscar"
 
-#: ../glom/application.cc:481
+#: ../glom/application.cc:502
 msgctxt "Developer menu title"
 msgid "_Developer"
 msgstr "_Desarrollador"
 
-#: ../glom/application.cc:485
+#: ../glom/application.cc:506
 msgid "_Database Preferences"
 msgstr "Preferencias de la base de _datos"
 
-#: ../glom/application.cc:490
+#: ../glom/application.cc:511
 msgid "_Fields"
 msgstr "_Campos"
 
-#: ../glom/application.cc:495
+#: ../glom/application.cc:516
 msgid "Relationships _Overview"
 msgstr "_Vista general de las relaciones"
 
-#: ../glom/application.cc:500
+#: ../glom/application.cc:521
 msgid "_Relationships for this Table"
 msgstr "_Relaciones para esta tabla"
 
-#: ../glom/application.cc:505
+#: ../glom/application.cc:526
 msgid "_Users"
 msgstr "_Usuarios"
 
-#: ../glom/application.cc:509
+#: ../glom/application.cc:530
 msgid "_Print Layouts"
 msgstr "_Distribución de impresión"
 
-#: ../glom/application.cc:514
+#: ../glom/application.cc:535
 msgid "R_eports"
 msgstr "_Informes"
 
-#: ../glom/application.cc:519
+#: ../glom/application.cc:540
 msgid "Script _Library"
 msgstr "_Biblioteca de scripts"
 
-#: ../glom/application.cc:524
+#: ../glom/application.cc:545
 msgid "_Layout"
 msgstr "_Distribución"
 
-#: ../glom/application.cc:529
+#: ../glom/application.cc:550
 msgid "Test Tra_nslation"
 msgstr "Comprobar la trad_ucción"
 
-#: ../glom/application.cc:533
+#: ../glom/application.cc:554
 msgid "_Translations"
 msgstr "_Traducciones"
 
 #. "Active Platform" menu:
-#: ../glom/application.cc:539
+#: ../glom/application.cc:560
 msgid "_Active Platform"
 msgstr "_Plataforma activa"
 
-#: ../glom/application.cc:544
+#: ../glom/application.cc:565
 msgid "_Normal"
 msgstr "_Normal"
 
-#: ../glom/application.cc:544
+#: ../glom/application.cc:565
 msgid "The layout to use for normal desktop environments."
 msgstr "La capa para utilizar en entornos normales de escritorio."
 
-#: ../glom/application.cc:549
+#: ../glom/application.cc:570
 msgid "_Maemo"
 msgstr "_Maemo"
 
-#: ../glom/application.cc:549
+#: ../glom/application.cc:570
 msgid "The layout to use for Maemo devices."
 msgstr "La capa para utilizar con dispositivos Maemo."
 
-#: ../glom/application.cc:554
+#: ../glom/application.cc:575
+msgid "_Export Backup"
+msgstr "_Exportar respaldo"
+
+#: ../glom/application.cc:579
+msgid "_Restore Backup"
+msgstr "_Restaurar respaldo"
+
+#: ../glom/application.cc:583
 msgid "_Show Layout Toolbar"
 msgstr "_Mostrar distribución de la barra de herramientas"
 
 #. TODO: Put this in the generic bakery code.
-#: ../glom/application.cc:697 ../glom/application.cc:706
+#: ../glom/application.cc:729 ../glom/application.cc:738
 msgid "Open Failed"
 msgstr "Falló al abrir"
 
-#: ../glom/application.cc:698
+#: ../glom/application.cc:730
 msgid "The document could not be found."
 msgstr "No se pudo encontrar el documento."
 
-#: ../glom/application.cc:707
+#: ../glom/application.cc:739
 msgid ""
 "The document could not be opened because it was created or modified by a "
 "newer version of Glom."
@@ -232,13 +239,13 @@ msgstr ""
 
 #. std::cout << "   SOUP_STATUS_FORBIDDEN or SOUP_STATUS_UNAUTHORIZED" << std::endl;
 #. Warn the user, and let him try again:
-#: ../glom/application.cc:757 ../glom/frame_glom.cc:2216
-#: ../glom/frame_glom.cc:2292
+#: ../glom/application.cc:789 ../glom/frame_glom.cc:2218
+#: ../glom/frame_glom.cc:2294
 msgid "Connection Failed"
 msgstr "Falló la conexión"
 
-#: ../glom/application.cc:757 ../glom/frame_glom.cc:2216
-#: ../glom/frame_glom.cc:2292
+#: ../glom/application.cc:789 ../glom/frame_glom.cc:2218
+#: ../glom/frame_glom.cc:2294
 msgid ""
 "Glom could not connect to the database server. Maybe you entered an "
 "incorrect user name or password, or maybe the postgres database server is "
@@ -248,7 +255,7 @@ msgstr ""
 "usuario o una contraseña incorrecta, o quizá la base de datos postgres del "
 "servidor no se está ejecutando."
 
-#: ../glom/application.cc:952
+#: ../glom/application.cc:977
 msgid ""
 "The file cannot be opened because this version of Glom does not support self-"
 "hosting of databases."
@@ -256,7 +263,7 @@ msgstr ""
 "No se puede abrir el archivo porque esta versión de Glom no soporta el auto-"
 "alojamiento de bases de datos "
 
-#: ../glom/application.cc:957 ../glom/application.cc:966
+#: ../glom/application.cc:982 ../glom/application.cc:991
 msgid ""
 "The file cannot be opened because this version of Glom does not support "
 "PostgreSQL databases."
@@ -264,7 +271,7 @@ msgstr ""
 "No se puede abrir el archivo porque esta versión de Glom no soporta bases de "
 "datos PostgreSQL."
 
-#: ../glom/application.cc:974
+#: ../glom/application.cc:999
 msgid ""
 "The file cannot be opened because this version of Glom does not support "
 "SQLite databases."
@@ -273,15 +280,15 @@ msgstr ""
 "datos SQLite."
 
 #. Warn the user.
-#: ../glom/application.cc:992
+#: ../glom/application.cc:1017
 msgid "File Uses Unsupported Database Backend"
 msgstr "El archivo usa un «backend» de bases de datos no soportado"
 
-#: ../glom/application.cc:1052
+#: ../glom/application.cc:1083
 msgid "Creating From Example File"
 msgstr "Creando desde un archivo de ejemplo."
 
-#: ../glom/application.cc:1053
+#: ../glom/application.cc:1084
 msgid ""
 "To use this example file you must save an editable copy of the file. A new "
 "database will also be created on the server."
@@ -289,11 +296,23 @@ msgstr ""
 "Para usar este archivo de ejemplo debe guardar una copia editable del "
 "archivo. También se creará una base de datos en el servidor."
 
-#: ../glom/application.cc:1110
+#: ../glom/application.cc:1088
+msgid "Creating From Backup File"
+msgstr "Creando desde un archivo de respaldo"
+
+#: ../glom/application.cc:1089
+msgid ""
+"To use this backup file you must save an editable copy of the file. A new "
+"database will also be created on the server."
+msgstr ""
+"Para usar este archivo de respaldo debe guardar una copia editable del "
+"archivo. También se creará una base de datos en el servidor."
+
+#: ../glom/application.cc:1150
 msgid "Opening Read-Only File."
 msgstr "Abriendo un archivo de sólo lectura."
 
-#: ../glom/application.cc:1111
+#: ../glom/application.cc:1151
 msgid ""
 "This file is read only, so you will not be able to enter Developer mode to "
 "make design changes."
@@ -301,16 +320,16 @@ msgstr ""
 "Este archivo es de sólo lectura, no podrá entrar en «Modo de desarrollador» "
 "para realizar cambios de diseño."
 
-#: ../glom/application.cc:1114
+#: ../glom/application.cc:1154
 msgid "Continue without Developer Mode"
 msgstr "Continuar sin el «Modo de desarrollador»"
 
 #. The connection to the server is OK, but the database is not there yet.
-#: ../glom/application.cc:1172
+#: ../glom/application.cc:1212
 msgid "Database Not Found On Server"
 msgstr "No se encontró la base de datos en el servidor"
 
-#: ../glom/application.cc:1172
+#: ../glom/application.cc:1212
 msgid ""
 "The database could not be found on the server. Please consult your system "
 "administrator."
@@ -318,45 +337,56 @@ msgstr ""
 "No se encontró la base de datos en el servidor. Consulte al administrador "
 "del sistema."
 
-#: ../glom/application.cc:1562
+#: ../glom/application.cc:1310
+msgid "Exporting Backup"
+msgstr "Exportando respaldo"
+
+#: ../glom/application.cc:1318
+msgid "Restoring Backup"
+msgstr "Restaurando respaldo"
+
+#: ../glom/application.cc:1634
 msgid "_Contents"
 msgstr "_Contenido"
 
-#: ../glom/application.cc:1562
+#: ../glom/application.cc:1634
 msgid "Help with the application"
 msgstr "Ayuda con la aplicación"
 
-#: ../glom/application.cc:1596
+#: ../glom/application.cc:1669 ../glom/application.cc:1749
+#: ../glom/application.cc:1937
 msgid "Creating Glom Database"
 msgstr "Crear la base de datos de Glom"
 
-#: ../glom/application.cc:1596
+#: ../glom/application.cc:1669 ../glom/application.cc:1749
 msgid "Creating Glom database from example file."
 msgstr "Creando base de datos Glom desde un archivo de ejemplo."
 
+#: ../glom/application.cc:1937
+msgid "Creating Glom database from backup file."
+msgstr "Creando base de datos Glom desde un archivo de respaldo."
+
 #. The save failed. Tell the user and don't do anything else:
-#: ../glom/application.cc:2044 ../glom/bakery/app_withdoc.cc:245
-#: ../glom/bakery/app_withdoc.cc:296
+#: ../glom/application.cc:2403 ../glom/bakery/app_withdoc.cc:241
+#: ../glom/bakery/app_withdoc.cc:292
 msgid "Save failed."
 msgstr "Fallo al guardar."
 
-#: ../glom/application.cc:2044 ../glom/bakery/app_withdoc.cc:245
-#: ../glom/bakery/app_withdoc.cc:296
-msgid ""
-"There was an error while saving the file. Your changes have not been saved."
-msgstr "Ocurrió un error al grabar el archivo. Sus cambios no se han guardado."
+#: ../glom/application.cc:2403
+msgid "There was an error while saving the example file."
+msgstr "Ocurrió un error al grabar el archivo de ejemplo."
 
-#: ../glom/application.cc:2085 ../glom/application.cc:2090
-#: ../glom/bakery/app_withdoc_gtk.cc:590
+#: ../glom/application.cc:2444 ../glom/application.cc:2449
+#: ../glom/bakery/app_withdoc_gtk.cc:564
 msgid "Save Document"
 msgstr "Guardando el documento"
 
 #. Warn the user:
-#: ../glom/application.cc:2178 ../glom/bakery/app_withdoc_gtk.cc:639
+#: ../glom/application.cc:2537 ../glom/bakery/app_withdoc_gtk.cc:613
 msgid "Read-only File."
 msgstr "Archivo de sólo lectura."
 
-#: ../glom/application.cc:2178 ../glom/bakery/app_withdoc_gtk.cc:639
+#: ../glom/application.cc:2537 ../glom/bakery/app_withdoc_gtk.cc:613
 msgid ""
 "You may not overwrite the existing file, because you do not have sufficient "
 "access rights."
@@ -365,11 +395,11 @@ msgstr ""
 "permisos de acceso."
 
 #. Warn the user:
-#: ../glom/application.cc:2192 ../glom/bakery/app_withdoc_gtk.cc:653
+#: ../glom/application.cc:2551 ../glom/bakery/app_withdoc_gtk.cc:627
 msgid "Read-only Directory."
 msgstr "Directorio de sólo lectura."
 
-#: ../glom/application.cc:2192 ../glom/bakery/app_withdoc_gtk.cc:653
+#: ../glom/application.cc:2551 ../glom/bakery/app_withdoc_gtk.cc:627
 msgid ""
 "You may not create a file in this directory, because you do not have "
 "sufficient access rights."
@@ -377,19 +407,19 @@ msgstr ""
 "No puede crear un archivo en este directorio porque no tiene suficientes "
 "permisos de acceso."
 
-#: ../glom/application.cc:2209
+#: ../glom/application.cc:2568
 msgid "Database Title missing"
 msgstr "Falta el título de la base de datos"
 
-#: ../glom/application.cc:2209
+#: ../glom/application.cc:2568
 msgid "You must specify a title for the new database."
 msgstr "Debe especificar un título para la nueva base de datos."
 
-#: ../glom/application.cc:2238 ../glom/frame_glom.cc:1963
+#: ../glom/application.cc:2597 ../glom/frame_glom.cc:1969
 msgid "Directory Already Exists"
 msgstr "El directorio ya existe"
 
-#: ../glom/application.cc:2238 ../glom/frame_glom.cc:1964
+#: ../glom/application.cc:2597 ../glom/frame_glom.cc:1970
 msgid ""
 "There is an existing directory with the same name as the directory that "
 "should be created for the new database files. You should specify a different "
@@ -399,19 +429,64 @@ msgstr ""
 "crearse para los archivos de la base de datos nueva. Debería especificar un "
 "nombre de archivo diferente para usar un nuevo directorio en su lugar."
 
-#: ../glom/application.cc:2442 ../glom/bakery/app_withdoc_gtk.cc:493
+#. This actually creates the directory:
+#: ../glom/application.cc:2733
+msgid "Save Backup"
+msgstr "Guardar respaldo"
+
+#: ../glom/application.cc:2821
+msgid "Export Backup failed."
+msgstr "Falló al exportar el respaldo."
+
+#: ../glom/application.cc:2821
+msgid "There was an error while exporting the backup."
+msgstr "Ocurrió un error al exportar el respaldo."
+
+#: ../glom/application.cc:2826
+msgid "Choose a backup file"
+msgstr "Elegir un archivo de respaldo"
+
+#: ../glom/application.cc:2831
+msgid ".tar.gz Backup files"
+msgstr "Archivos .tar.gz de respaldo"
+
+#: ../glom/application.cc:2837
+msgid "Restore"
+msgstr "Restaurar"
+
+#: ../glom/application.cc:2911 ../glom/application.cc:2917
+msgid "Restore Backup failed."
+msgstr "Falló al restaurar el respaldo."
+
+#: ../glom/application.cc:2911
+msgid ""
+"There was an error while restoring the backup. The tar utility failed to "
+"extract the archive."
+msgstr ""
+"Ocurrió un error al restaurar el respaldo. La utilidad «tar» falló al extraer "
+"el archivo."
+
+#: ../glom/application.cc:2917
+msgid ""
+"There was an error while restoring the backup. The .glom file could not be "
+"found."
+msgstr ""
+"Ocurrió un error al restaurar el respaldo. No se pudo encontrar el archivo "
+"de glom."
+
+#: ../glom/application.cc:3021 ../glom/bakery/app_withdoc_gtk.cc:474
 msgid " (read-only)"
 msgstr " (sólo-lectura)"
 
-#: ../glom/base_db.cc:140 ../glom/base_db.cc:153
+#: ../glom/base_db.cc:132 ../glom/base_db.cc:145
 msgid "Internal error"
 msgstr "Error interno"
 
-#: ../glom/base_db.cc:1860
+#: ../glom/base_db.cc:1616
 msgid "Value Is Not Unique"
 msgstr "El valor no es único"
 
-#: ../glom/base_db.cc:1860
+#: ../glom/base_db.cc:1616
 msgid ""
 "The field's value must be unique, but a record with this value already "
 "exists."
@@ -420,7 +495,7 @@ msgstr ""
 
 #. Warn the user:
 #. TODO: Make the field insensitive until it can receive data, so people never see this dialog.
-#: ../glom/base_db_table_data.cc:320
+#: ../glom/base_db_table_data.cc:306
 msgid ""
 "Data may not be entered into this related field, because the related record "
 "does not yet exist, and the relationship does not allow automatic creation "
@@ -430,13 +505,13 @@ msgstr ""
 "relacionado no existe todavía, y la relación no permite la creación "
 "automática de nuevos registros relacionados."
 
-#: ../glom/base_db_table_data.cc:325
+#: ../glom/base_db_table_data.cc:311
 msgid "Related Record Does Not Exist"
 msgstr "No existe el registro relacionado"
 
 #. Warn the user:
 #. TODO: Make the field insensitive until it can receive data, so people never see this dialog.
-#: ../glom/base_db_table_data.cc:345
+#: ../glom/base_db_table_data.cc:331
 msgid ""
 "Data may not be entered into this related field, because the related record "
 "does not yet exist, and the key in the related record is auto-generated and "
@@ -447,12 +522,12 @@ msgstr ""
 "auto-generada y por tanto no se puede crear con el valor de la clave en este "
 "registro."
 
-#: ../glom/base_db_table_data.cc:350
+#: ../glom/base_db_table_data.cc:336
 msgid "Related Record Cannot Be Created"
 msgstr "No se puede crear el registro relacionado"
 
 #. Ask the user for confirmation:
-#: ../glom/base_db_table_data.cc:452
+#: ../glom/base_db_table_data.cc:446
 msgid ""
 "Are you sure that you would like to delete this record? The data in this "
 "record will then be permanently lost."
@@ -460,7 +535,7 @@ msgstr ""
 "¿Está seguro de que quiere eliminar este registro? Los datos de este "
 "registro se perderán permanentemente."
 
-#: ../glom/base_db_table_data.cc:456
+#: ../glom/base_db_table_data.cc:450
 msgid "Delete record"
 msgstr "Eliminar registro"
 
@@ -469,7 +544,7 @@ msgstr "Eliminar registro"
 #. Name column:
 #. Append the View columns:
 #: ../glom/box_reports.cc:90
-#: ../glom/mode_design/box_db_table_relationships.cc:43
+#: ../glom/mode_design/box_db_table_relationships.cc:44
 #: ../glom/mode_design/fields/box_db_table_definition.cc:52
 #: ../glom/mode_design/layout/dialog_choose_field.cc:54
 #: ../glom/mode_design/layout/dialog_choose_relationship.cc:55
@@ -490,7 +565,7 @@ msgstr ""
 
 #. Title column:
 #: ../glom/box_reports.cc:94
-#: ../glom/mode_design/box_db_table_relationships.cc:47
+#: ../glom/mode_design/box_db_table_relationships.cc:48
 #: ../glom/mode_design/fields/box_db_table_definition.cc:56
 #: ../glom/mode_design/layout/dialog_choose_field.cc:55
 #: ../glom/mode_design/layout/dialog_layout_details.cc:104
@@ -519,7 +594,7 @@ msgstr "Un entorno de bases de datos amigable."
 msgid "Glom"
 msgstr "Glom"
 
-#: ../glom/dialog_connection.cc:217
+#: ../glom/dialog_connection.cc:209
 msgid "Not yet created."
 msgstr "Todavía no se ha creado."
 
@@ -539,28 +614,28 @@ msgstr "No hay plantillas disponibles."
 msgid "Open a Document"
 msgstr "Abrir un documento"
 
-#: ../glom/dialog_existing_or_new.cc:134
+#: ../glom/dialog_existing_or_new.cc:133
 msgid "Select File"
 msgstr "Seleccionar archivo"
 
-#: ../glom/dialog_existing_or_new.cc:138
+#: ../glom/dialog_existing_or_new.cc:137
 msgid "Local Network"
 msgstr "Red local"
 
-#: ../glom/dialog_existing_or_new.cc:142
+#: ../glom/dialog_existing_or_new.cc:141
 msgid "Recently Opened"
 msgstr "Archivos abiertos recientemente"
 
-#: ../glom/dialog_existing_or_new.cc:238
+#: ../glom/dialog_existing_or_new.cc:237
 msgid "New Empty Document"
 msgstr "Documento vacío nuevo"
 
-#: ../glom/dialog_existing_or_new.cc:241
+#: ../glom/dialog_existing_or_new.cc:240
 msgid "New From Template"
 msgstr "Nuevo desde plantilla"
 
 #. Translator hint: This is <Service Name> on <Host> (via Network Interface such as eth0).
-#: ../glom/dialog_existing_or_new.cc:884
+#: ../glom/dialog_existing_or_new.cc:784
 #, c-format
 msgid "%s on %s (via %s)"
 msgstr "%s en %s (vía %s)"
@@ -715,11 +790,11 @@ msgstr "Esto evitará que otros usuarios de la red usen esta base de datos."
 msgid "_Stop Sharing"
 msgstr "_Dejar de compartir"
 
-#: ../glom/frame_glom.cc:1283
+#: ../glom/frame_glom.cc:1289
 msgid "Table Exists Already"
 msgstr "La tabla ya existe"
 
-#: ../glom/frame_glom.cc:1283
+#: ../glom/frame_glom.cc:1289
 msgid ""
 "A table with this name already exists in the database. Please choose a "
 "different table name."
@@ -727,11 +802,11 @@ msgstr ""
 "Ya existe una tabla con ese nombre en la base de datos. Por favor elija un "
 "nombre de tabla diferente."
 
-#: ../glom/frame_glom.cc:1287
+#: ../glom/frame_glom.cc:1293
 msgid "Relationship Exists Already"
 msgstr "Ya existe la relación"
 
-#: ../glom/frame_glom.cc:1287
+#: ../glom/frame_glom.cc:1293
 msgid ""
 "A relationship with this name already exists for this table. Please choose a "
 "different relationship name."
@@ -739,73 +814,73 @@ msgstr ""
 "Ya existe una relación con ese nombre para esta tabla. Elija otro nombre "
 "para la relación."
 
-#: ../glom/frame_glom.cc:1291
+#: ../glom/frame_glom.cc:1297
 msgid "More information needed"
 msgstr "Se necesita más información"
 
-#: ../glom/frame_glom.cc:1291
+#: ../glom/frame_glom.cc:1297
 msgid "You must specify a field, a table name, and a relationship name."
 msgstr ""
 "Debe especificar un campo, un nombre de tabla, y un nombre de relación."
 
-#: ../glom/frame_glom.cc:1345
+#: ../glom/frame_glom.cc:1351
 msgid "Related Table Created"
 msgstr "Tabla de relación creada"
 
-#: ../glom/frame_glom.cc:1345
+#: ../glom/frame_glom.cc:1351
 msgid "The new related table has been created."
 msgstr "Se ha creado la tabla de relación nueva."
 
-#: ../glom/frame_glom.cc:1375 ../glom/glom.glade.h:23
+#: ../glom/frame_glom.cc:1381 ../glom/glom.glade.h:23
 msgid "Edit Tables"
 msgstr "Editar tablas"
 
-#: ../glom/frame_glom.cc:1454
+#: ../glom/frame_glom.cc:1460
 #: ../glom/mode_data/datawidget/dialog_choose_id.cc:111
 msgid "You have not entered any quick find criteria."
 msgstr "No ha introducido ningún criterio de búsqueda rápida."
 
-#: ../glom/frame_glom.cc:1459
+#: ../glom/frame_glom.cc:1465
 msgid "No find criteria"
 msgstr "No hay criterio de búsqueda"
 
 #. show user level:
 #. The _C macro provides translator context.
-#: ../glom/frame_glom.cc:1519
+#: ../glom/frame_glom.cc:1525
 msgctxt "Mode"
 msgid "Operator"
 msgstr "Operador"
 
-#: ../glom/frame_glom.cc:1521
+#: ../glom/frame_glom.cc:1527
 msgctxt "Mode"
 msgid "Developer"
 msgstr "Desarrollador"
 
-#: ../glom/frame_glom.cc:1821 ../glom/glom_developer.glade.h:159
+#: ../glom/frame_glom.cc:1827 ../glom/glom_developer.glade.h:160
 msgid "Reports"
 msgstr "Informes"
 
-#: ../glom/frame_glom.cc:1852 ../glom/glom_developer.glade.h:153
+#: ../glom/frame_glom.cc:1858 ../glom/glom_developer.glade.h:154
 msgid "Print Layouts"
 msgstr "Distribución de impresión"
 
-#: ../glom/frame_glom.cc:1932
+#: ../glom/frame_glom.cc:1938
 msgid "Initializing Database Data"
 msgstr "Inicializando los datos de la base de datos"
 
-#: ../glom/frame_glom.cc:1941
+#: ../glom/frame_glom.cc:1947
 msgid "Starting Database Server"
 msgstr "Iniciando el servidor de bases de datos"
 
-#: ../glom/frame_glom.cc:1949
+#: ../glom/frame_glom.cc:1955
 msgid "Stopping Database Server"
 msgstr "Parando el servidor de bases de datos"
 
-#: ../glom/frame_glom.cc:1968
+#: ../glom/frame_glom.cc:1974
 msgid "Could Not Create Directory"
 msgstr "No se pudo crear el directorio."
 
-#: ../glom/frame_glom.cc:1969
+#: ../glom/frame_glom.cc:1975
 msgid ""
 "There was an error when attempting to create the directory for the new "
 "database files."
@@ -813,16 +888,16 @@ msgstr ""
 "Ocurrió un error al intentar crear el directorio para los archivos de la "
 "nueva base de datos."
 
-#: ../glom/frame_glom.cc:1973
+#: ../glom/frame_glom.cc:1979
 msgid "Could Not Start Database Server"
 msgstr "No se pudo iniciar el servidor de bases de datos"
 
-#: ../glom/frame_glom.cc:1974
+#: ../glom/frame_glom.cc:1980
 msgid "There was an error when attempting to start the database server."
 msgstr "Ocurrió un error al intentar iniciar el servidor de bases de datos."
 
 #. Show 0 instead of "all" when all of no records are found, to avoid confusion.
-#: ../glom/frame_glom.cc:2695
+#: ../glom/frame_glom.cc:2680
 msgid "All"
 msgstr "Todos"
 
@@ -1153,7 +1228,7 @@ msgstr ""
 "El texto será el mismo para cada campo visto."
 
 #: ../glom/glom_developer.glade.h:72
-#: ../glom/mode_design/box_db_table_relationships.cc:53
+#: ../glom/mode_design/box_db_table_relationships.cc:54
 msgid "Allow Editing"
 msgstr "Permitir editar"
 
@@ -1288,7 +1363,7 @@ msgid "English"
 msgstr "Inglés"
 
 #: ../glom/glom_developer.glade.h:102
-#: ../glom/mode_design/translation/window_translations.cc:507
+#: ../glom/mode_design/translation/window_translations.cc:508
 msgid "Export"
 msgstr "Exportar"
 
@@ -1354,10 +1429,10 @@ msgstr "Del campo:"
 
 #: ../glom/glom_developer.glade.h:117
 #: ../glom/libglom/data_structure/layout/layoutgroup.cc:377
-#: ../glom/mode_data/flowtablewithfields.cc:1424
-#: ../glom/mode_data/flowtablewithfields.cc:1451
-#: ../glom/utility_widgets/layouttoolbar.cc:54
-#: ../glom/utility_widgets/layouttoolbar.cc:64
+#: ../glom/mode_data/flowtablewithfields.cc:1500
+#: ../glom/mode_data/flowtablewithfields.cc:1527
+#: ../glom/utility_widgets/layouttoolbar.cc:53
+#: ../glom/utility_widgets/layouttoolbar.cc:63
 #: ../glom/utility_widgets/notebooklabelglom.cc:74
 msgid "Group"
 msgstr "Agrupar"
@@ -1434,88 +1509,98 @@ msgstr ""
 "caja multilínea con una barra de desplazamiento."
 
 #: ../glom/glom_developer.glade.h:132
+msgid ""
+"If this option is selected then the choices will list values from all "
+"records in the related table. If this option is not selected then the "
+"choices will list values only from related records."
+msgstr ""
+"Si esta opción está marcada las selecciones listarán valores de todos los "
+"registros en la tabla relacionada. Si esta opción no está marcada, las "
+"selecciones sólo listarán valores de los registros relacionados."
+
+#: ../glom/glom_developer.glade.h:133
 msgid "Image Object"
 msgstr "Objeto imagen"
 
 #. Note to translators: "Import" here is an action verb - it's a button.
-#: ../glom/glom_developer.glade.h:133
-#: ../glom/mode_design/translation/window_translations.cc:586
+#: ../glom/glom_developer.glade.h:134
+#: ../glom/mode_design/translation/window_translations.cc:588
 msgid "Import"
 msgstr "Importar"
 
-#: ../glom/glom_developer.glade.h:134
+#: ../glom/glom_developer.glade.h:135
 msgid "Language:"
 msgstr "Idioma:"
 
 #. Don't add ContextLayout in client only mode because it would never
 #. be sensitive anyway
-#: ../glom/glom_developer.glade.h:135
-#: ../glom/mode_data/box_data_calendar_related.cc:494
-#: ../glom/utility_widgets/db_adddel/db_adddel.cc:277
+#: ../glom/glom_developer.glade.h:136
+#: ../glom/mode_data/box_data_calendar_related.cc:496
+#: ../glom/utility_widgets/db_adddel/db_adddel.cc:275
 msgid "Layout"
 msgstr "Distribución"
 
-#: ../glom/glom_developer.glade.h:136
+#: ../glom/glom_developer.glade.h:137
 msgid "Locale:"
 msgstr "Conf. regional:"
 
-#: ../glom/glom_developer.glade.h:137
+#: ../glom/glom_developer.glade.h:138
 msgid "Logo"
 msgstr "Logotipo"
 
 #. Translators: The Main part of the report (not the footer or header)
-#: ../glom/glom_developer.glade.h:139
+#: ../glom/glom_developer.glade.h:140
 msgid "Main"
 msgstr "Principal"
 
-#: ../glom/glom_developer.glade.h:140
+#: ../glom/glom_developer.glade.h:141
 msgid "Module name:"
 msgstr "Nombre del módulo:"
 
-#: ../glom/glom_developer.glade.h:141
+#: ../glom/glom_developer.glade.h:142
 msgid "Multi-line"
 msgstr "Multi-línea"
 
-#: ../glom/glom_developer.glade.h:142
+#: ../glom/glom_developer.glade.h:143
 msgid "Name of new related table:"
 msgstr "Nombre de la tabla relacionada nueva:"
 
-#: ../glom/glom_developer.glade.h:143
+#: ../glom/glom_developer.glade.h:144
 msgid "Name of new relationship:"
 msgstr "Nombre de la nueva relación:"
 
-#: ../glom/glom_developer.glade.h:144
+#: ../glom/glom_developer.glade.h:145
 msgid "Name:"
 msgstr "Nombre:"
 
-#: ../glom/glom_developer.glade.h:145
+#: ../glom/glom_developer.glade.h:146
 msgid "No Choices"
 msgstr "Sin opciones"
 
-#: ../glom/glom_developer.glade.h:146
+#: ../glom/glom_developer.glade.h:147
 msgid "None"
 msgstr "Ninguno"
 
-#: ../glom/glom_developer.glade.h:147 ../glom/glom.glade.h:36
+#: ../glom/glom_developer.glade.h:148 ../glom/glom.glade.h:36
 #: ../glom/mode_design/dialog_design.cc:52
 #: ../glom/mode_design/print_layouts/window_print_layout_edit.cc:495
 msgid "None selected"
 msgstr "Ninguno seleccionado"
 
-#: ../glom/glom_developer.glade.h:148
+#: ../glom/glom_developer.glade.h:149
 #: ../glom/mode_design/layout/dialog_layout_details.cc:948
 msgid "Notebook Tabs"
 msgstr "Solapas del cuaderno"
 
-#: ../glom/glom_developer.glade.h:149
+#: ../glom/glom_developer.glade.h:150
 msgid "Organisation"
 msgstr "Organización"
 
-#: ../glom/glom_developer.glade.h:150 ../glom/glom.glade.h:39
+#: ../glom/glom_developer.glade.h:151 ../glom/glom.glade.h:39
 msgid "Password"
 msgstr "Contraseña"
 
-#: ../glom/glom_developer.glade.h:151
+#: ../glom/glom_developer.glade.h:152
 msgid ""
 "Please enter the initial connection details for your database. You may add "
 "additional users later. Remember to keep this password secret because it "
@@ -1525,24 +1610,24 @@ msgstr ""
 "añadir usuarios adicionales más tarde. Recuerde mantener la contraseña en "
 "secreto porque permite acceso a sus datos desde otros equipos de la red."
 
-#: ../glom/glom_developer.glade.h:152
+#: ../glom/glom_developer.glade.h:153
 msgid "Print Layout Editor"
 msgstr "Editor de la distribución de impresión"
 
-#: ../glom/glom_developer.glade.h:154
+#: ../glom/glom_developer.glade.h:155
 #: ../glom/utility_widgets/layoutwidgetutils.cc:37
 msgid "Properties"
 msgstr "Propiedades"
 
-#: ../glom/glom_developer.glade.h:155
+#: ../glom/glom_developer.glade.h:156
 msgid "Relationship:"
 msgstr "Relación:"
 
-#: ../glom/glom_developer.glade.h:156
+#: ../glom/glom_developer.glade.h:157
 msgid "Relationships Overview"
 msgstr "Visión general de las relaciones"
 
-#: ../glom/glom_developer.glade.h:157
+#: ../glom/glom_developer.glade.h:158
 msgid ""
 "Remove the item from the layout. If you remove a field layout item, it will "
 "not remove the field from the table itself. It just will not be seen on the "
@@ -1552,53 +1637,57 @@ msgstr ""
 "campo, no quitará el campo de la tabla. Tan sólo no se verá en la "
 "disposición."
 
-#: ../glom/glom_developer.glade.h:158
+#: ../glom/glom_developer.glade.h:159
 msgid "Report Layout"
 msgstr "Distribución del informe"
 
-#: ../glom/glom_developer.glade.h:160
+#: ../glom/glom_developer.glade.h:161
 msgid "Restrict data to these choices"
 msgstr "Restringir los datos a esas opciones"
 
-#: ../glom/glom_developer.glade.h:161
+#: ../glom/glom_developer.glade.h:162
 msgid "Script Library"
 msgstr "Biblioteca de scripts"
 
-#: ../glom/glom_developer.glade.h:162
+#: ../glom/glom_developer.glade.h:163
 msgid "Script name:"
 msgstr "Nombre del script:"
 
-#: ../glom/glom_developer.glade.h:163
+#: ../glom/glom_developer.glade.h:164
 msgid "Secondary Fields:"
 msgstr "Campos secundarios:"
 
-#: ../glom/glom_developer.glade.h:164
+#: ../glom/glom_developer.glade.h:165
 #: ../glom/mode_data/datawidget/dialog_choose_id.cc:94
-#: ../glom/utility_widgets/imageglom.cc:351
+#: ../glom/utility_widgets/imageglom.cc:328
 msgid "Select"
 msgstr "Seleccionar"
 
-#: ../glom/glom_developer.glade.h:165
+#: ../glom/glom_developer.glade.h:166
 msgid "Select Field"
 msgstr "Seleccionar campo"
 
-#: ../glom/glom_developer.glade.h:166
+#: ../glom/glom_developer.glade.h:167
 msgid "Select Relationship"
 msgstr "Seleccionar relación"
 
-#: ../glom/glom_developer.glade.h:167
+#: ../glom/glom_developer.glade.h:168
 msgid "Show _Related Relationships"
 msgstr "Mostrar relaciones"
 
-#: ../glom/glom_developer.glade.h:168
+#: ../glom/glom_developer.glade.h:169
+msgid "Show all records"
+msgstr "Mostrar todos los registros"
+
+#: ../glom/glom_developer.glade.h:170
 msgid "Show child relationships"
 msgstr "Mostrar relaciones hijas"
 
-#: ../glom/glom_developer.glade.h:169
+#: ../glom/glom_developer.glade.h:171
 msgid "Sort Fields:"
 msgstr "Ordenar campos:"
 
-#: ../glom/glom_developer.glade.h:170
+#: ../glom/glom_developer.glade.h:172
 msgid ""
 "Start a translation for this target locale by copying the strings from "
 "another target locale."
@@ -1606,59 +1695,59 @@ msgstr ""
 "Inicia una traducción para esta configuración regional copiando las cadenas "
 "de otra configuración regional."
 
-#: ../glom/glom_developer.glade.h:171
+#: ../glom/glom_developer.glade.h:173
 msgid "Startup Script"
 msgstr "Script de inicio"
 
-#: ../glom/glom_developer.glade.h:172
+#: ../glom/glom_developer.glade.h:174
 msgid "State/County:"
 msgstr "Estado/País:"
 
-#: ../glom/glom_developer.glade.h:173
+#: ../glom/glom_developer.glade.h:175
 msgid "Street (Line 2):"
 msgstr "Calle (línea 2):"
 
-#: ../glom/glom_developer.glade.h:174
+#: ../glom/glom_developer.glade.h:176
 msgid "Street:"
 msgstr "Calle:"
 
-#: ../glom/glom_developer.glade.h:175
+#: ../glom/glom_developer.glade.h:177
 msgid "Summary Type:"
 msgstr "Tipo de resumen:"
 
-#: ../glom/glom_developer.glade.h:176
+#: ../glom/glom_developer.glade.h:178
 msgid "System Name:"
 msgstr "Nombre del sistema:"
 
-#: ../glom/glom_developer.glade.h:177
+#: ../glom/glom_developer.glade.h:179
 msgid "Table Name"
 msgstr "Nombre de la tabla"
 
-#: ../glom/glom_developer.glade.h:178 ../glom/glom.glade.h:45
+#: ../glom/glom_developer.glade.h:180 ../glom/glom.glade.h:45
 msgid "Table:"
 msgstr "Tabla:"
 
-#: ../glom/glom_developer.glade.h:179
+#: ../glom/glom_developer.glade.h:181
 msgid "Table: "
 msgstr "Tabla: "
 
-#: ../glom/glom_developer.glade.h:180
+#: ../glom/glom_developer.glade.h:182
 msgid "Test"
 msgstr "Prueba"
 
-#: ../glom/glom_developer.glade.h:181
+#: ../glom/glom_developer.glade.h:183
 msgid "Test Translation"
 msgstr "Comprobar la traducción"
 
-#: ../glom/glom_developer.glade.h:182
+#: ../glom/glom_developer.glade.h:184
 msgid "Text Format"
 msgstr "Formato del texto"
 
-#: ../glom/glom_developer.glade.h:183
+#: ../glom/glom_developer.glade.h:185
 msgid "Text Object"
 msgstr "Objeto de texto"
 
-#: ../glom/glom_developer.glade.h:184
+#: ../glom/glom_developer.glade.h:186
 msgid ""
 "The field value will be the return value of the python function, which you "
 "implement here."
@@ -1666,7 +1755,7 @@ msgstr ""
 "El valor del campo será el valor de retorno de la función python, la cual se "
 "implementa aquí."
 
-#: ../glom/glom_developer.glade.h:185
+#: ../glom/glom_developer.glade.h:187
 msgid ""
 "These modules will be available to your button scripts and field "
 "calculations via the python import keyword."
@@ -1674,14 +1763,14 @@ msgstr ""
 "Estos módulos estarán disponibles para sus botones de scripts y cálculos de "
 "campos por medio de la palabra clave de importación python."
 
-#: ../glom/glom_developer.glade.h:186
+#: ../glom/glom_developer.glade.h:188
 msgid ""
 "This field will be used to decide which records to show in the calendar."
 msgstr ""
 "Este campo se utilizará para decidir qué registros se mostrarán en el "
 "calendario."
 
-#: ../glom/glom_developer.glade.h:187
+#: ../glom/glom_developer.glade.h:189
 msgid ""
 "This will add a new table and add a relationship that refers to the new  "
 "table, as a convenient alternative to doing this in separate steps.\n"
@@ -1696,59 +1785,59 @@ msgstr ""
 "Si ya existe una tabla relacionada conveniente entonces debería cancelar y "
 "tan sólo añadir la relación."
 
-#: ../glom/glom_developer.glade.h:190
+#: ../glom/glom_developer.glade.h:192
 msgid "Title:"
 msgstr "Título:"
 
-#: ../glom/glom_developer.glade.h:191
+#: ../glom/glom_developer.glade.h:193
 msgid "Town:"
 msgstr "Ciudad:"
 
-#: ../glom/glom_developer.glade.h:192
+#: ../glom/glom_developer.glade.h:194
 msgid "Translations"
 msgstr "Traducciones"
 
-#: ../glom/glom_developer.glade.h:193
+#: ../glom/glom_developer.glade.h:195
 msgid "Triggered by:"
 msgstr "Disparado por:"
 
-#: ../glom/glom_developer.glade.h:194
+#: ../glom/glom_developer.glade.h:196
 msgid "Typ_e:"
 msgstr "T_ipo:"
 
-#: ../glom/glom_developer.glade.h:195
+#: ../glom/glom_developer.glade.h:197
 msgid "Use 1000s separator"
 msgstr "Usar separadores de millares"
 
-#: ../glom/glom_developer.glade.h:196
+#: ../glom/glom_developer.glade.h:198
 msgid "Use custom formatting"
 msgstr "Usar formato personalizado"
 
-#: ../glom/glom_developer.glade.h:197
+#: ../glom/glom_developer.glade.h:199
 msgid "Use custom title:"
 msgstr "Usar título personalizado:"
 
-#: ../glom/glom_developer.glade.h:198
+#: ../glom/glom_developer.glade.h:200
 msgid "Use default field title: "
 msgstr "Usar título del campo predeterminado: "
 
-#: ../glom/glom_developer.glade.h:199
+#: ../glom/glom_developer.glade.h:201
 msgid "Use default formatting"
 msgstr "Usar el formato predeterminado"
 
-#: ../glom/glom_developer.glade.h:200 ../glom/glom.glade.h:46
+#: ../glom/glom_developer.glade.h:202 ../glom/glom.glade.h:46
 msgid "User"
 msgstr "Usuario"
 
-#: ../glom/glom_developer.glade.h:201
+#: ../glom/glom_developer.glade.h:203
 msgid "Users"
 msgstr "Usuarios"
 
-#: ../glom/glom_developer.glade.h:202
+#: ../glom/glom_developer.glade.h:204
 msgid "Value"
 msgstr "Valor"
 
-#: ../glom/glom_developer.glade.h:203
+#: ../glom/glom_developer.glade.h:205
 msgid ""
 "When the button is clicked it will run the python function which you "
 "implement here."
@@ -1756,14 +1845,14 @@ msgstr ""
 "Al pulsar el botón se ejecutará la función de python, la cual debe "
 "implementar aquí."
 
-#: ../glom/glom_developer.glade.h:204
+#: ../glom/glom_developer.glade.h:206
 msgid ""
 "When the database is opened the python function implemented here will run."
 msgstr ""
 "Cuando se abre la base de datos se ejecutará la función python implementada "
 "aquí."
 
-#: ../glom/glom_developer.glade.h:205
+#: ../glom/glom_developer.glade.h:207
 msgid ""
 "When this is checked the table's title will be shown at the top of the "
 "report in addition to the report title."
@@ -1771,89 +1860,89 @@ msgstr ""
 "Cuando esto está habilitado, se mostrará el título de la tabla en la parte "
 "superior del informe, además del título del informe."
 
-#: ../glom/glom_developer.glade.h:206
+#: ../glom/glom_developer.glade.h:208
 msgid "Zip/Postal Code:"
 msgstr "Código postal:"
 
-#: ../glom/glom_developer.glade.h:207
+#: ../glom/glom_developer.glade.h:209
 msgid "_Auto-increment"
 msgstr "Autoincrem_entar"
 
-#: ../glom/glom_developer.glade.h:208
+#: ../glom/glom_developer.glade.h:210
 msgid "_Calculate Value"
 msgstr "Calcular _valor"
 
 #. Translators: This is the verb
-#: ../glom/glom_developer.glade.h:210
+#: ../glom/glom_developer.glade.h:212
 msgid "_Check"
 msgstr "_Verificar"
 
-#: ../glom/glom_developer.glade.h:211
+#: ../glom/glom_developer.glade.h:213
 msgid "_Confirm Password:"
 msgstr "_Confirmar contraseña:"
 
-#: ../glom/glom_developer.glade.h:212 ../glom/bakery/app_withdoc_gtk.cc:343
+#: ../glom/glom_developer.glade.h:214 ../glom/bakery/app_withdoc_gtk.cc:324
 msgid "_Edit"
 msgstr "_Editar"
 
-#: ../glom/glom_developer.glade.h:213
+#: ../glom/glom_developer.glade.h:215
 msgid "_Field:"
 msgstr "Ca_mpo:"
 
-#: ../glom/glom_developer.glade.h:214
+#: ../glom/glom_developer.glade.h:216
 msgid "_Lookup value when a field changes."
 msgstr "Buscar va_lor al cambiar un campo."
 
-#: ../glom/glom_developer.glade.h:215
+#: ../glom/glom_developer.glade.h:217
 msgid "_Name:"
 msgstr "_Nombre:"
 
-#: ../glom/glom_developer.glade.h:216 ../glom/glom.glade.h:52
+#: ../glom/glom_developer.glade.h:218 ../glom/glom.glade.h:52
 msgid "_Password:"
 msgstr "Contrase_ña:"
 
-#: ../glom/glom_developer.glade.h:217
+#: ../glom/glom_developer.glade.h:219
 msgid "_Primary Key"
 msgstr "Cla_ve primaria"
 
-#: ../glom/glom_developer.glade.h:218
+#: ../glom/glom_developer.glade.h:220
 msgid "_Relationship:"
 msgstr "Re_lación:"
 
-#: ../glom/glom_developer.glade.h:219
+#: ../glom/glom_developer.glade.h:221
 msgid "_Report name:"
 msgstr "Nombre del in_forme:"
 
-#: ../glom/glom_developer.glade.h:220 ../glom/glom.glade.h:53
+#: ../glom/glom_developer.glade.h:222 ../glom/glom.glade.h:53
 msgid "_Select"
 msgstr "_Seleccionar"
 
-#: ../glom/glom_developer.glade.h:221
+#: ../glom/glom_developer.glade.h:223
 msgid "_Show table title"
 msgstr "Mo_strar el título de la tabla"
 
-#: ../glom/glom_developer.glade.h:222
+#: ../glom/glom_developer.glade.h:224
 msgid "_Table:"
 msgstr "_Tabla:"
 
-#: ../glom/glom_developer.glade.h:223
+#: ../glom/glom_developer.glade.h:225
 #: ../glom/utility_widgets/filechooserdialog_saveextras.cc:101
 msgid "_Title:"
 msgstr "Tít_ulo:"
 
-#: ../glom/glom_developer.glade.h:224
+#: ../glom/glom_developer.glade.h:226
 msgid "_Unique"
 msgstr "Ã?_nico"
 
-#: ../glom/glom_developer.glade.h:225
+#: ../glom/glom_developer.glade.h:227
 msgid "_User Entry"
 msgstr "Entrada del _usuario"
 
-#: ../glom/glom_developer.glade.h:226 ../glom/glom.glade.h:55
+#: ../glom/glom_developer.glade.h:228 ../glom/glom.glade.h:55
 msgid "_User:"
 msgstr "_Usuario:"
 
-#: ../glom/glom_developer.glade.h:227
+#: ../glom/glom_developer.glade.h:229
 msgid "table name"
 msgstr "nombre de la tabla"
 
@@ -2037,41 +2126,46 @@ msgstr "No hay archivo de ayuda disponible"
 msgid "Could not display help: "
 msgstr "No se pudo mostrar la ayuda: "
 
-#: ../glom/utils_ui.cc:502
+#: ../glom/utils_ui.cc:485
 msgid "Your find criteria did not match any records in the table."
 msgstr ""
 "El criterio de búsqueda introducido no coincide con ningún registro de la "
 "tabla."
 
-#: ../glom/utils_ui.cc:507
+#: ../glom/utils_ui.cc:490
 msgid "No Records Found"
 msgstr "No se encontró ningún registro"
 
-#: ../glom/utils_ui.cc:513
+#: ../glom/utils_ui.cc:497
 msgid "New Find"
 msgstr "Nueva búsqueda"
 
-#: ../glom/bakery/app_withdoc_gtk.cc:386
+#: ../glom/bakery/app_withdoc_gtk.cc:367
 msgid "_Help"
 msgstr "Ay_uda"
 
-#: ../glom/bakery/app_withdoc_gtk.cc:390
+#: ../glom/bakery/app_withdoc_gtk.cc:371
 msgid "_About"
 msgstr "Acerca _de"
 
-#: ../glom/bakery/app_withdoc_gtk.cc:390
+#: ../glom/bakery/app_withdoc_gtk.cc:371
 msgid "About the application"
 msgstr "Acerca de esta aplicación"
 
-#: ../glom/bakery/app_withdoc_gtk.cc:530
+#: ../glom/bakery/app_withdoc_gtk.cc:511
 msgid "Open Document"
 msgstr "Abrir documento"
 
-#: ../glom/bakery/app_withdoc.cc:506
+#: ../glom/bakery/app_withdoc.cc:241 ../glom/bakery/app_withdoc.cc:292
+msgid ""
+"There was an error while saving the file. Your changes have not been saved."
+msgstr "Ocurrió un error al grabar el archivo. Sus cambios no se han guardado."
+
+#: ../glom/bakery/app_withdoc.cc:502
 msgid "Open Failed."
 msgstr "Falló al abrir."
 
-#: ../glom/bakery/app_withdoc.cc:506
+#: ../glom/bakery/app_withdoc.cc:502
 msgid "The document could not be opened."
 msgstr "No se pudo abrir el documento."
 
@@ -2097,7 +2191,7 @@ msgstr "Cerrar sin guardar"
 msgid "Discard"
 msgstr "Descartar"
 
-#: ../glom/import_csv/dialog_import_csv.cc:88
+#: ../glom/import_csv/dialog_import_csv.cc:86
 msgid "Auto Detect"
 msgstr "Autodetectar"
 
@@ -2108,7 +2202,7 @@ msgstr "Autodetectar"
 #. Get the ISO (not current locale) text representation:
 #. ignored
 #. iso_format
-#: ../glom/import_csv/dialog_import_csv.cc:145
+#: ../glom/import_csv/dialog_import_csv.cc:143
 msgid ""
 "Note that the source file should contain numbers and dates in international "
 "ISO format. For instance, 22nd November 2008 should be %1."
@@ -2116,37 +2210,37 @@ msgstr ""
 "Note que el archivo origen debería contener números y fechas en el formato "
 "internacional ISO. Por ejemplo, 22 de noviembre de 2008 debería ser %1."
 
-#: ../glom/import_csv/dialog_import_csv.cc:174
+#: ../glom/import_csv/dialog_import_csv.cc:172
 msgid "No Document Available"
 msgstr "No hay un documento disponible"
 
-#: ../glom/import_csv/dialog_import_csv.cc:174
+#: ../glom/import_csv/dialog_import_csv.cc:172
 msgid "You need to open a document to import the data into a table."
 msgstr "Necesita abrir un documento para importar los datos en una tabla."
 
-#: ../glom/import_csv/dialog_import_csv.cc:185
+#: ../glom/import_csv/dialog_import_csv.cc:183
 msgid "Import From CSV File"
 msgstr "Importar desde un archivo CSV"
 
-#: ../glom/import_csv/dialog_import_csv.cc:190
-#: ../glom/import_csv/dialog_import_csv.cc:582
+#: ../glom/import_csv/dialog_import_csv.cc:188
+#: ../glom/import_csv/dialog_import_csv.cc:570
 msgid "<None>"
 msgstr "<Ninguno>"
 
-#: ../glom/import_csv/dialog_import_csv.cc:270
+#: ../glom/import_csv/dialog_import_csv.cc:268
 msgid "Error Importing CSV File"
 msgstr "Error al importar el archivo CSV"
 
-#: ../glom/import_csv/dialog_import_csv.cc:424
+#: ../glom/import_csv/dialog_import_csv.cc:422
 msgid "Encoding detected as: %1"
 msgstr "Codificación detectada como: %1"
 
-#: ../glom/import_csv/dialog_import_csv.cc:463
+#: ../glom/import_csv/dialog_import_csv.cc:461
 msgid "Encoding detection failed. Please manually choose one from the box."
 msgstr ""
 "Falló la detección de la codificación. Seleccione una manualmente de la caja."
 
-#: ../glom/import_csv/dialog_import_csv.cc:467
+#: ../glom/import_csv/dialog_import_csv.cc:465
 msgid ""
 "The file contains data not in the specified encoding. Please choose another "
 "one, or try \"Auto Detect\"."
@@ -2155,24 +2249,24 @@ msgstr ""
 "una codificación, o pruebe «Autodetectar»."
 
 #. Note to translators: This is a straight line, not a database row.
-#: ../glom/import_csv/dialog_import_csv.cc:509
+#: ../glom/import_csv/dialog_import_csv.cc:507
 #: ../glom/libglom/data_structure/layout/layoutitem_line.cc:82
 msgid "Line"
 msgstr "Línea"
 
-#: ../glom/import_csv/dialog_import_csv.cc:560
+#: ../glom/import_csv/dialog_import_csv.cc:550
 msgid "Target Field"
 msgstr "Campo destino"
 
-#: ../glom/import_csv/dialog_import_csv.cc:607
+#: ../glom/import_csv/dialog_import_csv.cc:595
 msgid "<Import Failure>"
 msgstr "<Fallo al importar>"
 
-#: ../glom/import_csv/dialog_import_csv.cc:617
+#: ../glom/import_csv/dialog_import_csv.cc:605
 msgid "<Picture>"
 msgstr "<Imagen>"
 
-#: ../glom/import_csv/dialog_import_csv.cc:716
+#: ../glom/import_csv/dialog_import_csv.cc:704
 msgid ""
 "One column needs to be assigned the table's primary key (<b>%1</b>) as "
 "target field before importing"
@@ -2180,27 +2274,27 @@ msgstr ""
 "Se debe asignar una columna a la clave primaria de la tabla (<b>%1</b>) como "
 "archivo destino antes de continuar"
 
-#: ../glom/import_csv/dialog_import_csv.cc:750
+#: ../glom/import_csv/dialog_import_csv.cc:733
 msgid "Could Not Open file"
 msgstr "No se pudo abrir el archivo"
 
-#: ../glom/import_csv/dialog_import_csv.cc:751
+#: ../glom/import_csv/dialog_import_csv.cc:734
 msgid "The file at \"%1\" could not be opened: %2"
 msgstr "El archivo en «%1» no se pudo abrir: «%2»"
 
-#: ../glom/import_csv/dialog_import_csv.cc:756
+#: ../glom/import_csv/dialog_import_csv.cc:739
 msgid "Import From CSV File: "
 msgstr "Importar desde un archivo CSV: "
 
-#: ../glom/import_csv/dialog_import_csv_progress.cc:87
+#: ../glom/import_csv/dialog_import_csv_progress.cc:80
 msgid "Parsing CSV file %1"
 msgstr "Analizando archivo CSV %1"
 
-#: ../glom/import_csv/dialog_import_csv_progress.cc:166
+#: ../glom/import_csv/dialog_import_csv_progress.cc:159
 msgid "Import complete\n"
 msgstr "Importación completada\n"
 
-#: ../glom/import_csv/dialog_import_csv_progress.cc:195
+#: ../glom/import_csv/dialog_import_csv_progress.cc:188
 msgid ""
 "Warning: Importing row %1: The value for field %2 must be unique, but is "
 "already in use. The value will not be imported.\n"
@@ -2208,7 +2302,7 @@ msgstr ""
 "Advertencia: Importando la fila %1: El valor del campo %2 debe ser único, "
 "pero ya está en uso. No se importará el valor.\n"
 
-#: ../glom/import_csv/dialog_import_csv_progress.cc:204
+#: ../glom/import_csv/dialog_import_csv_progress.cc:197
 msgid ""
 "Warning: Importing row %1: The value for field %2, \"%3\" could not be "
 "converted to the field's type. The value will not be imported.\n"
@@ -2216,7 +2310,7 @@ msgstr ""
 "Advertencia: Importando la fila %1: El valor del campo %2, «%3» no se puede "
 "convertir al tipo del campo. No se importará el valor.\n"
 
-#: ../glom/import_csv/dialog_import_csv_progress.cc:229
+#: ../glom/import_csv/dialog_import_csv_progress.cc:222
 msgid ""
 "Error importing row %1: Cannot import the row because the primary key is "
 "empty.\n"
@@ -2305,43 +2399,43 @@ msgstr "Rumano"
 msgid "Vietnamese"
 msgstr "Vietnamita"
 
-#: ../glom/libglom/data_structure/field.cc:650
+#: ../glom/libglom/data_structure/field.cc:638
 #: ../glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.cc:143
 #: ../glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.cc:151
 msgid "Invalid"
 msgstr "No válido"
 
-#: ../glom/libglom/data_structure/field.cc:651
+#: ../glom/libglom/data_structure/field.cc:639
 msgid "Number"
 msgstr "Número"
 
-#: ../glom/libglom/data_structure/field.cc:652
+#: ../glom/libglom/data_structure/field.cc:640
 #: ../glom/libglom/data_structure/layout/layoutitem_text.cc:72
 #: ../glom/libglom/data_structure/translatable_item.cc:316
 #: ../glom/mode_design/layout/dialog_layout_details.cc:1148
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:39
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:37
 #: ../glom/mode_design/print_layouts/window_print_layout_edit.cc:608
 msgid "Text"
 msgstr "Texto"
 
-#: ../glom/libglom/data_structure/field.cc:653
+#: ../glom/libglom/data_structure/field.cc:641
 msgid "Time"
 msgstr "Hora"
 
-#: ../glom/libglom/data_structure/field.cc:654
+#: ../glom/libglom/data_structure/field.cc:642
 msgid "Date"
 msgstr "Fecha"
 
-#: ../glom/libglom/data_structure/field.cc:655
+#: ../glom/libglom/data_structure/field.cc:643
 msgid "Boolean"
 msgstr "Booleano"
 
-#: ../glom/libglom/data_structure/field.cc:656
+#: ../glom/libglom/data_structure/field.cc:644
 #: ../glom/libglom/data_structure/layout/layoutitem_image.cc:69
 #: ../glom/libglom/data_structure/translatable_item.cc:318
 #: ../glom/mode_design/layout/dialog_layout_details.cc:1155
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:41
-#: ../glom/utility_widgets/layouttoolbar.cc:66
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:39
+#: ../glom/utility_widgets/layouttoolbar.cc:65
 msgid "Image"
 msgstr "Imagen"
 
@@ -2386,7 +2480,7 @@ msgstr ""
 #: ../glom/libglom/data_structure/layout/layoutitem_button.cc:67
 #: ../glom/libglom/data_structure/translatable_item.cc:314
 #: ../glom/mode_design/layout/dialog_layout_details.cc:1141
-#: ../glom/utility_widgets/layouttoolbar.cc:62
+#: ../glom/utility_widgets/layouttoolbar.cc:61
 msgid "Button"
 msgstr "Botón"
 
@@ -2396,8 +2490,8 @@ msgstr "Calendario del portal"
 
 #. Note to translators: "Notebook" means a GtkNotebook-type widget.
 #: ../glom/libglom/data_structure/layout/layoutitem_notebook.cc:56
-#: ../glom/mode_data/flowtablewithfields.cc:1420
-#: ../glom/utility_widgets/layouttoolbar.cc:56
+#: ../glom/mode_data/flowtablewithfields.cc:1496
+#: ../glom/utility_widgets/layouttoolbar.cc:55
 msgid "Notebook"
 msgstr "Cuaderno"
 
@@ -2455,7 +2549,7 @@ msgstr "Informe"
 
 #. Tables:
 #: ../glom/libglom/data_structure/translatable_item.cc:308
-#: ../glom/mode_design/box_db_table_relationships.cc:51
+#: ../glom/mode_design/box_db_table_relationships.cc:52
 #: ../glom/mode_design/dialog_database_preferences.cc:59
 #: ../glom/mode_design/users/dialog_groups_list.cc:71
 #: ../glom/navigation/box_tables.cc:129
@@ -2471,95 +2565,99 @@ msgstr "Distribución del grupo"
 msgid "Field Title"
 msgstr "Campo del título"
 
-#: ../glom/libglom/document/document.cc:477
-#: ../glom/libglom/document/document.cc:495
+#: ../glom/libglom/document/document.cc:478
+#: ../glom/libglom/document/document.cc:496
 msgid "System Preferences"
 msgstr "Preferencias del sistema"
 
-#: ../glom/libglom/document/document.cc:508
+#: ../glom/libglom/document/document.cc:509
 msgid "System Name"
 msgstr "Nombre del sistema"
 
-#: ../glom/libglom/document/document.cc:514
+#: ../glom/libglom/document/document.cc:515
 msgid "Organisation Name"
 msgstr "Nombre de la organización"
 
-#: ../glom/libglom/document/document.cc:520
+#: ../glom/libglom/document/document.cc:521
 msgid "Organisation Logo"
 msgstr "Logotipo de la organización"
 
-#: ../glom/libglom/document/document.cc:526
+#: ../glom/libglom/document/document.cc:527
 msgid "Street"
 msgstr "Calle"
 
-#: ../glom/libglom/document/document.cc:532
+#: ../glom/libglom/document/document.cc:533
 msgid "Street (line 2)"
 msgstr "Calle (línea 2)"
 
-#: ../glom/libglom/document/document.cc:538
+#: ../glom/libglom/document/document.cc:539
 msgid "City"
 msgstr "Ciudad"
 
-#: ../glom/libglom/document/document.cc:544
+#: ../glom/libglom/document/document.cc:545
 msgid "State"
 msgstr "Estado"
 
-#: ../glom/libglom/document/document.cc:550
+#: ../glom/libglom/document/document.cc:551
 msgid "Country"
 msgstr "País"
 
-#: ../glom/libglom/document/document.cc:556
+#: ../glom/libglom/document/document.cc:557
 msgid "Zip Code"
 msgstr "Código postal"
 
-#: ../glom/libglom/document/bakery/document.cc:439
+#: ../glom/libglom/document/bakery/document.cc:404
 msgid "Untitled"
 msgstr "Sin título"
 
-#: ../glom/libglom/gst-package.c:57
+#: ../glom/libglom/gst-package.c:56
 msgid "Could not install package"
 msgstr "No se pudo instalar el paquete"
 
-#: ../glom/libglom/gst-package.c:75
+#: ../glom/libglom/gst-package.c:74
 msgid "The necessary applications to install the package could not be found."
 msgstr ""
 "No se pudieron encontrar las aplicaciones necesarias para instalar el "
 "paquete."
 
-#: ../glom/libglom/db_utils.cc:1082
+#: ../glom/libglom/db_utils.cc:1049
 #: ../glom/mode_design/users/dialog_groups_list.cc:68
 msgid "Description"
 msgstr "Descripción"
 
-#: ../glom/libglom/db_utils.cc:1089
+#: ../glom/libglom/db_utils.cc:1056
 msgid "Comments"
 msgstr "Comentarios"
 
-#: ../glom/main.cc:195
+#: ../glom/main.cc:197
 msgid "Glom options"
 msgstr "Opciones de Glom"
 
-#: ../glom/main.cc:195
+#: ../glom/main.cc:197
 msgid "Command-line options for glom"
 msgstr "Opciones de línea de comandos de glom"
 
-#: ../glom/main.cc:203
+#: ../glom/main.cc:206
 msgid "The Filename"
 msgstr "El nombre del archivo"
 
-#: ../glom/main.cc:209
+#: ../glom/main.cc:212
 msgid "The version of this application."
 msgstr "La versión de esta aplicación."
 
-#: ../glom/main.cc:214
+#: ../glom/main.cc:217
+msgid "Whether the filename is a .tar.gz backup to be restored."
+msgstr "Indica si el nombre del archivo es .tar.gz se restaurará el respaldo."
+
+#: ../glom/main.cc:222
 msgid "Show the generated SQL queries on stdout, for debugging."
 msgstr "Mostrar las consultas SQL generadas en stdout, para depurar."
 
-#: ../glom/main.cc:219
+#: ../glom/main.cc:227
 msgid "Show how Glom outputs a date in this locale, then stop."
 msgstr "Mostrar cómo genera Glom la fecha en esta localización y parar."
 
-#: ../glom/main.cc:232
+#: ../glom/main.cc:240
 msgid ""
 "You seem to be running Glom as a user with administrator privileges. Glom "
 "may not be run with such privileges for security reasons.\n"
@@ -2571,7 +2669,7 @@ msgstr ""
 "Inicie sesión en su sistema como un usuario normal."
 
 #. Warn the user:
-#: ../glom/main.cc:246
+#: ../glom/main.cc:254
 msgid ""
 "You seem to be running Glom as root. Glom may not be run as root.\n"
 "Please login to your system as a normal user."
@@ -2580,20 +2678,20 @@ msgstr ""
 "ejecutar como superusuario.\n"
 "Inicie sesión en su sistema como un usuario normal."
 
-#: ../glom/main.cc:253
+#: ../glom/main.cc:261
 msgid "Running As Root"
 msgstr "Ejecutándose como superusuario"
 
 #. Show message to the user about the broken installation:
 #. This is a packaging bug, but it would probably annoy packagers to mention that in the dialog:
 #. Show message to the user about the broken installation:
-#: ../glom/main.cc:300 ../glom/main.cc:313 ../glom/main.cc:580
+#: ../glom/main.cc:308 ../glom/main.cc:321 ../glom/main.cc:554
 msgid "Incomplete Glom Installation"
 msgstr "La instalación de Glom está incompleta"
 
 #. use_markup
 #. modal
-#: ../glom/main.cc:301
+#: ../glom/main.cc:309
 msgid ""
 "Your installation of Glom is not complete, because PostgreSQL is not "
 "available on your system. PostgreSQL is needed for self-hosting of Glom "
@@ -2607,13 +2705,13 @@ msgstr ""
 "\n"
 "Ahora debe instalar PostgreSQL para completar la instalación de Glom."
 
-#: ../glom/main.cc:303
+#: ../glom/main.cc:311
 msgid "Install PostgreSQL"
 msgstr "Instalar PostreSQL"
 
 #. use_markup
 #. modal
-#: ../glom/main.cc:314
+#: ../glom/main.cc:322
 msgid ""
 "Your installation of Glom is not complete, because PostgreSQL is not "
 "available on your system. PostgreSQL is needed for self-hosting of Glom "
@@ -2630,7 +2728,7 @@ msgstr ""
 "para que pueda ser corregido."
 
 #. The python module could not be imported by Glom, so warn the user:
-#: ../glom/main.cc:330
+#: ../glom/main.cc:338
 msgid ""
 "Your installation of Glom is not complete, because the Glom Python module is "
 "not available on your system.\n"
@@ -2644,12 +2742,12 @@ msgstr ""
 "Informe de este error a su distribuidor o al administrador de su sistema "
 "para que pueda ser corregido."
 
-#: ../glom/main.cc:333
+#: ../glom/main.cc:341
 msgid "Glom Python Module Not Installed"
 msgstr "El módulo Glom de Python no está instalado"
 
 #. The python module could not be imported by Glom, so warn the user:
-#: ../glom/main.cc:350
+#: ../glom/main.cc:358
 msgid ""
 "Your installation of Glom is not complete, because the gda Python module is "
 "not available on your system.\n"
@@ -2663,30 +2761,30 @@ msgstr ""
 "Informe de este error a su distribuidor o al administrador de su sistema "
 "para que pueda ser corregido."
 
-#: ../glom/main.cc:353
+#: ../glom/main.cc:361
 msgid "gda Python Module Not Installed"
 msgstr "El módulo gda de Python no está instalado"
 
-#: ../glom/main.cc:497
+#: ../glom/main.cc:477
 msgid "Error while parsing command-line options: "
 msgstr "Error al analizar las opciones de la línea de comandos: "
 
-#: ../glom/main.cc:498
+#: ../glom/main.cc:478
 msgid "Use --help to see a list of available command-line options."
 msgstr ""
 "Use --help para ver una lista de las opciones disponibles para la línea de "
 "comandos."
 
-#: ../glom/main.cc:547
+#: ../glom/main.cc:520
 msgid "Glom: The file does not exist."
 msgstr "Glom: El archivo no existe."
 
-#: ../glom/main.cc:556
+#: ../glom/main.cc:530
 msgid "Glom: The file path is a directory instead of a file."
 msgstr "Glom: La ruta del archivo es un directorio en lugar de un archivo."
 
 #. The Postgres provider was not found, so warn the user:
-#: ../glom/main.cc:577
+#: ../glom/main.cc:551
 msgid ""
 "Your installation of Glom is not complete, because the PostgreSQL libgda "
 "provider is not available on your system. This provider is needed to access "
@@ -2703,14 +2801,14 @@ msgstr ""
 "para que pueda ser corregido."
 
 #. Note to translators: This text is shown instead of a table title, when the table has not yet been chosen.
-#: ../glom/mode_data/box_data_calendar_related.cc:97
+#: ../glom/mode_data/box_data_calendar_related.cc:98
 #: ../glom/mode_data/box_data_list_related.cc:96
-#: ../glom/mode_data/box_data_portal.cc:260
-#: ../glom/mode_data/box_data_portal.cc:274
+#: ../glom/mode_data/box_data_portal.cc:259
+#: ../glom/mode_data/box_data_portal.cc:273
 msgid "Undefined Table"
 msgstr "Tabla no definida"
 
-#: ../glom/mode_data/box_data.cc:139
+#: ../glom/mode_data/box_data.cc:149
 msgid ""
 "You have not entered any find criteria. Try entering information in the "
 "fields."
@@ -2718,12 +2816,12 @@ msgstr ""
 "No ha introducido un criterio de búsqueda. Pruebe introduciendo información "
 "en los campos."
 
-#: ../glom/mode_data/box_data.cc:144
+#: ../glom/mode_data/box_data.cc:154
 #: ../glom/mode_data/datawidget/dialog_choose_id.cc:115
 msgid "No Find Criteria"
 msgstr "No hay criterio de búsqueda"
 
-#: ../glom/mode_data/box_data.cc:183
+#: ../glom/mode_data/box_data.cc:193
 msgid ""
 "This data cannot be stored in the database because you have not provided a "
 "primary key.\n"
@@ -2733,7 +2831,7 @@ msgstr ""
 "proporcionado una clave primaria.\n"
 "¿Desea descartar estos datos?"
 
-#: ../glom/mode_data/box_data.cc:189
+#: ../glom/mode_data/box_data.cc:199
 msgid "No primary key value"
 msgstr "No hay un valor de clave primaria"
 
@@ -2761,11 +2859,11 @@ msgstr "Ver el siguiente registro de la lista."
 msgid "View the last record in the list."
 msgstr "Ver el último registro de la lista."
 
-#: ../glom/mode_data/box_data_details.cc:453
+#: ../glom/mode_data/box_data_details.cc:428
 msgid "Layout Contains No Fields"
 msgstr "El esquema no contiene ningún campo"
 
-#: ../glom/mode_data/box_data_details.cc:453
+#: ../glom/mode_data/box_data_details.cc:428
 msgid ""
 "There are no fields on the layout, so there is no way to enter data in a new "
 "record."
@@ -2774,20 +2872,20 @@ msgstr ""
 "datos en un nuevo registro."
 
 #. Tell user that a primary key is needed to delete a record:
-#: ../glom/mode_data/box_data_details.cc:481
+#: ../glom/mode_data/box_data_details.cc:456
 msgid "No primary key value."
 msgstr "No hay un valor para la clave primaria."
 
-#: ../glom/mode_data/box_data_details.cc:482
+#: ../glom/mode_data/box_data_details.cc:457
 msgid "This record cannot be deleted because there is no primary key."
 msgstr "Este registro no se puede eliminar porque no hay una clave primaria."
 
 #. Warn user that they can't choose their own primary key:
-#: ../glom/mode_data/box_data_details.cc:895
+#: ../glom/mode_data/box_data_details.cc:862
 msgid "Primary key auto increments"
 msgstr "La clave primaria es autoincrementable"
 
-#: ../glom/mode_data/box_data_details.cc:896
+#: ../glom/mode_data/box_data_details.cc:863
 msgid ""
 "The primary key is auto-incremented.\n"
 " You may not enter your own primary key value."
@@ -2796,7 +2894,7 @@ msgstr ""
 " No debería introducir su propio valor para la clave primaria."
 
 #. Add Pages:
-#: ../glom/mode_data/box_data_list.cc:537
+#: ../glom/mode_data/box_data_list.cc:527
 #: ../glom/mode_data/box_data_manyrecords.cc:83
 #: ../glom/mode_data/notebook_data.cc:40 ../glom/mode_find/notebook_find.cc:32
 msgid "List"
@@ -2804,30 +2902,30 @@ msgstr "Lista"
 
 #. On Maemo, we add the box to m_window_maemo_details instead:
 #. Details column:
-#: ../glom/mode_data/box_data_portal.cc:145
+#: ../glom/mode_data/box_data_portal.cc:144
 #: ../glom/mode_data/notebook_data.cc:44 ../glom/mode_data/notebook_data.cc:48
 #: ../glom/mode_design/report_layout/dialog_layout_report.cc:210
 #: ../glom/mode_find/notebook_find.cc:41
 msgid "Details"
 msgstr "Detalles"
 
-#: ../glom/mode_data/box_data_portal.cc:160
+#: ../glom/mode_data/box_data_portal.cc:159
 msgid "New Related %1"
 msgstr "Nuevo relacionado %1"
 
-#: ../glom/mode_data/box_data_portal.cc:202
+#: ../glom/mode_data/box_data_portal.cc:201
 msgid "Add Related %1"
 msgstr "Añadir relacionado %1"
 
-#: ../glom/mode_data/box_data_portal.cc:204
+#: ../glom/mode_data/box_data_portal.cc:203
 msgid "Add related record"
 msgstr "Añadir registro relacionado"
 
-#: ../glom/mode_data/box_data_portal.cc:559
+#: ../glom/mode_data/box_data_portal.cc:553
 msgid "No Corresponding Record Exists"
 msgstr "No existe un registro correspondiente"
 
-#: ../glom/mode_data/box_data_portal.cc:559
+#: ../glom/mode_data/box_data_portal.cc:553
 msgid ""
 "No record with this value exists. Therefore navigation to the related record "
 "is not possible."
@@ -2835,64 +2933,64 @@ msgstr ""
 "No existe ningún registro con ese valor. Por consiguiente la navegación "
 "hasta el registro relacionado no es posible."
 
-#: ../glom/mode_data/flowtablewithfields.cc:1166
-#: ../glom/mode_data/flowtablewithfields.cc:1423
-#: ../glom/mode_data/flowtablewithfields.cc:1450
+#: ../glom/mode_data/flowtablewithfields.cc:1242
+#: ../glom/mode_data/flowtablewithfields.cc:1499
+#: ../glom/mode_data/flowtablewithfields.cc:1526
 #: ../glom/utility_widgets/notebooklabelglom.cc:73
 #: ../glom/utility_widgets/notebooklabelglom.cc:113
 msgid "New Group"
 msgstr "Grupo nuevo"
 
-#: ../glom/mode_data/flowtablewithfields.cc:1172
+#: ../glom/mode_data/flowtablewithfields.cc:1248
 #: ../glom/mode_design/layout/dialog_layout_details.cc:721
 msgid "notebook"
 msgstr "cuaderno"
 
 #. Note to translators: This is the default name (not seen by most users) for a notebook tab.
-#: ../glom/mode_data/flowtablewithfields.cc:1178
+#: ../glom/mode_data/flowtablewithfields.cc:1254
 msgid "tab1"
 msgstr "tab1"
 
 #. Note to translators: This is the default label text for a notebook tab.
-#: ../glom/mode_data/flowtablewithfields.cc:1181
+#: ../glom/mode_data/flowtablewithfields.cc:1257
 msgid "Tab One"
 msgstr "Solapa uno"
 
-#: ../glom/mode_data/flowtablewithfields.cc:1194
+#: ../glom/mode_data/flowtablewithfields.cc:1270
 msgid "button"
 msgstr "botón"
 
-#: ../glom/mode_data/flowtablewithfields.cc:1195
-#: ../glom/mode_data/flowtablewithfields.cc:1464
+#: ../glom/mode_data/flowtablewithfields.cc:1271
+#: ../glom/mode_data/flowtablewithfields.cc:1540
 #: ../glom/mode_design/layout/dialog_layout_details.cc:645
 msgid "New Button"
 msgstr "Botón nuevo"
 
 #. Note to translators: This is the default contents of a text item on a print layout:
-#: ../glom/mode_data/flowtablewithfields.cc:1201
-#: ../glom/mode_data/flowtablewithfields.cc:1476
+#: ../glom/mode_data/flowtablewithfields.cc:1277
+#: ../glom/mode_data/flowtablewithfields.cc:1552
 #: ../glom/mode_design/print_layouts/window_print_layout_edit.cc:382
 msgid "text"
 msgstr "texto"
 
-#: ../glom/mode_data/flowtablewithfields.cc:1202
-#: ../glom/mode_data/flowtablewithfields.cc:1477
+#: ../glom/mode_data/flowtablewithfields.cc:1278
+#: ../glom/mode_data/flowtablewithfields.cc:1553
 msgid "New Text"
 msgstr "Texto nuevo"
 
 #. TODO: Avoid this error message, maybe by adding a group.
 #. TODO: At least avoid losing the dragged item.
-#: ../glom/mode_data/flowtablewithfields.cc:1561
+#: ../glom/mode_data/flowtablewithfields.cc:1637
 msgid "You cannot drop anything here. Try to add a group first"
 msgstr "No puede arrastrar nada aquí. Intente añadir primero un grupo."
 
 #. TODO: Use a real English sentence here?
-#: ../glom/mode_data/flowtablewithfields.cc:1611
+#: ../glom/mode_data/flowtablewithfields.cc:1687
 msgid "Delete whole group \"%1\"?"
 msgstr "¿Eliminar el grupo «%1» entero?"
 
 #. TODO: Use a real English sentence here:
-#: ../glom/mode_data/flowtablewithfields.cc:1617
+#: ../glom/mode_data/flowtablewithfields.cc:1693
 msgid "Delete whole group?"
 msgstr "¿Eliminar el grupo entero?"
 
@@ -2900,30 +2998,30 @@ msgstr "¿Eliminar el grupo entero?"
 msgid "List Or Details View"
 msgstr "Vista de lista o detalles"
 
-#: ../glom/mode_data/notebook_data.cc:252
+#: ../glom/mode_data/notebook_data.cc:246
 msgid "%1 Details"
 msgstr "%1 detalles"
 
 #. Don't allow a relationship to be added twice.
-#: ../glom/mode_design/box_db_table_relationships.cc:45
+#: ../glom/mode_design/box_db_table_relationships.cc:46
 msgid ""
 "This relationship already exists. Please choose a different relationship name"
 msgstr "Esta relación ya existe. Elija otro nombre para la relación"
 
 #. Translators: FROM as in SQL's FROM
-#: ../glom/mode_design/box_db_table_relationships.cc:50
+#: ../glom/mode_design/box_db_table_relationships.cc:51
 msgid "From Field"
 msgstr "Del campo"
 
-#: ../glom/mode_design/box_db_table_relationships.cc:52
+#: ../glom/mode_design/box_db_table_relationships.cc:53
 msgid "To Field"
 msgstr "Al campo"
 
-#: ../glom/mode_design/box_db_table_relationships.cc:54
+#: ../glom/mode_design/box_db_table_relationships.cc:55
 msgid "Automatic Creation"
 msgstr "Creación automática"
 
-#: ../glom/mode_design/box_db_table_relationships.cc:56
+#: ../glom/mode_design/box_db_table_relationships.cc:57
 #: ../glom/navigation/box_tables.cc:140
 msgid "Title (Singular Form)"
 msgstr "Título (forma singular)"
@@ -3101,12 +3199,12 @@ msgstr "Valor predeterminado"
 #. otherwise we get this warning:
 #. " unable to set property `text' of type `gchararray' from value of type `glibmm__CustomPointer_Pc' "
 #. TODO: Add a template specialization to Glib::ObjectBase::set_property() to allow this?
-#: ../glom/mode_design/layout/combobox_fields.cc:215
+#: ../glom/mode_design/layout/combobox_fields.cc:214
 msgid "(None)"
 msgstr "(Ninguno)"
 
-#: ../glom/mode_design/layout/combobox_relationship.cc:268
-#: ../glom/mode_design/layout/combobox_relationship.cc:272
+#: ../glom/mode_design/layout/combobox_relationship.cc:267
+#: ../glom/mode_design/layout/combobox_relationship.cc:271
 msgid " Via: "
 msgstr " Vía: "
 
@@ -3208,30 +3306,30 @@ msgstr ""
 "relacionados."
 
 #. Translators: This is Automatic text alignment.
-#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:94
+#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:98
 msgid "Automatic"
 msgstr "Automático"
 
 #. Translators: This is Left text alignment.
-#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:98
+#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:102
 msgid "Left"
 msgstr "Izquierda"
 
 #. Translators: This is Right text alignment.
-#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:102
+#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:106
 msgid "Right"
 msgstr "Derecha"
 
 #. Add labels (because we will hide the checkboxes):
-#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:147
+#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:152
 msgid "Font"
 msgstr "Tipografía"
 
-#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:150
+#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:155
 msgid "Foreground Color"
 msgstr "Color de primer plano"
 
-#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:153
+#: ../glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:158
 msgid "Background Color"
 msgstr "Color de fondo"
 
@@ -3262,75 +3360,75 @@ msgid "<b>Rename Print Layout</b>"
 msgstr "<b>Renombrar la distribución de impresión</b>"
 
 #: ../glom/mode_design/print_layouts/box_print_layouts.cc:223
-#: ../glom/navigation/box_tables.cc:382
+#: ../glom/navigation/box_tables.cc:376
 msgid "Rename"
 msgstr "Renombrar"
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:33
-#: ../glom/utility_widgets/layouttoolbar.cc:51
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:31
+#: ../glom/utility_widgets/layouttoolbar.cc:50
 msgid "Items"
 msgstr "Elementos"
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:34
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:32
 msgid "Lines"
 msgstr "Líneas"
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:35
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:33
 msgid "Records"
 msgstr "Registros"
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:37
-#: ../glom/utility_widgets/layouttoolbar.cc:58
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:35
+#: ../glom/utility_widgets/layouttoolbar.cc:57
 msgid "Database Field"
 msgstr "Base de datos"
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:37
-#: ../glom/utility_widgets/layouttoolbar.cc:58
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:35
+#: ../glom/utility_widgets/layouttoolbar.cc:57
 msgid "Drag this to the layout to add a new database field."
 msgstr ""
 "Arrastre esto a la distribución para añadir un campo de base de datos nuevo."
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:39
-#: ../glom/utility_widgets/layouttoolbar.cc:64
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:37
+#: ../glom/utility_widgets/layouttoolbar.cc:63
 msgid "Drag this to the layout to add a new static text box."
 msgstr ""
 "Arrastre esto a la distribución para añadir una nueva caja de texto estática."
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:41
-#: ../glom/utility_widgets/layouttoolbar.cc:66
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:39
+#: ../glom/utility_widgets/layouttoolbar.cc:65
 msgid "Drag this to the layout to add a new static image."
 msgstr "Arrastre esto a la distribución para añadir una imagen estática nueva."
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:43
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:41
 msgid "Horizontal Line"
 msgstr "Línea horizontal"
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:43
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:41
 msgid "Drag this to the layout to add a new horizontal line."
 msgstr ""
 "Arrastre esto a la distribución para añadir una línea horizontal nueva."
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:45
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:43
 msgid "Vertical Line"
 msgstr "Línea vertical"
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:45
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:43
 msgid "Drag this to the layout to add a new vertical line."
 msgstr "Arrastre esto a la distribución para añadir una línea vertical nueva."
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:47
-#: ../glom/utility_widgets/layouttoolbar.cc:60
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:45
+#: ../glom/utility_widgets/layouttoolbar.cc:59
 msgid "Related Records"
 msgstr "Registros relacionados"
 
-#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:47
+#: ../glom/mode_design/print_layouts/print_layout_toolbar.cc:45
 msgid "Drag this to the layout to add a new related records portal."
 msgstr ""
 "Arrastre esto a la distribución para añadir un nuevo portal de registros "
 "relacionados."
 
 #: ../glom/mode_design/print_layouts/window_print_layout_edit.cc:126
-#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:58
+#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:59
 msgid "Page _Setup"
 msgstr "_Configuración de la página"
 
@@ -3363,7 +3461,7 @@ msgid "Insert _Vertical Line"
 msgstr "Insertar línea _vertical"
 
 #: ../glom/mode_design/print_layouts/window_print_layout_edit.cc:149
-#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:63
+#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:64
 msgid "_View"
 msgstr "_Ver"
 
@@ -3395,15 +3493,15 @@ msgstr "Ampliación 25%"
 msgid "Insert"
 msgstr "Insertar"
 
-#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:64
+#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:65
 msgid "Show _Grid"
 msgstr "Mostrar r_ejilla"
 
-#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:491
+#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:481
 msgid "Edit _Fields"
 msgstr "Editar los _campos"
 
-#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:494
+#: ../glom/mode_design/relationships_overview/dialog_relationships_overview.cc:484
 msgid "Edit _Relationships"
 msgstr "Editar las _relaciones"
 
@@ -3450,24 +3548,24 @@ msgid "Full access."
 msgstr "Acceso completo."
 
 #. Append the View columns:
-#: ../glom/mode_design/users/dialog_users_list.cc:67
+#: ../glom/mode_design/users/dialog_users_list.cc:68
 msgctxt "Users List"
 msgid "User"
 msgstr "Usuario"
 
-#: ../glom/mode_design/users/dialog_users_list.cc:162
+#: ../glom/mode_design/users/dialog_users_list.cc:163
 msgid "Delete User"
 msgstr "Eliminar usuario"
 
-#: ../glom/mode_design/users/dialog_users_list.cc:163
+#: ../glom/mode_design/users/dialog_users_list.cc:164
 msgid "Are your sure that you wish to delete this user?"
 msgstr "¿Está seguro de querer eliminar este usuario?"
 
-#: ../glom/mode_design/users/dialog_users_list.cc:398
+#: ../glom/mode_design/users/dialog_users_list.cc:399
 msgid "Developer group may not be empty."
 msgstr "El grupo de desarrollo no debe estar vacío."
 
-#: ../glom/mode_design/users/dialog_users_list.cc:399
+#: ../glom/mode_design/users/dialog_users_list.cc:400
 msgid "The developer group must contain at least one user."
 msgstr "El grupo de desarrollo debe tener al menos un usuario."
 
@@ -3486,11 +3584,11 @@ msgid "Default"
 msgstr "Predeterminado"
 
 #. Ask the user if they want us to try to cope with this:
-#: ../glom/navigation/box_tables.cc:239
+#: ../glom/navigation/box_tables.cc:233
 msgid "Table Already Exists"
 msgstr "La tabla ya existe"
 
-#: ../glom/navigation/box_tables.cc:240
+#: ../glom/navigation/box_tables.cc:234
 msgid ""
 "This table already exists on the database server, though it is not mentioned "
 "in the .glom file. This should not happen. Would you like Glom to attempt to "
@@ -3501,7 +3599,7 @@ msgstr ""
 "la tabla existente?"
 
 #. TODO: Do not show tables that are not in the document.
-#: ../glom/navigation/box_tables.cc:300
+#: ../glom/navigation/box_tables.cc:294
 msgid ""
 "You cannot delete this table, because there is no information about this "
 "table in the document."
@@ -3510,7 +3608,7 @@ msgstr ""
 "documento."
 
 #. Ask the user to confirm:
-#: ../glom/navigation/box_tables.cc:307
+#: ../glom/navigation/box_tables.cc:301
 msgid ""
 "Are you sure that you want to delete this table?\n"
 "Table name: "
@@ -3518,24 +3616,24 @@ msgstr ""
 "¿Está seguro de querer eliminar esta tabla?\n"
 "Nombre de la tabla: "
 
-#: ../glom/navigation/box_tables.cc:308
+#: ../glom/navigation/box_tables.cc:302
 msgid "Delete Table"
 msgstr "Eliminar una tabla"
 
-#: ../glom/navigation/box_tables.cc:379
+#: ../glom/navigation/box_tables.cc:373
 msgid "Are you sure that you want to rename this table?"
 msgstr "¿Está seguro de querer renombrar esta tabla?"
 
 #. TODO: Show old and new names?
-#: ../glom/navigation/box_tables.cc:380
+#: ../glom/navigation/box_tables.cc:374
 msgid "<b>Rename Table</b>"
 msgstr "<b>Renombrar la tabla</b>"
 
-#: ../glom/navigation/box_tables.cc:422
+#: ../glom/navigation/box_tables.cc:416
 msgid "Unknown Table"
 msgstr "Tabla desconocida"
 
-#: ../glom/navigation/box_tables.cc:423
+#: ../glom/navigation/box_tables.cc:417
 msgid ""
 "You cannot open this table, because there is no information about this table "
 "in the document."
@@ -3543,12 +3641,12 @@ msgstr ""
 "No puede abrir esta tabla porque no hay información sobre ella en el "
 "documento."
 
-#: ../glom/print_layout/canvas_layout_item.cc:303
+#: ../glom/print_layout/canvas_layout_item.cc:269
 #: ../glom/utility_widgets/layoutwidgetmenu.cc:38
 msgid "Choose Field"
 msgstr "Elegir campo"
 
-#: ../glom/print_layout/canvas_print_layout.cc:257
+#: ../glom/print_layout/canvas_print_layout.cc:244
 msgid "_Formatting"
 msgstr "_Formato"
 
@@ -3576,12 +3674,12 @@ msgstr "Error de gettext: "
 
 #. Show the file-chooser dialog, to select an output .po file:
 #: ../glom/mode_design/translation/window_translations.cc:497
-#: ../glom/mode_design/translation/window_translations.cc:575
+#: ../glom/mode_design/translation/window_translations.cc:576
 msgid "Choose .po File Name"
 msgstr "Elija el nombre de archivo .po"
 
-#: ../glom/mode_design/translation/window_translations.cc:502
-#: ../glom/mode_design/translation/window_translations.cc:579
+#: ../glom/mode_design/translation/window_translations.cc:503
+#: ../glom/mode_design/translation/window_translations.cc:581
 msgid "Po files"
 msgstr "Archivos po"
 
@@ -3593,32 +3691,32 @@ msgstr "Este elemento ya existe. Inténtelo de nuevo."
 msgid "Duplicate"
 msgstr "Duplicar"
 
-#: ../glom/mode_data/datawidget/comboentry.cc:189
+#: ../glom/mode_data/datawidget/comboentry.cc:173
 msgid "Read-only field."
 msgstr "Campo de sólo lectura."
 
-#: ../glom/mode_data/datawidget/comboentry.cc:189
+#: ../glom/mode_data/datawidget/comboentry.cc:173
 msgid "This field may not be edited here."
 msgstr "Este campo no debe editarse aquí."
 
-#: ../glom/mode_data/datawidget/datawidget.cc:245
-#: ../glom/mode_data/datawidget/datawidget.cc:247
+#: ../glom/mode_data/datawidget/datawidget.cc:225
+#: ../glom/mode_data/datawidget/datawidget.cc:227
 msgid "..."
 msgstr "â?¦"
 
-#: ../glom/mode_data/datawidget/datawidget.cc:249
+#: ../glom/mode_data/datawidget/datawidget.cc:229
 msgid "Choose a date from an on-screen calendar."
 msgstr "Elegir una fecha desde un calendario en pantalla."
 
-#: ../glom/mode_data/datawidget/datawidget.cc:261
+#: ../glom/mode_data/datawidget/datawidget.cc:241
 msgid "Open"
 msgstr "Abrir"
 
-#: ../glom/mode_data/datawidget/datawidget.cc:263
+#: ../glom/mode_data/datawidget/datawidget.cc:243
 msgid "Open the record identified by this ID, in the other table."
 msgstr "Abrir el registro identificado por este ID en la otra tabla."
 
-#: ../glom/mode_data/datawidget/datawidget.cc:278
+#: ../glom/mode_data/datawidget/datawidget.cc:258
 msgid ""
 "Enter search criteria to identify records in the other table, to choose an "
 "ID for this field."
@@ -3626,27 +3724,27 @@ msgstr ""
 "Introduzca un criterio de búsqueda para identificar registros en la otra "
 "tabla, para elegir un ID para este campo."
 
-#: ../glom/utility_widgets/db_adddel/db_adddel.cc:107
+#: ../glom/utility_widgets/db_adddel/db_adddel.cc:105
 msgid "Table Content"
 msgstr "Contenido de la tabla"
 
 #. Translators: This is just some example text used to discover an appropriate height for user-entered text in the UI. This text itself is never shown to the user.
-#: ../glom/utility_widgets/db_adddel/db_adddel.cc:684
+#: ../glom/utility_widgets/db_adddel/db_adddel.cc:671
 msgid "Example"
 msgstr "Ejemplo"
 
-#: ../glom/utility_widgets/db_adddel/db_adddel.cc:2406
+#: ../glom/utility_widgets/db_adddel/db_adddel.cc:2379
 msgid "Right-click to layout, to specify the related fields."
 msgstr ""
 "Pulse con el botón derecho en la disposición, para especificar los campos "
 "relacionados."
 
 #. Tell user that they can't do that:
-#: ../glom/utility_widgets/db_adddel/db_adddel.cc:2635
+#: ../glom/utility_widgets/db_adddel/db_adddel.cc:2599
 msgid "Extra Related Records Not Possible"
 msgstr "No son posibles adicionales registros relacionados"
 
-#: ../glom/utility_widgets/db_adddel/db_adddel.cc:2636
+#: ../glom/utility_widgets/db_adddel/db_adddel.cc:2600
 msgid ""
 "You attempted to add a new related record, but there can only be one related "
 "record, because the relationship uses a unique key."
@@ -3654,16 +3752,15 @@ msgstr ""
 "Está intentando introducir un nuevo registro relacionado, pero sólo puede "
 "haber uno porque la relación usa una clave única."
 
-#: ../glom/utility_widgets/dialog_image_progress.cc:138
-#: ../glom/utility_widgets/dialog_image_progress.cc:159
+#: ../glom/utility_widgets/dialog_image_progress.cc:117
 msgid "Not enough memory available to load the image"
 msgstr "No hay suficiente memoria disponible para cargar la imagen"
 
-#: ../glom/utility_widgets/dialog_image_progress.cc:232
+#: ../glom/utility_widgets/dialog_image_progress.cc:165
 msgid "Error loading %1"
 msgstr "Error cargando %1"
 
-#: ../glom/utility_widgets/dialog_image_progress.cc:233
+#: ../glom/utility_widgets/dialog_image_progress.cc:166
 msgid "Error loading image"
 msgstr "Error al cargar la imagen"
 
@@ -3737,37 +3834,37 @@ msgstr ""
 "especificarlo en el siguiente paso."
 
 #. TODO: Use Hildon::FileChooser for Maemo.
-#: ../glom/utility_widgets/imageglom.cc:342
+#: ../glom/utility_widgets/imageglom.cc:319
 msgid "Choose Image"
 msgstr "Elegir imagen"
 
-#: ../glom/utility_widgets/imageglom.cc:346
+#: ../glom/utility_widgets/imageglom.cc:323
 msgid "Images"
 msgstr "Imágenes"
 
-#: ../glom/utility_widgets/imageglom.cc:486
+#: ../glom/utility_widgets/imageglom.cc:463
 msgid "Choose File"
 msgstr "Elegir archivo"
 
-#: ../glom/utility_widgets/layouttoolbar.cc:52
+#: ../glom/utility_widgets/layouttoolbar.cc:51
 msgid "Containers"
 msgstr "Contenedores"
 
-#: ../glom/utility_widgets/layouttoolbar.cc:54
+#: ../glom/utility_widgets/layouttoolbar.cc:53
 msgid "Drag this to the layout to add a new group."
 msgstr "Arrastre esto a la distribución para añadir un grupo nuevo."
 
-#: ../glom/utility_widgets/layouttoolbar.cc:56
+#: ../glom/utility_widgets/layouttoolbar.cc:55
 msgid "Drag this to the layout to add a new notebook."
 msgstr ""
 "Arrastre esto a la distribución para añadir un cuaderno de notas nuevo."
 
-#: ../glom/utility_widgets/layouttoolbar.cc:60
+#: ../glom/utility_widgets/layouttoolbar.cc:59
 msgid "Drag this to the layout to add a new Related Record."
 msgstr ""
 "Arrastre esto a la distribución para añadir un nuevo registro relacionado."
 
-#: ../glom/utility_widgets/layouttoolbar.cc:62
+#: ../glom/utility_widgets/layouttoolbar.cc:61
 msgid "Drag this to the layout to add a new button."
 msgstr "Arrastre esto a la distribución para añadir un botón nuevo."
 
@@ -3791,11 +3888,11 @@ msgstr "¿Eliminar el cuaderno de notas «%1» entero?"
 msgid "Delete whole notebook?"
 msgstr "¿Eliminar el cuaderno de notas entero?"
 
-#: ../glom/xsl_utils.cc:141
+#: ../glom/xsl_utils.cc:120
 msgid "Report Finished"
 msgstr "Informe finalizado"
 
-#: ../glom/xsl_utils.cc:141
+#: ../glom/xsl_utils.cc:120
 msgid "The report will now be opened in your web browser."
 msgstr "El informe se abrirá ahora en su navegador web."
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]