Update the menu items associated with this invoice page.
This function should be called whenever the posted state of an invoice is changed.
480 GSimpleActionGroup *simple_action_group;
483 GncInvoiceType invoice_type;
487 gboolean has_uri = FALSE;
491 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(page));
493 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);
496 priv->is_posted = is_posted;
497 priv->can_unpost = can_unpost;
503 invoice_type = gnc_invoice_get_type_from_window(priv->iw);
505 switch (invoice_type) {
506 case GNC_INVOICE_CUST_INVOICE:
507 label_list = invoice_action_labels;
509 case GNC_INVOICE_VEND_INVOICE:
510 label_list = bill_action_labels;
512 case GNC_INVOICE_EMPL_INVOICE:
513 label_list = voucher_action_labels;
515 case GNC_INVOICE_CUST_CREDIT_NOTE:
516 case GNC_INVOICE_VEND_CREDIT_NOTE:
517 case GNC_INVOICE_EMPL_CREDIT_NOTE:
518 label_list = creditnote_action_labels;
521 label_list = invoice_action_labels;
525 switch (invoice_type) {
526 case GNC_INVOICE_CUST_INVOICE:
527 case GNC_INVOICE_CUST_CREDIT_NOTE:
528 label_layout_list = invoice_action_layout_labels;
530 case GNC_INVOICE_VEND_INVOICE:
531 case GNC_INVOICE_VEND_CREDIT_NOTE:
532 label_layout_list = bill_action_layout_labels;
534 case GNC_INVOICE_EMPL_INVOICE:
535 case GNC_INVOICE_EMPL_CREDIT_NOTE:
536 label_layout_list = voucher_action_layout_labels;
539 label_layout_list = invoice_action_layout_labels;
551 g_simple_action_set_enabled (G_SIMPLE_ACTION(action), TRUE);
564 gnc_plugin_page_invoice_action_update (page, label_list);
567 gnc_plugin_page_update_reset_layout_action (page);
570 gnc_plugin_page_invoice_action_update (page, label_layout_list);
573 invoice = gnc_invoice_window_get_invoice (priv->iw);
574 if (gncInvoiceGetDocLink (invoice))
577 update_doclink_actions (page, has_uri);
GtkWidget * gnc_plugin_page_get_window(GncPluginPage *page)
Retrieve a pointer to the GncMainWindow (GtkWindow) containing this page.
GSimpleActionGroup * gnc_plugin_page_get_action_group(GncPluginPage *page)
Retrieve the GSimpleActionGroup object associated with this page.
GncPluginPage * gnc_main_window_get_current_page(GncMainWindow *window)
Retrieve a pointer to the page that is currently at the front of the specified window.
GAction * gnc_main_window_find_action(GncMainWindow *window, const gchar *action_name)
Find the GAction in the main window.
gboolean qof_book_is_readonly(const QofBook *book)
Return whether the book is read only.
The instance data structure for a main window object.