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
This commit is contained in:
Derek Atkins
2006-02-19 16:22:21 +00:00
parent 33133b87f0
commit 57115770d6
2 changed files with 24 additions and 0 deletions

View File

@@ -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 <derek@ihtfp.com>
* intl-scm/xgettext.scm: remove the absolute path from filenames

View File

@@ -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;
}