Bug 397112

Summary: Add editor for online quotes
Product: [Frameworks and Libraries] libalkimia Reporter: Ralf Habacker <ralf.habacker>
Component: GeneralAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: master   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In: 8.0.0
Bug Depends on: 397957, 397958    
Bug Blocks:    
Attachments: Main window of online quote editor
Web inspector for the displayed web page
locale specific combobox

Description Ralf Habacker 2018-08-03 00:24:51 UTC
Alkimia is a library intended for common financial function, as mentioned at https://community.kde.org/Alkimia/Usecases 

Especially functions for querying financial status, which is mentioned at https://community.kde.org/Alkimia/Usecases#Finance_Status, would increase the usability of alkimia.

When finding errors in KMyMoney in relation with price updates, it turned out that the current implementation of online price update settings does not offer any possibility to check updated regular expressions directly.

For this use case it would be helpful to have an editor in alkimia to simplify this.

Appended is a screenshot of the implementation of this editor. On the left side the online quote can be selected, changed and checked and on the right side, the fetched web page is shown.
Comment 1 Ralf Habacker 2018-08-03 00:25:43 UTC
Created attachment 114278 [details]
Main window of online quote editor
Comment 2 Ralf Habacker 2018-08-03 00:27:42 UTC
Created attachment 114279 [details]
Web inspector for the displayed web page

In the context menu of the web page there is an entry to open the web inspector, which helps to identify required regular expressions.
Comment 3 Ralf Habacker 2018-08-03 00:35:13 UTC
Created attachment 114280 [details]
locale specific combobox

In case there are locale specific issues on web sites providing online quotes (as mentioned at bug 396797) there is a language combo box with which the web page could be displayed in several locales.
Comment 4 Ralf Habacker 2018-08-03 01:08:04 UTC
For online quotes, which are not fetchable by the normal KIO download support (see bug 396003 comment 1), webkit support can be activated by choosing the '.webkit' suffix in the quote name.

Please not that using this suffix is preliminary and will be replaced by a dedicated check box in the online quote editing area later.
Comment 5 Ralf Habacker 2018-08-11 03:51:55 UTC
See https://cgit.kde.org/alkimia.git/log/?h=work/397112-alkonlinequotes for the related working branch. 

It contains a copy of class WebPriceQuote and friends splitted into files for each class and migrated to the 'Alk' namespace e.g. AlkOnlineQuote. The online quote editor is located in the tools subdirectory an uses a widget named AlkOnlineQuoteWidget, imported from kmymoney an extended with a profile view, which is required to be able to edit online quotes for different applications (Online quotes in kmymoneyrc or GNHS files for skrooge)

The new classes has been (partially) refactored to be usable as public api (no inline code, private stuff moved into Private class) 

To see how the current api is usable in QML applications a qml plugin (see qml subdir) a related test app (see test subdir) has been added.
Comment 6 Ralf Habacker 2018-12-13 10:07:26 UTC
Online quote editor has been moved to master branch, is usable now and will be released with alkimia version 8.0.0.