mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
gncInvoice/gncOrder: add Printable object method
dialog-invoice,dialog-order: integrate 'New' dialogs remove 'cancel' in ledger windows invoice.glade/order.glade: rename 'ok' to 'close' in ledger windows dialog-search: update search results after callbacks git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6731 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
018114f27d
commit
e6f16dd283
@ -32,6 +32,7 @@ struct _gncInvoice {
|
||||
char * id;
|
||||
char * notes;
|
||||
char * terms;
|
||||
char * printname;
|
||||
GList * entries;
|
||||
GncOwner owner;
|
||||
Timespec date_opened;
|
||||
@ -100,6 +101,8 @@ void gncInvoiceDestroy (GncInvoice *invoice)
|
||||
g_list_free (invoice->entries);
|
||||
remObj (invoice);
|
||||
|
||||
if (invoice->printname) g_free (invoice->printname);
|
||||
|
||||
g_free (invoice);
|
||||
}
|
||||
|
||||
@ -709,6 +712,22 @@ static void _gncInvoiceForeach (GNCBook *book, foreachObjectCB cb,
|
||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
||||
}
|
||||
|
||||
static const char * _gncInvoicePrintable (GncInvoice *invoice)
|
||||
{
|
||||
g_return_val_if_fail (invoice, NULL);
|
||||
|
||||
if (invoice->dirty || invoice->printname == NULL) {
|
||||
if (invoice->printname) g_free (invoice->printname);
|
||||
|
||||
invoice->printname =
|
||||
g_strdup_printf ("%s%s%s", invoice->id,
|
||||
gncInvoiceIsPosted (invoice) ? _(" (closed)") : "",
|
||||
gncInvoiceIsPaid (invoice) ? _(" (paid)") : "");
|
||||
}
|
||||
|
||||
return invoice->printname;
|
||||
}
|
||||
|
||||
static GncObject_t gncInvoiceDesc = {
|
||||
GNC_OBJECT_VERSION,
|
||||
_GNC_MOD_NAME,
|
||||
@ -716,7 +735,7 @@ static GncObject_t gncInvoiceDesc = {
|
||||
_gncInvoiceCreate,
|
||||
_gncInvoiceDestroy,
|
||||
_gncInvoiceForeach,
|
||||
NULL /* printable */
|
||||
_gncInvoicePrintable,
|
||||
};
|
||||
|
||||
gboolean gncInvoiceRegister (void)
|
||||
|
@ -29,6 +29,7 @@ struct _gncOrder {
|
||||
GUID guid;
|
||||
char * id;
|
||||
char * notes;
|
||||
char * printname;
|
||||
GncOwner owner;
|
||||
GList * entries;
|
||||
Timespec opened;
|
||||
@ -86,6 +87,8 @@ void gncOrderDestroy (GncOrder *order)
|
||||
CACHE_REMOVE (order->notes);
|
||||
remObj (order);
|
||||
|
||||
if (order->printname) g_free (order->printname);
|
||||
|
||||
g_free (order);
|
||||
}
|
||||
|
||||
@ -335,6 +338,21 @@ static void _gncOrderForeach (GNCBook *book, foreachObjectCB cb,
|
||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
||||
}
|
||||
|
||||
static const char * _gncOrderPrintable (GncOrder *order)
|
||||
{
|
||||
g_return_val_if_fail (order, NULL);
|
||||
|
||||
if (order->dirty || order->printname == NULL) {
|
||||
if (order->printname) g_free (order->printname);
|
||||
|
||||
order->printname =
|
||||
g_strdup_printf ("%s%s", order->id,
|
||||
gncOrderIsClosed (order) ? _(" (closed)") : "");
|
||||
}
|
||||
|
||||
return order->printname;
|
||||
}
|
||||
|
||||
static GncObject_t gncOrderDesc = {
|
||||
GNC_OBJECT_VERSION,
|
||||
_GNC_MOD_NAME,
|
||||
@ -342,7 +360,7 @@ static GncObject_t gncOrderDesc = {
|
||||
_gncOrderCreate,
|
||||
_gncOrderDestroy,
|
||||
_gncOrderForeach,
|
||||
NULL /* printable */
|
||||
_gncOrderPrintable,
|
||||
};
|
||||
|
||||
gboolean gncOrderRegister (void)
|
||||
|
@ -106,8 +106,9 @@ static void gnc_ui_to_invoice (InvoiceWindow *iw, GncInvoice *invoice)
|
||||
timespecFromTime_t (&ts, tt);
|
||||
gncInvoiceSetDateOpened (invoice, &ts);
|
||||
|
||||
gncInvoiceSetActive (invoice, gtk_toggle_button_get_active
|
||||
(GTK_TOGGLE_BUTTON (iw->active_check)));
|
||||
if (iw->active_check)
|
||||
gncInvoiceSetActive (invoice, gtk_toggle_button_get_active
|
||||
(GTK_TOGGLE_BUTTON (iw->active_check)));
|
||||
|
||||
gnc_owner_get_owner (iw->owner_choice, &(iw->owner));
|
||||
gncInvoiceSetOwner (invoice, &(iw->owner));
|
||||
@ -497,8 +498,9 @@ gnc_invoice_update_window (InvoiceWindow *iw)
|
||||
gtk_editable_insert_text (GTK_EDITABLE (iw->notes_text), string,
|
||||
strlen (string), &pos);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (iw->active_check),
|
||||
gncInvoiceGetActive (invoice));
|
||||
if (iw->active_check)
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (iw->active_check),
|
||||
gncInvoiceGetActive (invoice));
|
||||
|
||||
ts = gncInvoiceGetDateOpened (invoice);
|
||||
if (timespec_equal (&ts, &ts_zero)) {
|
||||
@ -545,6 +547,9 @@ gnc_invoice_update_window (InvoiceWindow *iw)
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
if (iw->dialog_type == NEW_INVOICE)
|
||||
return;
|
||||
|
||||
/* Hide/show the appropriate widgets based on our posted/paid state */
|
||||
|
||||
if (is_paid == FALSE) {
|
||||
@ -596,10 +601,6 @@ gnc_invoice_update_window (InvoiceWindow *iw)
|
||||
hide = glade_xml_get_widget (iw->xml, "post_invoice_button");
|
||||
gtk_widget_hide_all (hide);
|
||||
|
||||
/* Hide the 'cancel' button */
|
||||
hide = glade_xml_get_widget (iw->xml, "cancel_button");
|
||||
gtk_widget_hide_all (hide);
|
||||
|
||||
if (is_paid) {
|
||||
hide = glade_xml_get_widget (iw->xml, "pay_invoice_button");
|
||||
gtk_widget_hide_all (hide);
|
||||
@ -656,7 +657,6 @@ gnc_invoice_new_window (GtkWidget *parent, GNCBook *bookp,
|
||||
|
||||
/* Build the ledger */
|
||||
switch (type) {
|
||||
case NEW_INVOICE:
|
||||
case EDIT_INVOICE:
|
||||
entry_ledger = gnc_entry_ledger_new (iw->book, GNCENTRY_INVOICE_ENTRY);
|
||||
break;
|
||||
@ -699,18 +699,16 @@ gnc_invoice_new_window (GtkWidget *parent, GNCBook *bookp,
|
||||
gnome_dialog_button_connect (iwd, 0,
|
||||
GTK_SIGNAL_FUNC(gnc_invoice_window_ok_cb), iw);
|
||||
gnome_dialog_button_connect (iwd, 1,
|
||||
GTK_SIGNAL_FUNC(gnc_invoice_window_cancel_cb), iw);
|
||||
gnome_dialog_button_connect (iwd, 2,
|
||||
GTK_SIGNAL_FUNC(gnc_invoice_window_help_cb), iw);
|
||||
|
||||
gnome_dialog_button_connect
|
||||
(iwd, 3, GTK_SIGNAL_FUNC(gnc_invoice_window_print_invoice_cb), iw);
|
||||
(iwd, 2, GTK_SIGNAL_FUNC(gnc_invoice_window_print_invoice_cb), iw);
|
||||
|
||||
gnome_dialog_button_connect
|
||||
(iwd, 4, GTK_SIGNAL_FUNC(gnc_invoice_window_post_invoice_cb), iw);
|
||||
(iwd, 3, GTK_SIGNAL_FUNC(gnc_invoice_window_post_invoice_cb), iw);
|
||||
|
||||
gnome_dialog_button_connect
|
||||
(iwd, 5, GTK_SIGNAL_FUNC(gnc_invoice_window_pay_invoice_cb), iw);
|
||||
(iwd, 4, GTK_SIGNAL_FUNC(gnc_invoice_window_pay_invoice_cb), iw);
|
||||
|
||||
/* Setup initial values */
|
||||
iw->invoice_guid = *gncInvoiceGetGUID (invoice);
|
||||
@ -729,13 +727,6 @@ gnc_invoice_new_window (GtkWidget *parent, GNCBook *bookp,
|
||||
if (class_name == NULL)
|
||||
class_name = DIALOG_EDIT_INVOICE_CM_CLASS;
|
||||
break;
|
||||
|
||||
case NEW_INVOICE:
|
||||
gtk_entry_set_text (GTK_ENTRY (iw->id_entry),
|
||||
g_strdup_printf ("%.6d", gncInvoiceNextID(bookp)));
|
||||
|
||||
class_name = DIALOG_NEW_INVOICE_CM_CLASS;
|
||||
break;
|
||||
}
|
||||
|
||||
iw->component_id =
|
||||
@ -757,6 +748,81 @@ gnc_invoice_new_window (GtkWidget *parent, GNCBook *bookp,
|
||||
return iw;
|
||||
}
|
||||
|
||||
static InvoiceWindow *
|
||||
gnc_invoice_window_new_invoice (GtkWidget *parent, GNCBook *bookp,
|
||||
GncOwner *owner)
|
||||
{
|
||||
InvoiceWindow *iw;
|
||||
GladeXML *xml;
|
||||
GnomeDialog *iwd;
|
||||
GncInvoice *invoice;
|
||||
|
||||
iw = g_new0 (InvoiceWindow, 1);
|
||||
iw->book = bookp;
|
||||
iw->dialog_type = NEW_INVOICE;
|
||||
|
||||
invoice = gncInvoiceCreate (bookp);
|
||||
gncInvoiceSetOwner (invoice, owner);
|
||||
|
||||
/* Save this for later */
|
||||
gncOwnerCopy (owner, &(iw->owner));
|
||||
|
||||
/* Find the dialog */
|
||||
iw->xml = xml = gnc_glade_xml_new ("invoice.glade", "New Invoice Dialog");
|
||||
iw->dialog = glade_xml_get_widget (xml, "New Invoice Dialog");
|
||||
iwd = GNOME_DIALOG (iw->dialog);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (iw->dialog), "dialog_info", iw);
|
||||
|
||||
/* Grab the widgets */
|
||||
iw->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
iw->terms_entry = glade_xml_get_widget (xml, "terms_entry");
|
||||
iw->notes_text = glade_xml_get_widget (xml, "notes_text");
|
||||
iw->opened_date = glade_xml_get_widget (xml, "opened_date");
|
||||
iw->owner_box = glade_xml_get_widget (xml, "owner_hbox");
|
||||
iw->owner_label = glade_xml_get_widget (xml, "owner_label");
|
||||
|
||||
/* default to ok */
|
||||
gnome_dialog_editable_enters (iwd, GTK_EDITABLE (iw->id_entry));
|
||||
gnome_dialog_set_default (iwd, 0);
|
||||
|
||||
if (parent) {
|
||||
gnome_dialog_set_parent (iwd, GTK_WINDOW (parent));
|
||||
gtk_window_set_modal (GTK_WINDOW (iw->dialog), TRUE);
|
||||
}
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (iw->dialog), "destroy",
|
||||
GTK_SIGNAL_FUNC(gnc_invoice_window_destroy_cb), iw);
|
||||
|
||||
gnome_dialog_button_connect (iwd, 0,
|
||||
GTK_SIGNAL_FUNC(gnc_invoice_window_ok_cb), iw);
|
||||
gnome_dialog_button_connect (iwd, 1,
|
||||
GTK_SIGNAL_FUNC(gnc_invoice_window_cancel_cb), iw);
|
||||
gnome_dialog_button_connect (iwd, 2,
|
||||
GTK_SIGNAL_FUNC(gnc_invoice_window_help_cb), iw);
|
||||
|
||||
/* Setup initial values */
|
||||
iw->invoice_guid = *gncInvoiceGetGUID (invoice);
|
||||
|
||||
gtk_entry_set_text (GTK_ENTRY (iw->id_entry),
|
||||
g_strdup_printf ("%.6d", gncInvoiceNextID(bookp)));
|
||||
|
||||
iw->component_id =
|
||||
gnc_register_gui_component (DIALOG_NEW_INVOICE_CM_CLASS,
|
||||
gnc_invoice_window_refresh_handler,
|
||||
gnc_invoice_window_close_handler,
|
||||
iw);
|
||||
|
||||
gnc_gui_component_watch_entity_type (iw->component_id,
|
||||
GNC_INVOICE_MODULE_NAME,
|
||||
GNC_EVENT_MODIFY | GNC_EVENT_DESTROY);
|
||||
|
||||
/* Now fill in a lot of the pieces and display properly */
|
||||
gnc_invoice_update_window (iw);
|
||||
|
||||
return iw;
|
||||
}
|
||||
|
||||
GncInvoice *
|
||||
gnc_invoice_new (GtkWidget *parent, GncOwner *ownerp, GNCBook *bookp)
|
||||
{
|
||||
@ -789,7 +855,7 @@ gnc_invoice_new (GtkWidget *parent, GncOwner *ownerp, GNCBook *bookp)
|
||||
/* Make sure required options exist */
|
||||
if (!bookp) return NULL;
|
||||
|
||||
iw = gnc_invoice_new_window (parent, bookp, NEW_INVOICE, NULL, &owner);
|
||||
iw = gnc_invoice_window_new_invoice (parent, bookp, &owner);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (iw->dialog), "close",
|
||||
GTK_SIGNAL_FUNC (gnc_invoice_on_close_cb),
|
||||
@ -797,6 +863,9 @@ gnc_invoice_new (GtkWidget *parent, GncOwner *ownerp, GNCBook *bookp)
|
||||
|
||||
gtk_main ();
|
||||
|
||||
if (created_invoice)
|
||||
gnc_invoice_edit (parent, created_invoice);
|
||||
|
||||
return created_invoice;
|
||||
}
|
||||
|
||||
|
@ -107,8 +107,9 @@ static void gnc_ui_to_order (OrderWindow *ow, GncOrder *order)
|
||||
timespecFromTime_t (&ts, tt);
|
||||
gncOrderSetDateOpened (order, &ts);
|
||||
|
||||
gncOrderSetActive (order, gtk_toggle_button_get_active
|
||||
(GTK_TOGGLE_BUTTON (ow->active_check)));
|
||||
if (ow->active_check)
|
||||
gncOrderSetActive (order, gtk_toggle_button_get_active
|
||||
(GTK_TOGGLE_BUTTON (ow->active_check)));
|
||||
|
||||
gnc_owner_get_owner (ow->owner_choice, &(ow->owner));
|
||||
gncOrderSetOwner (order, &(ow->owner));
|
||||
@ -294,7 +295,8 @@ gnc_order_window_destroy_cb (GtkWidget *widget, gpointer data)
|
||||
ow->order_guid = *xaccGUIDNULL ();
|
||||
}
|
||||
|
||||
gnc_entry_ledger_destroy (ow->ledger);
|
||||
if (ow->ledger)
|
||||
gnc_entry_ledger_destroy (ow->ledger);
|
||||
gnc_unregister_gui_component (ow->component_id);
|
||||
gnc_resume_gui_refresh ();
|
||||
|
||||
@ -466,6 +468,11 @@ gnc_order_update_window (OrderWindow *ow)
|
||||
}
|
||||
gnome_date_edit_set_time (GNOME_DATE_EDIT (ow->opened_date), tt);
|
||||
|
||||
|
||||
/* If this is a "New Order Window" we can stop here! */
|
||||
if (ow->dialog_type == NEW_ORDER)
|
||||
return;
|
||||
|
||||
ts = gncOrderGetDateClosed (order);
|
||||
if (timespec_equal (&ts, &ts_zero)) {
|
||||
tt = time(NULL);
|
||||
@ -476,7 +483,7 @@ gnc_order_update_window (OrderWindow *ow)
|
||||
gnome_date_edit_set_time (GNOME_DATE_EDIT (ow->closed_date), tt);
|
||||
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ow->active_check),
|
||||
gncOrderGetActive (order));
|
||||
gncOrderGetActive (order));
|
||||
|
||||
}
|
||||
|
||||
@ -511,8 +518,6 @@ gnc_order_update_window (OrderWindow *ow)
|
||||
/* Hide the 'close order' button */
|
||||
hide = glade_xml_get_widget (ow->xml, "close_order_button");
|
||||
gtk_widget_hide_all (hide);
|
||||
hide = glade_xml_get_widget (ow->xml, "cancel_button");
|
||||
gtk_widget_hide_all (hide);
|
||||
hide = glade_xml_get_widget (ow->xml, "new_invoice_button");
|
||||
gtk_widget_hide_all (hide);
|
||||
}
|
||||
@ -534,11 +539,6 @@ gnc_order_new_window (GtkWidget *parent, GNCBook *bookp,
|
||||
ow->book = bookp;
|
||||
ow->dialog_type = type;
|
||||
|
||||
if (type == NEW_ORDER) {
|
||||
order = gncOrderCreate (bookp);
|
||||
gncOrderSetOwner (order, owner);
|
||||
}
|
||||
|
||||
/* Save this for later */
|
||||
gncOwnerCopy (owner, &(ow->owner));
|
||||
|
||||
@ -565,7 +565,6 @@ gnc_order_new_window (GtkWidget *parent, GNCBook *bookp,
|
||||
|
||||
/* Build the ledger */
|
||||
switch (type) {
|
||||
case NEW_ORDER:
|
||||
case EDIT_ORDER:
|
||||
entry_ledger = gnc_entry_ledger_new (ow->book, GNCENTRY_ORDER_ENTRY);
|
||||
break;
|
||||
@ -608,15 +607,13 @@ gnc_order_new_window (GtkWidget *parent, GNCBook *bookp,
|
||||
gnome_dialog_button_connect (owd, 0,
|
||||
GTK_SIGNAL_FUNC(gnc_order_window_ok_cb), ow);
|
||||
gnome_dialog_button_connect (owd, 1,
|
||||
GTK_SIGNAL_FUNC(gnc_order_window_cancel_cb), ow);
|
||||
gnome_dialog_button_connect (owd, 2,
|
||||
GTK_SIGNAL_FUNC(gnc_order_window_help_cb), ow);
|
||||
|
||||
gnome_dialog_button_connect
|
||||
(owd, 3, GTK_SIGNAL_FUNC(gnc_order_window_invoice_cb), ow);
|
||||
(owd, 2, GTK_SIGNAL_FUNC(gnc_order_window_invoice_cb), ow);
|
||||
|
||||
gnome_dialog_button_connect
|
||||
(owd, 4, GTK_SIGNAL_FUNC(gnc_order_window_close_order_cb), ow);
|
||||
(owd, 3, GTK_SIGNAL_FUNC(gnc_order_window_close_order_cb), ow);
|
||||
|
||||
/* Setup initial values */
|
||||
ow->order_guid = *gncOrderGetGUID (order);
|
||||
@ -635,13 +632,6 @@ gnc_order_new_window (GtkWidget *parent, GNCBook *bookp,
|
||||
if (class_name == NULL)
|
||||
class_name = DIALOG_EDIT_ORDER_CM_CLASS;
|
||||
break;
|
||||
|
||||
case NEW_ORDER:
|
||||
gtk_entry_set_text (GTK_ENTRY (ow->id_entry),
|
||||
g_strdup_printf ("%.6d", gncOrderNextID(bookp)));
|
||||
|
||||
class_name = DIALOG_NEW_ORDER_CM_CLASS;
|
||||
break;
|
||||
}
|
||||
|
||||
ow->component_id =
|
||||
@ -653,7 +643,79 @@ gnc_order_new_window (GtkWidget *parent, GNCBook *bookp,
|
||||
|
||||
gnc_table_realize_gui (gnc_entry_ledger_get_table (entry_ledger));
|
||||
|
||||
/* Now fill in a lot of the pirces and display properly */
|
||||
/* Now fill in a lot of the pieces and display properly */
|
||||
gnc_order_update_window (ow);
|
||||
|
||||
/* Set the Reference */
|
||||
gnc_order_owner_changed_cb (ow->owner_choice, ow);
|
||||
|
||||
return ow;
|
||||
}
|
||||
|
||||
static OrderWindow *
|
||||
gnc_order_window_new_order (GtkWidget *parent, GNCBook *bookp, GncOwner *owner)
|
||||
{
|
||||
OrderWindow *ow;
|
||||
GladeXML *xml;
|
||||
GnomeDialog *owd;
|
||||
GncOrder *order;
|
||||
|
||||
ow = g_new0 (OrderWindow, 1);
|
||||
ow->book = bookp;
|
||||
ow->dialog_type = NEW_ORDER;
|
||||
|
||||
order = gncOrderCreate (bookp);
|
||||
gncOrderSetOwner (order, owner);
|
||||
|
||||
/* Save this for later */
|
||||
gncOwnerCopy (owner, &(ow->owner));
|
||||
|
||||
/* Find the dialog */
|
||||
xml = gnc_glade_xml_new ("order.glade", "New Order Dialog");
|
||||
ow->dialog = glade_xml_get_widget (xml, "New Order Dialog");
|
||||
owd = GNOME_DIALOG (ow->dialog);
|
||||
|
||||
gtk_object_set_data (GTK_OBJECT (ow->dialog), "dialog_info", ow);
|
||||
|
||||
/* Grab the widgets */
|
||||
ow->id_entry = glade_xml_get_widget (xml, "id_entry");
|
||||
ow->ref_entry = glade_xml_get_widget (xml, "ref_entry");
|
||||
ow->notes_text = glade_xml_get_widget (xml, "notes_text");
|
||||
ow->opened_date = glade_xml_get_widget (xml, "opened_date");
|
||||
ow->owner_box = glade_xml_get_widget (xml, "owner_hbox");
|
||||
ow->owner_label = glade_xml_get_widget (xml, "owner_label");
|
||||
|
||||
/* default to ok */
|
||||
gnome_dialog_editable_enters (owd, GTK_EDITABLE (ow->id_entry));
|
||||
gnome_dialog_set_default (owd, 0);
|
||||
|
||||
if (parent) {
|
||||
gnome_dialog_set_parent (owd, GTK_WINDOW (parent));
|
||||
gtk_window_set_modal (GTK_WINDOW (ow->dialog), TRUE);
|
||||
}
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (ow->dialog), "destroy",
|
||||
GTK_SIGNAL_FUNC(gnc_order_window_destroy_cb), ow);
|
||||
|
||||
gnome_dialog_button_connect (owd, 0,
|
||||
GTK_SIGNAL_FUNC(gnc_order_window_ok_cb), ow);
|
||||
gnome_dialog_button_connect (owd, 1,
|
||||
GTK_SIGNAL_FUNC(gnc_order_window_cancel_cb), ow);
|
||||
gnome_dialog_button_connect (owd, 2,
|
||||
GTK_SIGNAL_FUNC(gnc_order_window_help_cb), ow);
|
||||
|
||||
/* Setup initial values */
|
||||
ow->order_guid = *gncOrderGetGUID (order);
|
||||
gtk_entry_set_text (GTK_ENTRY (ow->id_entry),
|
||||
g_strdup_printf ("%.6d", gncOrderNextID(bookp)));
|
||||
|
||||
ow->component_id =
|
||||
gnc_register_gui_component (DIALOG_NEW_ORDER_CM_CLASS,
|
||||
gnc_order_window_refresh_handler,
|
||||
gnc_order_window_close_handler,
|
||||
ow);
|
||||
|
||||
/* Now fill in a lot of the pieces and display properly */
|
||||
gnc_order_update_window (ow);
|
||||
|
||||
/* Set the Reference */
|
||||
@ -687,7 +749,7 @@ gnc_order_new (GtkWidget *parent, GncOwner *ownerp, GNCBook *bookp)
|
||||
/* Make sure required options exist */
|
||||
if (!bookp) return NULL;
|
||||
|
||||
ow = gnc_order_new_window (parent, bookp, NEW_ORDER, NULL, &owner);
|
||||
ow = gnc_order_window_new_order (parent, bookp, &owner);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (ow->dialog), "close",
|
||||
GTK_SIGNAL_FUNC (gnc_order_on_close_cb),
|
||||
@ -695,6 +757,10 @@ gnc_order_new (GtkWidget *parent, GncOwner *ownerp, GNCBook *bookp)
|
||||
|
||||
gtk_main ();
|
||||
|
||||
/* now open up the ledger */
|
||||
if (created_order)
|
||||
gnc_order_edit (parent, created_order);
|
||||
|
||||
return created_order;
|
||||
}
|
||||
|
||||
|
@ -64,15 +64,7 @@
|
||||
<name>button1</name>
|
||||
<can_default>True</can_default>
|
||||
<can_focus>True</can_focus>
|
||||
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<name>cancel_button</name>
|
||||
<can_default>True</can_default>
|
||||
<can_focus>True</can_focus>
|
||||
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
|
||||
<stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
@ -873,7 +865,19 @@
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
<class>GtkHBox</class>
|
||||
<name>owner_hbox</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
@ -998,11 +1002,6 @@
|
||||
<name>vbox1</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkHBox</class>
|
||||
|
@ -64,15 +64,7 @@
|
||||
<name>button1</name>
|
||||
<can_default>True</can_default>
|
||||
<can_focus>True</can_focus>
|
||||
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkButton</class>
|
||||
<name>cancel_button</name>
|
||||
<can_default>True</can_default>
|
||||
<can_focus>True</can_focus>
|
||||
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
|
||||
<stock_button>GNOME_STOCK_BUTTON_CLOSE</stock_button>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
@ -762,7 +754,7 @@
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label15</name>
|
||||
<name>owner_label</name>
|
||||
<label>(owner)</label>
|
||||
<justify>GTK_JUSTIFY_RIGHT</justify>
|
||||
<wrap>False</wrap>
|
||||
@ -941,15 +933,10 @@
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>vbox1</name>
|
||||
<child_name>GnomeDock:contents</child_name>
|
||||
<name>vbox1</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkHBox</class>
|
||||
|
@ -85,6 +85,9 @@ gnc_search_dialog_result_clicked (GtkButton *button, GNCSearchWindow *sw)
|
||||
|
||||
if (!res)
|
||||
gnc_search_dialog_destroy (sw);
|
||||
|
||||
/* Update the display */
|
||||
gnc_search_dialog_display_results (sw);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -330,8 +333,20 @@ search_new_item_cb (GtkButton *button, GNCSearchWindow *sw)
|
||||
sw->selected_item = res;
|
||||
if (!retval)
|
||||
gnc_search_dialog_destroy (sw);
|
||||
// else
|
||||
// gnc_search_dialog_display_results (sw);
|
||||
|
||||
else {
|
||||
if (!sw->q) {
|
||||
if (!sw->start_q) {
|
||||
sw->start_q = gncQueryNew ();
|
||||
gncQuerySetBook (sw->start_q, gnc_get_current_book ());
|
||||
}
|
||||
sw->q = gncQueryCopy (sw->start_q);
|
||||
}
|
||||
|
||||
/* XXX: add an "object match" so this object shows up??? */
|
||||
|
||||
gnc_search_dialog_display_results (sw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user