mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Pass a dialog pointer through the scm code and back to the C error
display functions. This will parent the error dialog properly. Fixes 334929. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13662 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
2006-03-17 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/scm/price-quotes.scm:
|
||||
* src/gnome/dialog-price-edit-db.c: Pass a dialog pointer through
|
||||
the scm code and back to the C error display functions. This will
|
||||
parent the error dialog properly. Fixes 334929.
|
||||
|
||||
* src/gnome-utils/account-quickfill.c: Enhance the quickfill event
|
||||
handler to detect changes in whether an account should appear in
|
||||
the quickfill. Fixes 334787.
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "gnc-ui-util.h"
|
||||
#include "guile-util.h"
|
||||
#include "engine-helpers.h"
|
||||
#include <g-wrap-wct.h>
|
||||
|
||||
|
||||
#define DIALOG_PRICE_DB_CM_CLASS "dialog-price-edit-db"
|
||||
@@ -261,6 +262,7 @@ gnc_prices_dialog_get_quotes_clicked (GtkWidget *widget, gpointer data)
|
||||
PricesDialog *pdb_dialog = data;
|
||||
SCM quotes_func;
|
||||
SCM book_scm;
|
||||
SCM scm_window, window_type;
|
||||
|
||||
ENTER(" ");
|
||||
quotes_func = scm_c_eval_string ("gnc:book-add-quotes");
|
||||
@@ -275,8 +277,11 @@ gnc_prices_dialog_get_quotes_clicked (GtkWidget *widget, gpointer data)
|
||||
return;
|
||||
}
|
||||
|
||||
window_type = scm_c_eval_string("<gtk:Widget*>");
|
||||
scm_window = gw_wcp_assimilate_ptr(pdb_dialog->dialog, window_type);
|
||||
|
||||
gnc_set_busy_cursor (NULL, TRUE);
|
||||
scm_call_1 (quotes_func, book_scm);
|
||||
scm_call_2 (quotes_func, scm_window, book_scm);
|
||||
gnc_unset_busy_cursor (NULL);
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@
|
||||
get-quotes
|
||||
kill-quoter)))
|
||||
|
||||
(define (gnc:book-add-quotes book)
|
||||
(define (gnc:book-add-quotes window book)
|
||||
|
||||
(define (book->commodity->fq-call-data book)
|
||||
;; Call helper that walks all of the defined commodities to see if
|
||||
@@ -634,17 +634,17 @@
|
||||
((eq? fq-call-data #f)
|
||||
(set! keep-going? #f)
|
||||
(if (gnc:ui-is-running?)
|
||||
(gnc:error-dialog #f (_ "No commodities marked for quote retrieval."))
|
||||
(gnc:error-dialog window (_ "No commodities marked for quote retrieval."))
|
||||
(gnc:warn (_ "No commodities marked for quote retrieval."))))
|
||||
((eq? fq-results #f)
|
||||
(set! keep-going? #f)
|
||||
(if (gnc:ui-is-running?)
|
||||
(gnc:error-dialog #f (_ "Unable to get quotes or diagnose the problem."))
|
||||
(gnc:error-dialog window (_ "Unable to get quotes or diagnose the problem."))
|
||||
(gnc:warn (_ "Unable to get quotes or diagnose the problem."))))
|
||||
((member 'missing-lib fq-results)
|
||||
(set! keep-going? #f)
|
||||
(if (gnc:ui-is-running?)
|
||||
(gnc:error-dialog #f
|
||||
(gnc:error-dialog window
|
||||
(_ "You are missing some needed Perl libraries.
|
||||
Run 'gnc-fq-update' as root to install them."))
|
||||
(gnc:warn (_ "You are missing some needed Perl libraries.
|
||||
@@ -652,17 +652,17 @@ Run 'gnc-fq-update' as root to install them.") "\n")))
|
||||
((member 'system-error fq-results)
|
||||
(set! keep-going? #f)
|
||||
(if (gnc:ui-is-running?)
|
||||
(gnc:error-dialog #f
|
||||
(gnc:error-dialog window
|
||||
(_ "There was a system error while retrieving the price quotes."))
|
||||
(gnc:warn (_ "There was a system error while retrieving the price quotes.") "\n")))
|
||||
((not (list? (car fq-results)))
|
||||
(set! keep-going? #f)
|
||||
(if (gnc:ui-is-running?)
|
||||
(gnc:error-dialog #f
|
||||
(gnc:error-dialog window
|
||||
(_ "There was an unknown error while retrieving the price quotes."))
|
||||
(gnc:warn (_ "There was an unknown error while retrieving the price quotes.") "\n")))
|
||||
((and (not commod-tz-quote-triples) (gnc:ui-is-running?))
|
||||
(gnc:error-dialog #f
|
||||
(gnc:error-dialog window
|
||||
(_ "Unable to get quotes or diagnose the problem."))
|
||||
(set! keep-going? #f))
|
||||
((not commod-tz-quote-triples)
|
||||
@@ -673,7 +673,7 @@ Run 'gnc-fq-update' as root to install them.") "\n")))
|
||||
(if (and ok-syms (not (null? ok-syms)))
|
||||
(set!
|
||||
keep-going?
|
||||
(gnc:verify-dialog #f #t
|
||||
(gnc:verify-dialog window #t
|
||||
(call-with-output-string
|
||||
(lambda (p)
|
||||
(display (_ "Unable to retrieve quotes for these items:") p)
|
||||
@@ -683,7 +683,7 @@ Run 'gnc-fq-update' as root to install them.") "\n")))
|
||||
(newline p)
|
||||
(display (_ "Continue using only the good quotes?") p)))))
|
||||
(begin
|
||||
(gnc:error-dialog #f
|
||||
(gnc:error-dialog window
|
||||
(call-with-output-string
|
||||
(lambda (p)
|
||||
(display
|
||||
@@ -712,7 +712,7 @@ Run 'gnc-fq-update' as root to install them.") "\n")))
|
||||
(if (gnc:ui-is-running?)
|
||||
(set!
|
||||
keep-going?
|
||||
(gnc:verify-dialog #f #t
|
||||
(gnc:verify-dialog window #t
|
||||
(call-with-output-string
|
||||
(lambda (p)
|
||||
(display (_ "Unable to create prices for these items:") p)
|
||||
@@ -744,7 +744,7 @@ Run 'gnc-fq-update' as root to install them.") "\n")))
|
||||
(if session
|
||||
(begin
|
||||
(gnc:debug "about to call gnc:book-add-quotes")
|
||||
(set! quote-ok? (and (gnc:book-add-quotes
|
||||
(set! quote-ok? (and (gnc:book-add-quotes #f
|
||||
(gnc:session-get-book session))))
|
||||
|
||||
(gnc:debug "done gnc:book-add-quotes:" quote-ok?)
|
||||
|
||||
Reference in New Issue
Block a user