2009-02-24 Murray Cumming * glom/utility_widgets/flowtable.cc: on_size_allocate(): Change an accidental += to the = that it should be, to stop columns getting increasingly large amounts of extra width when there are >2 columns. Bug #539369 (maximiliano) 2009-02-24 Armin Burgmeier * glom/libglom/connectionpool_backends/postgres_central.cc (set_host): Only reset m_port to zero if m_try_other_ports is true. Otherwise, a specific port has already been set by the user. (connect): Compare m_port to 0, not port, which is a Glib::ustring. This fixes a warning about g_utf8_collate's argument being NULL, and fixes connection to a remote postgres server advertized via networked glom. Bug #572982 2009-02-24 Armin Burgmeier * glom/libglom/connectionpool_backends/backend.h: * glom/libglom/connectionpool_backends/backend.cc: Moved the ConnectionPool backend base class into a new file in the connectionpool_backends subdirectory. * glom/libglom/connectionpool_backends/Makefile.am: Add it to the build. * glom/libglom/connectionpool_backends/postgres.h: * glom/libglom/connectionpool_backends/sqlite.h: * glom/libglom/connectionpool_backends/sqlite.cc: * glom/libglom/connectionpool.h: * glom/libglom/connectionpool.cc: * glom/libglom/test_connectionpool.cc: * glom/dialog_connection.cc: * glom/frame_glom.cc: Adapt. 2009-02-24 Armin Burgmeier * glom/libglom/connectionpool.h: * glom/libglom/connectionpool.cc: Added a get_string_find_operator() virtual method to ConnectionPoolBackend, and a similar method to ConnectionPool which simply queries its backend. * glom/libglom/connectionpool_backends/sqlite.h: * glom/libglom/connectionpool_backends/postgres.h: Implement the new virtual method appropriately. * glom/libglom/data_structure/field.cc (sql_find_operator): Use the get_string_find_operator() method of the connectionpool backend in case the field's type is TYPE_TEXT. This fixes Find Mode with SQLite. Bug #570401. I wonder whether libgda can generate a case-insensitive string comparison, which would make this easier for us. 2009-02-24 Armin Burgmeier * configure.in: Added an --enable-sqlite configure option, which is enabled by default. * glom/libglom/connectionpool_backends/sqlite.h: #error if this file is included with SQLite support disabled. Mostly meant as a debugging aid. * glom/libglom/connectionpool_backends/Makefile.am: Don't build sqlite.cc in case SQLite support is disabled. * glom/libglom/document/document_glom.h: * glom/libglom/document/document_glom.cc: Don't declare SQLITE_HOSTED hosting mode if SQLite support is disabled, and refuse to open files with unknown hosting mode instead of falling back to postgres central. * glom/utility_widgets/filechooserdialog_saveextras.h: * glom/utility_widgets/filechooserdialog_saveextras.cc: Don't show the option to create a SQLite hosted file in the GUI if SQLite support is disabled. * glom/utility_widgets/db_adddel/glom_db_treemodel.cc: Removed a superfluous include. * glom/frame_glom.cc: * glom/application.cc: #ifdef-out code to create a SQLite connectionpool backend if SQLite support is disabled, as well as a few related checks. 2009-02-24 Armin Burgmeier * glom/libglom/connectionpool_backends/sqlite.cc: Keep non-NULL constraint of columns when recreating table. 2009-02-23 David King * glom/frame_glom.cc: on_menu_file_import(): Add CSV mime-type filter to import dialog. Bug #572702 2009-02-23 Armin Burgmeier * glom/utility_widgets/db_adddel/db_adddel.cc (construct_specified_columns): Clear m_refListStore if in case no column types are set. This allows dropping the reference to the GDA DataModel by setting an empty table name on the AddDel. * glom/frame_glom.h: * glom/frame_glom.cc: Added show_table_allow_empty() which allows the table name to be empty, in which case no table is shown, and show_no_table() as a shortcut for this case. Show an empty table before opening the fields editing dialog, so that no references to the database are used anymore. SQLite requires this to be able to drop the old table when changing fields. Bug #572847 2009-02-22 Murray Cumming * glom/glom.glade, glom_developer.glade: * glom/base_db.cc: offer_notebook(): Move the dialog_notebook window into glom_developer.glade because it is only used in developer mode. 2009-02-22 Murray Cumming * Various minor fixes to avoid minor compiler warnings. 2009-02-22 Murray Cumming * glom/libglom/data_structure/glomconversions.cc: get_text_for_gda_value(): Avoid a warning about no return value. 2009-02-22 Armin Burgmeier * glom/mode_data/flowtablewithfields.cc (add_field_at_position): Don't leak the Gtk::EventBox. 2009-02-21 Murray Cumming * glom/glom_developer.glade: Resaved with glade-3. Recent versions of glade-3 are much better at converting from glade-2. I just had to hand-add the GtkSourceView widgets back. Bug #567470 2009-02-20 Murray Cumming * glom/application.cc: * glom/base_db.[h|cc]: * glom/dialog_connection.cc: * glom/frame_glom.cc: * glom/libglom/connectionpool.[h|cc]: * glom/libglom/connectionpool_backends/postgres_central.cc * glom/navigation/box_tables.[h|cc]: Added ifdefs to fix the build with --enable-client-only. 2009-02-20 Murray Cumming * glom/glom_privs[h|cc]: get_current_privs(): Cache the priviliges for each table for 30 seconds, to avoid unnecessary repetitive groups queries to the database. This seems to avoid about 5 out of 6 requests, so it should be faster. Bug #567473 2009-02-20 Murray Cumming * configure.in: * glom/libglom/connectionpool_backends/postgres_self.cc: Use the postgres executable name instead of the deprecated postmaster executable. Everything probably has that now. Bug # 525108 2009-02-20 Murray Cumming * glom/utlity_widgets/datawidget.cc: Constructor: Show the Open button, (but not Find) for related fields that are primary keys, so we can navigate to that record. * glom/mode_data/box_data_details.cc: on_flowtable_field_open_details_requested(): Navigate to the appropriate record in the appropriate table for this type of Open button. Bug #571975 * glom/base_db.cc: fill_full_field_details(): Avoid crashes. 2009-02-20 Murray Cumming * glom/libglom/document/document_glom.[h|cc]: get_field_used_in_relationship_to_one(): Make this take a LayoutItem_Field instead of just a field name. * glom/utlity_widgets/datawidget.cc: Constructor: adapt, so we add Open and Find buttons for related fields too when appropriate. * glom/base_db.cc: Adapt to API change. 2009-02-18 Murray Cumming * glom/libglom/data_structure/field.cc: from_file_format(): Adjusted for a libgda API change in gda_string_to_binary(). 2009-02-18 Armin Burgmeier * glom/libglom/data_structure/field.cc (set_glom_type): Reset the default value if the Glom type is changed. The old default value probably doesn't make sense for the new type. This fixes a warning when changing a field's type from text to numerical. (set_default_value): Verify that the new default value is compatible with the field's glom type. (set_field_info): Verify that the default value of the new field info is compatible with the field's glom type. * glom/mode_design/fields/box_db_table_definition.cc (get_field_definition): When changing the field info's GType, make sure its default value matches the new GType, or reset it if not. * glom/libglom/document/document_glom.cc (load_after): Set a field's default value after having set the glom type, so that the checks introduced above don't fail. 2009-02-18 Murray Cumming * glom/libglom/data_structure/field.[h|cc]: sql(value, format): Replace this with sql(value, connection). Use Gda::DataHolder::get_sql_from_value(), using the connection to get the DataHolder. Remove the nasty Postgres escaping code, which is now unnecessary. There is now no code in Glom to do escaping or unescaping - we use libgda functions instead. sql(value): Use the active connection. * glom/libglom/connectionpool_backends/postgres.cc: change_columns(): * glom/libglom/connectionpool_backends/sqlite.cc: recreate_table(): Adapted, though these can probably just call sql(value), using the active connection. * glom/base_db.[h|cc]: get_connection(): Make this static because it can be. 2009-02-17 Murray Cumming * glom/libglom/data_structure/field.[h|cc]: Added static versions of from_file_format() and to_file_format(), taking the field type, for use in document, though we can probably avoid that. * glom/libglom/data_structure/glomconversions.[h|cc]: * glom/libglom/document/document_glom.[h|cc]: Remove support for the deprecated one-big-string example_rows format. Store the example rows as a vector of vector of Values, instead of strings. This avoids extra string parsing, unescaping, etc. * glom/glom_document.dtd: Documented the change. * glom/frame_glom.[h|cc]: Added export_data_to_vector(). * glom/application.cc: on_menu_file_save_as_example(): Use the vector instead of a string. * glom/base_db.cc: insert_example_data(): Handle the vector instead of doing nasty string parsing. * examples/example_*.glom: Resaved in the new format. 2009-02-16 Murray Cumming * glom/libglom/data_structure/glomconversions.cc: get_text_for_gda_value(), parse_value(): Use std::setprecision() to avoid showing the awkward scientific e notation, raising the limit from 7 digits to 15. We don't know how to avoid it always. Noticed by Arq. Maximiliano Meilán. 2009-02-16 Armin Burgmeier * glom/libglom/connectionpool_backends/sqlite.cc: Fixed various problems with field type changes. Before, often some or all of the records have been erased after certain changes (only from the view, not from the database). 2009-02-10 Murray Cumming * glom/libglom/data_structure/field.[h|cc]: Renamed from_sql() to from_file_format(), without the sql_format parameter, to make it clearer. Added to_file_format(), which currently just calls sql() with the postgres format. * glom/data_structure/glomconversions.cc: Removed unused unescape_binary_data_sqlite(). * glom/base_db.cc: insert_example_data(): * glom/dialog_import_csv.cc: field_data_func(): * glom/dialog_import_csv_progress.cc: on_idle_import(): Adapt. * glom/frame_glom.cc: export_data_to_string(): Use to_file_format() instead of sql() to make it clearer.