Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major rework of Map's template API and of TemplateListWidget #1653

Merged
merged 26 commits into from
Jun 11, 2020
Merged

Commits on Jun 8, 2020

  1. Map: Revise template API, part 1

    Move separate inline definitions either to class or to cpp file:
    We don't need to force inlining for getters, and we probaly don't
    want inlining for setters.
    Consistently use identifier "pos" for the index of the template
    (but leaving "i" for closed templates).
    Use idiomatic non-member begin().
    Fix implicit conversions.
    Rewrite findTemplateIndex using std algorithms.
    Revise documentation.
    dg0yt committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    d7a8aa6 View commit details
    Browse the repository at this point in the history
  2. Map: Revise template API, part 2

    Change addTemplate and setTemplate parameter order to the more common
    position, template. This also matches the signals.
    dg0yt committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    6cc760f View commit details
    Browse the repository at this point in the history
  3. Map: Revise template API, part 3

    Add method to move templates in the list, and send a new signal.
    dg0yt committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    0d76636 View commit details
    Browse the repository at this point in the history
  4. Map: Revise template API, part 4

    Explicitly take, hold, and release strong ownership of templates
    by using std::unique_ptr<Template>.
    dg0yt committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    9748301 View commit details
    Browse the repository at this point in the history
  5. Map: Revise template API, part 5

    Update the index of the first front template when templates are
    added or removed in the background of the map.
    Introduce the special value '-1' to insert templates just below
    the map.
    Rewrite ReopenTemplateDialog::OpenTemplateList::dropEvent to make
    use of this API change.
    
    Note that the changed interactions at template deletion require
    another TemplateListWidget connection to be marked as queued: When
    the template table selection model emits selectionChanged, the
    template table still holds the row for the template which is already
    removed from Map, so table row <-> template index mappings do not
    work correctly in this moment.
    dg0yt committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    ece807a View commit details
    Browse the repository at this point in the history
  6. Map: Revise template API, part 6

    Emit signals before adding, moving or removing templates, and when
    changing the index of the first front template.
    This follows the pattern of signals in QAbstractItemModel. It allows to
    do some light-weight independent actions, e.g. initializing template
    visibility, before more complex actions.
    dg0yt committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    d823597 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d670c1d View commit details
    Browse the repository at this point in the history
  8. Map: Take care of setTemplatesDirty...

    ... when changing the list of templates, changing the start of the
    front templates, or being notified of a changed template.
    Note: This is the combined state of the templates with regard to what
    is saved on disk. It is not the state for repainting the screen.
    dg0yt committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    115d94f View commit details
    Browse the repository at this point in the history
  9. Map: Take care of setTemplateAreaDirty

    For all common events, Map knows that setTemplateAreaDirty needs to
    be called (and when).
    In addition, a change of template visibility shouldn't affect more
    than the map widgets attached to the particular map view.
    dg0yt committed Jun 8, 2020
    Configuration menu
    Copy the full SHA
    83096d6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a92ac60 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    3a2fbcc View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    74ccc5e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    7f6644c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    011249b View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2020

  1. TemplateListWidget: Factor out TemplateTableModel

    This change leverages Qt's model/view classes, separating the
    template list GUI from the the data model.
    
    To let the model properly deal with templates being added to the map
    next to the map layer, the map must also explicitly signal whether a
    template is meant to be added to the background or not. To avoid
    a hard dependency on map.h in target slot declarations, we use
    a simple bool, not a more verbose enum in map.h.
    dg0yt committed Jun 9, 2020
    Configuration menu
    Copy the full SHA
    fd86151 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    efcbfa8 View commit details
    Browse the repository at this point in the history
  3. TemplateListWidget: Cleanup

    Change order of functions for reasonable grouping.
    Add '*' to 'auto' where dealing with pointers.
    Rename 'getCurrentTemplate' to 'currentTemplate'.
    dg0yt committed Jun 9, 2020
    Configuration menu
    Copy the full SHA
    f850d1d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9c9fa35 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7ee3cf7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4e7846c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    33e8f1e View commit details
    Browse the repository at this point in the history
  8. TemplateListWidget: Stop move-by-hand properly

    Tear down the tool when the user select another row in the list.
    Fixes GH-1517 (unintuitive move-template function).
    dg0yt committed Jun 9, 2020
    Configuration menu
    Copy the full SHA
    b99a950 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2a4140d View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2020

  1. Configuration menu
    Copy the full SHA
    112a28d View commit details
    Browse the repository at this point in the history
  2. TemplateListWidget: Normalize positioning action

    Move full lifecycle control to TemplateListWidget and
    TemplatePositionDockWidget.
    dg0yt committed Jun 10, 2020
    Configuration menu
    Copy the full SHA
    d308c47 View commit details
    Browse the repository at this point in the history
  3. Template dock widgets: Save/restore state

    Turn these dock widget into regular MapEditorController/QMainWindow
    dock widgets for which state is saved and restored.
    Dock widgets need an object name in order to let QMainWindow properly
    save and restore the state. Fixes a runtime warning at the console.
    dg0yt committed Jun 10, 2020
    Configuration menu
    Copy the full SHA
    4438096 View commit details
    Browse the repository at this point in the history