Update the menu items associated with this invoice page.
This function should be called whenever the posted state of an invoice is changed.
479 GSimpleActionGroup *simple_action_group;
482 GncInvoiceType invoice_type;
486 gboolean has_uri = FALSE;
490 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(page));
492 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);
495 priv->is_posted = is_posted;
496 priv->can_unpost = can_unpost;
502 invoice_type = gnc_invoice_get_type_from_window(priv->iw);
504 switch (invoice_type) {
505 case GNC_INVOICE_CUST_INVOICE:
506 label_list = invoice_action_labels;
508 case GNC_INVOICE_VEND_INVOICE:
509 label_list = bill_action_labels;
511 case GNC_INVOICE_EMPL_INVOICE:
512 label_list = voucher_action_labels;
514 case GNC_INVOICE_CUST_CREDIT_NOTE:
515 case GNC_INVOICE_VEND_CREDIT_NOTE:
516 case GNC_INVOICE_EMPL_CREDIT_NOTE:
517 label_list = creditnote_action_labels;
520 label_list = invoice_action_labels;
524 switch (invoice_type) {
525 case GNC_INVOICE_CUST_INVOICE:
526 case GNC_INVOICE_CUST_CREDIT_NOTE:
527 label_layout_list = invoice_action_layout_labels;
529 case GNC_INVOICE_VEND_INVOICE:
530 case GNC_INVOICE_VEND_CREDIT_NOTE:
531 label_layout_list = bill_action_layout_labels;
533 case GNC_INVOICE_EMPL_INVOICE:
534 case GNC_INVOICE_EMPL_CREDIT_NOTE:
535 label_layout_list = voucher_action_layout_labels;
538 label_layout_list = invoice_action_layout_labels;
550 g_simple_action_set_enabled (G_SIMPLE_ACTION(action), TRUE);
563 gnc_plugin_page_invoice_action_update (page, label_list);
566 gnc_plugin_page_update_reset_layout_action (page);
569 gnc_plugin_page_invoice_action_update (page, label_layout_list);
572 invoice = gnc_invoice_window_get_invoice (priv->iw);
573 if (gncInvoiceGetDocLink (invoice))
576 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.