Commit Graph

22843 Commits

Author SHA1 Message Date
Robert Fewell
9f97ce6c21 Fix g_signal_handler_disconnect: assertion in trace file
There is a difference in the way the sheet is closed between registers
and invoices. The gnc-date-cell-destroy is being called before the
gnc-item_edit_destroying for invoices and so when the item_edit tries
to do the signal disconnect on the popup_item it no longer exists.
Moving the gtk_widget_destroy before ledger_destroy fixes this.
2020-06-06 10:04:36 +01:00
John Ralls
e4e36e6843 Bug 797781 - Num Field Regression - characters in wrong order when typed. 2020-06-05 12:06:32 -07:00
John Ralls
cee479f4f4 Gnucash-sheet: Add debug statements for tracking selection. 2020-06-05 12:06:32 -07:00
Geert Janssens
153ee8871a Add first version of gnucash-cli manpage
Note manpages for both gnucash and gnucash-cli need revision.
They refer to outdated files and environment variables, and
some more recent command line options are missing.
2020-06-05 20:32:14 +02:00
Geert Janssens
769196fec6 First version of a gnucash-cli man page 2020-06-05 20:13:34 +02:00
Geert Janssens
cee52d4f91 Convert '--run-report' to '--report run' to accomodate for additonal report commands
Note this required the introduction of a '--name' parameter
for the report name to run. Without it the command line
would have to support a variable number of positional
parameters, depending on the context (quotes or report)
and that would complicate the parsing considerably.
2020-06-05 19:46:17 +02:00
Geert Janssens
451d38f6e8 Convert command line option '--add-price-quotes' to '--quotes get' 2020-06-05 18:44:07 +02:00
Geert Janssens
422dca54e1 Rework command line option parsing to store values directly in class member variables
The program options libary has a convenience binding for boost::optional
to indicate whether an option is set or not.
Use this to store options passed on the command line directly
in variables for later use. This avoids the need to refer to options
in several locations using a fixed string (like 'help', 'help-gtk', 'nofile',...)

In addition drop a number of obsolete class member variables.
They were leftovers from the conversion to c++ and no longer used.
2020-06-05 18:16:25 +02:00
Christopher Lam
d14e2cced7 [cli-reports] modify to open session readonly
Reverts 658241d3b because now READONLY session will not delete lock
file. Because reports don't (and shouldn't) modify data. allows
reports to be run on files open in another session.
2020-06-05 21:01:49 +08:00
Robert Fewell
d4e90132d9 Fix a missing mode == in 'Replace the three bool parameters
to qof_session_begin to an enum'.
2020-06-05 11:10:16 +01:00
John Ralls
b8d514e157 Don't try to unlock the GncDbiSqlConnection when it was connected read-only.
If it's locked it's not *our* lock.
2020-06-04 14:07:28 -07:00
John Ralls
6a1cb5eecd Replace the three bool parameters to qof_session_begin to an enum.
For clarity. In so doing found the backend behavior a bit inconsistent
so it's modified to do what the enum values indicate.

In the course of changing the various calls I found some implementation
errors in the back end and corrected them.
2020-06-04 14:07:28 -07:00
John Ralls
c73a1bd475 Extract function template drop_database. 2020-06-04 14:07:28 -07:00
John Ralls
a320035f42 QofSession, QofBackend: Change book_id to uri.
It's more descriptive and less likely to be confused with the book:id value
in XML files that is the book's GUID.
Also changed the QofSessionImpl::begin new_uri parameter from std::string to
const char*. There's no point in allocating a string just to call
new_uri.c_str() all over the place.
2020-06-04 14:07:28 -07:00
John Ralls
65e2639de4 Delete QOF_STDOUT.
Apparently a hack for the long-gone QSF backend.
2020-06-04 14:07:28 -07:00
Christopher Lam
0281ef2fc5 Bug 797739 - Tweak Transaction Report Column Defaults
Tweaks to Transaction Report defaults:

* Account Name: false
* Full Account Name: false
* Other Account Name: true
* Amount: double

Also tweak test-transaction which assumed previous defaults.
2020-06-03 19:19:10 +08:00
Yuri Chornoivan
1467f33275 I18N: Fix typo Exsiting -> Existing 2020-06-02 17:50:22 +02:00
John Ralls
54859eaf5b Add scm-core-utils as dependency of scm-engine-1.
Fixes build failure reported on gnucash-devel.
2020-06-01 13:43:28 -07:00
John Ralls
ff8075569e Include gnucash-windows-locale.c in the dist. 2020-06-01 09:35:15 -07:00
John Ralls
0f6cec18ee Release 3.903. 2020-05-31 14:39:38 -07:00
Geert Janssens
88c27c5ed3 Make gnucash-cli report errors to stderr by default. 2020-05-31 11:17:04 -07:00
John Ralls
73063e5700 Provide an error message for ERR_BACKEND_LOCKED. 2020-05-31 10:42:48 -07:00
Frank H. Ellenberger
3e3fc72fc7 Merge branch 'maint' 2020-05-31 19:21:45 +02:00
John Ralls
aac4332f48 Put command logging back to logging.
This time with PERR instead of g_warning. N.B. If you want the errors
on stderr you have to pass --logto=stderr.
2020-05-31 09:47:39 -07:00
John Ralls
fe28d6c3dc Merge branch 'maint' 2020-05-31 08:21:49 -07:00
John Ralls
d13598a426 New Ukrainian translation for 4.x from the translation project. 2020-05-31 08:21:40 -07:00
John Ralls
0778f2d57e Add gnucash-windows-locale.c to POTFILES.in
Not that it has any translatable strings.
2020-05-31 08:21:40 -07:00
Christopher Lam
658241d3be [gnucash-commands] don't force open a locked datafile
qof_session_begin (..., ..., ignore_lock=TRUE, ..., ...) will
force-open a datafile currently in use in another session.

This will unfortunately delete any existing .LCK file.

To my knowledge there is no read-only qofsession which will leave .LCK
file intact. Therefore to prevent possible dataloss, it is best to
disallow opening a locked file which prevents deletion of .LCK file.
2020-05-31 22:04:19 +08:00
Christopher Lam
fe09c45d17 [gnucash-commands] fprintf instead of g_warning
because g_warning doesn't actually report error. also fix indent which
was previously misleading.
2020-05-31 22:04:19 +08:00
Frank H. Ellenberger
76015bd0b6 Update description of gnc_gnome_help and gnc_launch_assoc 2020-05-31 00:57:17 +02:00
John Ralls
2a42078e9a Prevent libstdc++ copysign declaration error on Win32. 2020-05-30 15:18:18 -07:00
John Ralls
8654cb86c8 Don't try to build gnucash-windows-locale.c on non-Windows OSes. 2020-05-30 14:48:20 -07:00
John Ralls
14ed322297 Extract set_win32_thread_locale() to a new C file gnucash-windows-locale.c
g++ can't find the Microsoft Locale symbols, gcc can.
2020-05-30 14:21:07 -07:00
John Ralls
e810ee1c09 gi18n.h, binreloc.h, and gnc-engine.h have C linkage. 2020-05-30 14:18:34 -07:00
Christopher Lam
b0effbc36f cli-reports: if run-report matches multiple, offer choices
If --run-report="Reportname" matches multiple reports, offer a
disambiguation. Will show guid and display the options selected in the
saved report. Example:

"Multicolumn View" matches multiple reports. Select guid instead:

* guid: 2f17ecb535f24a3a9f314bc5855569e5
General / Number of columns: 2.0
General / Report name: A saved-report based on multicolumn-view
General / Stylesheet: Easy

* guid: d8ba4a2e89e8479ca9f6eccdeb164588
2020-05-30 23:16:04 +08:00
Geert Janssens
ad826e0f44 A few translation tweaks in gnucash and gnucash-cli
Contrary to glib's option parsing, boost's doesn't do further translations
internally, so pass it pre-translated messages.
2020-05-30 10:19:48 +02:00
Geert Janssens
18adb5723c C++ tweaks
- use auto where possible
- replace goto with function to call
2020-05-30 09:33:57 +02:00
Geert Janssens
780c4b4e2b Small tweaks that got left out by mistake
Among others this will fix the missing saved reports in
gnucash-cli --run-report
2020-05-30 09:22:42 +02:00
Geert Janssens
d57a1cfaec Move saved report loading to report initialization code 2020-05-30 09:06:59 +02:00
Christopher Lam
30450e4d87 Check all known report templates instead of just custom reports.
Allows users to run any report from the command-line.
2020-05-29 17:13:59 -07:00
John Ralls
3884e24eb9 Convert args passed to run reports to const std::string&. 2020-05-29 17:11:38 -07:00
John Ralls
1e9b5a5707 gnucash-cli: Actually run the report. 2020-05-29 16:03:25 -07:00
John Ralls
c23ca6fb12 Make run-report member variable names consistent. 2020-05-29 16:00:52 -07:00
Christopher Lam
caac850104 instead of saved-reports only, dump in-menu? reports alphabetically
@derekatkins request
2020-05-29 15:31:04 -07:00
Christopher Lam
b34913feda [cli-reports] run reports from cli 2020-05-29 15:30:42 -07:00
Geert Janssens
1ea284d868 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.
2020-05-29 18:34:23 +02:00
Geert Janssens
4af7ea0f0a Fix log initialization
- Log related options weren't parsed properly yet
- Rewrite gnc_log_init to use c++ features
2020-05-29 17:43:37 +02:00
Geert Janssens
fa66168d59 Rework gnucash startup code to be a Gnucash class member function
This allows to remove a couple of helper functions
2020-05-29 17:43:37 +02:00
Geert Janssens
b56b87685b 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.
2020-05-29 17:43:37 +02:00
Geert Janssens
09b270c693 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.
2020-05-29 17:43:37 +02:00