Commit Graph
100 Commits
Author SHA1 Message Date
Geert Janssens f28896fbde Fix cmake run on Ubuntu 16.04 (and possibly other distros)
Apparently that platform trips over a missing newline at the end of the generated POTFILES.in.in file.
Adding one allows cmake to complete configuration and appears to be fine on Fedora as well
(although it worked fine without the newline too).

Thanks go to Michael Jung <gnucash-devel@mailinglists.mjung.org> for reporting this and proposing the fix.
2017-08-21 16:41:08 +02:00
Geert Janssens 3e1a1b262c Fix missing Find... functionality
It got lost during migration of business-gnome to gnome.
Spotted and solved by Robert Fewell.
2017-08-21 11:14:28 +02:00
Geert Janssens 4d5a37d292 Minor cleanupus in .gitignore 2017-08-17 15:26:54 +02:00
Geert Janssens f943ba61ae Rename directory for code from external projects
'lib' is also being used by the cmake build, so there was a
theoretical risk for file conflicts. The new name is 'borrowed'.
2017-08-17 15:25:49 +02:00
Geert Janssens a25001dfe6 Win32: drop goffice directory from path
Gnucash is not using goffice any more
2017-08-17 13:05:02 +02:00
Geert Janssens 7fd38c88a5 Improve a comment
My Ingrish is pretty poor at times...
2017-08-17 12:36:48 +02:00
Geert Janssens a96a68fd4e Add as many values as there are fields in the list
This wasn't causing trouble, but it looks more correct this way.
2017-08-17 12:33:08 +02:00
Geert Janssens 0946b0315f Use another way to fix backend loading on OS X 2017-08-17 10:10:50 +02:00
Geert Janssens 1883d8ec31 Fix a number of test mismatches between cmake and autotools
cmake:
- add test-app-utils
- rename test-link-module to test-link-module-app-utils
- add gtest-import-map
autotools:
- move gtest-import-map from TEST_PROGS to TESTS (autotools) so it shows up in the colored results list
2017-08-16 12:40:38 +02:00
Geert Janssens 53afd36de1 Keep the test modules from gnc-module outside of the normal GNC_MODULE_PATH
They interfere with other tests and pollute the build logs in cmake.
2017-08-16 11:59:27 +02:00
Geert Janssens 723530a9bc Merge branch 'reorganize-source-dirs' 2017-08-14 18:49:50 +02:00
Geert Janssens 3e3eead3c5 Eliminate plugins directory
bi-import and customer-import have been put with the other importers
example is moved to gnc-module as, well, an example
2017-08-14 18:17:13 +02:00
Geert Janssens 2a7f2f891a Eliminate the separate bin directory
Instead its content is moved to gnucash directly, making the gnucash directory
more meaningful.
2017-08-13 12:39:45 +02:00
Geert Janssens 53736e0842 Update .gitignore to handle all the renamed directories
At the same time clean up some obsolete entries (business-xyz)
and fix a gnc-scm-info.h -> gnc-vcs-info.h
2017-08-13 12:12:34 +02:00
Geert Janssens 4ce7be0497 Drop packaging directory
While I myself asked for it to be retained a couple of years back
I now believe it really makes no sense to keep on carrying
a completely outdated rpm spec file around. This should not
be part of the source and properly up to date and maintained
rpm spec files can be found in each rpm based distro that ships
gnucash.
2017-08-12 10:13:43 +02:00
Geert Janssens dfe8ea4536 Add conditional source files to dist tarball
They should be added even if not used on the system being used to create the dist tarball
2017-08-11 22:51:14 +02:00
Geert Janssens 0c6da2f001 Cleanup some more obscure references to no longer existing 'src' directory 2017-08-11 22:44:50 +02:00
Geert Janssens afecab330a Move accounts, checks and pixmaps into a data directory
At the same time move the art directory into contrib to unclutter the top level
2017-08-11 22:42:15 +02:00
Geert Janssens 83d14e1c1c Restructure the src directory
It is split into
- /libgnucash (for the non-gui bits)
- /gnucash (for the gui)
- /common (misc source files used by both)
- /bindings (currently only holds python bindings)

This is the first step in restructuring the code. It will need much
more fine tuning later on.
2017-08-10 18:45:00 +02:00
Geert Janssens ffc640bada Move global definitions to toplevel CMakeLists.txt 2017-08-09 17:30:59 +02:00
Geert Janssens 9de9f5362e Drop the cutecash experiment and the gtkmm optional bindings
These are currently unmaintained, cutecash us based on the obsolete qt4
and gtkmm is only used by cutecash. Whenever someone wishes to revive
this experiment it can be recovered from git history and be brought
into a separate repository.
2017-08-09 16:09:32 +02:00
Geert Janssens 785568b0a3 Drop gtk dependency from app-utils
The resolves it's 'allmost nongui' status. Note the options code still
stores a pointer to a gtk widget but this is never used in the app-utils code
itself. This was already so before this commit and fixing this will require
more refactoring later on.

This commit also aligns the list of non-gui source directories between
cmake and autotools. This may need further tweaking in the context of
splitting the source in libgnucash and gnucash (the application)
2017-08-09 15:37:39 +02:00
Geert Janssens 708a9a4775 Make all backend loading use the same build environment module path resolution
This obsoletes some cmake hacks
2017-08-09 15:37:39 +02:00
Geert Janssens 8687dfb1da Merge qof directory into engine
They are both about handling core gnucash objects. Qof was once split out
in an attempt to make it a separate library. This hasn't worked out so there's
no good reason any more to keep this artificial separation.

A few considerations:
- The qof tests are merged into the engine test directory but they are kept as
  a separate test entity for now. Several assumptions made in the qof tests
  are no longer valid in the context of the engine. (For example if the
  pricedb test is added in the same test executable as the qofbook test,
  the book creation test fails because it now has 2 collections (pricedb and
  book) instead of only one. There are plenty of others like this so merging
  the tests needs more careful review and is perhaps best done while converting
  to c++/Google test.
- I had to use unique names for the MockBackend classes because apparently the tests were
  using a MockClass from another file in the cmake builds, causing several
  tests to fail.
2017-08-09 15:37:39 +02:00
Geert Janssens 848bb34741 Move core-utils files with depedencies on qof to engine
I have done this in a separate commit from merging qof back
into engine to keep an overview of changes
2017-08-07 18:32:19 +02:00
Geert Janssens 4f2d34f043 Fix cmake based sqlite3 test when run twice in a row
The second (and subsequent) time(s) would always fail because the test file
already exists at that point. Just force an overwrite in this case.
2017-08-07 18:32:18 +02:00
Geert Janssens 80be96219e Fix source file dependency on config.h in engine 2017-08-07 18:32:18 +02:00
Geert Janssens 342627d527 Remove the gncmod boilerplate from standard-reports and utility-reports
This adds unnecessary overhead and also serves as an initial experiment
to greatly reduce the gnc-module based modularization.

Oh, and it fixes the autotools make check failure in standard-reports
which I introduced in the previous commit. The fix was to either
fully gnc-modularize business reports or to go to de-gnc-modularize
standard-reports. I chose the latter as I don't want to add any new
gnc-modules any more at this point.
2017-08-07 18:32:18 +02:00
Geert Janssens f71317626d Integrate gnome-business into gnome
This breaks autotools' make check, which will be fixed in a subsequent commit.
2017-08-07 18:32:18 +02:00
Geert Janssens ea0d442235 Move auxiliary business files to gnome directory 2017-08-07 18:32:18 +02:00
Geert Janssens f34348a40c Move business-gnome subdirectory to higher level
This is a first step in integrating it into the rest of the gnome directory
and already allows us to drop the business intermediate directory
2017-08-07 18:32:18 +02:00
Geert Janssens 71ef0709e9 Remove references to long obsolete source directories 2017-08-07 18:32:18 +02:00
Geert Janssens f5c8ae29d6 Update ChangeLog 2017-08-07 18:31:53 +02:00
Geert Janssens 88e365d2d1 Merge branch 'gtk3-update4' of https://github.com/Bob-IT/gnucash 2017-08-04 08:26:36 +02:00
Geert Janssens 16b98cc5a4 Tweak cmake/autotools so they produce the same output for POTFILES.in 2017-08-03 18:19:06 +02:00
Geert Janssens 96642c608f Merge branch 'master' of https://github.com/0-wiz-0/gnucash 2017-08-01 15:04:51 +02:00
Geert Janssens b55a3e7d72 Fix cmake's build as installed
That is copy the required icons and images into the respective locations at build time
2017-07-12 11:59:37 +02:00
Geert Janssens 0bb51ffa95 Merge branch 'dist-alignment' 2017-07-10 22:00:40 +02:00
Geert Janssens 453af7f081 Align master-only dist files between cmake and autotools 2017-07-10 22:00:15 +02:00
Geert Janssens f4832e4584 Merge branch 'maint' 2017-07-10 20:23:09 +02:00
Geert Janssens b430744fb5 Merge branch 'maint' 2017-07-10 20:22:35 +02:00
Geert Janssens 17c48b19a7 Fix a couple of double EXTRA_DIST declarations from the previous commit 2017-07-10 20:16:35 +02:00
Geert Janssens b1f9f80110 Add CMakeLists.txt files to dist tarball generated by autotools
This is half of the work to align the cmake and autotools generated dist tarballs.
What's missing in the cmake dist tarball on my system are all the files generated
or installed by running autogen.sh. I can't test this because cmake can't run
my version of automake (1.15), or at least our CMake configuration prevents this from happening.
2017-07-10 20:06:31 +02:00
Geert Janssens eb55b5f98c Rework icon cache loading
- We actually don't care about the available icon sizes so stop checking for them.
- Even if an icon isn't found continue (with a warning). Gtk uses a fallback icon in most cases.
2017-07-10 12:09:51 +02:00
Geert Janssens 85ce243ef8 Add icons in the proper directory 2017-07-10 12:07:32 +02:00
Geert Janssens ff93071608 Rework our icon management
They are now all stored in a directory structure similar to the final
installation target, so no more copying of images during build is needed.
Both Makefile.am and CMakelists.txt behave the same now.

Some additional cleanups:
- move stock_move related images to art; they aren't used so don't need to be installed
- clean up icon loading

There is one harmless warning still at run time about not all requested image
sizes being found. This is odd because they are all installed. I suspect gtk
no longer searches for these resolutions. Perhaps we just shouldn't run the
check on them. The application works fine even without the images in the
requested resolution.
2017-07-09 21:49:07 +02:00
Geert Janssens a7f1f9cdd7 Fix build with cmake > 3.5 2017-07-09 12:45:01 +02:00
Geert Janssens 3c65795d24 Travis - install libgtk-3-dev and libwebkit2gtk-3.0-dev before building 2017-07-08 19:06:35 +02:00
Geert Janssens dabf458f06 A few cleanups from the previous merge commit 2017-07-08 18:18:11 +02:00
Geert Janssens 5405cf480c Merge branch 'gtk3' 2017-07-08 17:49:44 +02:00
Geert Janssens 50deaa0d3c Merge branch 'fix-win-compile' of https://github.com/kcwu/gnucash 2017-07-02 12:28:48 +02:00
Geert Janssens 823b41d629 Fix commodity namespace tests
While new files will use CURRENCY to indicate a commodity is a currency,
older files (including our ancient test files) are still using
ISO4217. So we need to expect both values in the xml file tests.
This is different from file loading (which will automatically map
ISO4217 to CURRENCY) and file saving (which will from now on always
write CURRENCY).
2017-06-21 10:11:54 +02:00
Geert Janssens f3eeda3a9e Stop writing commodity namespaces to xml files in gnucash 1.8 compatible way
Gnucash will still be able to read the old ISO4217 tags, but no longer write them
2017-06-20 22:36:58 +02:00
Geert Janssens 12d85ff647 Merge branch 'maint' 2017-06-20 22:35:57 +02:00
Geert Janssens c80dad742e Bug 603379 - Prevent changing some Account Options if it has transactions - followup
Relax the account type change restrictions again. In the new implementation
account types can't be changed for an account with splits:
- if the change woud force a commodity change (to/from normal accounts from/to stock related accounts)
- for immutable accounts

At the time of this commit the following account types are considered immutable:
- Accounts Receivable
- Accounts Payable
- Trading accounts
2017-06-20 22:08:51 +02:00
Geert Janssens 4032d33b48 Properly define the template namespace rather than using a local string everywhere 2017-06-20 12:16:33 +02:00
Geert Janssens cc3010d89b Bug 781634 followup - separate translatable commodity namespace strings from those uses in storage
There is now a separate GNC_COMMODITY_NS_ISO_GUI label to be used
everywhere the users needs to read 'Currency namespace'. It's currently
set to 'Currencies' and can be translated. It may change in to future
to better describe this namespace is restricted to ISO4217 defined
currencies as opposed to all the non-formal currencies in vogue today
(like bitcoin and friends).
2017-06-20 12:16:33 +02:00
Geert Janssens 9087418f81 Drop ifdeffed out code block 2017-05-03 18:08:37 +02:00
Geert Janssens c5ef629fdc Bug 781634 - Alert on missing account currency when opening account 2017-05-03 18:08:37 +02:00
Geert Janssens e0af43d413 Properly handle import of reconcile state.
Gnucash exports this state localized it should expect a localized state on import.
2017-05-03 12:19:04 +02:00
Geert Janssens 3603ec1aa8 Document supported date formats in the saved csv settings 2017-05-03 09:44:36 +02:00
Geert Janssens 9af57849ba Use GncDate in csv importer
This removes all date specific functionality from the importer
2017-05-02 23:16:21 +02:00
Geert Janssens 7df29b572a Add copy constructor and assignment operator to GncDate 2017-05-02 23:09:36 +02:00
Geert Janssens 5070037314 Add comparison operators for GncDate
Note the operands are const GncDate& because the GncDate has no copy
constructor/assigment operator (any other definition would fail
when used with variables of type boost::optional<GncDate>)
2017-05-01 16:24:01 +02:00
Geert Janssens 1a3595cbeb Convert gnc_dmy2timespec{,_end,_neutral} to use the equivalent GncDateTime constructor
This required a couple of tweaks to the tests because:
- the invalid date returned for impossible conversions is different between the old implementation and the cpp edition
- unhandled glib warnings caused the tests to abort
2017-04-28 18:41:04 +02:00
Geert Janssens 7a037932ae Align day end time as used in the GncDateTime constructor and gnc_dmy2timespec_end
The former was using 23:59:00 while existing code was using 23:59:59. To avoid
disruptions, stick with the latter in our cpp code as well.
2017-04-28 18:41:04 +02:00
Geert Janssens 586b89c6ca Fix John's remarks 2017-04-28 18:41:04 +02:00
Geert Janssens 610f6309a3 Fix double free abort in gtest-gnc-datetime.cpp
This double free happened after the introduction of a class variable (static member variable
to GndDate and the test compiling in gnc-datetime.cpp *and* at the same time linking to
gnc-qof. This apparently threw off internal memory management. Removing either of linking to
gnc-qof or compiling in the source file solved it.
Credits go to John Ralls for debugging this.
2017-04-28 18:41:04 +02:00
Geert Janssens 209f971589 Add constructor to create GncDate from string and predefined date format
Primary use case is for parsing dates from external sources (importers)
2017-04-28 18:41:04 +02:00
Geert Janssens 9b30bb2b62 Various small fixups in csv importer
- Use descriptive names instead of numbers in std::get<>
- Remove unused parameters
- Fix some doxigen comments
2017-04-28 18:41:04 +02:00
Geert Janssens b7bcd792f6 Align cmake rational/numeric test invocation with Makefile based one
This invocation avoids linking in gnc-qof and instead will
directly pull in all sources required.
2017-04-28 18:41:04 +02:00
Geert Janssens b5530bd41f Fix autotools based build
For some reason gnc-vcs-info.h isn't found properly any more although
the relevant parts of the Makefiles haven't changed compared to the
maint branch. Perhaps a compiler option has changed ? Anyway simply
adding its path explicitly does fix it.
2017-04-26 11:10:30 +02:00
Geert Janssens 391955975b Fix static code checker warnings about parameter definition in doxygen comments
Apparently these shouldn't suffixed with a colon (:)
2017-04-20 23:19:08 +02:00
Geert Janssens d1ff16138e Add GncDateTime constructor taking a GncDate as parameter
As a GncDate doesn't have any time information, this has to be made up.
GnuCash uses 3 times-of-day quite a lot:
- start-of-day (00:00 local time)
- end-of-day (23:59 local time)
- neutral time (10:59 utc, chosen to minimize
  day offsetting when converting to/from localtime)

A second parameter to the new constructor will tell it to use one of these presets.
2017-04-20 23:18:01 +02:00
Geert Janssens 724f8aa784 Swap GncDate and GncDateTime in preparation of a future commit 2017-04-20 21:42:24 +02:00
Geert Janssens dd9b2007b0 Gtk3: fix failing item-edit widget on sheets
There were several problems since the conversion to gtk3
* widget wasn't displayed at all - apparently this was because I had overriden the draw function of the gtklayout (sheet)
  -> fixed by adding a draw callback instead
* several gtk warnings about allocating sizes to widgets without using *get_preferred_width/height
  -> fixed by adding the itemedit dropdowns to the layout only when they are requested
* the arrow button didn't want to resize small enough
  -> fixed by adding a custom style to drops the button's internal padding
* there were several sizing issues which ironically got fixed dropping much of the custom sizing code
2017-04-14 19:23:19 +02:00
Geert Janssens 24ed305c18 Gtk3: fix register redrawing when the window is scrolled
The new drawing interface in gtk3 uses a different coordinate system.
Some calculations had to be adjusted to this.
2017-04-14 19:22:29 +02:00
Geert Janssens 3a76cb91f1 Gtk3: Fix register not being drawn - item_edit still missing
While the data is displayed the widget to edit the active cell isn't yet.
2017-04-14 19:21:35 +02:00
Geert Janssens e5d2ab8dc5 Fix build with webkitgtk >= 2.8 2017-04-14 19:21:35 +02:00
Geert Janssens 8f66cf4286 Gtk3: Replace obsolete functions
gtk_statusbar_set_has_resize_grip
gdk_drawable_get_screen
gdk_device_get_core_pointer

There is no replacement for it in gtk3 and it's probably
not needed any more either.
2017-04-14 19:21:34 +02:00
Geert Janssens e40acf5915 Temporarily disable deprecation warnings 2017-04-14 19:21:34 +02:00
Geert Janssens e26480ccbb Gtk3: Convert GdkColor into GdkRGBA
Only gnc-dense-cal.[ch] is left untouched because it's use
of color is tightly coupled to the use of GtkStyle. This
latter needs conversion as well, but would be too much to
add in one commit.

Additionally the register code uses GtkStyle to extract
colors. This has been partially converted to using GdkRGBA
with the inconvenient side effect that depending on how
a color is retrieved it has to be freed with gdk_rgba_free
or not. This may be cleaned up later.
2017-04-14 19:21:34 +02:00
Geert Janssens f07ad114c4 Gtk3: replace expose_event size_request functions
expose_event has been replaced with draw
size_request has become get_preferred_width and get_preferred_height
2017-04-14 19:21:34 +02:00
Geert Janssens 6edbb53fe6 GnucashSheet - drop unused variables 2017-03-31 14:03:49 +02:00
Geert Janssens 4b30a7dae7 GnucashSheet - fix screen refresh
I noticed improper screen redraws when switching cells while the
window was scrolled down. The drawing logic is pretty conflated
so instead of hunting this down, I have made it so that the full
visible part of the windows gets redrawn each time the user
switches to a different cell.
This is slightly more expensive, but should still be ok.
2017-03-31 14:03:49 +02:00
Geert Janssens d439d37980 Fix two critical GObject warnings 2017-03-31 14:03:49 +02:00
Geert Janssens 68091faa80 ItemEdit - drop unused function 2017-03-31 14:03:49 +02:00
Geert Janssens 03699efe14 Extract the GnucashRegister widget into a separate file
It was interleaved in the gnucash-sheet.* sources making it harder to examine
2017-03-31 14:03:49 +02:00
Geert Janssens 5223ca8c81 Restore pasting in the item_edit
The register is implemented such that the edit widget is read-only and
all keystrokes are filtered by the sheet widget which then directly sets
the appropriate text in the edit widget each time.
The interim fix here is to make the text edit widget temporarily editable
when cutting or pasting text.
A better solution will be to make the edit widget responsible for all
text entry and delegate everything not handled directly to the sheet widget.
This will be for a later commit
2017-03-31 14:03:49 +02:00
Geert Janssens a3f8f69604 Rework GncItemEdit widget
Use real widgets instead of custom drawing something

In essence this is a gtkentry with an optional gtkbutton if the current cell
has a popup (like a calendar or account list). The old code went through
several hoops to keep a hidden gtkentry in sync with the custom drawn item
on screen.

There are still a few issues to fix:
- it's not properly themed to fit in the register. This will be fixed after switching to gtk3 (using css)
- right-click menu is wrong. This currenly shows a default copy/paste menu from a gtkentry
  it should be changed to show our own full menu
- keyboard events are still handled backwards. The sheet gets a first stab and passes
  on what it can't handle to the item edit. In the current implementation this means not
  all key strokes the item edit can handle are received (most notably paste is not working).
2017-03-31 14:03:49 +02:00
Geert Janssens 986720e6c3 Fix hidden scrollbars for itemlist type popup 2017-03-31 14:03:49 +02:00
Geert Janssens efcb06e6a3 Fix crash in previously unreached code 2017-03-31 14:03:49 +02:00
Geert Janssens 131462ca41 Create specialized popup items their respective source files
The extracted function in gnc_item_edit was unneeded and confusing
2017-03-31 14:03:49 +02:00
Geert Janssens 58bfd3e1e9 Reduce the cursor from a full widget to a simple gobject that tracks cursor coordinates
As with the grid there is no direct interaction possible with the cursor.
It is merely decoration. It does keep track of coordinates so I've made
it a gobject for memory management. The actual drawing of the cursor
frame is now done by the sheet, just like for the grid.

This change also fixes the transparency issue in the cursor.
2017-03-31 14:03:49 +02:00
Geert Janssens c54cf61cce Rework gnucash-cursor
- drop lots of unneeded complexity
- use cairo instead of gdk_gc to draw

Issue still to fix: the cursor widget has a grey background instead
of being transparent. I'm not sure this can be fixed before switching
to gtk3
2017-03-31 14:03:49 +02:00
Geert Janssens 6c06336d3e Reduce grid object from a complete widget to only two utility functions
There was no added value in it being a full widget. It only served two functions really
- speed draw the visible and non-editable part of a register window
- locating a cell starting from a pixel

Both are used exclusively by the sheet object, so
I have made them private functions of the sheet.
They are still kept in a separate file though for length considerations.
2017-03-31 14:03:49 +02:00
Geert Janssens 3025e30e4a Refactor divider line drawing some more to reduce duplicate code 2017-03-31 14:03:49 +02:00
Geert Janssens 93a03d19ee Use cairo to redraw the grid widget 2017-03-31 14:03:49 +02:00
Geert Janssens 4888d34554 Replace all other uses of GnomeCanvas with standard gtk widgets
Most are converted to GtkLayout/GtkiDrawingArea widgets as these
most closely approach the GnomeCanvas concept.

This currently builds and runs but has the following issues still:
- item edit isn't drawn properly (margin and offset issues)
- cursor is not handled properly yet

These will be handled in subsequent commits.
2017-03-31 14:03:49 +02:00
Geert Janssens 194634615f Convert gnc-header from GnomeCanvas to GtkLayout
Only reducing column size to less than window width needs extra
research. The auto-expansion of the description column is not
propagated to the header so header and body widths can go
temporarily out of sync as of this commit.
2017-03-31 14:03:49 +02:00