From 57115770d66445acb4f1f82ab5d8bc3a6842220a Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Sun, 19 Feb 2006 16:22:21 +0000 Subject: [PATCH] Pop up a warning dialog if the user has no valid post-to accounts. Fixes #331730. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13295 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 4 ++++ src/business/business-gnome/dialog-payment.c | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5829cfe923..662924ff3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ did in TransLog.c Fixes #331620. + * src/business/business-gnome/dialog-payment.c: + Pop up a warning dialog if the user has no valid post-to accounts. + Fixes #331730. + 2006-02-18 Derek Atkins * intl-scm/xgettext.scm: remove the absolute path from filenames diff --git a/src/business/business-gnome/dialog-payment.c b/src/business/business-gnome/dialog-payment.c index ac3851c4ac..4d220e49fb 100644 --- a/src/business/business-gnome/dialog-payment.c +++ b/src/business/business-gnome/dialog-payment.c @@ -309,6 +309,26 @@ new_payment_window (GncOwner *owner, GNCBook *book, gnc_numeric initial_payment) /* Show it all */ gtk_widget_show_all (pw->dialog); + /* Warn the user if they have no valid post-to accounts */ + { + const gchar *text; + const char *acct_type; + + text = gtk_entry_get_text(GTK_ENTRY((GTK_COMBO(pw->post_combo))->entry)); + if (!text || safe_strcmp (text, "") == 0) { + + /* XXX: I know there's only one type here */ + acct_type = xaccAccountGetTypeStr(GPOINTER_TO_INT(pw->acct_types->data)); + gnc_warning_dialog(pw->dialog, + _("You have no valid \"Post To\" accounts. " + "Please create an account of type \"%s\" " + "before you continue to process this payment. " + "Perhaps you want to create an Invoice or " + "Bill first?"), + acct_type); + } + } + return pw; }