gnucash master: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Fri May 29 17:05:53 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/1ea284d8 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4af7ea0f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/fa66168d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b56b8768 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/09b270c6 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/5cf0c05c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/16003416 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/88ed957d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a435b4c4 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/317f32de (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f6788412 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/2b8f91a1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/91473b12 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/785f6702 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/969d00a5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c58cfdb8 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/3cd0de8c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/736979f9 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9bf2b026 (commit)
	from  https://github.com/Gnucash/gnucash/commit/45d52d61 (commit)



commit 1ea284d868244f9453cc22e4e0f8bf3a88b95e45
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 18:26:52 2020 +0200

    Use common input file parameter for gnucash-cli --add-price-quotes
    
    As gnucash and most gnucash-cli commands will work on an input file
    it makes sense to use the common positional input-file parameter everywhere.
    
    It's still optional for a normal gnucash run though. It will fall back to
    to last-used file as before.
    
    A --add-price-quotes run on the other hand will bail out with an error
    message. As this command is typically run unattended in a cron script
    it's safer to explicitly request a file to work on.

commit 4af7ea0f0a0f06d384abdf321c804e059ddc992a
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 14:54:05 2020 +0200

    Fix log initialization
    
    - Log related options weren't parsed properly yet
    - Rewrite gnc_log_init to use c++ features

commit fa66168d59276b982de63fdd53ae64eb7a6ff454
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 12:42:56 2020 +0200

    Rework gnucash startup code to be a Gnucash class member function
    
    This allows to remove a couple of helper functions

commit b56b87685b5a8fd418f5c694fc079f60d615f4f0
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 14:13:33 2020 +0200

    Factor out common quotes retrieval code into a new file gnucash-commands.cpp
    
    This file will contain implementations of all
    commands that can be run via gnucash-cli.

commit 09b270c693c73893d892676220e365e7b3bcc0ad
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 11:27:09 2020 +0200

    Return from main instead of exiting
    
    Right now it doesn't make a difference as the end of main
    is currently never reached. However with some additional
    tweaks it can be, and that would allow the application
    destructor to be called for a nicer cleanup on exit.

commit 5cf0c05ca44638887eaeb152e6cf4719140de76c
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 11:10:51 2020 +0200

    Catch unrecognized command line options
    
    Print help message if that happens.
    The alternative would be to pass allow_unregistered() to the options description
    while parsing. That however would only make sense if we had other code to parse
    the options. We don't.

commit 160034165c8b9b5782626833ee933f1eff3fe42d
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 11:02:28 2020 +0200

    Make options that don't take arguments bool_switch type
    
    This means they will always exist in the value store after parsing and
    are set to true or false. This eliminates the need to test for their
    existence first.

commit 88ed957d2a062718aad2c6c1c4de62b36907bafb
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 11:01:01 2020 +0200

    Pass argc and argv by value instead of by reference
    
    Contrary to gtk_init, boost::program_options won't remove parsed options from
    the argument list so there's no need to provide the option to update
    the list.

commit a435b4c4f6c02839b0f366f6fc7c06609d315e25
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Thu May 28 22:24:18 2020 +0200

    Port command line option handling to boost::program_options
    
    This allows for better separation of options in common, gnucash and gnucash-cli options.

commit 317f32de0b17a9513a392beb4777eb11edc80e4d
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat May 23 17:21:13 2020 +0200

    Only offer gtk options for gnucash, not for gnucash-cli
    
    * As the gtk command line options are only relevant for
      gnucash and not gnucash-cli, remove the bit that adds
      them from Gnucash::CoreApp.
    * As the gtk command line options are parsed out by gtk_init_check
      it's sufficient to run that before parsing our own command line
      options to have gtk handle them for us.
    * That just leaves us with the loss of a help message for the
      gtk command line options. To handle that we derive a class
      Gnucash::Gnucash from Gnucash::CoreApp which will generate an
      option context for the gtk options purely to extract the help message.
      This will then be used if the users pass option --help-gtk.
    
    This is a bit clumsy to do with GOptionContext as it requires to store
    a few gnucash only parameters in Gnucash::CoreApp. The plan is to
    improve this in a future commit.
    Note however we will still be stuck with the dummy option context generation
    for the gtk option help message. There's just no other way to extract this
    message otherwise.

commit f6788412ce5044236ead015a03e9d70627608506
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu May 28 14:44:52 2020 -0700

    MacOS Build Fixes

commit 2b8f91a191669a843155030e419b570d581ec06b
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 16:35:33 2020 +0200

    Rename Gnucash::Base to Gnucash::CoreApp
    
    That name better reflects what the class represents

commit 91473b1218a49dab8c28b261e7142e3607c66ad7
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sat May 23 10:15:23 2020 +0200

    Reformat Objective C code to work around a KDevelop bug.
    
    KDevelop erroneously interprets [[ as the beginning of a C++17 attribute which
    messes up all subsequent formatting. Changing this to '[ [' (with a space in between)
    resolves the issue.

commit 785f6702a11f6eb36b3f66470b1237f36ad08776
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 14:13:39 2020 +0200

    Switch to using boost::locale::format and iostream for printing messages

commit 969d00a59f9ededeb4ea27df69d694a8eba64eea
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 22 14:56:35 2020 +0200

    Further cleanup in gnucash and gnucash-cli
    
    - Remove unneeded includes, required a few fixes in other header files
    - Silence unused parameter warnings using c++17 attribute [[maybe_unused]]
    - Remove some duplicate, unused functions from gnucash and gnucash-cli
      They were a left over from a previous commit

commit c58cfdb87dfaa90bbb0d3b4710e3198d651819aa
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 14:06:21 2020 +0200

    Extract common setup bits from gnucash and gnucash-cli into a separate class Gnucash::Base
    
    This is just a first start, more refactoring will follow in later commits.
    The idea is to have an application class that provides the basic framework
    gnucash and gnucash-cli will become specializations of this class adding their
    specific functionality. I'm splitting this over several commits to be able to
    keep track of all the many changes.

commit 3cd0de8ce4dd3a5acae1e71cc733cb37a3ae2387
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri May 29 13:57:20 2020 +0200

    Introduce new executable 'gnucash-cli'
    
    This tool is intended to expose certain gnucash functions to a command line interface.
    The first one is --add-price-quotes. This option currently also exists in gnucash.
    It will be marked deprecated there. Future extensions to this can be things like
    report generation, non-interactive imports,...

commit 736979f9326d1aedacd7b3a655addd2c775b0f0f
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue May 19 17:30:55 2020 +0200

    Build gnucash main file as C++

commit 9bf2b026ac2afe535a600d1269bf9e82dc90f61f
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon May 18 17:46:01 2020 +0200

    Rename main source file from gnucash-bin.c to gnucash.c
    
    That reflects more closely what the eventual binary will be named.



Summary of changes:
 CMakeLists.txt                                     |   6 +-
 gnucash/CMakeLists.txt                             |  54 +-
 gnucash/gnome-utils/gnc-file.h                     |   1 +
 gnucash/gnome/dialog-new-user.h                    |   2 +
 gnucash/gnucash-bin.c                              | 936 ---------------------
 gnucash/gnucash-cli.cpp                            | 124 +++
 gnucash/gnucash-commands.cpp                       | 118 +++
 .../business-urls.h => gnucash-commands.hpp}       |  19 +-
 gnucash/gnucash-core-app.cpp                       | 680 +++++++++++++++
 gnucash/gnucash-core-app.hpp                       |  74 ++
 gnucash/gnucash.cpp                                | 423 ++++++++++
 po/POTFILES.in                                     |   5 +-
 12 files changed, 1483 insertions(+), 959 deletions(-)
 delete mode 100644 gnucash/gnucash-bin.c
 create mode 100644 gnucash/gnucash-cli.cpp
 create mode 100644 gnucash/gnucash-commands.cpp
 copy gnucash/{gnome/business-urls.h => gnucash-commands.hpp} (71%)
 create mode 100644 gnucash/gnucash-core-app.cpp
 create mode 100644 gnucash/gnucash-core-app.hpp
 create mode 100644 gnucash/gnucash.cpp



More information about the gnucash-patches mailing list