27 #include <glib/gi18n.h>
31 #include "dialog-utils.h"
34 #include "dialog-choose-owner.h"
35 #include "business-gnome-utils.h"
40 GtkWidget * owner_choice;
47 gcoi_create_dialog(
Split* split)
51 GtkWidget *widget, *box;
53 g_return_val_if_fail(split, NULL);
61 builder = gtk_builder_new();
62 gnc_builder_add_from_file (builder,
"dialog-choose-owner.glade",
"Choose Owner Dialog");
66 dco->dialog = GTK_WIDGET(gtk_builder_get_object (builder,
"Choose Owner Dialog"));
67 g_assert(dco->dialog);
70 widget = GTK_WIDGET(gtk_builder_get_object (builder,
"title_label"));
73 gncOwnerInitCustomer(&(dco->owner), NULL);
74 gtk_label_set_text(GTK_LABEL(widget),
75 _(
"This transaction needs to be assigned to a Customer."
76 " Please choose the Customer below."));
80 gncOwnerInitVendor(&(dco->owner), NULL);
81 gtk_label_set_text(GTK_LABEL(widget),
82 _(
"This transaction needs to be assigned to a Vendor."
83 " Please choose the Vendor below."));
87 widget = GTK_WIDGET(gtk_builder_get_object (builder,
"desc_label"));
88 gtk_label_set_text(GTK_LABEL(widget),
92 widget = GTK_WIDGET(gtk_builder_get_object (builder,
"owner_label"));
93 box = GTK_WIDGET(gtk_builder_get_object (builder,
"owner_box"));
94 dco->owner_choice = gnc_owner_select_create(widget, box, dco->book,
97 gtk_widget_show_all(dco->dialog);
99 g_object_unref(G_OBJECT(builder));
106 gnc_split_assign_owner(GtkWidget* window,
Split* split)
109 gcoi_create_dialog(split);
Business Interface: Object OWNERs.
QofBook * qof_instance_get_book(gconstpointer)
Transaction * xaccSplitGetParent(const Split *split)
const char * xaccTransGetDescription(const Transaction *trans)
API for Transactions and Splits (journal entries)