Merge branch 'maint' into unstable

This commit is contained in:
Geert Janssens 2018-02-02 18:53:47 +01:00
commit 59fb8efaf9
7 changed files with 80 additions and 3 deletions

View File

@ -1125,6 +1125,7 @@ many months before the current month:</property>
<child>
<object class="GtkLabel" id="label50">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes" comments="Preferences Dialog, General Tab">&lt;b&gt;General&lt;/b&gt;</property>
<property name="use_markup">True</property>
@ -1613,6 +1614,7 @@ many months before the current month:</property>
<child>
<object class="GtkLabel" id="label15">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">12</property>
<property name="label" translatable="yes">Time to _wait for answer:</property>
@ -2520,6 +2522,7 @@ many months before the current month:</property>
<child>
<object class="GtkLabel" id="label14">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">12</property>
<property name="label" translatable="yes" comments="Register2 feature">Number of _characters for auto complete:</property>
@ -3253,6 +3256,52 @@ many months before the current month:</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="apilabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Alpha Vantage API key</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="pref/general.finance-quote/alphavantage-api-key">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">To retrieve online quotes from Alphavantage, this key needs to be set. A key can be retrieved from the Alpha Vantage website.</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
<packing>
<property name="position">9</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Online Quotes</property>
</object>
<packing>
<property name="position">9</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>

View File

@ -8,6 +8,7 @@ SET(gnome_GSCHEMA
org.gnucash.dialogs.sxs.gschema.xml
org.gnucash.dialogs.totd.gschema.xml
org.gnucash.gschema.xml
org.gnucash.general.finance-quote.gschema.xml
org.gnucash.window.pages.account.tree.gschema.xml
org.gnucash.window.pages.gschema.xml
)

View File

@ -0,0 +1,9 @@
<schemalist gettext-domain="@GETTEXT_PACKAGE@">
<schema id="org.gnucash.general.finance-quote" path="/org/gnucash/general/finance-quote/">
<key name="alphavantage-api-key" type="s">
<default>''</default>
<summary>Alpha Vantage API key</summary>
<description>To retrieve online quotes from Alphavantage, this key needs to be set. A key can be retrieved from the Alpha Vantage website.</description>
</key>
</schema>
</schemalist>

View File

@ -56,5 +56,6 @@
(re-export gnc-prefs-set-float)
(re-export gnc-prefs-set-string)
(re-export gnc-prefs-set-coords)
(re-export gnc-prefs-get-string)
(define-public gnc:version (gnc-version))

View File

@ -419,7 +419,7 @@
(string-append
currency-str ":" (gnc-commodity-get-mnemonic commodity))
(begin
(set! saved-price (gnc-pricedb-lookup-day64 pricedb
(set! saved-price (gnc-pricedb-lookup-day-t64 pricedb
commodity currency
gnc-time))
(if (not (null? saved-price))
@ -465,6 +465,13 @@
#f)))
prices)))
;; Add the alphavantage api key to the environment. This value is taken from
;; the Online Quotes preference tab
(let* ((alphavantage-api-key (gnc-prefs-get-string "general.finance-quote" "alphavantage-api-key")))
(gnc:debug (string-concatenate (list "ALPHAVANTAGE_API_KEY=" alphavantage-api-key)))
(if (not (string-null? alphavantage-api-key))
(setenv "ALPHAVANTAGE_API_KEY" alphavantage-api-key)))
;; FIXME: uses of gnc:warn in here need to be cleaned up. Right
;; now, they'll result in funny formatting.

View File

@ -91,6 +91,7 @@ gnucash/gnome/gnc-split-reg.c
[type: gettext/gsettings]gnucash/gnome/gschemas/org.gnucash.dialogs.reconcile.gschema.xml.in.in
[type: gettext/gsettings]gnucash/gnome/gschemas/org.gnucash.dialogs.sxs.gschema.xml.in.in
[type: gettext/gsettings]gnucash/gnome/gschemas/org.gnucash.dialogs.totd.gschema.xml.in.in
[type: gettext/gsettings]gnucash/gnome/gschemas/org.gnucash.general.finance-quote.gschema.xml.in.in
[type: gettext/gsettings]gnucash/gnome/gschemas/org.gnucash.gschema.xml.in.in
[type: gettext/gsettings]gnucash/gnome/gschemas/org.gnucash.window.pages.account.tree.gschema.xml.in.in
[type: gettext/gsettings]gnucash/gnome/gschemas/org.gnucash.window.pages.gschema.xml.in.in

View File

@ -0,0 +1,9 @@
<schemalist gettext-domain="@GETTEXT_PACKAGE@">
<schema id="org.gnucash.general.finance-quote" path="/org/gnucash/general/finance-quote/">
<key name="alphavantage-api-key" type="s">
<default>''</default>
<summary>Alpha Vantage API key</summary>
<description>To retrieve online quotes from Alphavantage, this key needs to be set. A key can be retrieved from the Alpha Vantage website.</description>
</key>
</schema>
</schemalist>