Commit Graph

17721 Commits

Author SHA1 Message Date
John Ralls
05049676cb Sync POTFILES.in with files added and removed by c++-backend. 2016-11-18 14:30:29 -08:00
John Ralls
105ec1e4f3 Fix bad time format.
Good catch by Mathew Forbis.
2016-11-17 20:34:51 -08:00
John Ralls
1774de79fe Fix Travis build errors. 2016-11-17 17:08:36 -08:00
John Ralls
0f506276ff Second interim merge of c++-backend.
This is about as far as I can go on the SQL/DBI backend without changes
to QofBackend, QofQuery, QofInstance, and the engine classes. The XML
backend needs the same OO treatment before that's possible, so that's
the next stage.
2016-11-17 15:38:08 -08:00
John Ralls
d73c9bef05 Remove two unnecessary local variable declarations. 2016-11-17 15:34:04 -08:00
John Ralls
3afe27ec45 Convert foo_needing_parents to std::vector and its loops to std::remove_if.
Fixing incorrect implementation in gnc-bill-term-sql and gnc-tax-table-sql,
where there was no test for the parent actually having been loaded.
Also #ifdef-out the starting balances part of GncSqlAccountBackend::load_all
and move its variable decls inside the ifdef as auto.
2016-11-17 15:34:04 -08:00
John Ralls
b847601ebe Replace GStrings with std::strings. 2016-11-17 15:34:03 -08:00
Robert Fewell
bc33d564a8 Changed the default value for date format
Set the default value to the new 'No Fancy Date Format'.
2016-11-16 19:23:58 +00:00
Robert Fewell
a56f031d45 Fix check printing custom preference value
The scheme option is 'date-format-user' so corrected here.
2016-11-16 19:22:21 +00:00
Robert Fewell
a67b4922c2 Correct the default options if default invalid
The default value should be a list and have set the default to the new
"No Fancy Date Format" option.
2016-11-16 19:20:15 +00:00
Robert Fewell
5ce8878764 Add an unset option to date-format
Added an option of "No Fancy Date Format" to date-format so it can be
the default. In this position, the format returned is that of what ever
the preference date is set to.
2016-11-16 19:13:50 +00:00
Robert Fewell
d56c3d3ac8 Added a default currency to the currency option
This was causing an error when the dialog options was raised.
2016-11-15 15:59:44 +00:00
Robert Fewell
12562bcc0c Add plot size option for future compatibility
This is really just a copy of the number-range-option with some tests
for the saved value being a pair which is used in later versions. If the
pair is a pixel setting, then that value will be used, otherwise the
default value is used. Should any report get saved, the saved values
will be over written in the old format.
2016-11-15 15:24:38 +00:00
Robert Fewell
da0b3b5131 Fix warning from glib when saving reports.
Glib complains about an already initialised pointer, there is no need
to initialise when used with gtk_tree_model_get_value.
2016-11-15 12:12:30 +00:00
Robert Fewell
74091fbcfa Change report resizing when not in view
When you have reports open but they are not selected, resizing the
window does not always resize the hidden report views properly. Use
the expose call back so the reports are reloaded on expose event.
2016-11-15 12:05:13 +00:00
Robert Fewell
372b3cc822 Forgot to add the png file to previous commit 2016-11-15 12:03:55 +00:00
Robert Fewell
371222cb6a Add an image for the report tab
There was an entry in plugin-page-report about a missing image for the
report tab so have created one and added it.
2016-11-15 11:29:37 +00:00
Robert Fewell
49014f4714 Change the reload to include using web_view_reload
In the resize call backs, use the webkit view reload function instead of
recreating the report.
2016-11-15 11:27:51 +00:00
Robert Fewell
891dcbc339 Track visibility of the view scroll bars
When the scroll bars show they can affect the chart so force a reload
when they show.
2016-11-15 11:18:44 +00:00
Robert Fewell
51277bcd81 Add progress bar updates for reload / Update
Added progress bar updates for refresh/reload button press and also for
when the options change. Created a new function to set progress bar
height from previous commit to be used for above changes.
2016-11-15 11:16:36 +00:00
Robert Fewell
12994ca6e7 Add call back to track page size changes
Add call back to track size-allocate events for the webkit view. Also
commented out expose event as that may not be required.
2016-11-15 11:15:23 +00:00
Robert Fewell
62e449f37b Stop the progress bar changing height
When the report is run and the progress bar is updated, the height
changes and then changes back forcing the webkit view to change height
and ultimately use the wrong value.
2016-11-15 11:09:43 +00:00
Robert Fewell
1b2f89e194 Add idle function to load report
The reason for webkit not using the full report area is that this area
has not been realized when the report is created and so webkit does not
know the correct size. By using the idle function, the page is created
and realized before loading the report with the added advantage the
progress bar updates on the blank report page.
2016-11-15 11:07:42 +00:00
Robert Fewell
d7648a2ba7 Remove macros/as-scrub-include.m4 from makefile
This has already been removed in previous commit.
2016-11-15 10:44:14 +00:00
John Ralls
2c01bfba13 Move gnc_sql_save_commodity to GncSqlBackend, with some restructuring. 2016-11-13 17:21:06 -08:00
John Ralls
b683878a25 Remove gnc-backend-sql.h and gnc-backend-sql.cpp.
Having removed all of their code to somewhere else.
2016-11-13 15:17:09 -08:00
John Ralls
00950e9724 Move 3 utility functions from gnc-backend-sql to gnc-sql-column-table-entry.
gnc_sql_load_object, gnc_sql_load_guid, and gnc_sql_append_guids_to_sql.
2016-11-13 14:52:03 -08:00
John Ralls
b838c1ebf3 Move gnc_sql_do_db_operation and gnc_sql_object_is_it_in_db into GncSqlBackend. 2016-11-13 12:49:45 -08:00
John Ralls
f2eb13fc55 Remove unused duplicate source file. 2016-11-13 12:49:09 -08:00
Geert Janssens
1339c1161f Fix make check after commit 673888dee7
- Update the lot list of the lot's account only when the account itself is not being destroyed
- Fix the test cases to accept the new (improved) lot destruction handling
2016-11-13 17:26:43 +01:00
Geert Janssens
ecb43e7d72 Bug 770364 - Sign of Value in Lots in Account window seems inconsistent
Two parts to this bug:
1. never reverse signs in the free splits list. Sign reversals don't
make sense there.

2. Sign reversal only makes sense for capital gains, not for business
transactions. So only to the sign dance for non-business lots in the
list of splits in the selected lot.
2016-11-12 11:06:27 +01:00
Geert Janssens
5b832c7f9b Use G_MAXINT64 instead of 0 to indicate an invalid date 2016-11-12 11:06:26 +01:00
Geert Janssens
96c22f54a3 Show empty business splits in lot viewer 2016-11-12 11:06:25 +01:00
Geert Janssens
254b4fbc2f Check more splits while running check & repair on business accounts
In addition, speed up the process a bit by already deleting empty splits as soon as they're encountered
2016-11-12 11:06:23 +01:00
Geert Janssens
a9c624bfad Business check & repair - correct lot invoice state
There have been situations where a lot refered to an invoice while
it doesn't actually contain splits for that invoice (any more).
The new code corrects this by removing the invoice reference from the lot.
Also if the lot and its splits don't agree on the invoice they belong to
set the lot invoice to whatever the splits indicate.
2016-11-12 11:06:22 +01:00
Geert Janssens
396117eec9 Various small improvements to check & repair on business accounts
- don't attempt to merge splits that belong to an invoice transaction. These splits are managed by the business code.
- lot link cleanup can leave empty splits, remove these as well
2016-11-12 11:06:20 +01:00
Geert Janssens
d52f44a8c7 When juggling business splits while scrubbing set both value and amount
With only value there were several warnings in the log file during scrubbing
2016-11-12 11:06:18 +01:00
Geert Janssens
0bcd30301e Update progress bar while running Check & Repair
Not complete - should still be added for check & repair invoked from a split register
2016-11-12 11:06:17 +01:00
Geert Janssens
673888dee7 Remove lot from account while deleting the lot
There was no way the account was informed about the lot being deleted.
This was resulting into invalid lot lists in an account while scrubbing.
Which would bomb at later stages like when re-running check & repair or
opening the lot viewer. Also saving would report a number of critical messages
about invalid objects, but these didn't result in a segfault.
2016-11-12 11:06:14 +01:00
John Ralls
32c4d14588 Ensure that the Namespace combo box is initialized to a valid iter.
Thanks to David T. for noticing that it wasn't.
2016-11-10 13:56:09 -08:00
John Ralls
ada3a31216 Fix DBI crash when URL lacks user and password. 2016-11-07 12:48:52 -08:00
John Ralls
c470d006ee Remove no-longer-necessary GncSqlBackend parameter.
Where it was required only to pass down to the CT_TIMESPEC specialization
of template<GncSqlObjectType Type>GncSqlColumnTableEntryImpl::add_to_query().
2016-11-07 12:48:51 -08:00
John Ralls
10b006fdc1 Replace GncSqlBackend::time64_to_string() with GncDateTime::format_zulu().
The primary motivation was to enable removing the sql_be parameter from
get_object_values and all of the templates it calls for the sole purpose
of using a customized per-server time output format (next commit). All
known sql servers/libraries can ingest GMT in ISO form (yyyy-mm-dd hh:mm:ss)
so there's no reason not to use a single standard format.

This has the secondary benefit of also removing an ugly character-by-character
formatting routine.
2016-11-07 12:48:50 -08:00
John Ralls
db719191a1 New function GncDateTime::format_zulu(), makes time string in GMT.
Required to ensure that date-times stored in SQL backend are in GMT for
backward compatibility.
2016-11-07 12:48:50 -08:00
John Ralls
ee0e61a07e Replace C API with C++ API for functions used by GncSqlDbiBackend.
Since these are now parent-class member functions they can be called
directly from dbi_be without any casting gymnastics.

Also: Move the GncSqlObjectBackend registry to its own class, a private
member of GncSqlBackend. This eliminates a static variable in gnc-backend-sql.cpp
and allows the GncSqlBackend::ObjectRegistry constructor to insert all of
the backends into the list, eliminating gnc_sql_init() and all of the
gnc_sql_init_foo_handler() functions. The cost of this is that the objects
are now created on the free store instead of the text segment.

Because the object backends are created at GncSqlBackend construction
there is now a GncSqlBookBackend in the registry and the second error
message in test_gnc_sql_commit_edit is no longer emitted; instead, the
object is properly committed.
2016-11-07 12:48:49 -08:00
John Ralls
b2a644c29d Separate SQL backend classes into their own header and source files.
And adjust includes accordingly.
2016-11-07 12:48:48 -08:00
John Ralls
4ae5abf83b Distinguish variables of various backend types by naming.
QofBackend* qof_be, GncSqlBackend* sql_be, and GncDbiBackend* dbi_be.\nRequested by Geert Janssens.
2016-11-07 12:48:47 -08:00
John Ralls
d1b406d8db Allow PRId64 & PRIu64 to work on MingGW in gnc-backend-dbi.cpp. 2016-11-07 12:47:34 -08:00
John Ralls
472b585feb Interim merge of c++-backend to expose C++ interface. 2016-10-29 13:16:29 -07:00
John Ralls
b8024fa9ea Fix review comment errors. 2016-10-29 12:40:57 -07:00