diff --git a/configure.ac b/configure.ac
index 4c7b38a560..e8bec1faf2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1585,6 +1585,7 @@ AC_CONFIG_FILES(
src/gnome/gschemas/org.gnucash.dialogs.sxs.gschema.xml.in
src/gnome/gschemas/org.gnucash.dialogs.totd.gschema.xml.in
src/gnome/gschemas/org.gnucash.gschema.xml.in
+ src/gnome/gschemas/org.gnucash.general.finance-quote.gschema.xml.in
src/gnome/gschemas/org.gnucash.window.pages.account.tree.gschema.xml.in
src/gnome/gschemas/org.gnucash.window.pages.gschema.xml.in
src/gnome-utils/gschemas/org.gnucash.history.gschema.xml.in
diff --git a/po/POTFILES.in b/po/POTFILES.in
index decb2298f7..990b3ba6fd 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -238,6 +238,7 @@ src/gnome/gnc-split-reg.c
[type: gettext/gsettings]src/gnome/gschemas/org.gnucash.dialogs.reconcile.gschema.xml.in.in
[type: gettext/gsettings]src/gnome/gschemas/org.gnucash.dialogs.sxs.gschema.xml.in.in
[type: gettext/gsettings]src/gnome/gschemas/org.gnucash.dialogs.totd.gschema.xml.in.in
+[type: gettext/gsettings]src/gnome/gschemas/org.gnucash.general.finance-quote.gschema.xml.in.in
[type: gettext/gsettings]src/gnome/gschemas/org.gnucash.gschema.xml.in.in
[type: gettext/gsettings]src/gnome/gschemas/org.gnucash.window.pages.account.tree.gschema.xml.in.in
[type: gettext/gsettings]src/gnome/gschemas/org.gnucash.window.pages.gschema.xml.in.in
@@ -494,7 +495,6 @@ src/plugins/customer_import/gnc-plugin-customer_import.c
src/plugins/customer_import/gtkbuilder/dialog-customer-import-gui.glade
src/plugins/customer_import/libgncmod-customer_import.c
src/plugins/example/gncmod-example.c
-src/plugins/example/gnc-plugin.example.c
src/python/gncmod-python.c
src/register/ledger-core/gnc-ledger-display2.c
src/register/ledger-core/gnc-ledger-display.c
diff --git a/src/core-utils/core-utils.scm b/src/core-utils/core-utils.scm
index 8fd2869825..8d88f62f50 100644
--- a/src/core-utils/core-utils.scm
+++ b/src/core-utils/core-utils.scm
@@ -60,5 +60,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))
diff --git a/src/gnome-utils/gtkbuilder/dialog-preferences.glade b/src/gnome-utils/gtkbuilder/dialog-preferences.glade
index 50cd79a5a4..821778c7bb 100644
--- a/src/gnome-utils/gtkbuilder/dialog-preferences.glade
+++ b/src/gnome-utils/gtkbuilder/dialog-preferences.glade
@@ -3102,6 +3102,18 @@ many months before the current month:
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
7
@@ -3777,6 +3777,80 @@ many months before the current month:
False
+
+
+
+ 9
+
+
+
+
+ True
+ False
+ 0
+ Online Quotes
+
+
+ 9
+ False
+
+
True
diff --git a/src/gnome/gschemas/CMakeLists.txt b/src/gnome/gschemas/CMakeLists.txt
index 05e8c82f66..21697b413d 100644
--- a/src/gnome/gschemas/CMakeLists.txt
+++ b/src/gnome/gschemas/CMakeLists.txt
@@ -7,6 +7,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
)
@@ -22,4 +23,4 @@ SET(gnome_gschema_DIST_local "")
FOREACH(file ${gnome_GSCHEMA})
LIST(APPEND gnome_gschema_DIST_local ${file}.in.in)
ENDFOREACH()
-SET_DIST_LIST(gnome_gschema_DIST CMakeLists.txt Makefile.am ${gnome_gschema_DIST_local})
\ No newline at end of file
+SET_DIST_LIST(gnome_gschema_DIST CMakeLists.txt Makefile.am ${gnome_gschema_DIST_local})
diff --git a/src/gnome/gschemas/Makefile.am b/src/gnome/gschemas/Makefile.am
index 6e5070ae82..3b353bf17f 100644
--- a/src/gnome/gschemas/Makefile.am
+++ b/src/gnome/gschemas/Makefile.am
@@ -8,6 +8,7 @@ gschema_in_files = \
org.gnucash.dialogs.sxs.gschema.xml.in \
org.gnucash.dialogs.totd.gschema.xml.in \
org.gnucash.gschema.xml.in \
+ org.gnucash.general.finance-quote.gschema.xml.in \
org.gnucash.window.pages.account.tree.gschema.xml.in \
org.gnucash.window.pages.gschema.xml.in
diff --git a/src/gnome/gschemas/org.gnucash.general.finance-quote.gschema.xml.in.in b/src/gnome/gschemas/org.gnucash.general.finance-quote.gschema.xml.in.in
new file mode 100644
index 0000000000..1a69fae6ae
--- /dev/null
+++ b/src/gnome/gschemas/org.gnucash.general.finance-quote.gschema.xml.in.in
@@ -0,0 +1,9 @@
+
+
+
+ ''
+ Alpha Vantage API key
+ To retrieve online quotes from Alphavantage, this key needs to be set. A key can be retrieved from the Alpha Vantage website.
+
+
+
diff --git a/src/scm/price-quotes.scm b/src/scm/price-quotes.scm
index 0008dd8047..2f01ca143d 100644
--- a/src/scm/price-quotes.scm
+++ b/src/scm/price-quotes.scm
@@ -453,6 +453,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.