Commit Graph
38 Commits
Author SHA1 Message Date
Geert Janssens 2c5f6b9cc3 Merge branch 'csv_imp_cpp'
This feature branch is about the c++ conversion of the
csv transaction importer.
2017-02-20 20:42:21 +01:00
Geert Janssens 1d552fbe7f Use boost::locale:conv:utf_to_uft instead of codecvt_utf8
The latter is not available until gcc 5.x and we still depend on
gcc 4.8 on some platforms (RHEL/Centos, Travis/Ubuntu 14.04, Windows).
2017-02-20 20:23:20 +01:00
Geert Janssens 558d4b43b2 Properly test for invalid dates (gnc-date C interface no longer throws - rightfully so) 2017-02-20 18:05:05 +01:00
Geert Janssens cd66fb2e2d Some ui refinement
- 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
2017-02-20 18:05:03 +01:00
Geert Janssens a295680212 Cleanup - use less ambiguous variable name for an iterator 2017-02-20 18:04:59 +01:00
Geert Janssens 372c46cc0f Fix base account reset when an account column is selected
This got broken somehow while refactoring the assistant.
2017-02-20 18:04:57 +01:00
Geert Janssens 61244301f2 Recover separators or column_widths when juggling file format more than once 2017-02-20 18:04:54 +01:00
Geert Janssens 5d96e47b39 Prevent multi-byte characters from erroneously being split in fixed-width mode
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.
2017-02-20 18:04:52 +01:00
Geert Janssens 8d03abac19 Include glib.h as everywhere else 2017-02-20 18:04:49 +01:00
Geert Janssens 6657e6660b Remove some obsolete comments and commented out code 2017-02-20 18:04:46 +01:00
Geert Janssens 4687eb649b Trim newlines from csv data
If the newline happens in the middle some field, replace it with a space.
We can't import newlines in gnucash.
2017-02-20 18:04:44 +01:00
Geert Janssens 9fbbd7366c Fix crash when adding columns by double-clicking the preview data
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.
2017-02-20 18:04:38 +01:00
Geert Janssens 449db62921 Fix settings loading and saving
- fixed width columns widths weren't saved
- column types were lost when loading a fixed width preset
2017-02-20 18:04:35 +01:00
Geert Janssens 5953543573 Improve visual feedback when previewing importable data 2017-02-20 18:04:33 +01:00
Geert Janssens 9ecde3a05d Improve preview table handling
- 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.
2017-02-20 18:04:30 +01:00
Geert Janssens d57a7ceed2 Look for translatable strings in lib directory as well
The Character Encoding menu imported from goffice comes with many such strings.
I still need to find a nice way to copy the existing translations for them
from goffice directly to gnucash.
2017-02-20 17:41:31 +01:00
Geert Janssens 01d31c7171 Yet another tweak to properly find GMOCK sources
The previous logic failed because GMOCK_SRC_DIR is cached. On
subsequent cmake runs FIND_PATH is not invoked again and hence
the first test for GMOCK_SRC_DIR will always succeed and
src is always appended to it to obtain GMOCK_SRC_MAIN_DIR.
This is not what we want, so I have chosen to force a rerun
of FIND_PATH by clearing the cached value of GMOCK_SRC_DIR.
2017-02-20 17:37:52 +01:00
Geert Janssens 2d451801e9 One more stab at properly discovering gtest/gmock
My previous attempt made wrong assumptions on the
way source files got included in the mock tree.
2017-02-08 17:16:58 +01:00
Geert Janssens 1241b71770 Fix cmake's gmock handling to work with Fedora packages
Similar checks were already in configure.ac for the autotools variant
2017-02-06 11:10:41 +01:00
Geert Janssens 659c96eb1b Optionally locate boost via environment variable BOOST_ROOT
This was already the case for our autotools based build
and simplifies the build setup for our Windows build system.
2017-02-02 18:48:15 +01:00
Geert Janssens 4fdacb9b2a Fix building gtest library on mingw
See https://github.com/google/googletest/issues/893
2017-02-02 18:31:54 +01:00
Geert Janssens 0a8d7a2142 Make google test framework a mandatory build dependency
All c++ unit tests will be written with it, and testing
should be possible out of the box.
We could make it optional, but then lots of tests will
be skipped. This creates an illusion of all tests passing
while many are simply not run. This confusion should be
avoided.
This change depends on a second commit for the windows build
in the gnucash-on-windows repository. This commit will be
pushed at the same time.
2017-02-02 17:20:43 +01:00
Geert Janssens aeb04e1d9d Fake change to test mail script on code.gnucash.org 2017-02-01 22:25:44 +01:00
Geert Janssens d503f3438e Drop callback that reloads report when a report tab is selected
This has the unwanted side-effect of misaligning the chart
legends (due to some internal bug in webkit). Resizing the window
properly redraws the chart afterwards, but leaving the page and
returning reloads the page again, hitting the bug again. This
prevents multiple report tabs open at once to show a correct chart.
Each resize of the window to correct one chart will trigger a
misaligned legend on all other charts the next time you look at them.

The disadvantage of removing this code is that reports loaded
automatically when gnucash opens are not sized properly. (All but
the one in the very last tab of the book being opened, that is).
However these pages can be corrected by manually reloading them
once. That's annoying but at least allows for correctly displayed reports.

A proper solution must be found for this of course.
2017-02-01 21:46:01 +01:00
Geert Janssens 996b6047fc Revert "Add call back to track page size changes"
This reverts commit 12994ca6e7.

Webkit takes care of this properly for newly opened reports. It
somehow fails for reports that are automatically loaded when
reopening gnucash. This needs additional investigation, but
reloading the report when exposing the page has undesired
side-effects which should be avoided.
2017-02-01 21:29:36 +01:00
Geert Janssens d9d5f07451 Revert "Change report resizing when not in view"
This reverts commit 74091fbcfa.

Webkit takes care of this properly for newly opened reports. It
somehow fails for reports that are automatically loaded when
reopening gnucash. This needs additional investigation, but
reloading the report when exposing the page has undesired
side-effects which should be avoided.
2017-02-01 21:21:45 +01:00
Geert Janssens 334fafc48d Merge branch 'maint' 2017-02-01 20:06:55 +01:00
Geert Janssens 6a5a850b73 Log javascript console messages to the trace file 2017-02-01 20:05:18 +01:00
Geert Janssens eac7987564 Always use actual window size when calculating x-axis ticks for charts
Previously the window size was only captured once and reused all the time.
2017-02-01 20:04:11 +01:00
Geert Janssens 02adf447fd Bug 777875 - Reports with charts are flickering in certain circumstances
This flickering was triggered by interference between scrollbar
visibility changes and report reloading. Both should not happen
at the same time.
2017-02-01 19:18:00 +01:00
Geert Janssens 5a144699b9 Extend account color to all columns in the account hierarchy page 2017-01-30 22:12:25 +01:00
Geert Janssens 420f40ed9a Fix duplicate widget names in gtkbuilder file 2017-01-30 21:44:44 +01:00
Geert Janssens ee7a73dea3 Drop with_html_engine option
We only support webkit. The option was there for backwards
compatibility in the 2.6 series, but for 2.8 it can go.
2017-01-30 19:34:53 +01:00
Geert Janssens 5cbdc5d816 Merge branch 'maint' 2017-01-30 19:34:29 +01:00
Geert Janssens 0a782dd0c0 Travis - fix failure to load some libraries while running scm tests
In the travis environment (guile 1.8 in combination with other unidentified,
particular package versions) the scm based tests are looking for
backend modules (xml and dbi) in the installation prefix instead of
in the build directory. Explicitly setting the environment variables
GNC_BUILDDIR and GNC_UNINSTALLED fix this. I haven't figured out why this
is not needed on all platforms/tool version combinations. But the fix
works in all (autotools based) cases. CMake builds may need a similar
fix, but I don't know that environment sufficiently to implement it.
2017-01-28 18:02:08 +01:00
Geert Janssens c87fa9eac1 Bug 759934 - Tiny reports in HiDPI
While a proper solution is only possible with a more recent
version of webkit, this commit will allow users to work around
the issue by manually setting a default zoom level for reports.
This setting can be found under
Edit->Preferences->Reports
2017-01-28 17:56:59 +01:00
Geert Janssens 33f39627e3 Drop a couple of webkit related configure tests
The tests are only relevant to webkit versions older than our baseline.
2017-01-27 19:24:53 +01:00
Geert Janssens 695065a0aa Merge branch 'maint' 2017-01-23 12:03:00 +01:00