1.14.4: 2010-07-22 Murray Cumming Added --restore command-line option. * glom/application.[h|cc]: Added init() with a bool restore option, calling do_backup_restore() if appropriate. * glom/main.cc: Added a --restore command and pass the bool result to Application::init(). This allows the user to restore from a backup without first loading an existing file, though this is so far only possible via the terminal. 2010-07-22 Murray Cumming Added Developer/Restore Backup menu item. * glom/application.[h.cc]: Added a Developer/Restore Backup menu item, which lets the user choose a .tar.gz, untars it in /tmp/ and opens it. * tests/test_selfhosting_new_empty.cc: * glom/libglom/utils.[h|cc]: Move delete_directory() to Utils. Added get_directory_child_with_suffix(), used to find the .glom file inside an untarred directory. 2010-07-22 Murray Cumming Saving from a backup: Now works. * glom/application.[h|cc]: on_document_load(): Simplify the code to create from a backup, modifying the from-example code to handle it too, calling a new recreate_database_from_backup() method. That now creates the database and then adds the groups before trying to restore from the backup file. * glom/libglom/connectionpool_backends/backend.h: convert_backup(): * glom/libglom/connectionpool_backends/postgres.[h|cc]: convert_backup(): * glom/libglom/connectionpool_backends/sqlite.[h|cc]: convert_backup(): Add a database_name_parameter. This now expects the database to exist already, though it should be empty. It should also already have the expected groups. * glom/libglom/connectionpool.[h|cc]: convert_backup(): Supply the database name. Also update the meta data so we know about the new tables. 2010-07-21 Murray Cumming Small Business example: Add table privileges. * examples/example_smallbusiness.glom: Give some privileges to the accounts and personnel groups and resave-as-an-example. These were probably lost some time. 2010-07-21 Murray Cumming > Saving as example: Fix this. * glom/libglom/document/document.cc: set_modified(): Actually use m_allow_auto_save so we don't just save every time, overwriting previous saves. For instance, the examples were saved with is_example=false after the document was changed back. 2010-07-21 Murray Cumming > Saving from examples: Set the table privileges mentioned in the document. * glom/base_db.[h|cc]: Added set_table_privileges_groups_from_document(). * glom/application.cc: recreate_database_from_example(): call it. 2010-07-21 Murray Cumming Saving from examples: Create the groups mentioned in the document. * glom/base_db.[h|cc]: Added add_groups_from_document(). * glom/application.cc: recreate_database_from_example(): call it. 2010-07-20 Murray Cumming > Fixed warnings with latest gtkmm-2.24 * glom/mode_data/notebook_data.cc: * glom/mode_find/notebook_find.cc: Use Gtk::Notebook::append_page() instead of Gtk::Notebook::pages().push_back(). 2010-07-13 Murray Cumming Fixed warnings, even with the latest gtkmm-2.24. Many files: Try to include box.h or dialog.h before other treemodel.h. Sometimes just add a gtkmm.h to simplify things. This will not be necessary with gtkmm-3.0 (in glom's master branch). 2010-07-07 Murray Cumming PostgresQL backups: Suggest a dated name. * glom/application.cc: on_menu_developer_export_backup(): Suggest a directory name based on the current name and the date/time. Also use the directory name for the .glom filename, as we usually would do, instead of calling it just backup.glom. 2010-07-07 Murray Cumming PostgreSQL backups: Archive the directory in a .tar.gz.. * configure.ac: Check for the tar and gzip executables. * glom/application.cc: on_menu_developer_export_backup(): Use tar via the command line, to put it all in a .tar.gz, so it is self-contained. 2010-07-07 Murray Cumming PostgreSQL backups: Use .pgpass. * glom/libglom/connectionpool_backends/postgres.[h|cc]: * glom/libglom/connectionpool_backends/postgres_self.[h|cc]: Move create_text_file() from PostgresSelf to Postgres and add an only_for_current_user bool parameter, so we can use it in a new save_password_to_pgpass() method. save_backup(), convert_backup(): Temporarily store the password in ~/.pgpass, so pg_dump and pg_restore actually work. 2010-07-05 Murray Cumming Show progress in the UI during backup saving and restoring. * glom/application.[h|cc]: on_document_load(), on_menu_developer_export_backup(): Show a pulsing progress dialog while waiting for backup exporting and restoring. on_menu_developer_export_backup(): Close the file chooser dialog as soon as we stop using it. 2010-07-03 Murray Cumming Improve backup saving and add backup restoring. * glom/libglom/document/document.[h|cc]: Added get/set_is_backup_file(), saved in the XML document.. on_menu_developer_export_backup(): Mark the .glom file as a backup file. Rename recreate_database() to recreate_database_from_example(). on_document_load(): Handle backup .glom files similarly to examples files, but using the backup file instead of example data. * glom/frame_glom.cc: * glom/libglom/connection_pool.[h|cc]: * glom/libglom/connectionpool_backends/backend.[h|cc]: startup(): Return a StartupErrors enum, to provide more clues, for instance to say that backup data was found. Add get/set_database_directory_uri(), replacing the one in sqlite.[h|cc] and replacing set_self_hosting_data_uri() in postgres_self.[hc|cc]. save_backup(): Don't take a filepath - use get_database_directory_uri() instead. Added convert_backup() to restore from a backup. * glom/libglom/connectionpool_backends/sqlite.[h|cc]: * glom/libglom/connectionpool_backends/postgres.[h|cc]: get_path_to_postgres_executable(): Catch exceptions from Glib::build_filename(). save_backup(): Use --format=c with pg_dump, because the default one can't be used with pg_restore. Implement convert_backup(), using pg_restore. Added get_self_hosting_config_path(), get_self_hosting_data_path() and get_self_hosting_backup_path() to avoid copy/pasting magic paths. * glom/libglom/connectionpool_backends/postgres_self.[h|cc]: Adapted. * glom/application.[h|cc]: * tests/test_selfhosting_new_empty.cc: Adapted to check the enum result from startup(). 2010-07-02 Murray Cumming Document: Avoid a crash when creating the parent directory. * glom/libglom/docment/bakery/document.cc: write_to_disk(): Check the result of Gio::File::get_parent() for null, because that happens if we provide a path instead of a URI. 2010-07-02 Murray Cumming Save as Example: Reset the old file URI and allow auto-saving again. * glom/application.cc: on_menu_file_save_as_example(): reset the old file URI and turn auto-saving back on again, because it makes no sense to leave the user editing an example document. This is really an export anyway. This allows the user to close the window again after saving as an example. 2010-07-01 Murray Cumming Add Save Backup menu item. * glom/libglom/connectionpool_backends/backend.[h|cc]: * glom/libglom/connectionpool_backends/posgres.[h|cc]: * glom/libglom/connectionpool_backends/sqlite.[h|cc]: Added save_backup() virtual method, using pg_dump for PostgreSQL. * glom/libglom/connectionpool.[h|cc]: Add save_backup() here, calling the backend. * glom/application.cc: Add a Developer/Export Backup menu item, to use this feature. This also saves the .glom file. 2010-07-01 Murray Cumming Spawn functions: Catch some exceptions. * glom/libglom/spawn_with_feedback.cc(): execute_command_line(), execute_command_line_and_wait(): Catch exceptions so that these functions don't throw, simplifying caller code. For instance, a command may be malformed and rejected by the shell. 2010-06-29 Murray Cumming * glom/application.[h|cc]: Developer menu: Added an Export Backup menu item. * glom/libglom/connectionpool_backends/postgres_central.[h|cc]: * glom/libglom/connectionpool_backends/postgres_self.[h|cc]: Moved m_host and m_port into the base class: * glom/libglom/connectionpool_backends/postgres.[h|cc]: because they are used in both derived classes. Therefore remove port parameter from attempt_connect(). Also move get_path_to_postgres_executable() and port_as_string() there so they can be used in the base class. 2010-06-29 Murray Cumming Improve stderr message. * glom/libglom/spawn_with_feedback.cc: execute_command_line_and_wait_until_second_command_returns_success(): Correct the error message when a command (such as postgres) fails. As noticed in bug #617504. 2010-06-21 David King Explicitly link with libdl for Python module loading test * Makefile_tests.am: Do not rely on libdl being a dependency of a library in LIBGLOM_LIBS, by linking with it explicitly.