GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-plugin-page-owner-tree.c
Go to the documentation of this file.
1 /*
2  * gnc-plugin-page-owner-tree.c --
3  *
4  * Copyright (C) 2011 Geert Janssens <[email protected]>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, contact:
18  *
19  * Free Software Foundation Voice: +1-617-542-5942
20  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
21  * Boston, MA 02110-1301, USA [email protected]
22  */
23 
34 #include "config.h"
35 
36 #include <gtk/gtk.h>
37 #include <glib/gi18n.h>
38 #include "swig-runtime.h"
39 
40 #include "gnc-plugin.h"
42 #include "gnc-plugin-page-report.h"
43 
44 #include "dialog-vendor.h"
45 #include "dialog-customer.h"
46 #include "dialog-employee.h"
47 #include "dialog-invoice.h"
48 #include "dialog-job.h"
49 
50 #include "gncOwner.h"
51 #include "dialog-utils.h"
52 #include "gnc-component-manager.h"
53 #include "gnc-engine.h"
54 #include "gnc-gnome-utils.h"
55 #include "gnc-gobject-utils.h"
56 #include "gnc-icons.h"
57 #include "gnc-session.h"
58 #include "gnc-tree-view-owner.h"
59 #include "gnc-ui.h"
60 #include "gnc-ui-util.h"
61 #include "guile-mappings.h"
62 #include "dialog-lot-viewer.h"
64 
65 /* This static indicates the debugging module that this .o belongs to. */
66 static QofLogModule log_module = GNC_MOD_GUI;
67 
68 #define PLUGIN_PAGE_ACCT_TREE_CM_CLASS "plugin-page-owner-tree"
69 
70 #define DELETE_DIALOG_FILTER "filter"
71 #define DELETE_DIALOG_OWNER "owner"
72 
73 enum
74 {
75  OWNER_SELECTED,
76  LAST_SIGNAL
77 };
78 
80 {
81  GtkWidget *widget;
82  GtkTreeView *tree_view;
83  gint component_id;
84  GncOwnerType owner_type;
87 
88 #define GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(o) \
89  (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_PAGE_OWNER_TREE, GncPluginPageOwnerTreePrivate))
90 
91 static GObjectClass *parent_class = NULL;
92 
93 /************************************************************
94  * Prototypes *
95  ************************************************************/
96 /* Plugin Actions */
97 static void gnc_plugin_page_owner_tree_class_init (GncPluginPageOwnerTreeClass *klass);
98 static void gnc_plugin_page_owner_tree_init (GncPluginPageOwnerTree *plugin_page);
99 static void gnc_plugin_page_owner_tree_finalize (GObject *object);
100 static void gnc_plugin_page_owner_tree_selected (GObject *object, gpointer user_data);
101 
102 static GtkWidget *gnc_plugin_page_owner_tree_create_widget (GncPluginPage *plugin_page);
103 static void gnc_plugin_page_owner_tree_destroy_widget (GncPluginPage *plugin_page);
104 static void gnc_plugin_page_owner_tree_save_page (GncPluginPage *plugin_page, GKeyFile *file, const gchar *group);
105 static GncPluginPage *gnc_plugin_page_owner_tree_recreate_page (GtkWidget *window, GKeyFile *file, const gchar *group);
106 
107 /* Callbacks */
108 static gboolean gnc_plugin_page_owner_tree_button_press_cb (GtkWidget *widget,
109  GdkEventButton *event,
110  GncPluginPage *page);
111 static void gnc_plugin_page_owner_tree_double_click_cb (GtkTreeView *treeview,
112  GtkTreePath *path,
113  GtkTreeViewColumn *col,
114  GncPluginPageOwnerTree *page);
115 
116 static void gnc_plugin_page_owner_tree_selection_changed_cb (GtkTreeSelection *selection,
117  GncPluginPageOwnerTree *page);
118 
119 /* Command callbacks */
120 static void gnc_plugin_page_owner_tree_cmd_new_owner (GtkAction *action, GncPluginPageOwnerTree *page);
121 static void gnc_plugin_page_owner_tree_cmd_edit_owner (GtkAction *action, GncPluginPageOwnerTree *page);
122 #if 0 /* Disabled due to crash */
123 static void gnc_plugin_page_owner_tree_cmd_delete_owner (GtkAction *action, GncPluginPageOwnerTree *page);
124 #endif
125 static void gnc_plugin_page_owner_tree_cmd_view_filter_by (GtkAction *action, GncPluginPageOwnerTree *page);
126 static void gnc_plugin_page_owner_tree_cmd_new_invoice (GtkAction *action, GncPluginPageOwnerTree *page);
127 static void gnc_plugin_page_owner_tree_cmd_owners_report (GtkAction *action, GncPluginPageOwnerTree *plugin_page);
128 static void gnc_plugin_page_owner_tree_cmd_owner_report (GtkAction *action, GncPluginPageOwnerTree *plugin_page);
129 
130 
131 static guint plugin_page_signals[LAST_SIGNAL] = { 0 };
132 
133 
134 static GtkActionEntry gnc_plugin_page_owner_tree_actions [] =
135 {
136  /* Toplevel */
137  { "FakeToplevel", NULL, "", NULL, NULL, NULL },
138 
139  /* Edit menu */
140  {
141  "OTEditVendorAction", GNC_STOCK_EDIT_ACCOUNT, N_("E_dit Vendor"), "<control>e",
142  N_("Edit the selected vendor"),
143  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_edit_owner)
144  },
145  {
146  "OTEditCustomerAction", GNC_STOCK_EDIT_ACCOUNT, N_("E_dit Customer"), "<control>e",
147  N_("Edit the selected customer"),
148  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_edit_owner)
149  },
150  {
151  "OTEditEmployeeAction", GNC_STOCK_EDIT_ACCOUNT, N_("E_dit Employee"), "<control>e",
152  N_("Edit the selected employee"),
153  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_edit_owner)
154  },
155  {
156  "OTNewVendorAction", GNC_STOCK_NEW_ACCOUNT, N_("_New Vendor..."), NULL,
157  N_("Create a new vendor"),
158  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_owner)
159  },
160  {
161  "OTNewCustomerAction", GNC_STOCK_NEW_ACCOUNT, N_("_New Customer..."), NULL,
162  N_("Create a new customer"),
163  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_owner)
164  },
165  {
166  "OTNewEmployeeAction", GNC_STOCK_NEW_ACCOUNT, N_("_New Employee..."), NULL,
167  N_("Create a new employee"),
168  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_owner)
169  },
170 
171 #if 0 /* Disabled due to crash */
172  {
173  "EditDeleteOwnerAction", GNC_STOCK_DELETE_ACCOUNT, N_("_Delete Owner..."), "Delete",
174  N_("Delete selected owner"),
175  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_delete_owner)
176  },
177 #endif /* Disabled due to crash */
178 
179  /* View menu */
180  {
181  "ViewFilterByAction", NULL, N_("_Filter By..."), NULL, NULL,
182  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_view_filter_by)
183  },
184 
185  /* Business menu */
186  {
187  "OTNewBillAction", GNC_STOCK_INVOICE_NEW, N_("New _Bill..."), NULL,
188  N_("Create a new bill"),
189  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_invoice)
190  },
191  {
192  "OTNewInvoiceAction", GNC_STOCK_INVOICE_NEW, N_("New _Invoice..."), NULL,
193  N_("Create a new invoice"),
194  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_invoice)
195  },
196  {
197  "OTNewVoucherAction", GNC_STOCK_INVOICE_NEW, N_("New _Voucher..."), NULL,
198  N_("Create a new voucher"),
199  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_new_invoice)
200  },
201  {
202  "OTVendorListingReportAction", GTK_STOCK_PRINT_PREVIEW, N_("Vendor Listing"), NULL,
203  N_("Show vendor aging overview for all vendors"),
204  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owners_report)
205  },
206  {
207  "OTCustomerListingReportAction", GTK_STOCK_PRINT_PREVIEW, N_("Customer Listing"), NULL,
208  N_("Show customer aging overview for all customers"),
209  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owners_report)
210  },
211  {
212  "OTVendorReportAction", NULL, N_("Vendor Report"), NULL,
213  N_("Show vendor report"),
214  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owner_report)
215  },
216  {
217  "OTCustomerReportAction", NULL, N_("Customer Report"), NULL,
218  N_("Show customer report"),
219  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owner_report)
220  },
221  {
222  "OTEmployeeReportAction", NULL, N_("Employee Report"), NULL,
223  N_("Show employee report"),
224  G_CALLBACK (gnc_plugin_page_owner_tree_cmd_owner_report)
225  },
226 };
228 static guint gnc_plugin_page_owner_tree_n_actions = G_N_ELEMENTS (gnc_plugin_page_owner_tree_actions);
229 
230 
233 static const gchar *actions_requiring_owner_rw[] =
234 {
235  "OTEditVendorAction",
236  "OTEditCustomerAction",
237  "OTEditEmployeeAction",
238 /* FIXME disabled due to crash "EditDeleteOwnerAction", */
239  NULL
240 };
241 
244 static const gchar *actions_requiring_owner_always[] =
245 {
246  "OTVendorReportAction",
247  "OTCustomerReportAction",
248  "OTEmployeeReportAction",
249  NULL
250 };
251 
252 /* This is the list of actions which are switched inactive in a read-only book. */
253 static const gchar* readonly_inactive_actions[] =
254 {
255  "OTNewVendorAction",
256  "OTNewCustomerAction",
257  "OTNewEmployeeAction",
258  "OTNewBillAction",
259  "OTNewInvoiceAction",
260  "OTNewVoucherAction",
261  NULL
262 };
263 
264 
266 static action_toolbar_labels toolbar_labels[] =
267 {
268  { "OTEditVendorAction", N_("Edit") },
269  { "OTEditCustomerAction", N_("Edit") },
270  { "OTEditEmployeeAction", N_("Edit") },
271  { "OTNewVendorAction", N_("New") },
272  { "OTNewCustomerAction", N_("New") },
273  { "OTNewEmployeeAction", N_("New") },
274  { "OTNewBillAction", N_("New Bill") },
275  { "OTNewInvoiceAction", N_("New Invoice") },
276  { "OTNewVoucherAction", N_("New Voucher") },
277  { "OTVendorListingReportAction", N_("Vendor Listing") },
278  { "OTCustomerListingReportAction", N_("Customer Listing") },
279 /* FIXME disable due to crash { "EditDeleteOwnerAction", N_("Delete") },*/
280  { NULL, NULL },
281 };
282 
286 typedef struct
287 {
289  const char *action_name;
291  GncOwnerType owner_type;
293 
294 static action_owners_struct action_owners[] =
295 {
296  { "OTEditVendorAction", GNC_OWNER_VENDOR },
297  { "OTEditCustomerAction", GNC_OWNER_CUSTOMER },
298  { "OTEditEmployeeAction", GNC_OWNER_EMPLOYEE },
299  { "OTNewVendorAction", GNC_OWNER_VENDOR },
300  { "OTNewCustomerAction", GNC_OWNER_CUSTOMER },
301  { "OTNewEmployeeAction", GNC_OWNER_EMPLOYEE },
302  { "OTNewBillAction", GNC_OWNER_VENDOR },
303  { "OTNewInvoiceAction", GNC_OWNER_CUSTOMER },
304  { "OTNewVoucherAction", GNC_OWNER_EMPLOYEE },
305  { "OTVendorListingReportAction", GNC_OWNER_VENDOR },
306  { "OTCustomerListingReportAction", GNC_OWNER_CUSTOMER },
307  { "OTVendorReportAction", GNC_OWNER_VENDOR },
308  { "OTCustomerReportAction", GNC_OWNER_CUSTOMER },
309  { "OTEmployeeReportAction", GNC_OWNER_EMPLOYEE },
310  { NULL, GNC_OWNER_NONE },
311 };
312 
313 GType
315 {
316  static GType gnc_plugin_page_owner_tree_type = 0;
317 
318  if (gnc_plugin_page_owner_tree_type == 0)
319  {
320  static const GTypeInfo our_info =
321  {
323  NULL,
324  NULL,
325  (GClassInitFunc) gnc_plugin_page_owner_tree_class_init,
326  NULL,
327  NULL,
328  sizeof (GncPluginPageOwnerTree),
329  0,
330  (GInstanceInitFunc) gnc_plugin_page_owner_tree_init
331  };
332 
333  gnc_plugin_page_owner_tree_type = g_type_register_static (GNC_TYPE_PLUGIN_PAGE,
334  GNC_PLUGIN_PAGE_OWNER_TREE_NAME,
335  &our_info, 0);
336  }
337 
338  return gnc_plugin_page_owner_tree_type;
339 }
340 
342 gnc_plugin_page_owner_tree_new (GncOwnerType owner_type)
343 {
344  GncPluginPageOwnerTree *plugin_page;
345 
347  const GList *item;
348 
349  GtkActionGroup *action_group;
350  GtkAction *action;
351  GValue gvalue = { 0 };
352  gint i;
353 
354  g_return_val_if_fail( (owner_type != GNC_OWNER_UNDEFINED)
355  && (owner_type != GNC_OWNER_NONE), NULL);
356  ENTER(" ");
357 
358  /* Is there an existing page? */
359  item = gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_OWNER_TREE_NAME);
360  for ( ; item; item = g_list_next(item))
361  {
362  plugin_page = (GncPluginPageOwnerTree *)item->data;
363  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(plugin_page);
364  if (priv->owner_type == owner_type)
365  {
366  LEAVE("existing %s tree page %p", gncOwnerTypeToQofIdType(owner_type), plugin_page);
367  return GNC_PLUGIN_PAGE(plugin_page);
368  }
369  }
370 
371  plugin_page = g_object_new(GNC_TYPE_PLUGIN_PAGE_OWNER_TREE, NULL);
372 
373  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(plugin_page);
374  priv->owner_type = owner_type;
375 
376  /* Hide menu and toolbar items that are not relevant for the active owner list */
377  action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(plugin_page));
378  g_value_init (&gvalue, G_TYPE_BOOLEAN);
379  for (i = 0; action_owners[i].action_name; i++)
380  {
381  action = gtk_action_group_get_action (action_group, action_owners[i].action_name);
382  g_value_set_boolean (&gvalue, (priv->owner_type == action_owners[i].owner_type) );
383  g_object_set_property (G_OBJECT(action), "visible", &gvalue);
384  }
385 
386  LEAVE("new %s tree page %p", gncOwnerTypeToQofIdType(owner_type), plugin_page);
387  return GNC_PLUGIN_PAGE(plugin_page);
388 }
389 
390 static void
391 gnc_plugin_page_owner_tree_class_init (GncPluginPageOwnerTreeClass *klass)
392 {
393  GObjectClass *object_class = G_OBJECT_CLASS (klass);
394  GncPluginPageClass *gnc_plugin_class = GNC_PLUGIN_PAGE_CLASS(klass);
395 
396  parent_class = g_type_class_peek_parent (klass);
397 
398  object_class->finalize = gnc_plugin_page_owner_tree_finalize;
399 
400  gnc_plugin_class->tab_icon = GNC_STOCK_ACCOUNT;
401  gnc_plugin_class->plugin_name = GNC_PLUGIN_PAGE_OWNER_TREE_NAME;
402  gnc_plugin_class->create_widget = gnc_plugin_page_owner_tree_create_widget;
403  gnc_plugin_class->destroy_widget = gnc_plugin_page_owner_tree_destroy_widget;
404  gnc_plugin_class->save_page = gnc_plugin_page_owner_tree_save_page;
405  gnc_plugin_class->recreate_page = gnc_plugin_page_owner_tree_recreate_page;
406 
407  g_type_class_add_private(klass, sizeof(GncPluginPageOwnerTreePrivate));
408 
409  plugin_page_signals[OWNER_SELECTED] =
410  g_signal_new ("owner_selected",
411  G_OBJECT_CLASS_TYPE (object_class),
412  G_SIGNAL_RUN_FIRST,
413  G_STRUCT_OFFSET (GncPluginPageOwnerTreeClass, owner_selected),
414  NULL, NULL,
415  g_cclosure_marshal_VOID__POINTER,
416  G_TYPE_NONE, 1,
417  G_TYPE_POINTER);
418 }
419 
420 static void
421 gnc_plugin_page_owner_tree_init (GncPluginPageOwnerTree *plugin_page)
422 {
423  GtkActionGroup *action_group;
425  GncPluginPage *parent;
426 
427  ENTER("page %p", plugin_page);
428  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(plugin_page);
429 
430  /* Init parent declared variables */
431  parent = GNC_PLUGIN_PAGE(plugin_page);
432  g_object_set(G_OBJECT(plugin_page),
433  "page-name", _("Owners"),
434  "page-uri", "default:",
435  "ui-description", "gnc-plugin-page-owner-tree-ui.xml",
436  NULL);
437  g_signal_connect (G_OBJECT (plugin_page), "selected",
438  G_CALLBACK (gnc_plugin_page_owner_tree_selected), plugin_page);
439 
440  /* change me when the system supports multiple books */
441  gnc_plugin_page_add_book(parent, gnc_get_current_book());
442 
443  /* Create menu and toolbar information */
444  action_group =
446  "GncPluginPageOwnerTreeActions");
447  gtk_action_group_add_actions(action_group,
448  gnc_plugin_page_owner_tree_actions,
449  gnc_plugin_page_owner_tree_n_actions,
450  plugin_page);
451  gnc_plugin_init_short_names (action_group, toolbar_labels);
452 
453 
454  /* Init filter */
455  priv->fd.show_inactive = TRUE;
456  priv->fd.show_zero_total = TRUE;
457 
458  LEAVE("page %p, priv %p, action group %p",
459  plugin_page, priv, action_group);
460 }
461 
462 static void
463 gnc_plugin_page_owner_tree_finalize (GObject *object)
464 {
467 
468  ENTER("object %p", object);
469  page = GNC_PLUGIN_PAGE_OWNER_TREE (object);
470  g_return_if_fail (GNC_IS_PLUGIN_PAGE_OWNER_TREE (page));
471  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
472  g_return_if_fail (priv != NULL);
473 
474  G_OBJECT_CLASS (parent_class)->finalize (object);
475  LEAVE(" ");
476 }
477 
478 static void update_inactive_actions(GncPluginPage *plugin_page)
479 {
480  GtkActionGroup *action_group;
481  gboolean is_sensitive = !qof_book_is_readonly(gnc_get_current_book());
482 
483  // We are readonly - so we have to switch particular actions to inactive.
484  g_return_if_fail(plugin_page);
485  g_return_if_fail(GNC_IS_PLUGIN_PAGE(plugin_page));
486 
487  /* Get the action group */
488  action_group = gnc_plugin_page_get_action_group(plugin_page);
489  g_return_if_fail(GTK_IS_ACTION_GROUP (action_group));
490 
491  /* Set the action's sensitivity */
492  gnc_plugin_update_actions (action_group, readonly_inactive_actions,
493  "sensitive", is_sensitive);
494 }
495 
496 static void
497 gnc_plugin_page_owner_tree_selected (GObject *object, gpointer user_data)
498 {
499  GncPluginPage *page = GNC_PLUGIN_PAGE (object);
500  g_return_if_fail (GNC_IS_PLUGIN_PAGE (page));
501  update_inactive_actions(page);
502 }
503 
504 
505 GncOwner *
507 {
509  GncOwner *owner;
510 
511  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
512  ENTER("page %p (tree view %p)", page, priv->tree_view);
513  owner = gnc_tree_view_owner_get_selected_owner (GNC_TREE_VIEW_OWNER(priv->tree_view));
514  if (owner == NULL)
515  {
516  LEAVE("no owner");
517  return NULL;
518  }
519 
520  LEAVE("owner %p", owner);
521  return owner;
522 }
523 
524 
525 /* Virtual Functions */
526 
527 static void
528 gnc_plugin_page_owner_refresh_cb (GHashTable *changes, gpointer user_data)
529 {
530  GncPluginPageOwnerTree *page = user_data;
532 
533  g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(page));
534 
535  /* We're only looking for forced updates here. */
536  if (changes)
537  return;
538 
539  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
540  gtk_widget_queue_draw(priv->widget);
541 }
542 
543 static void
544 gnc_plugin_page_owner_tree_close_cb (gpointer user_data)
545 {
546  GncPluginPage *plugin_page;
547 
548  plugin_page = GNC_PLUGIN_PAGE(user_data);
549  gnc_main_window_close_page(plugin_page);
550 }
551 
552 static GtkWidget *
553 gnc_plugin_page_owner_tree_create_widget (GncPluginPage *plugin_page)
554 {
557  GtkTreeSelection *selection;
558  GtkTreeView *tree_view;
559  GtkWidget *scrolled_window;
560  GtkTreeViewColumn *col;
561  const gchar *state_section = NULL;
562  gchar* label = "";
563 
564  ENTER("page %p", plugin_page);
565  page = GNC_PLUGIN_PAGE_OWNER_TREE (plugin_page);
566  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
567  if (priv->widget != NULL)
568  {
569  LEAVE("widget = %p", priv->widget);
570  return priv->widget;
571  }
572 
573  priv->widget = gtk_vbox_new (FALSE, 0);
574  gtk_widget_show (priv->widget);
575 
576  scrolled_window = gtk_scrolled_window_new (NULL, NULL);
577  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
578  GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
579  gtk_widget_show (scrolled_window);
580  gtk_box_pack_start (GTK_BOX (priv->widget), scrolled_window,
581  TRUE, TRUE, 0);
582 
583  tree_view = gnc_tree_view_owner_new(priv->owner_type);
584 
585  /* Show default columns */
587  GNC_TREE_VIEW(tree_view), GNC_OWNER_TREE_ID_COL);
588  g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
590  GNC_TREE_VIEW(tree_view), GNC_OWNER_TREE_ADDRESS_1_COL);
591  g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
593  GNC_TREE_VIEW(tree_view), GNC_OWNER_TREE_ADDRESS_2_COL);
594  g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
596  GNC_TREE_VIEW(tree_view), GNC_OWNER_TREE_PHONE_COL);
597  g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
598  gnc_tree_view_configure_columns(GNC_TREE_VIEW(tree_view));
599 
600 
601 
602  switch (priv->owner_type)
603  {
604  case GNC_OWNER_NONE :
605  case GNC_OWNER_UNDEFINED :
606  break;
607  case GNC_OWNER_CUSTOMER :
608  label = N_("Customers");
609  state_section = "Customers Overview";
610  break;
611  case GNC_OWNER_JOB :
612  label = N_("Jobs");
613  state_section = "Jobs Overview";
614  break;
615  case GNC_OWNER_VENDOR :
616  label = N_("Vendors");
617  state_section = "Vendors Overview";
618  break;
619  case GNC_OWNER_EMPLOYEE :
620  label = N_("Employees");
621  state_section = "Employees Overview";
622  break;
623  }
624 
625  g_object_set(G_OBJECT(tree_view), "state-section", state_section,
626  "show-column-menu", TRUE,
627  NULL);
628 
629  g_object_set(G_OBJECT(plugin_page), "page-name", label, NULL);
630 
631  priv->tree_view = tree_view;
632  selection = gtk_tree_view_get_selection(tree_view);
633  g_signal_connect (G_OBJECT (selection), "changed",
634  G_CALLBACK (gnc_plugin_page_owner_tree_selection_changed_cb), page);
635  g_signal_connect (G_OBJECT (tree_view), "button-press-event",
636  G_CALLBACK (gnc_plugin_page_owner_tree_button_press_cb), page);
637  g_signal_connect (G_OBJECT (tree_view), "row-activated",
638  G_CALLBACK (gnc_plugin_page_owner_tree_double_click_cb), page);
639 
640  gtk_tree_view_set_headers_visible(tree_view, TRUE);
641  gnc_plugin_page_owner_tree_selection_changed_cb (NULL, page);
642  gtk_widget_show (GTK_WIDGET (tree_view));
643  gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET(tree_view));
644 
645  priv->fd.tree_view = GNC_TREE_VIEW_OWNER(priv->tree_view);
647  GNC_TREE_VIEW_OWNER(tree_view),
649 
650  priv->component_id =
651  gnc_register_gui_component(PLUGIN_PAGE_ACCT_TREE_CM_CLASS,
652  gnc_plugin_page_owner_refresh_cb,
653  gnc_plugin_page_owner_tree_close_cb,
654  page);
655  gnc_gui_component_set_session (priv->component_id,
656  gnc_get_current_session());
657 
658  LEAVE("widget = %p", priv->widget);
659  return priv->widget;
660 }
661 
662 static void
663 gnc_plugin_page_owner_tree_destroy_widget (GncPluginPage *plugin_page)
664 {
667 
668  ENTER("page %p", plugin_page);
669  page = GNC_PLUGIN_PAGE_OWNER_TREE (plugin_page);
670  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
671 
672  if (priv->widget)
673  {
674  g_object_unref(G_OBJECT(priv->widget));
675  priv->widget = NULL;
676  }
677 
678  if (priv->component_id)
679  {
680  gnc_unregister_gui_component(priv->component_id);
681  priv->component_id = 0;
682  }
683 
684  LEAVE("widget destroyed");
685 }
686 
687 #define OWNER_TYPE_LABEL "OwnerType"
688 
698 static void
699 gnc_plugin_page_owner_tree_save_page (GncPluginPage *plugin_page,
700  GKeyFile *key_file,
701  const gchar *group_name)
702 {
703  GncPluginPageOwnerTree *owner_page;
705 
706  g_return_if_fail (GNC_IS_PLUGIN_PAGE_OWNER_TREE(plugin_page));
707  g_return_if_fail (key_file != NULL);
708  g_return_if_fail (group_name != NULL);
709 
710  ENTER("page %p, key_file %p, group_name %s", plugin_page, key_file,
711  group_name);
712 
713  owner_page = GNC_PLUGIN_PAGE_OWNER_TREE(plugin_page);
714  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(owner_page);
715 
716  g_key_file_set_integer(key_file, group_name, OWNER_TYPE_LABEL,
717  priv->owner_type);
718 
719  gnc_tree_view_owner_save(GNC_TREE_VIEW_OWNER(priv->tree_view),
720  &priv->fd, key_file, group_name);
721  LEAVE(" ");
722 }
723 
724 
725 
735 static GncPluginPage *
736 gnc_plugin_page_owner_tree_recreate_page (GtkWidget *window,
737  GKeyFile *key_file,
738  const gchar *group_name)
739 {
740  GncPluginPageOwnerTree *owner_page;
742  GncPluginPage *page;
743  GncOwnerType owner_type;
744 
745  g_return_val_if_fail(key_file, NULL);
746  g_return_val_if_fail(group_name, NULL);
747  ENTER("key_file %p, group_name %s", key_file, group_name);
748 
749  /* Create the new page. */
750  owner_type = g_key_file_get_integer(key_file, group_name, OWNER_TYPE_LABEL, NULL);
751  page = gnc_plugin_page_owner_tree_new(owner_type);
752  owner_page = GNC_PLUGIN_PAGE_OWNER_TREE(page);
753  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(owner_page);
754 
755  /* Install it now so we can then manipulate the created widget */
756  gnc_main_window_open_page(GNC_MAIN_WINDOW(window), page);
757 
758  gnc_tree_view_owner_restore(GNC_TREE_VIEW_OWNER(priv->tree_view),
759  &priv->fd, key_file, group_name, owner_type);
760  LEAVE(" ");
761  return page;
762 }
763 
764 /* Wrapper function to open the proper edit dialog, depending on the owner type */
765 static void gnc_ui_owner_edit (GncOwner *owner)
766 {
767  if (NULL == owner) return;
768 
769  switch (owner->type)
770  {
771  case GNC_OWNER_NONE :
772  case GNC_OWNER_UNDEFINED :
773  break;
774  case GNC_OWNER_CUSTOMER :
775  {
776  gnc_ui_customer_edit (owner->owner.customer);
777  break;
778  }
779  case GNC_OWNER_JOB :
780  {
781  gnc_ui_job_edit (owner->owner.job);
782  break;
783  }
784  case GNC_OWNER_VENDOR :
785  {
786  gnc_ui_vendor_edit (owner->owner.vendor);
787  break;
788  }
789  case GNC_OWNER_EMPLOYEE :
790  {
791  gnc_ui_employee_edit (owner->owner.employee);
792  break;
793  }
794  }
795 }
796 
797 
798 /* Callbacks */
799 
807 static gboolean
808 gnc_plugin_page_owner_tree_button_press_cb (GtkWidget *widget,
809  GdkEventButton *event,
810  GncPluginPage *page)
811 {
812  g_return_val_if_fail(GNC_IS_PLUGIN_PAGE(page), FALSE);
813 
814  ENTER("widget %p, event %p, page %p", widget, event, page);
815  gnc_main_window_button_press_cb(widget, event, page);
816  LEAVE(" ");
817 
818  /* Always return FALSE. This will let the tree view callback run as
819  * well which will select the item under the cursor. By the time
820  * the user sees the menu both callbacks will have run and the menu
821  * actions will operate on the just-selected owner. */
822  return FALSE;
823 }
824 
825 static void
826 gnc_plugin_page_owner_tree_double_click_cb (GtkTreeView *treeview,
827  GtkTreePath *path,
828  GtkTreeViewColumn *col,
830 {
831  GncOwner *owner;
832 
833  g_return_if_fail (GNC_IS_PLUGIN_PAGE_OWNER_TREE (page));
834  owner = gnc_tree_view_owner_get_owner_from_path (GNC_TREE_VIEW_OWNER(treeview), path);
835  gnc_ui_owner_edit (owner);
836 }
837 
838 static void
839 gnc_plugin_page_owner_tree_selection_changed_cb (GtkTreeSelection *selection,
841 {
842  GtkActionGroup *action_group;
843  GtkTreeView *view;
844  GncOwner *owner = NULL;
845  gboolean sensitive;
846  gboolean is_readwrite = !qof_book_is_readonly(gnc_get_current_book());
847 
848  g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(page));
849 
850  if (!selection)
851  {
852  sensitive = FALSE;
853  }
854  else
855  {
856  g_return_if_fail(GTK_IS_TREE_SELECTION(selection));
857  view = gtk_tree_selection_get_tree_view (selection);
858  owner = gnc_tree_view_owner_get_selected_owner (GNC_TREE_VIEW_OWNER(view));
859  sensitive = (owner != NULL);
860  }
861 
862  action_group = gnc_plugin_page_get_action_group(GNC_PLUGIN_PAGE(page));
863  gnc_plugin_update_actions (action_group, actions_requiring_owner_always,
864  "sensitive", sensitive);
865  gnc_plugin_update_actions (action_group, actions_requiring_owner_rw,
866  "sensitive", sensitive && is_readwrite);
867  g_signal_emit (page, plugin_page_signals[OWNER_SELECTED], 0, owner);
868 }
869 
870 /******************************************************************/
871 /* Report helper functions */
872 /******************************************************************/
873 
874 static int
875 build_aging_report (GncOwnerType owner_type)
876 {
877  gchar *report_name = NULL;
878  gchar *report_title = NULL;
879  SCM args;
880  SCM func;
881  SCM arg;
882 
883  args = SCM_EOL;
884 
885  switch (owner_type)
886  {
887  case GNC_OWNER_NONE :
888  case GNC_OWNER_UNDEFINED :
889  case GNC_OWNER_EMPLOYEE :
890  case GNC_OWNER_JOB :
891  {
892  return -1;
893  }
894  case GNC_OWNER_VENDOR :
895  {
896  report_name = "gnc:payables-report-create";
897  report_title = _("Vendor Listing");
898  break;
899  }
900  case GNC_OWNER_CUSTOMER :
901  {
902  report_name = "gnc:receivables-report-create";
903  report_title = _("Customer Listing");
904  break;
905  }
906  }
907 
908  /* Find report generator function in guile */
909  func = scm_c_eval_string (report_name);
910  g_return_val_if_fail (scm_is_procedure (func), -1);
911 
912  /* Option Show zero's ? - Yes for the listing report */
913  arg = SCM_BOOL_T;
914  args = scm_cons (arg, args);
915  g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
916 
917  /* Option Report title */
918  arg = scm_from_utf8_string (report_title);
919  args = scm_cons (arg, args);
920 
921  /* Option Account - Using False to select default account
922  *
923  * XXX I'm not sure if it would make sense to use another
924  * account than default */
925  arg = SCM_BOOL_F;
926  args = scm_cons (arg, args);
927  g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
928 
929 
930  /* Apply the function to the args */
931  arg = scm_apply (func, args, SCM_EOL);
932  g_return_val_if_fail (scm_is_exact (arg), -1);
933 
934  return scm_to_int (arg);
935 }
936 
937 static int build_owner_report (GncOwner *owner, Account *acc)
938 {
939  SCM args;
940  SCM func;
941  SCM arg;
942 
943  g_return_val_if_fail (owner, -1);
944 
945  args = SCM_EOL;
946 
947  func = scm_c_eval_string ("gnc:owner-report-create");
948  g_return_val_if_fail (scm_is_procedure (func), -1);
949 
950  if (acc)
951  {
952  swig_type_info * qtype = SWIG_TypeQuery("_p_Account");
953  g_return_val_if_fail (qtype, -1);
954 
955  arg = SWIG_NewPointerObj(acc, qtype, 0);
956  g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
957  args = scm_cons (arg, args);
958  }
959  else
960  {
961  args = scm_cons (SCM_BOOL_F, args);
962  }
963 
964  arg = SWIG_NewPointerObj(owner, SWIG_TypeQuery("_p__gncOwner"), 0);
965  g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
966  args = scm_cons (arg, args);
967 
968  /* Apply the function to the args */
969  arg = scm_apply (func, args, SCM_EOL);
970  g_return_val_if_fail (scm_is_exact (arg), -1);
971  return scm_to_int (arg);
972 }
973 
974 
975 /************************************************************/
976 /* Command callbacks */
977 /************************************************************/
978 
979 static void
980 gnc_plugin_page_owner_tree_cmd_new_owner (GtkAction *action, GncPluginPageOwnerTree *page)
981 {
983 
984  g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(page));
985 
986  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE (page);
987 
988  switch (priv->owner_type)
989  {
990  case GNC_OWNER_NONE :
991  case GNC_OWNER_UNDEFINED :
992  break;
993  case GNC_OWNER_CUSTOMER :
994  {
995  gnc_ui_customer_new (gnc_get_current_book ());
996  break;
997  }
998  case GNC_OWNER_JOB :
999  {
1000  /* XXX currently not properly implemented, so disabled for now
1001  gnc_ui_job_new (owner, gnc_get_current_book ()); */
1002  break;
1003  }
1004  case GNC_OWNER_VENDOR :
1005  {
1006  gnc_ui_vendor_new (gnc_get_current_book ());
1007  break;
1008  }
1009  case GNC_OWNER_EMPLOYEE :
1010  {
1011  gnc_ui_employee_new (gnc_get_current_book ());
1012  break;
1013  }
1014  }
1015 }
1016 
1017 static void
1018 gnc_plugin_page_owner_tree_cmd_edit_owner (GtkAction *action, GncPluginPageOwnerTree *page)
1019 {
1021  if (NULL == owner) return;
1022 
1023  ENTER("action %p, page %p", action, page);
1024 
1025  gnc_ui_owner_edit (owner);
1026 
1027  LEAVE(" ");
1028 }
1029 
1030 #if 0 /* Disabled due to crash */
1031 static void
1032 gnc_plugin_page_owner_tree_cmd_delete_owner (GtkAction *action, GncPluginPageOwnerTree *page)
1033 {
1035  gchar *owner_name;
1036  GtkWidget *window;
1037  GtkWidget *dialog = NULL;
1038  gint response;
1039  GList* list;
1040 
1041  if (NULL == owner) return;
1042 
1043  /* If the owner has objects referring to it, show the list - the owner can't be deleted until these
1044  references are dealt with. */
1045  list = qof_instance_get_referring_object_list(QOF_INSTANCE(gncOwnerGetUndefined(owner)));
1046  if (list != NULL)
1047  {
1048 #define EXPLANATION "The list below shows objects which make use of the owner which you want to delete.\nBefore you can delete it, you must either delete those objects or else modify them so they make use\nof another owner"
1049 
1050  gnc_ui_object_references_show( _(EXPLANATION), list);
1051  g_list_free(list);
1052  return;
1053  }
1054 
1055  window = gnc_plugin_page_get_window(GNC_PLUGIN_PAGE(page));
1056  owner_name = g_strdup (gncOwnerGetName(owner));
1057  if (!owner_name)
1058  {
1059  owner_name = g_strdup (_("(no name)"));
1060  }
1061 
1062  /*
1063  * Present a message to the user which specifies what will be
1064  * deleted, then ask for verification.
1065  */
1066  {
1067  char *message = g_strdup_printf(_("The owner %s will be deleted.\nAre you sure you want to do this?"), owner_name);
1068 
1069  dialog = gtk_message_dialog_new(GTK_WINDOW(window),
1070  GTK_DIALOG_DESTROY_WITH_PARENT,
1071  GTK_MESSAGE_QUESTION,
1072  GTK_BUTTONS_NONE,
1073  "%s", message);
1074  g_free(message);
1075  gtk_dialog_add_buttons(GTK_DIALOG(dialog),
1076  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
1077  GTK_STOCK_DELETE, GTK_RESPONSE_ACCEPT,
1078  (gchar *)NULL);
1079  gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
1080  response = gtk_dialog_run(GTK_DIALOG(dialog));
1081  gtk_widget_destroy(dialog);
1082 
1083  if (GTK_RESPONSE_ACCEPT == response)
1084  {
1085  /* FIXME The code below results in a crash.
1086  * The corresponding menu item/toolbar button is disabled until this is fixed. */
1087  gnc_set_busy_cursor(NULL, TRUE);
1088  gnc_suspend_gui_refresh ();
1089  gncOwnerBeginEdit (owner);
1090  gncOwnerDestroy (owner);
1091  gnc_resume_gui_refresh ();
1092  gnc_unset_busy_cursor(NULL);
1093  }
1094  }
1095  g_free(owner_name);
1096 }
1097 #endif /* Disabled due to crash */
1098 
1099 /*********************/
1100 
1101 static void
1102 gnc_plugin_page_owner_tree_cmd_view_filter_by (GtkAction *action,
1103  GncPluginPageOwnerTree *page)
1104 {
1106 
1107  g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(page));
1108  ENTER("(action %p, page %p)", action, page);
1109 
1110  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
1111  owner_filter_dialog_create(&priv->fd, GNC_PLUGIN_PAGE(page));
1112  LEAVE(" ");
1113 }
1114 
1115 
1116 static void
1117 gnc_plugin_page_owner_tree_cmd_new_invoice (GtkAction *action,
1118  GncPluginPageOwnerTree *page)
1119 {
1121  GncOwner current_owner;
1122 
1123  ENTER("action %p, page %p", action, page);
1124 
1125  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(page);
1126  switch (priv->owner_type)
1127  {
1128  case GNC_OWNER_NONE :
1129  case GNC_OWNER_UNDEFINED :
1130  gncOwnerInitUndefined(&current_owner, NULL);
1131  break;
1132  case GNC_OWNER_CUSTOMER :
1133  {
1134  gncOwnerInitCustomer(&current_owner,
1136  break;
1137  }
1138  case GNC_OWNER_JOB :
1139  {
1140  gncOwnerInitJob(&current_owner,
1142  break;
1143  }
1144  case GNC_OWNER_VENDOR :
1145  {
1146  gncOwnerInitVendor(&current_owner,
1148  break;
1149  }
1150  case GNC_OWNER_EMPLOYEE :
1151  {
1152  gncOwnerInitEmployee(&current_owner,
1154  break;
1155  }
1156  }
1157 
1158  if (gncOwnerGetType(&current_owner) != GNC_OWNER_UNDEFINED)
1159  gnc_ui_invoice_new (&current_owner, gnc_get_current_book());
1160 
1161  LEAVE(" ");
1162 }
1163 
1164 static void
1165 gnc_plugin_page_owner_tree_cmd_owners_report (GtkAction *action,
1166  GncPluginPageOwnerTree *plugin_page)
1167 {
1169  int id;
1170 
1171  ENTER("(action %p, plugin_page %p)", action, plugin_page);
1172 
1173  g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(plugin_page));
1174 
1175  priv = GNC_PLUGIN_PAGE_OWNER_TREE_GET_PRIVATE(plugin_page);
1176  id = build_aging_report (priv->owner_type);
1177  if (id >= 0)
1178  {
1179  GncMainWindow *window;
1180  window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
1181  gnc_main_window_open_report(id, window);
1182  }
1183 
1184  LEAVE(" ");
1185 }
1186 
1187 static void
1188 gnc_plugin_page_owner_tree_cmd_owner_report (GtkAction *action,
1189  GncPluginPageOwnerTree *plugin_page)
1190 {
1191  GncOwner *current_owner;
1192  int id;
1193 
1194  ENTER("(action %p, plugin_page %p)", action, plugin_page);
1195 
1196  g_return_if_fail(GNC_IS_PLUGIN_PAGE_OWNER_TREE(plugin_page));
1197 
1198  current_owner = gnc_plugin_page_owner_tree_get_current_owner (plugin_page);
1199  id = build_owner_report (current_owner, NULL);
1200  if (id >= 0)
1201  {
1202  GncMainWindow *window;
1203  window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
1204  gnc_main_window_open_report(id, window);
1205  }
1206 
1207  LEAVE(" ");
1208 }
1209 
GtkWidget * gnc_plugin_page_get_window(GncPluginPage *page)
const gchar * tab_icon
GtkTreeView * gnc_tree_view_owner_new(GncOwnerType owner_type)
Business Interface: Object OWNERs.
const GList * gnc_gobject_tracking_get_list(const gchar *name)
GncPluginPage *(* recreate_page)(GtkWidget *window, GKeyFile *file, const gchar *group)
gboolean gnc_main_window_button_press_cb(GtkWidget *whatever, GdkEventButton *event, GncPluginPage *page)
void gnc_tree_view_owner_set_filter(GncTreeViewOwner *view, gnc_tree_view_owner_filter_func func, gpointer data, GSourceFunc destroy)
GtkTreeView implementation for gnucash owner tree.
utility functions for the GnuCash UI
GtkActionGroup * gnc_plugin_page_get_action_group(GncPluginPage *page)
GtkTreeViewColumn * gnc_tree_view_find_column_by_name(GncTreeView *view, const gchar *wanted)
#define ENTER(format, args...)
Definition: qoflog.h:261
void gncOwnerBeginEdit(GncOwner *owner)
Definition: gncOwner.c:73
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
Functions providing a page which lists owners of one type. This type can be vendors, customers or employees.
Gobject helper routines.
void(* destroy_widget)(GncPluginPage *plugin_page)
void gnc_plugin_init_short_names(GtkActionGroup *action_group, action_toolbar_labels *toolbar_labels)
Definition: gnc-plugin.c:263
void gnc_tree_view_configure_columns(GncTreeView *view)
const gchar * plugin_name
GncOwner * gnc_plugin_page_owner_tree_get_current_owner(GncPluginPageOwnerTree *page)
QofIdTypeConst gncOwnerTypeToQofIdType(GncOwnerType t)
Definition: gncOwner.c:213
gpointer gncOwnerGetUndefined(const GncOwner *owner)
Definition: gncOwner.c:340
Gnome specific utility functions.
All type declarations for the whole Gnucash engine.
GList * qof_instance_get_referring_object_list(const QofInstance *inst)
GncOwnerType gncOwnerGetType(const GncOwner *owner)
Definition: gncOwner.c:201
GType gnc_plugin_page_owner_tree_get_type(void)
GncJob * gncOwnerGetJob(const GncOwner *owner)
Definition: gncOwner.c:354
gboolean qof_book_is_readonly(const QofBook *book)
void gnc_plugin_update_actions(GtkActionGroup *action_group, const gchar **action_names, const gchar *property_name, gboolean value)
Definition: gnc-plugin.c:313
GtkWidget *(* create_widget)(GncPluginPage *plugin_page)
void gnc_main_window_close_page(GncPluginPage *page)
Functions for adding plugins to a GnuCash window.
#define LEAVE(format, args...)
Definition: qoflog.h:271
void(* save_page)(GncPluginPage *page, GKeyFile *file, const gchar *group)
GncVendor * gncOwnerGetVendor(const GncOwner *owner)
Definition: gncOwner.c:361
GncCustomer * gncOwnerGetCustomer(const GncOwner *owner)
Definition: gncOwner.c:347
void gnc_plugin_page_add_book(GncPluginPage *page, QofBook *book)
GncOwner * gnc_tree_view_owner_get_selected_owner(GncTreeViewOwner *view)
GtkActionGroup * gnc_plugin_page_create_action_group(GncPluginPage *page, const gchar *group_name)
GncOwner * gnc_tree_view_owner_get_owner_from_path(GncTreeViewOwner *view, GtkTreePath *s_path)
gboolean gnc_plugin_page_owner_tree_filter_owners(GncOwner *owner, gpointer user_data)
GncEmployee * gncOwnerGetEmployee(const GncOwner *owner)
Definition: gncOwner.c:368
GncPluginPage * gnc_plugin_page_owner_tree_new(GncOwnerType owner_type)
const gchar * QofLogModule
Definition: qofid.h:89