mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Use GncQuotes in price db window
This commit is contained in:
parent
8896d61c7a
commit
8c08fedaa1
@ -133,6 +133,7 @@ target_link_libraries(gnc-gnome
|
||||
gnc-register-gnome
|
||||
gnc-register-core
|
||||
gnc-gnome-utils
|
||||
gnc-app-utils
|
||||
gnc-engine
|
||||
gnc-expressions
|
||||
gnc-html
|
||||
@ -148,6 +149,7 @@ target_compile_options(gnc-gnome PRIVATE -Wno-deprecated-declarations)
|
||||
target_include_directories(gnc-gnome
|
||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/libgnucash/app-utils
|
||||
${CMAKE_SOURCE_DIR}/libgnucash/app-utils/calculation
|
||||
${CMAKE_SOURCE_DIR}/gnucash/html
|
||||
${CMAKE_BINARY_DIR}/gnucash/gnome-utils # for gnc-warnings.h
|
||||
|
@ -27,8 +27,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <libguile.h>
|
||||
#include <time.h>
|
||||
#include <gnc-quotes.hpp>
|
||||
|
||||
extern "C" {
|
||||
#include "dialog-utils.h"
|
||||
@ -47,9 +47,6 @@ extern "C" {
|
||||
#include "gnc-ui.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "gnc-warnings.h"
|
||||
#include "swig-runtime.h"
|
||||
#include "guile-mappings.h"
|
||||
#include "gnc-engine-guile.h"
|
||||
#include <gnc-glib-utils.h>
|
||||
}
|
||||
|
||||
@ -560,30 +557,19 @@ void
|
||||
gnc_prices_dialog_get_quotes_clicked (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
auto pdb_dialog = static_cast<PricesDialog *> (data);
|
||||
SCM quotes_func;
|
||||
SCM book_scm;
|
||||
SCM scm_window;
|
||||
|
||||
ENTER(" ");
|
||||
quotes_func = scm_c_eval_string ("gnc:book-add-quotes");
|
||||
if (!scm_is_procedure (quotes_func))
|
||||
GncQuotes quotes (pdb_dialog->book);
|
||||
if (quotes.cmd_result() != 0)
|
||||
{
|
||||
LEAVE(" no procedure");
|
||||
if (!quotes.error_msg().empty())
|
||||
PWARN ("%s", quotes.error_msg().c_str());
|
||||
LEAVE("quote retrieval failed");
|
||||
return;
|
||||
}
|
||||
|
||||
book_scm = gnc_book_to_scm (pdb_dialog->book);
|
||||
if (scm_is_true (scm_not (book_scm)))
|
||||
{
|
||||
LEAVE("no book");
|
||||
return;
|
||||
}
|
||||
|
||||
scm_window = SWIG_NewPointerObj(pdb_dialog->window,
|
||||
SWIG_TypeQuery("_p_GtkWindow"), 0);
|
||||
|
||||
gnc_set_busy_cursor (NULL, TRUE);
|
||||
scm_call_2 (quotes_func, scm_window, book_scm);
|
||||
quotes.fetch_all();
|
||||
gnc_unset_busy_cursor (NULL);
|
||||
|
||||
/* Without this, the summary bar on the accounts tab
|
||||
|
Loading…
Reference in New Issue
Block a user