1. 02 Feb, 2012 11 commits
  2. 01 Feb, 2012 10 commits
    • Murray Cumming's avatar
      Allow user and group names to have spaces and other special characters. · ce417b97
      Murray Cumming authored
      * glom/libglom/privs.cc: get_table_privileges(): Instead of parsing the
      relacl.pg_class field, use the PostgreSQL has_table_privilege()
      function, though it needs some strange quoting (see comments).
      This code is much simpler now.
      * tests/test_selfhosting_new_empty_then_users.cc: Add various other
      table, group, and user names, to excercise the code.
      This now passes.
      ce417b97
    • Murray Cumming's avatar
      Fix the build. · 6e779a38
      Murray Cumming authored
      * glom/mode_design/users/dialog_new_group.cc:
      * glom/mode_design/users/dialog_user.cc: Add includes to fix the build.
      6e779a38
    • Murray Cumming's avatar
      test_selfhosting_new_empty_then_users: Show the problem with spaces. · b1e34c7f
      Murray Cumming authored
      * tests/test_selfhosting_new_empty_then_users.cc:
      Privs::get_table_privileges() must parse a strange format. This test
      shows that it fails if the group name contains spaces.
      b1e34c7f
    • Murray Cumming's avatar
      Fix typos · 91b06b02
      Murray Cumming authored
      91b06b02
    • Murray Cumming's avatar
      Limit user and group name lengths. · 739a0452
      Murray Cumming authored
      * glom/libglom/privs.[h|cc]: Add a MAX_ROLE_SIZE enum constants.
      I cannot find any PostgreSQL documentation of this 63 character limit.
      * glom/mode_design/users/dialog_new_group.cc:
      * glom/mode_design/users/dialog_user.cc: Use it to set maximum characters
      for the entry boxes.
      * tests/test_selfhosting_new_empty_then_users.cc: Show that the problem
      found so far was caused by too-long names, not spaces.
      I still need to check parsing of table permissions.
      739a0452
    • Murray Cumming's avatar
      Fix typo · ccaf384e
      Murray Cumming authored
      ccaf384e
    • Murray Cumming's avatar
      test_selfhosting_new_empty_then_users: Test user adding with all group names. · 2bd22e21
      Murray Cumming authored
      * tests/test_selfhosting_new_empty_then_users.cc: Use for loops to
      simplify the code and to make sure that we test adding of users with
      all the group types.
      This shows a problem:
        Privs::get_database_groups() does not contain the expected user:
        group: somegroup with space characters1
        user: someuser with space characters1for_somegroup with space characters1
      2bd22e21
    • Murray Cumming's avatar
      test_selfhosting_new_empty_then_users: Improvements. · 4ad252ec
      Murray Cumming authored
      * tests/test_selfhosting_new_empty_then_users.cc:
      Add tables that will be affected.
      Test strange characters in group and user names.
      4ad252ec
    • Murray Cumming's avatar
      Add test_selfhosting_new_empty_then_users · 68ad8059
      Murray Cumming authored
      * glom/mode_design/users/dialog_groups_list.cc: on_button_group_new():
      Move the group creation code to:
      * glom/libglom/db_utils.[h|cc]:
      
      * glom/libglom/privs.[h|cc]: set_table_privileges():
      Return a bool to report failures.
      * Makefile_tests.am:
      * tests/test_selfhosting_new_empty_then_users.cc: Add this test to
      test simple creation of a group and a user.
      68ad8059
    • Murray Cumming's avatar
      Add test_selfhosting_new_from_example_operator. · 9c67be8d
      Murray Cumming authored
      * glom/base_db.[h|cc]: Move add_user() to
      * glom/libglom/db_utils.[h|cc]:
      * glom/frame_glom.cc:
      * glom/mode_design/users/dialog_users_list.cc: Adapted.
      
      * glom/libglom/connectionpool.cc: invalidate_connection():
      Also clear m_pFieldTypes to make sure that we refill it when making
      a new connection.
      
      * glom/libglom/data_structure/fieldtypes.[h|cc]: Add get_types_count().
      * tests/test_selfhosting_utils.[h|cc]: Add test_selfhost() to
      start an already-existing .glom system.
      * Makefile_tests.am:
      * tests/test_selfhosting_new_from_example_operator.cc:
      Add this new test which attempts to re-open a .glom system as
      a non-developer user. This currently fails to get the list of
      tables from the database. I must investigate that.
      9c67be8d
  3. 30 Jan, 2012 7 commits
  4. 29 Jan, 2012 5 commits
    • Murray Cumming's avatar
      TableInfo, Report, PrintLayout: Make member variables private. · 4a79c93e
      Murray Cumming authored
      * glom/libglom/data_structure/print_layout.[h|cc]:
      * glom/libglom/data_structure/report.[h|cc]:
      * glom/libglom/data_structure/tableinfo.[h|cc]: Hide the member
      variables behind getters and setters.
      * glom/application.cc:
      * glom/base_db.cc:
      * glom/libglom/db_utils.cc:
      * glom/libglom/document/document.cc:
      * glom/libglom/report_builder.cc:
      * glom/mode_design/print_layouts/window_print_layout_edit.cc:
      * glom/mode_design/report_layout/dialog_layout_report.cc:
      * glom/navigation/box_tables.cc:
      * glom/print_layout/canvas_print_layout.[h|cc]:
      * glom/print_layout/print_layout_utils.cc:
      * tests/test_document_load.cc: Adapt.
      This avoids java-libglom from generating getM_*() and setM_*() methods,
      as well as being generally correct.
      4a79c93e
    • Murray Cumming's avatar
      Database Preferences: Really store the organization name in the database. · 38d7b90f
      Murray Cumming authored
      * glom/libglom/db_utils.cc: set_database_preferences(): Also UPDATE
      the organization name.
      
      This fixes bug #668836 (alien)
      38d7b90f
    • Murray Cumming's avatar
      Field Formatting: Related Choices: Default to showing the primary key. · 5eb8d493
      Murray Cumming authored
      * glom/mode_design/layout/layout_item_dialogs/box_formatting.cc:
      on_combo_choices_relationship_changed(): By default, automatically
      choose the related table's primary key as the field to show in the
      choices. Other fields should then be shown (or looked up) based on the
      chosen ID.
      This avoids the confusion noticed here: https://bugzilla.gnome.org/show_bug.cgi?id=668759#c21
      5eb8d493
    • Murray Cumming's avatar
      CellRendererDbList: Do not crash if one of the fields is hidden. · 0d7acedc
      Murray Cumming authored
      * glom/mode_data/datawidget/cellrenderer_dblist.cc:
      repack_cells_related(): Do not crash if create_cell() returns 0,
      and add a comment explaining that that is OK.
      * glom/mode_data/datawidget/cellcreation.cc: Add explanatory comments.
      
      This fixes the second crash mentioned in #668759 (alien).
      0d7acedc
    • Murray Cumming's avatar
      Choices: Allow the field to be be other than the primary key. · ca685406
      Murray Cumming authored
      * glom/mode_data/datawidget/treemodel_db.h: Make most methods and
      members private again, documentation what they *key methods and members
      really mean.
      * glom/mode_data/datawidget/treemodel_db_withextratext.[h|cc]: Add
      m_column_index_first and m_item_first members.
      Constructor: Set these by looking for the first LayoutItem_Field,
      because that is what we will want to show in the first cell of
      a combobox, which is where this model is used.
      Use these instead of the *key members, which were actually the primary
      key. We had previously assumed that the first field would always be
      the primary key, but we should not enforce that.
      This fixes crashing bug #668759 (alien).
      ca685406
  5. 28 Jan, 2012 1 commit
    • Murray Cumming's avatar
      ComboChoicesWithTreeModel: Make sure the model always has the primary key. · 1accf800
      Murray Cumming authored
      	* glom/libglom/data_structure/layout/layoutitem_field.h:
      	predicate_LayoutItem_Field_IsSameField: Let this be used with containers of
      	LayoutItems as well as just LayoutItem_Fields.
      	* glom/libglom/utils.[h|cc]: Add get_layout_items_plus_primary_key().
      	* glom/mode_data/box_data_list.cc: create_layout(): Simplify code by using
      	get_layout_items_plus_primary_key().
      	* glom/mode_data/datawidget/combochoiceswithtreemodel.cc:
      	set_choices_related(): Use get_layout_items_plus_primary_key() so the
      	model has the primary key, avoiding a warning and a later crash.
      1accf800
  6. 27 Jan, 2012 1 commit
    • Murray Cumming's avatar
      Test creation from examples in non-English locales. · a83bd818
      Murray Cumming authored
      * Makefile_tests.am:
      * tests/test_selfhosting_new_from_example_in_locales.sh:
      Run the test_selfhosting_new_from_example example in various
      locales, to make sure that the libgda problem (see bug #668346),
      or something like it, does not come back.
      * tests/test_selfhosting_new_from_example.cc: Call setlocale().
      a83bd818
  7. 26 Jan, 2012 1 commit
  8. 25 Jan, 2012 4 commits