27 #include <glib/gi18n.h> 30 #include "business-gnome-utils.h" 31 #include "dialog-invoice.h" 36 #include "gnc-component-manager.h" 39 #include "gnc-icons.h" 40 #include "gnucash-register.h" 45 #include "dialog-utils.h" 46 #include "dialog-doclink.h" 47 #include "dialog-doclink-utils.h" 53 static QofLogModule log_module = GNC_MOD_GUI;
55 static void gnc_plugin_page_invoice_finalize (GObject *
object);
57 static GtkWidget *gnc_plugin_page_invoice_create_widget (
GncPluginPage *plugin_page);
58 static gboolean gnc_plugin_page_invoice_focus_widget (
GncPluginPage *plugin_page);
59 static void gnc_plugin_page_invoice_destroy_widget (
GncPluginPage *plugin_page);
60 static void gnc_plugin_page_invoice_save_page (
GncPluginPage *plugin_page, GKeyFile *file,
const gchar *group);
61 static GncPluginPage *gnc_plugin_page_invoice_recreate_page (GtkWidget *window, GKeyFile *file,
const gchar *group);
62 static void gnc_plugin_page_invoice_window_changed (
GncPluginPage *plugin_page, GtkWidget *window);
64 static void gnc_plugin_page_invoice_summarybar_position_changed (gpointer prefs, gchar* pref, gpointer user_data);
67 static void gnc_plugin_page_invoice_cmd_new_invoice (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
68 static void gnc_plugin_page_invoice_cmd_new_account (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
69 static void gnc_plugin_page_invoice_cmd_print (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
70 static void gnc_plugin_page_invoice_cmd_cut (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
71 static void gnc_plugin_page_invoice_cmd_copy (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
72 static void gnc_plugin_page_invoice_cmd_paste (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
73 static void gnc_plugin_page_invoice_cmd_edit (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
74 static void gnc_plugin_page_invoice_cmd_duplicateInvoice (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
75 static void gnc_plugin_page_invoice_cmd_post (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
76 static void gnc_plugin_page_invoice_cmd_unpost (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
77 static void gnc_plugin_page_invoice_cmd_refresh (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
78 static void gnc_plugin_page_invoice_cmd_sort_changed (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
79 static void gnc_plugin_page_invoice_cmd_enter (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
80 static void gnc_plugin_page_invoice_cmd_cancel (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
81 static void gnc_plugin_page_invoice_cmd_delete (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
82 static void gnc_plugin_page_invoice_cmd_blank (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
83 static void gnc_plugin_page_invoice_cmd_duplicateEntry (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
84 static void gnc_plugin_page_invoice_cmd_pay_invoice (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
85 static void gnc_plugin_page_invoice_cmd_save_layout (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
86 static void gnc_plugin_page_invoice_cmd_reset_layout (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
87 static void gnc_plugin_page_invoice_cmd_link (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
88 static void gnc_plugin_page_invoice_cmd_link_open (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
89 static void gnc_plugin_page_invoice_cmd_company_report (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
90 static void gnc_plugin_page_invoice_cmd_entryUp (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
91 static void gnc_plugin_page_invoice_cmd_entryDown (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
92 static void gnc_plugin_page_invoice_cmd_edit_tax (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
94 static void gnc_plugin_page_redraw_help_cb (GnucashRegister *gsr,
GncPluginPageInvoice *invoice_page);
95 static void gnc_plugin_page_show_popup_cb (GnucashRegister *gsr,
GncPluginPageInvoice *invoice_page);
96 static void gnc_plugin_page_invoice_refresh_cb (GHashTable *changes, gpointer user_data);
101 static GActionEntry gnc_plugin_page_invoice_actions [] =
103 {
"FileNewAccountAction", gnc_plugin_page_invoice_cmd_new_account, NULL, NULL, NULL },
104 {
"FilePrintAction", gnc_plugin_page_invoice_cmd_print, NULL, NULL, NULL },
105 {
"EditCutAction", gnc_plugin_page_invoice_cmd_cut, NULL, NULL, NULL },
106 {
"EditCopyAction", gnc_plugin_page_invoice_cmd_copy, NULL, NULL, NULL },
107 {
"EditPasteAction", gnc_plugin_page_invoice_cmd_paste, NULL, NULL, NULL },
108 {
"EditEditInvoiceAction", gnc_plugin_page_invoice_cmd_edit, NULL, NULL, NULL },
109 {
"EditDuplicateInvoiceAction", gnc_plugin_page_invoice_cmd_duplicateInvoice, NULL, NULL, NULL },
110 {
"EditPostInvoiceAction", gnc_plugin_page_invoice_cmd_post, NULL, NULL, NULL },
111 {
"EditUnpostInvoiceAction", gnc_plugin_page_invoice_cmd_unpost, NULL, NULL, NULL },
112 {
"EditTaxOptionsAction", gnc_plugin_page_invoice_cmd_edit_tax, NULL, NULL, NULL },
113 {
"ViewRefreshAction", gnc_plugin_page_invoice_cmd_refresh, NULL, NULL, NULL },
114 {
"ViewSaveLayoutAction", gnc_plugin_page_invoice_cmd_save_layout, NULL, NULL, NULL },
115 {
"ViewResetLayoutAction", gnc_plugin_page_invoice_cmd_reset_layout, NULL, NULL, NULL },
116 {
"RecordEntryAction", gnc_plugin_page_invoice_cmd_enter, NULL, NULL, NULL },
117 {
"CancelEntryAction", gnc_plugin_page_invoice_cmd_cancel, NULL, NULL, NULL },
118 {
"DeleteEntryAction", gnc_plugin_page_invoice_cmd_delete, NULL, NULL, NULL },
119 {
"BlankEntryAction", gnc_plugin_page_invoice_cmd_blank, NULL, NULL, NULL },
120 {
"DuplicateEntryAction", gnc_plugin_page_invoice_cmd_duplicateEntry, NULL, NULL, NULL },
121 {
"EntryUpAction", gnc_plugin_page_invoice_cmd_entryUp, NULL, NULL, NULL },
122 {
"EntryDownAction", gnc_plugin_page_invoice_cmd_entryDown, NULL, NULL, NULL },
123 {
"BusinessNewInvoiceAction", gnc_plugin_page_invoice_cmd_new_invoice, NULL, NULL, NULL },
124 {
"BusinessLinkAction", gnc_plugin_page_invoice_cmd_link, NULL, NULL, NULL },
125 {
"BusinessLinkOpenAction", gnc_plugin_page_invoice_cmd_link_open, NULL, NULL, NULL },
126 {
"ToolsProcessPaymentAction", gnc_plugin_page_invoice_cmd_pay_invoice, NULL, NULL, NULL },
127 {
"ReportsCompanyReportAction", gnc_plugin_page_invoice_cmd_company_report, NULL, NULL, NULL },
128 {
"SortOrderRadioAction", gnc_plugin_page_invoice_cmd_sort_changed,
"i",
"@i 0", NULL },
130 static guint gnc_plugin_page_invoice_n_actions = G_N_ELEMENTS(gnc_plugin_page_invoice_actions);
133 static const gchar *gnc_plugin_load_ui_items [] =
142 "ActionsPlaceholder4",
143 "ActionsPlaceholder5",
144 "BusinessPlaceholder2",
145 "BusinessPlaceholder3",
146 "ReportsPlaceholder1",
150 static const gchar *invoice_book_readwrite_actions[] =
153 "FileNewAccountAction",
154 "EditDuplicateInvoiceAction",
155 "BusinessNewInvoiceAction",
156 "ToolsProcessPaymentAction",
157 "BusinessLinkAction",
161 static const gchar *posted_actions[] =
166 static const gchar *unposted_actions[] =
170 "EditEditInvoiceAction",
171 "EditPostInvoiceAction",
175 "DuplicateEntryAction",
182 static const gchar *can_unpost_actions[] =
184 "EditUnpostInvoiceAction",
190 {
"FilePrintAction", N_(
"_Print Invoice"), N_(
"Make a printable invoice")},
191 {
"EditEditInvoiceAction", N_(
"_Edit Invoice"), N_(
"Edit this invoice")},
192 {
"EditDuplicateInvoiceAction", N_(
"_Duplicate Invoice"), N_(
"Create a new invoice as a duplicate of the current one")},
193 {
"EditPostInvoiceAction", N_(
"_Post Invoice"), N_(
"Post this invoice to your Chart of Accounts")},
194 {
"EditUnpostInvoiceAction", N_(
"_Unpost Invoice"), N_(
"Unpost this invoice and make it editable")},
195 {
"BusinessNewInvoiceAction", N_(
"New _Invoice"), N_(
"Create a new invoice for the same owner as the current one")},
196 {
"BlankEntryAction", N_(
"Blank"), N_(
"Move to the blank entry at the bottom of the invoice")},
197 {
"ToolsProcessPaymentAction", N_(
"_Pay Invoice"), N_(
"Enter a payment for the owner of this invoice") },
198 {
"ReportsCompanyReportAction", N_(
"_Company Report"), N_(
"Open a customer report window for the owner of this invoice") },
199 {
"BusinessLinkAction", N_(
"_Manage Document Link…"), N_(
"Manage Document Link")},
200 {
"BusinessLinkOpenAction", N_(
"_Open Linked Document"), N_(
"Open Linked Document")},
206 {
"ViewSaveLayoutAction", N_(
"_Use as Default Layout for Customer Documents"),
207 N_(
"Use the current layout as default for all customer invoices and credit notes")},
208 {
"ViewResetLayoutAction", N_(
"_Reset Default Layout for Customer Documents"),
209 N_(
"Reset default layout for all customer invoices and credit notes back to built-in defaults and update the current page accordingly")},
215 {
"FilePrintAction", N_(
"_Print Bill"), N_(
"Make a printable bill")},
216 {
"EditEditInvoiceAction", N_(
"_Edit Bill"), N_(
"Edit this bill")},
217 {
"EditDuplicateInvoiceAction", N_(
"_Duplicate Bill"), N_(
"Create a new bill as a duplicate of the current one")},
218 {
"EditPostInvoiceAction", N_(
"_Post Bill"), N_(
"Post this bill to your Chart of Accounts")},
219 {
"EditUnpostInvoiceAction", N_(
"_Unpost Bill"), N_(
"Unpost this bill and make it editable")},
220 {
"BusinessNewInvoiceAction", N_(
"New _Bill"), N_(
"Create a new bill for the same owner as the current one")},
221 {
"BlankEntryAction", N_(
"Blank"), N_(
"Move to the blank entry at the bottom of the bill")},
222 {
"ToolsProcessPaymentAction", N_(
"_Pay Bill"), N_(
"Enter a payment for the owner of this bill") },
223 {
"ReportsCompanyReportAction", N_(
"_Company Report"), N_(
"Open a vendor report window for the owner of this bill") },
224 {
"BusinessLinkAction", N_(
"_Manage Document Link…"), N_(
"Manage Document Link")},
225 {
"BusinessLinkOpenAction", N_(
"_Open Linked Document"), N_(
"Open Linked Document")},
231 {
"ViewSaveLayoutAction", N_(
"_Use as Default Layout for Vendor Documents"),
232 N_(
"Use the current layout as default for all vendor bills and credit notes")},
233 {
"ViewResetLayoutAction", N_(
"_Reset Default Layout for Vendor Documents"),
234 N_(
"Reset default layout for all vendor bills and credit notes back to built-in defaults and update the current page accordingly")},
240 {
"FilePrintAction", N_(
"_Print Voucher"), N_(
"Make a printable voucher")},
241 {
"EditEditInvoiceAction", N_(
"_Edit Voucher"), N_(
"Edit this voucher")},
242 {
"EditDuplicateInvoiceAction", N_(
"_Duplicate Voucher"), N_(
"Create a new voucher as a duplicate of the current one")},
243 {
"EditPostInvoiceAction", N_(
"_Post Voucher"), N_(
"Post this voucher to your Chart of Accounts")},
244 {
"EditUnpostInvoiceAction", N_(
"_Unpost Voucher"), N_(
"Unpost this voucher and make it editable")},
245 {
"BusinessNewInvoiceAction", N_(
"New _Voucher"), N_(
"Create a new voucher for the same owner as the current one")},
246 {
"BlankEntryAction", N_(
"Blank"), N_(
"Move to the blank entry at the bottom of the voucher")},
247 {
"ToolsProcessPaymentAction", N_(
"_Pay Voucher"), N_(
"Enter a payment for the owner of this voucher") },
248 {
"ReportsCompanyReportAction", N_(
"_Company Report"), N_(
"Open a employee report window for the owner of this voucher") },
249 {
"BusinessLinkAction", N_(
"_Manage Document Link…"), N_(
"Manage Document Link")},
250 {
"BusinessLinkOpenAction", N_(
"_Open Linked Document"), N_(
"Open Linked Document")},
256 {
"ViewSaveLayoutAction", N_(
"_Use as Default Layout for Employee Documents"),
257 N_(
"Use the current layout as default for all employee vouchers and credit notes")},
258 {
"ViewResetLayoutAction", N_(
"_Reset Default Layout for Employee Documents"),
259 N_(
"Reset default layout for all employee vouchers and credit notes back to built-in defaults and update the current page accordingly")},
265 {
"FilePrintAction", N_(
"_Print Credit Note"), N_(
"Make a printable credit note")},
266 {
"EditEditInvoiceAction", N_(
"_Edit Credit Note"), N_(
"Edit this credit note")},
267 {
"EditDuplicateInvoiceAction", N_(
"_Duplicate Credit Note"), N_(
"Create a new credit note as a duplicate of the current one")},
268 {
"EditPostInvoiceAction", N_(
"_Post Credit Note"), N_(
"Post this credit note to your Chart of Accounts")},
269 {
"EditUnpostInvoiceAction", N_(
"_Unpost Credit Note"), N_(
"Unpost this credit note and make it editable")},
270 {
"BusinessNewInvoiceAction", N_(
"New _Credit Note"), N_(
"Create a new credit note for the same owner as the current one")},
271 {
"BlankEntryAction", N_(
"Blank"), N_(
"Move to the blank entry at the bottom of the credit note")},
272 {
"ToolsProcessPaymentAction", N_(
"_Pay Credit Note"), N_(
"Enter a payment for the owner of this credit note") },
273 {
"ReportsCompanyReportAction", N_(
"_Company Report"), N_(
"Open a company report window for the owner of this credit note") },
274 {
"BusinessLinkAction", N_(
"_Manage Document Link…"), N_(
"Manage Document Link…")},
275 {
"BusinessLinkOpenAction", N_(
"_Open Linked Document"), N_(
"Open Linked Document")},
282 {
"RecordEntryAction", N_(
"Enter")},
283 {
"CancelEntryAction", N_(
"Cancel")},
284 {
"DeleteEntryAction", N_(
"Delete")},
285 {
"DuplicateEntryAction", N_(
"Duplicate")},
286 {
"EntryUpAction", N_(
"Up")},
287 {
"EntryDownAction", N_(
"Down")},
288 {
"BlankEntryAction", N_(
"Blank")},
289 {
"EditPostInvoiceAction", N_(
"Post")},
290 {
"EditUnpostInvoiceAction", N_(
"Unpost")},
291 {
"ToolsProcessPaymentAction", N_(
"Pay")},
307 gint component_manager_id;
312 #define GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(o) \ 313 ((GncPluginPageInvoicePrivate*)gnc_plugin_page_invoice_get_instance_private((GncPluginPageInvoice*)o)) 328 for ( ; item; item = g_list_next(item))
331 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(invoice_page);
333 if (gnc_invoice_window_get_invoice (priv->iw) == invoice)
349 for ( ; item; item = g_list_next(item))
352 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(invoice_page);
354 return GNC_PLUGIN_PAGE(invoice_page);
357 invoice_page = GNC_PLUGIN_PAGE_INVOICE (g_object_new (GNC_TYPE_PLUGIN_PAGE_INVOICE,
nullptr));
358 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(invoice_page);
361 plugin_page = GNC_PLUGIN_PAGE(invoice_page);
364 priv->component_manager_id = 0;
371 GObjectClass *object_class = G_OBJECT_CLASS (klass);
374 object_class->finalize = gnc_plugin_page_invoice_finalize;
377 gnc_plugin_class->
plugin_name = GNC_PLUGIN_PAGE_INVOICE_NAME;
378 gnc_plugin_class->
create_widget = gnc_plugin_page_invoice_create_widget;
379 gnc_plugin_class->
destroy_widget = gnc_plugin_page_invoice_destroy_widget;
380 gnc_plugin_class->
save_page = gnc_plugin_page_invoice_save_page;
381 gnc_plugin_class->
recreate_page = gnc_plugin_page_invoice_recreate_page;
382 gnc_plugin_class->
window_changed = gnc_plugin_page_invoice_window_changed;
390 GSimpleActionGroup *simple_action_group;
394 parent = GNC_PLUGIN_PAGE(plugin_page);
396 g_object_set(G_OBJECT(plugin_page),
397 "page-name", _(
"Invoice"),
398 "ui-description",
"gnc-plugin-page-invoice.ui",
399 "use-new-window", use_new,
407 g_action_map_add_action_entries (G_ACTION_MAP(simple_action_group),
408 gnc_plugin_page_invoice_actions,
409 gnc_plugin_page_invoice_n_actions,
414 gnc_plugin_page_invoice_finalize (GObject *
object)
416 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE (
object));
418 ENTER(
"object %p",
object);
419 G_OBJECT_CLASS (gnc_plugin_page_invoice_parent_class)->finalize (
object);
424 update_doclink_actions (
GncPluginPage *plugin_page, gboolean has_uri)
427 "BusinessLinkOpenAction");
428 g_simple_action_set_enabled (G_SIMPLE_ACTION(uri_action), has_uri);
432 gnc_plugin_page_invoice_action_update (
GncPluginPage *plugin_page,
435 GncMainWindow *window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
436 GtkWidget *tool_item;
438 for (gint i = 0; (action_list[i].
action_name != NULL); i++)
441 action_list[i].action_name,
442 _(action_list[i].label),
443 _(action_list[i].tooltip));
446 action_list[i].action_name);
450 gtk_tool_button_set_label (GTK_TOOL_BUTTON(tool_item), _(action_list[i].label));
451 gtk_widget_set_tooltip_text (GTK_WIDGET(tool_item), _(action_list[i].tooltip));
452 g_object_set (G_OBJECT(tool_item),
"has-tooltip", FALSE, NULL);
460 gnc_plugin_page_update_reset_layout_action (
GncPluginPage *page)
463 GAction *layout_action;
464 gboolean has_default = FALSE;
466 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(page));
468 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);
471 if (gnc_invoice_window_document_has_user_state (priv->iw))
473 g_simple_action_set_enabled (G_SIMPLE_ACTION(layout_action), has_default);
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);
586 gnc_plugin_page_invoice_focus_widget (
GncPluginPage *invoice_plugin_page)
588 if (GNC_IS_PLUGIN_PAGE_INVOICE(invoice_plugin_page))
592 GtkWidget *regWidget = gnc_invoice_get_register(priv->iw);
593 GtkWidget *notes = gnc_invoice_get_notes(priv->iw);
598 g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
601 g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
605 gnc_plugin_load_ui_items);
613 gnc_plugin_page_update_reset_layout_action (invoice_plugin_page);
615 if (!GNUCASH_IS_REGISTER(regWidget))
618 sheet = gnucash_register_get_sheet (GNUCASH_REGISTER(regWidget));
621 if (!gnucash_sheet_is_read_only (sheet))
623 if (!gtk_widget_is_focus (GTK_WIDGET(sheet)))
624 gtk_widget_grab_focus (GTK_WIDGET(sheet));
628 if (!gtk_widget_is_focus (GTK_WIDGET(notes)))
629 gtk_widget_grab_focus (GTK_WIDGET(notes));
639 gnc_plugin_page_invoice_create_widget (
GncPluginPage *plugin_page)
643 GtkWidget *regWidget, *widget;
645 ENTER(
"page %p", plugin_page);
646 page = GNC_PLUGIN_PAGE_INVOICE (plugin_page);
647 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);
648 if (priv->widget != NULL)
654 priv->widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
655 gtk_box_set_homogeneous (GTK_BOX (priv->widget), FALSE);
658 gtk_widget_set_name (GTK_WIDGET(priv->widget),
"gnc-id-invoice-page");
660 gtk_widget_show (priv->widget);
662 widget = gnc_invoice_create_page(priv->iw, page);
663 gtk_widget_show (widget);
664 gtk_box_pack_start(GTK_BOX (priv->widget), widget, TRUE, TRUE, 0);
666 plugin_page->
summarybar = gnc_invoice_window_create_summary_bar(priv->iw);
667 gtk_box_pack_start(GTK_BOX (priv->widget), plugin_page->
summarybar, FALSE, FALSE, 0);
668 gnc_plugin_page_invoice_summarybar_position_changed(NULL, NULL, page);
670 GNC_PREF_SUMMARYBAR_POSITION_TOP,
671 (gpointer)gnc_plugin_page_invoice_summarybar_position_changed,
674 GNC_PREF_SUMMARYBAR_POSITION_BOTTOM,
675 (gpointer)gnc_plugin_page_invoice_summarybar_position_changed,
678 regWidget = gnc_invoice_get_register(priv->iw);
681 g_signal_connect (G_OBJECT (regWidget),
"redraw-help",
682 G_CALLBACK (gnc_plugin_page_redraw_help_cb), page);
684 g_signal_connect (G_OBJECT(regWidget),
"show-popup-menu",
685 G_CALLBACK(gnc_plugin_page_show_popup_cb), page);
688 priv->component_manager_id =
689 gnc_register_gui_component(GNC_PLUGIN_PAGE_INVOICE_NAME,
690 gnc_plugin_page_invoice_refresh_cb,
693 g_signal_connect (G_OBJECT(plugin_page),
"inserted",
702 gnc_plugin_page_invoice_destroy_widget (
GncPluginPage *plugin_page)
707 ENTER(
"page %p", plugin_page);
708 page = GNC_PLUGIN_PAGE_INVOICE (plugin_page);
709 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);
712 GNC_PREF_SUMMARYBAR_POSITION_TOP,
713 (gpointer)gnc_plugin_page_invoice_summarybar_position_changed,
716 GNC_PREF_SUMMARYBAR_POSITION_BOTTOM,
717 (gpointer)gnc_plugin_page_invoice_summarybar_position_changed,
724 g_idle_remove_by_data (plugin_page);
726 if (priv->widget == NULL)
732 if (priv->component_manager_id)
734 gnc_unregister_gui_component(priv->component_manager_id);
735 priv->component_manager_id = 0;
738 gtk_widget_hide(priv->widget);
739 gnc_invoice_window_destroy_cb(priv->widget, priv->iw);
754 gnc_plugin_page_invoice_save_page (
GncPluginPage *plugin_page,
756 const gchar *group_name)
761 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
762 g_return_if_fail (key_file != NULL);
763 g_return_if_fail (group_name != NULL);
765 ENTER(
"page %p, key_file %p, group_name %s", plugin_page, key_file,
768 invoice = GNC_PLUGIN_PAGE_INVOICE(plugin_page);
769 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(invoice);
771 gnc_invoice_save_page(priv->iw, key_file, group_name);
787 gnc_plugin_page_invoice_recreate_page (GtkWidget *window,
789 const gchar *group_name)
793 g_return_val_if_fail(GNC_IS_MAIN_WINDOW(window), NULL);
794 g_return_val_if_fail(key_file, NULL);
795 g_return_val_if_fail(group_name, NULL);
796 ENTER(
"key_file %p, group_name %s", key_file, group_name);
799 page = gnc_invoice_recreate_page(GNC_MAIN_WINDOW(window),
800 key_file, group_name);
808 gnc_plugin_page_invoice_window_changed (
GncPluginPage *plugin_page,
814 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE (plugin_page));
816 page = GNC_PLUGIN_PAGE_INVOICE(plugin_page);
817 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);
818 gnc_invoice_window_changed (priv->iw, window);
823 gnc_plugin_page_invoice_summarybar_position_changed (gpointer prefs,
830 GtkPositionType position = GTK_POS_BOTTOM;
832 g_return_if_fail(user_data != NULL);
834 plugin_page = GNC_PLUGIN_PAGE(user_data);
835 page = GNC_PLUGIN_PAGE_INVOICE (user_data);
836 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);
839 position = GTK_POS_TOP;
841 gtk_box_reorder_child(GTK_BOX(priv->widget),
843 (position == GTK_POS_TOP ? 0 : -1) );
852 gnc_plugin_page_invoice_cmd_new_invoice (GSimpleAction *simple,
856 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
860 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
862 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
863 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
865 gnc_invoice_window_new_invoice_cb(parent, priv->iw);
870 gnc_plugin_page_invoice_cmd_new_account (GSimpleAction *simple,
874 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
875 GtkWindow *parent = NULL;
876 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
878 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
884 gnc_plugin_page_invoice_cmd_print (GSimpleAction *simple,
888 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
892 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
894 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
895 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
897 gnc_invoice_window_printCB (parent, priv->iw);
902 gnc_plugin_page_invoice_cmd_cut (GSimpleAction *simple,
906 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
909 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
911 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
912 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
913 gnc_invoice_window_cut_cb(NULL, priv->iw);
918 gnc_plugin_page_invoice_cmd_copy (GSimpleAction *simple,
922 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
925 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
927 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
928 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
929 gnc_invoice_window_copy_cb(NULL, priv->iw);
934 gnc_plugin_page_invoice_cmd_paste (GSimpleAction *simple,
938 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
941 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
943 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
944 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
945 gnc_invoice_window_paste_cb(NULL, priv->iw);
950 gnc_plugin_page_invoice_cmd_edit (GSimpleAction *simple,
954 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
958 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
960 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
961 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
963 gnc_invoice_window_editCB (parent, priv->iw);
968 gnc_plugin_page_invoice_cmd_edit_tax (GSimpleAction *simple,
972 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
975 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
977 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
979 gnc_tax_info_dialog (parent, NULL);
984 gnc_plugin_page_invoice_cmd_duplicateInvoice (GSimpleAction *simple,
988 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
992 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
994 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
995 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
997 gnc_invoice_window_duplicateInvoiceCB(parent, priv->iw);
1002 gnc_plugin_page_invoice_cmd_post (GSimpleAction *simple,
1006 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1009 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1011 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1012 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1013 gnc_invoice_window_postCB(NULL, priv->iw);
1018 gnc_plugin_page_invoice_cmd_unpost (GSimpleAction *simple,
1022 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1025 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1027 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1028 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1029 gnc_invoice_window_unpostCB(NULL, priv->iw);
1034 gnc_plugin_page_invoice_cmd_sort_changed (GSimpleAction *simple,
1035 GVariant *parameter,
1039 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1042 g_return_if_fail (G_IS_SIMPLE_ACTION(simple));
1043 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1045 ENTER(
"action %p, plugin_page (%p), item is %d",
1046 simple, plugin_page, g_variant_get_int32 (parameter));
1048 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1049 item = g_variant_get_int32 (parameter);
1050 g_action_change_state (G_ACTION(simple), parameter);
1051 gnc_invoice_window_sort (priv->iw, (invoice_sort_type_t)item);
1056 gnc_plugin_page_invoice_cmd_refresh (GSimpleAction *simple,
1060 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1063 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1065 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1066 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1068 gtk_widget_queue_draw (priv->widget);
1073 gnc_plugin_page_invoice_cmd_enter (GSimpleAction *simple,
1077 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1080 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1082 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1083 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1084 gnc_invoice_window_recordCB(NULL, priv->iw);
1089 gnc_plugin_page_invoice_cmd_cancel (GSimpleAction *simple,
1093 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1096 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1098 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1099 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1100 gnc_invoice_window_cancelCB(NULL, priv->iw);
1105 gnc_plugin_page_invoice_cmd_delete (GSimpleAction *simple,
1109 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1112 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1114 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1115 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1116 gnc_invoice_window_deleteCB(NULL, priv->iw);
1121 gnc_plugin_page_invoice_cmd_blank (GSimpleAction *simple,
1125 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1128 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1130 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1131 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1132 gnc_invoice_window_blankCB(NULL, priv->iw);
1137 gnc_plugin_page_invoice_cmd_duplicateEntry (GSimpleAction *simple,
1141 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1144 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1146 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1147 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1148 gnc_invoice_window_duplicateCB(NULL, priv->iw);
1153 gnc_plugin_page_invoice_cmd_entryUp (GSimpleAction *simple,
1157 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1159 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1161 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1162 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1163 gnc_invoice_window_entryUpCB(NULL, priv->iw);
1168 gnc_plugin_page_invoice_cmd_entryDown (GSimpleAction *simple,
1172 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1174 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1176 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1177 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1178 gnc_invoice_window_entryDownCB(NULL, priv->iw);
1183 gnc_plugin_page_invoice_cmd_pay_invoice (GSimpleAction *simple,
1187 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1191 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1193 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1194 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1196 gnc_invoice_window_payment_cb (parent, priv->iw);
1201 gnc_plugin_page_invoice_cmd_save_layout (GSimpleAction *simple,
1205 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1207 GAction *layout_action;
1209 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1211 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1212 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1213 gnc_invoice_window_save_document_layout_to_user_state (priv->iw);
1216 "ViewResetLayoutAction");
1217 g_simple_action_set_enabled (G_SIMPLE_ACTION(layout_action), TRUE);
1223 gnc_plugin_page_invoice_cmd_reset_layout (GSimpleAction *simple,
1227 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1229 GAction *layout_action;
1231 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1233 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1234 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1235 gnc_invoice_window_reset_document_layout_and_clear_user_state (priv->iw);
1238 "ViewResetLayoutAction");
1239 g_simple_action_set_enabled (G_SIMPLE_ACTION(layout_action), FALSE);
1245 gnc_plugin_page_invoice_cmd_link (GSimpleAction *simple,
1249 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1252 GncInvoice *invoice;
1255 gboolean has_uri = FALSE;
1257 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1258 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1259 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1262 invoice = gnc_invoice_window_get_invoice (priv->iw);
1263 uri = gncInvoiceGetDocLink (invoice);
1265 ret_uri = gnc_doclink_get_uri_dialog (parent, _(
"Manage Document Link"), uri);
1270 if (ret_uri && g_strcmp0 (uri, ret_uri) != 0)
1272 GtkWidget *doclink_button =
1273 gnc_invoice_window_get_doclink_button (priv->iw);
1275 if (g_strcmp0 (ret_uri,
"") == 0)
1279 gtk_widget_hide (GTK_WIDGET(doclink_button));
1285 gchar *display_uri =
1286 gnc_doclink_get_unescaped_just_uri (ret_uri);
1287 gtk_link_button_set_uri (GTK_LINK_BUTTON(doclink_button),
1289 gtk_widget_show (GTK_WIDGET(doclink_button));
1290 g_free (display_uri);
1293 gncInvoiceSetDocLink (invoice, ret_uri);
1296 update_doclink_actions (GNC_PLUGIN_PAGE(plugin_page), has_uri);
1303 gnc_plugin_page_invoice_cmd_link_open (GSimpleAction *simple,
1307 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1310 GncInvoice *invoice;
1311 const gchar *uri = NULL;
1313 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1314 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1315 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1318 invoice = gnc_invoice_window_get_invoice (priv->iw);
1319 uri = gncInvoiceGetDocLink (invoice);
1322 gnc_doclink_open_uri (parent, uri);
1328 gnc_plugin_page_invoice_cmd_company_report (GSimpleAction *simple,
1332 auto plugin_page = GNC_PLUGIN_PAGE_INVOICE (user_data);
1336 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1338 ENTER(
"(action %p, plugin_page %p)", simple, plugin_page);
1339 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
1341 gnc_invoice_window_report_owner_cb (parent, priv->iw);
1350 gnc_plugin_page_redraw_help_cb (GnucashRegister *g_reg,
1358 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(invoice_page));
1360 window = GNC_WINDOW(GNC_PLUGIN_PAGE(invoice_page)->window);
1363 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(invoice_page);
1364 help = gnc_invoice_get_help(priv->iw);
1365 status = help ? help : g_strdup(
"");
1366 gnc_window_set_status(window, GNC_PLUGIN_PAGE(invoice_page), status);
1371 gnc_plugin_page_show_popup_cb (GnucashRegister *g_reg,
1376 g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(invoice_page));
1378 window = GNC_WINDOW(GNC_PLUGIN_PAGE(invoice_page)->window);
1387 GNC_PLUGIN_PAGE(invoice_page));
1397 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
1399 page = GNC_PLUGIN_PAGE_INVOICE(plugin_page);
1400 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);
1401 title = gnc_invoice_get_title(priv->iw);
1407 gnc_plugin_page_invoice_refresh_cb (GHashTable *changes, gpointer user_data)
1409 auto page = GNC_PLUGIN_PAGE_INVOICE(user_data);
1413 g_return_if_fail(GNC_IS_PLUGIN_PAGE_INVOICE(page));
1419 priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);
1420 reg = gnc_invoice_get_register(priv->iw);
1421 gnucash_register_refresh_from_prefs(GNUCASH_REGISTER(reg));
1422 gtk_widget_queue_draw(priv->widget);
Public declarations for GncLedgerDisplay class.
utility functions for the GnuCash UI
GtkWidget * gnc_plugin_page_get_window(GncPluginPage *page)
Retrieve a pointer to the GncMainWindow (GtkWindow) containing this page.
const gchar * tab_icon
The relative name of the icon that should be shown on the tab for this page.
gboolean(* focus_page_function)(GncPluginPage *plugin_page)
This function performs specific actions to set the focus on a specific widget.
void gnc_main_window_update_menu_and_toolbar(GncMainWindow *window, GncPluginPage *page, const gchar **ui_updates)
Update the main window menu with the placeholders listed in ui_updates and load the page specific too...
The instance data structure for a content plugin.
const GList * gnc_gobject_tracking_get_list(const gchar *name)
Get a list of all known objects of a specified type.
gulong gnc_prefs_register_cb(const char *group, const gchar *pref_name, gpointer func, gpointer user_data)
Register a callback that gets triggered when the given preference changes.
This file contains the functions to present a gui to the user for creating a new account or editing a...
utility functions for the GnuCash UI
GncPluginPage *(* recreate_page)(GtkWidget *window, GKeyFile *file, const gchar *group)
Create a new page based on the information saved during a previous instantiation of gnucash...
void gnc_main_window_menu_add_accelerator_keys(GncMainWindow *window)
Scan the main window menu and add accelerator keys to main window accelerator group.
void gnc_main_window_init_short_names(GncMainWindow *window, GncToolBarShortNames *toolbar_labels)
Update the labels of the toolbar items with short names.
Functions that are supported by all types of windows.
GSimpleActionGroup * gnc_plugin_page_get_action_group(GncPluginPage *page)
Retrieve the GSimpleActionGroup object associated with this page.
GtkWidget * window
The window that contains the display widget for this plugin.
GSimpleActionGroup * gnc_plugin_page_create_action_group(GncPluginPage *page, const gchar *group_name)
Create the GSimpleActionGroup object associated with this page.
gboolean gnc_main_window_update_menu_for_action(GncMainWindow *window, const gchar *action_name, const gchar *label, const gchar *tooltip)
Find the GMenuModel item given the action name for the window specified.
#define ENTER(format, args...)
Print a function entry debugging message.
void gnc_plugin_page_invoice_update_menus(GncPluginPage *page, gboolean is_posted, gboolean can_unpost)
Update the menu items associated with this invoice 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.
void(* destroy_widget)(GncPluginPage *plugin_page)
Function called to destroy the display widget for a particular type of plugin.
The class data structure for a content plugin.
GAction * gnc_main_window_find_action(GncMainWindow *window, const gchar *action_name)
Find the GAction in the main window.
GncPluginPage * gnc_plugin_page_invoice_new(InvoiceWindow *iw)
Create a new "invoice" plugin page, given a pointer to an InvoiceWindow data structure.
void gnc_plugin_page_disconnect_page_changed(GncPluginPage *page)
Disconnect the page_changed_id signal callback.
void(* window_changed)(GncPluginPage *plugin_page, GtkWidget *window)
Perform plugin specific actions when a page is added to a window (or has been removed from one window...
gboolean gnc_main_window_popup_menu_cb(GtkWidget *widget, GncPluginPage *page)
Callback function invoked when the user requests that Gnucash popup the contextual menu via the keybo...
const gchar * plugin_name
The textual name of this plugin.
GtkWidget *(* create_widget)(GncPluginPage *plugin_page)
Function called to create the display widget for a particular type of plugin.
Gnome specific utility functions.
void gnc_ui_new_account_window(GtkWindow *parent, QofBook *book, Account *parent_acct)
Display a window for creating a new account.
void(* save_page)(GncPluginPage *page, GKeyFile *file, const gchar *group)
Save enough information about this page so that it can be recreated next time the user starts gnucash...
Generic api to store and retrieve preferences.
Business Invoice Interface.
gboolean qof_book_is_readonly(const QofBook *book)
Return whether the book is read only.
gboolean gnc_prefs_get_bool(const gchar *group, const gchar *pref_name)
Get a boolean value from the preferences backend.
void gnc_plugin_page_inserted_cb(GncPluginPage *page, gpointer user_data)
Set up the page_changed callback for when the current page is changed.
Functions for adding plugins to a GnuCash window.
#define LEAVE(format, args...)
Print a function exit debugging message.
void gnc_plugin_page_add_book(GncPluginPage *page, QofBook *book)
Add a book reference to the specified page.
Utility functions for convert uri in separate components and back.
The instance data structure for a main window object.
void main_window_update_page_name(GncPluginPage *page, const gchar *name_in)
Update the name of the page in the main window.
GAction * gnc_plugin_page_get_action(GncPluginPage *page, const gchar *name)
Retrieve a GAction object associated with this page.
GtkWidget * gnc_main_window_toolbar_find_tool_item(GncMainWindow *window, const gchar *action_name)
Find the toolbar item with the given action name for the window specified.
InvoiceWindow * gnc_plugin_page_invoice_get_window(GncInvoice *invoice)
Find the Invoice Window amongst the plugin pages for an Invoice, if not present return NULL...
GtkWidget * summarybar
The summary bar widget (if any) that is associated with this plugin.
void gnc_plugin_page_invoice_update_title(GncPluginPage *plugin_page)
Update the title associated with this invoice page.
void gnc_prefs_remove_cb_by_func(const gchar *group, const gchar *pref_name, gpointer func, gpointer user_data)
Remove a function that was registered for a callback when the given preference changed.