- Adjust description on the assistant's start page to match current behavior
- Hide separator buttons in case the file format is set to fixed width
- For fixed width display some instructions on how to manipulate columns
- Move the error messages to below the preview table
This happens because in case std::string is the base type for the tokenizer
the offsets are interpreted as byte offsets although some characters
may consist of more that one byte in utf-8. This is not so for std::wstring
so to solve this issue the fixed width tokenizer is changed to use
wide character strings internally.
Each column change would cause the code to completely delete the
existing columns and then add new ones from scratch. For some
reason his upsets the MOVE_NOTIFY event, which is triggered
whenever you move the mouse pointer around. I suspect it internally
keeps a link to the last hovered column to check if the move action
moves the mouse to a different column. As the code removed the columns
this internal references becomes invalid.
I have worked around this by no longer completely recreating the
columns. Instead columns are added or removed as needed to follow
the changes in the data model.
At the same time the refresh function has been split into several
smaller ones.
- Properly enable/disable context menu for managing columns in fixed width data mode
- Make this context menu work on the table body instead of the table headers
- Both of the above is done a well for the double-click column creation behaviour
- Migrate the column type setting widgets to the table header cells and remove
the second (one-row) table, which was only used to allow type selection.
- Use enums instead of magic numbers to access associated treeview models
To fix: for some reason the column headers are no responding to clicks when
the preview page is first opened. However the first time the preview table
is regenerated (pretty much whenever an option is changed) they are. This
should still be debugged.
The keyfile that stores the settings won't accept '[' and ']' as settingss names,
so this commit will prevent the user from entering these characters. They are
automatically replaced with the valid '(' and ')' characters.
In addition any attempt to save settings with an invalid name via a code path
bypassing the gui will be refused.
In this form not all data needs reparsing when a single column
changes. The drawback is it makes the code slightly more complicated
because accounts can only be verified after the account match page
has completed, while most columns are set on the preview page.
With the preview page blocking as long as there are (unskipped) errors
there is no need any more for the assistant to go back from the documentation
page to the preview page in case of errors - the documentation page
can only be reached if all required data is valid.
This required some additional tweaks to other functions that were
written to be called twice in TxImport and no longer will be.
- Not all possible issues were reported to the user.
- Report column conflicts above the table, and line issues in the first column of the line having the issue
- m_ prefix all member variables
- delay variable declarations until actually needed
- use auto where possible for variable declarations
- use standard c(++) types and constants where possible
- rename variables and functions to be more consistent
- set gui callbacks as much as possible in the glade file
- drop unused parameters
- Store importer settings in a separate object inside the CsvTxImport
- make CsvTxImport responsible for maintaining a consistent settings state
- reduce the assistant's responsability to passing settings changes to CsvTxImport and
visual display. It no longer does validation
- Refine the gui some more
- make the CsvTxImport class responsible for the check
- guide the user with suggestions rather than have the user click through to the next page to find out things weren't set up properly
- move all gtk related stuff to the assistant code
- move all checks to the settings object, the assistant should query that
- handle sensitivity of the save and delete button more intelligently
The context being either multi-split or two-split. There's no use
in selecting a Transaction ID column in two-split mode for example.
Similarly none of the 'Transfer xzy' types will be used in
multi-split mode.
In its current state it will only work for a very restricted context.
However there's no code to validate this context so the importer will
happily produce wrong results in all other contexts.
A query on the mailing list didn't return any interest in this feature
so instead of fixing it I'd rather drop it to keep the code clean.