Commit Graph

23043 Commits

Author SHA1 Message Date
Geert Janssens
160034165c 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.
2020-05-29 17:43:37 +02:00
Geert Janssens
88ed957d2a 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.
2020-05-29 17:43:37 +02:00
Geert Janssens
a435b4c4f6 Port command line option handling to boost::program_options
This allows for better separation of options in common, gnucash and gnucash-cli options.
2020-05-29 17:43:37 +02:00
Geert Janssens
317f32de0b 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.
2020-05-29 17:43:37 +02:00
John Ralls
f6788412ce MacOS Build Fixes 2020-05-29 17:43:37 +02:00
Geert Janssens
2b8f91a191 Rename Gnucash::Base to Gnucash::CoreApp
That name better reflects what the class represents
2020-05-29 17:37:57 +02:00
Geert Janssens
91473b1218 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.
2020-05-29 17:37:57 +02:00
Geert Janssens
785f6702a1 Switch to using boost::locale::format and iostream for printing messages 2020-05-29 17:37:57 +02:00
Geert Janssens
969d00a59f 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
2020-05-29 17:37:57 +02:00
Geert Janssens
c58cfdb87d 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.
2020-05-29 17:37:57 +02:00
Geert Janssens
3cd0de8ce4 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,...
2020-05-29 17:37:57 +02:00
Geert Janssens
736979f932 Build gnucash main file as C++ 2020-05-29 17:37:57 +02:00
Geert Janssens
9bf2b026ac Rename main source file from gnucash-bin.c to gnucash.c
That reflects more closely what the eventual binary will be named.
2020-05-29 17:37:57 +02:00
Geert Janssens
45d52d612a Fix build depencency hiccup
report-menus needs gnc-gnome. It may also need gnc-gnome-utils
but that's already a dependency of gnc-gnome so it will be
built anyway.
2020-05-29 17:36:13 +02:00
Geert Janssens
a124e647db Add files omitted in previous commit 2020-05-29 17:35:04 +02:00
Frank H. Ellenberger
3a97fc6a81 Merge PR #727 2020-05-29 17:23:56 +02:00
Geert Janssens
5fc2b9519c Add mock sources and import-export test to dist 2020-05-29 17:20:53 +02:00
Frank H. Ellenberger
2a77c9fc9c L12N:de Ammend last commit about Python messages
keep format-flags
update po date
2020-05-29 16:47:00 +02:00
Christopher Lam
def9a1610c Use gnc:split->owner instead of gnc:owner-from-split 2020-05-29 21:32:23 +08:00
Christopher Lam
c434239b7d Upgrade split->owner to gnc:split->owner 2020-05-29 21:32:23 +08:00
Christopher Lam
8717c5c3cc Bugfix new reports 2020-05-29 21:11:58 +08:00
Christopher Lam
efb9abfb4d deprecate old reports 2020-05-29 18:18:38 +08:00
Christopher Lam
6caf7beee3 Merge branch 'master-guid-dance' #706
For release notes:

* new reports are now using different options and renderer
* options and layout are different

* Old reports still accessible via --extras
2020-05-29 18:13:57 +08:00
c-holtermann
bcb2b47151 updates for python gettext 2020-05-29 10:15:08 +02:00
c-holtermann
fdf51872c1 update with recent gnucash.pot 2020-05-29 10:14:10 +02:00
John Ralls
5091d7a670 Merge Christoph Holterman's python-gettext-localize into master. 2020-05-28 14:17:10 -07:00
John Ralls
20251999a4 python-gettext-localize: Additional POTFILES.in changes. 2020-05-28 14:16:38 -07:00
c-holtermann
b13f40aeaf remove translation test 2020-05-28 20:55:15 +02:00
c-holtermann
e1701fbdd6 locale is not needed anymore (debug) 2020-05-28 20:42:27 +02:00
c-holtermann
9e678a421e remove debug stuff 2020-05-28 20:31:16 +02:00
c-holtermann
7bf38ef837 test info 2020-05-28 20:29:33 +02:00
c-holtermann
ca21f32249 remove global gettext import 2020-05-28 20:21:31 +02:00
c-holtermann
efe9b4b606 remove debug info 2020-05-28 20:19:39 +02:00
c-holtermann
f788e59318 remove debug stuff (temporarily) 2020-05-28 18:51:01 +02:00
c-holtermann
fc87e275fa further debugging 2020-05-28 18:51:01 +02:00
c-holtermann
8d429d8295 further debugging 2020-05-28 18:51:01 +02:00
c-holtermann
2c09fe4f44 debug on travis 2020-05-28 18:51:01 +02:00
c-holtermann
694e5a26ff add test for gettext 2020-05-28 18:50:55 +02:00
c-holtermann
31d2b3cb44 install gettext 2020-05-28 18:41:34 +02:00
c-holtermann
101a2ca09d add translatable python files 2020-05-28 18:41:34 +02:00
c-holtermann
22848c6b0a localize strings for python 2020-05-28 18:41:34 +02:00
c-holtermann
41dc6ddbe2 implement gettext localization for python
make gnc_path_get_localedir() and GETTEXT_PACKAGE available for python
to access locales. Import gettext module to provide _ as translator
method. Provide null _-method returning english text in case of missing gettext.
Make a lot of messages translatable by adding _-method. Include python
files to create .pot-files.
2020-05-28 18:41:34 +02:00
Robert Fewell
6e83494008 Add opening the transaction association from register sheet.
Add option to open transaction association by clicking on the
association in the association cell.
2020-05-28 17:25:41 +01:00
Robert Fewell
6b3f9bd80e Bug 796531 - Display the Transaction Association link
Displays the Transaction Association link in the Transaction Report and
when selected will open the association outside of Gnucash as it
currently does when opened from the register.
2020-05-28 17:25:41 +01:00
Robert Fewell
ac02966426 Add a total entries label to the Association dialogue 2020-05-28 17:25:41 +01:00
Robert Fewell
553b422e19 Change Associations list dialog for Business
Change the existing Transaction list dialog to cater for Business
associations and add a menu option to the Business menu to open this
dialog.
2020-05-28 17:25:41 +01:00
Robert Fewell
e2fac36608 Add an Invoice section to dialog-utils for when the path head changes 2020-05-28 17:25:41 +01:00
Robert Fewell
30f21763e8 Allow Associations to be added to invoices
Use the existing associations functions to do the updating, opening and
removing of the association for invoices and all objects that use the
invoice interface. The actual association when present is added as a
link button which is shown below the notes.
2020-05-28 17:25:41 +01:00
Robert Fewell
2f9be87549 Replace tabs with spaces in gncInvoice.c/h
Replace tabs with spaces, trim ending spaces and add spaces to function
calls where appropriate.
2020-05-28 17:25:41 +01:00
Robert Fewell
69aeacb621 Add KVP Association property to GncInvoice 2020-05-28 17:25:41 +01:00