GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dialog-price-editor.c
1 /********************************************************************\
2  * dialog-price-editor.c -- price editor dialog *
3  * Copyright (C) 2001 Gnumatic, Inc. *
4  * Author: Dave Peticolas <[email protected]> *
5  * Copyright (c) 2006 David Hampton <[email protected]> *
6  * Copyright (c) 2009 Herbert Thoma <[email protected]> *
7  * Copyright (c) 2011 Robert Fewell *
8  * *
9  * This program is free software; you can redistribute it and/or *
10  * modify it under the terms of the GNU General Public License as *
11  * published by the Free Software Foundation; either version 2 of *
12  * the License, or (at your option) any later version. *
13  * *
14  * This program is distributed in the hope that it will be useful, *
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
17  * GNU General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU General Public License*
20  * along with this program; if not, contact: *
21  * *
22  * Free Software Foundation Voice: +1-617-542-5942 *
23  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
24  * Boston, MA 02110-1301, USA [email protected] *
25 \********************************************************************/
26 
27 #include "config.h"
28 
29 #include <gtk/gtk.h>
30 #include <glib/gi18n.h>
31 #include <time.h>
32 
33 #include "dialog-utils.h"
34 #include "gnc-gtk-utils.h"
35 #include "gnc-amount-edit.h"
36 #include "gnc-commodity-edit.h"
37 #include "dialog-commodity.h"
38 #include "gnc-general-select.h"
39 #include "gnc-component-manager.h"
40 #include "gnc-currency-edit.h"
41 #include "gnc-date-edit.h"
42 #include "qof.h"
43 #include "gnc-pricedb.h"
44 #include "gnc-session.h"
45 #include "gnc-ui.h"
46 #include "gnc-ui-util.h"
47 #include "guile-util.h"
48 #include "engine-helpers.h"
49 
50 
51 #define DIALOG_PRICE_EDIT_CM_CLASS "dialog-price-edit"
52 #define GNC_PREFS_GROUP "dialogs.price-editor"
53 #define DIALOG_PRICE_EDIT_SOURCE "user:price-editor"
54 
55 
56 /* This static indicates the debugging module that this .o belongs to. */
57 G_GNUC_UNUSED static QofLogModule log_module = GNC_MOD_GUI;
58 
59 
60 typedef struct
61 {
62  GtkWidget * dialog;
63  QofSession *session;
64  QofBook *book;
65  GNCPriceDB *price_db;
66  GNCPriceEditType type;
67 
68  GtkWidget * namespace_cbwe;
69  GtkWidget * commodity_cbwe;
70  GtkWidget * currency_edit;
71  GtkWidget * date_edit;
72  GtkWidget * source_entry;
73  GtkWidget * type_combobox;
74  GtkWidget * price_edit;
75 
76  GtkWidget * cancel_button;
77  GtkWidget * apply_button;
78  GtkWidget * ok_button;
79 
80  GNCPrice *price;
81  gboolean changed;
82  gboolean is_new;
83 
85 
86 void pedit_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data);
87 void pedit_data_changed_cb (GtkWidget *w, gpointer data);
88 void pedit_commodity_ns_changed_cb (GtkComboBox *cbwe, gpointer data);
89 void pedit_commodity_changed_cb (GtkComboBox *cbwe, gpointer data);
90 
91 
92 static void
93 gnc_prices_set_changed (PriceEditDialog *pedit_dialog, gboolean changed)
94 {
95  pedit_dialog->changed = changed;
96 
97  gtk_widget_set_sensitive (pedit_dialog->apply_button, changed);
98 }
99 
100 
101 static int
102 type_string_to_index (const char *type)
103 {
104  if (g_strcmp0 (type, "bid") == 0)
105  return 0;
106 
107  if (g_strcmp0 (type, "ask") == 0)
108  return 1;
109 
110  if (g_strcmp0 (type, "last") == 0)
111  return 2;
112 
113  if (g_strcmp0 (type, "nav") == 0)
114  return 3;
115 
116  return 4;
117 }
118 
119 
120 static const char *
121 type_index_to_string (int index)
122 {
123  switch (index)
124  {
125  case 0:
126  return "bid";
127  case 1:
128  return "ask";
129  case 2:
130  return "last";
131  case 3:
132  return "nav";
133  default:
134  return "unknown";
135  }
136 }
137 
138 
139 static void
140 price_to_gui (PriceEditDialog *pedit_dialog)
141 {
142  gnc_commodity *commodity = NULL;
143  gnc_commodity *currency = NULL;
144  const gchar *name_space, *fullname;
145  const char *source;
146  const char *type;
147  gnc_numeric value;
148  Timespec date;
149 
150  if (pedit_dialog->price)
151  {
152  commodity = gnc_price_get_commodity (pedit_dialog->price);
153  }
154 
155  if (commodity)
156  {
157  name_space = gnc_commodity_get_namespace(commodity);
158  fullname = gnc_commodity_get_printname(commodity);
159  gnc_ui_update_namespace_picker(pedit_dialog->namespace_cbwe,
160  name_space, DIAG_COMM_ALL);
161  gnc_ui_update_commodity_picker(pedit_dialog->commodity_cbwe,
162  name_space, fullname);
163 
164  currency = gnc_price_get_currency (pedit_dialog->price);
165  date = gnc_price_get_time (pedit_dialog->price);
166  source = gnc_price_get_source (pedit_dialog->price);
167  type = gnc_price_get_typestr (pedit_dialog->price);
168  value = gnc_price_get_value (pedit_dialog->price);
169  }
170  else
171  {
172  currency = gnc_default_currency ();
173  date.tv_sec = gnc_time (NULL);
174  date.tv_nsec = 0;
175  source = DIALOG_PRICE_EDIT_SOURCE;
176  type = "";
177  value = gnc_numeric_zero ();
178  }
179 
180 
181  if (currency)
182  {
184  (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit), currency);
185  }
186 
187  gnc_date_edit_set_time (GNC_DATE_EDIT (pedit_dialog->date_edit), date.tv_sec);
188 
189  gtk_entry_set_text (GTK_ENTRY (pedit_dialog->source_entry), source);
190 
191  gtk_combo_box_set_active (GTK_COMBO_BOX(pedit_dialog->type_combobox),
192  type_string_to_index (type));
193 
194  gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (pedit_dialog->price_edit), value);
195 }
196 
197 
198 static const char *
199 gui_to_price (PriceEditDialog *pedit_dialog)
200 {
201  gnc_commodity *commodity;
202  gnc_commodity *currency;
203  gchar *name_space;
204  const gchar *fullname;
205  const char *source;
206  const char *type;
207  gnc_numeric value;
208  Timespec date;
209 
210  name_space = gnc_ui_namespace_picker_ns (pedit_dialog->namespace_cbwe);
211  fullname = gtk_entry_get_text( GTK_ENTRY( gtk_bin_get_child( GTK_BIN( GTK_COMBO_BOX(pedit_dialog->commodity_cbwe)))));
212 
213  commodity = gnc_commodity_table_find_full(gnc_get_current_commodities(), name_space, fullname);
214  if (!commodity)
215  return _("You must select a Security.");
216 
218  (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit));
219  if (!currency)
220  return _("You must select a Currency.");
221 
222  date.tv_sec = gnc_date_edit_get_date (GNC_DATE_EDIT (pedit_dialog->date_edit));
223  date.tv_nsec = 0;
224 
225  source = gtk_entry_get_text (GTK_ENTRY (pedit_dialog->source_entry));
226 
227  type = type_index_to_string
228  (gtk_combo_box_get_active (GTK_COMBO_BOX (pedit_dialog->type_combobox)));
229 
230  if (!gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (pedit_dialog->price_edit)))
231  return _("You must enter a valid amount.");
232 
233  value = gnc_amount_edit_get_amount
234  (GNC_AMOUNT_EDIT (pedit_dialog->price_edit));
235 
236  if (!pedit_dialog->price)
237  pedit_dialog->price = gnc_price_create (pedit_dialog->book);
238  gnc_price_begin_edit (pedit_dialog->price);
239  gnc_price_set_commodity (pedit_dialog->price, commodity);
240  gnc_price_set_currency (pedit_dialog->price, currency);
241  gnc_price_set_time (pedit_dialog->price, date);
242  gnc_price_set_source (pedit_dialog->price, source);
243  gnc_price_set_typestr (pedit_dialog->price, type);
244  gnc_price_set_value (pedit_dialog->price, value);
245  gnc_price_commit_edit (pedit_dialog->price);
246 
247  g_free(name_space);
248 
249  return NULL;
250 }
251 
252 
253 static void
254 pedit_dialog_destroy_cb (GtkWidget *widget, gpointer data)
255 {
256  PriceEditDialog *pedit_dialog = data;
257 
258  gnc_unregister_gui_component_by_data (DIALOG_PRICE_EDIT_CM_CLASS,
259  pedit_dialog);
260 
261  if (pedit_dialog->price)
262  {
263  gnc_price_unref (pedit_dialog->price);
264  pedit_dialog->price = NULL;
265  pedit_dialog->is_new = FALSE;
266  }
267 
268  g_free (pedit_dialog);
269 }
270 
271 
272 void
273 pedit_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data)
274 {
275  PriceEditDialog *pedit_dialog = data;
276  GNCPrice *new_price = NULL;
277  const char *error_str;
278 
279  if ((response == GTK_RESPONSE_OK) || (response == GTK_RESPONSE_APPLY))
280  {
281  error_str = gui_to_price (pedit_dialog);
282  if (error_str)
283  {
284  gnc_warning_dialog (pedit_dialog->dialog, "%s", error_str);
285  return;
286  }
287 
288  gnc_prices_set_changed (pedit_dialog, FALSE);
289  if (TRUE == pedit_dialog->is_new)
290  {
291  gnc_pricedb_add_price (pedit_dialog->price_db, pedit_dialog->price);
292  }
293 
294  gnc_gui_refresh_all ();
295  }
296 
297  if (response == GTK_RESPONSE_APPLY)
298  {
299  new_price = gnc_price_clone (pedit_dialog->price, pedit_dialog->book);
300  pedit_dialog->is_new = TRUE;
301 
302  gnc_price_unref (pedit_dialog->price);
303  pedit_dialog->price = new_price;
304  }
305  else
306  {
307  gnc_save_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pedit_dialog->dialog));
308  gtk_widget_destroy (GTK_WIDGET (pedit_dialog->dialog));
309  pedit_dialog_destroy_cb (NULL, pedit_dialog);
310  }
311 }
312 
313 
314 void
315 pedit_commodity_ns_changed_cb (GtkComboBox *cbwe, gpointer data)
316 {
317  PriceEditDialog *pedit_dialog = data;
318  gchar *name_space;
319 
320  gnc_prices_set_changed (pedit_dialog, TRUE);
321 
322  name_space = gnc_ui_namespace_picker_ns (pedit_dialog->namespace_cbwe);
323  gnc_ui_update_commodity_picker (pedit_dialog->commodity_cbwe, name_space, NULL);
324 
325  g_free(name_space);
326 }
327 
328 
329 void
330 pedit_commodity_changed_cb (GtkComboBox *cbwe, gpointer data)
331 {
332  gnc_commodity *commodity = NULL;
333  gnc_commodity *currency = NULL;
334  gchar *name_space;
335  const gchar *fullname;
336  GList *price_list;
337  PriceEditDialog *pedit_dialog = data;
338 
339  gnc_prices_set_changed (pedit_dialog, TRUE);
340 
341  name_space = gnc_ui_namespace_picker_ns (pedit_dialog->namespace_cbwe);
342  fullname = gtk_entry_get_text( GTK_ENTRY( gtk_bin_get_child( GTK_BIN( GTK_COMBO_BOX(pedit_dialog->commodity_cbwe)))));
343 
344  commodity = gnc_commodity_table_find_full(gnc_get_current_commodities(), name_space, fullname);
345 
346  if (commodity)
347  {
349  (pedit_dialog->price_db, commodity);
350  if (price_list)
351  {
352  currency = gnc_price_get_currency((GNCPrice *)price_list->data);
353 
354  if (currency)
356  (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit), currency);
357 
358  gnc_price_list_destroy(price_list);
359  }
360  else
361  {
363  (GNC_CURRENCY_EDIT (pedit_dialog->currency_edit), gnc_default_currency());
364  }
365  }
366 
367  g_free(name_space);
368 }
369 
370 
371 void
372 pedit_data_changed_cb (GtkWidget *w, gpointer data)
373 {
374  PriceEditDialog *pedit_dialog = data;
375 
376  gnc_prices_set_changed (pedit_dialog, TRUE);
377 }
378 
379 
380 static void
381 gnc_price_pedit_dialog_create (GtkWidget *parent,
382  PriceEditDialog *pedit_dialog,
383  QofSession *session)
384 {
385  GtkBuilder *builder;
386  GNCPrintAmountInfo print_info;
387  GtkWidget *dialog;
388  GtkWidget *entry;
389  GtkWidget *box;
390  GtkWidget *w;
391  GtkWidget *label;
392  gchar *name_space;
393 
394  builder = gtk_builder_new();
395  gnc_builder_add_from_file (builder, "dialog-price.glade", "liststore1");
396  gnc_builder_add_from_file (builder, "dialog-price.glade", "liststore2");
397  gnc_builder_add_from_file (builder, "dialog-price.glade", "liststore3");
398  gnc_builder_add_from_file (builder, "dialog-price.glade", "Price Dialog");
399 
400  pedit_dialog->session = session;
401  pedit_dialog->book = qof_session_get_book(pedit_dialog->session);
402  pedit_dialog->price_db = gnc_pricedb_get_db(pedit_dialog->book);
403 
404  dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Price Dialog"));
405  pedit_dialog->dialog = dialog;
406 
407  /* parent */
408  if (parent != NULL)
409  gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
410 
411  w = GTK_WIDGET(gtk_builder_get_object (builder, "namespace_cbwe"));
412  pedit_dialog->namespace_cbwe = w;
413 
415  gnc_cbwe_require_list_item(GTK_COMBO_BOX(pedit_dialog->namespace_cbwe));
416  gtk_combo_box_set_active(GTK_COMBO_BOX(pedit_dialog->namespace_cbwe), 1);
417 
418  w = GTK_WIDGET(gtk_builder_get_object (builder, "commodity_cbwe"));
419  pedit_dialog->commodity_cbwe = w;
420 
421  gnc_cbwe_require_list_item(GTK_COMBO_BOX(pedit_dialog->commodity_cbwe));
422  name_space = gnc_ui_namespace_picker_ns(pedit_dialog->namespace_cbwe);
423  gnc_ui_update_commodity_picker(pedit_dialog->commodity_cbwe, name_space, NULL);
424  g_free(name_space);
425 
426  box = GTK_WIDGET(gtk_builder_get_object (builder, "currency_box"));
427  w = gnc_currency_edit_new ();
428  gnc_currency_edit_set_currency (GNC_CURRENCY_EDIT (w),
430  pedit_dialog->currency_edit = w;
431  gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
432  gtk_widget_show (w);
433  g_signal_connect (G_OBJECT (GTK_COMBO_BOX(w)), "changed",
434  G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
435  label = GTK_WIDGET(gtk_builder_get_object (builder, "currency_label"));
436  gtk_label_set_mnemonic_widget (GTK_LABEL(label), w);
437 
438  box = GTK_WIDGET(gtk_builder_get_object (builder, "date_box"));
439  w = gnc_date_edit_new (time (NULL), FALSE, FALSE);
440  pedit_dialog->date_edit = w;
441  gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
442  gtk_widget_show (w);
443  g_signal_connect (G_OBJECT (w), "date_changed",
444  G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
445  g_signal_connect (G_OBJECT (GNC_DATE_EDIT (w)->date_entry), "changed",
446  G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
447  gtk_entry_set_activates_default(GTK_ENTRY(GNC_DATE_EDIT(w)->date_entry), TRUE);
448  label = GTK_WIDGET(gtk_builder_get_object (builder, "date__label"));
449  gnc_date_make_mnemonic_target (GNC_DATE_EDIT(w), label);
450 
451  w = GTK_WIDGET(gtk_builder_get_object (builder, "source_entry"));
452  pedit_dialog->source_entry = w;
453 
454  w = GTK_WIDGET(gtk_builder_get_object (builder, "type_combobox"));
455  pedit_dialog->type_combobox = w;
456 
457  box = GTK_WIDGET(gtk_builder_get_object (builder, "price_box"));
458  w = gnc_amount_edit_new ();
459  pedit_dialog->price_edit = w;
460  gtk_box_pack_start (GTK_BOX (box), w, TRUE, TRUE, 0);
461  gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (w), TRUE);
462  print_info = gnc_default_price_print_info ();
463  gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (w), print_info);
464  gtk_entry_set_activates_default(GTK_ENTRY(w), TRUE);
465  gtk_widget_show (w);
466  label = GTK_WIDGET(gtk_builder_get_object (builder, "price_label"));
467  gtk_label_set_mnemonic_widget (GTK_LABEL(label), w);
468 
469  entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (w));
470  g_signal_connect (G_OBJECT (entry), "changed",
471  G_CALLBACK (pedit_data_changed_cb), pedit_dialog);
472 
473  w = GTK_WIDGET(gtk_builder_get_object (builder, "pd_cancel_button"));
474  pedit_dialog->cancel_button = w;
475 
476  w = GTK_WIDGET(gtk_builder_get_object (builder, "pd_apply_button"));
477  pedit_dialog->apply_button = w;
478  gnc_prices_set_changed (pedit_dialog, FALSE);
479 
480  w = GTK_WIDGET(gtk_builder_get_object (builder, "pd_ok_button"));
481  pedit_dialog->ok_button = w;
482 
483  gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, pedit_dialog);
484 
485  g_object_unref(G_OBJECT(builder));
486 }
487 
488 
489 static void
490 close_handler (gpointer user_data)
491 {
492  PriceEditDialog *pedit_dialog = user_data;
493 
494  gtk_dialog_response(GTK_DIALOG(pedit_dialog->dialog), GTK_RESPONSE_CANCEL);
495 }
496 
497 
498 static void
499 refresh_handler (GHashTable *changes, gpointer user_data)
500 {
501  // PriceEditDialog *pedit_dialog = user_data;
502 
503  // gnc_prices_load_prices (pedit_dialog);
504 }
505 
506 
507 static gboolean
508 show_handler (const char *klass, gint component_id,
509  gpointer user_data, gpointer iter_data)
510 {
511  PriceEditDialog *pedit_dialog = user_data;
512  GNCPrice * price = iter_data;
513 
514  if (!pedit_dialog || (pedit_dialog->price != price))
515  return(FALSE);
516 
517  gtk_window_present (GTK_WINDOW(pedit_dialog->dialog));
518  return(TRUE);
519 }
520 
521 
522 /********************************************************************\
523  * gnc_price_edit_dialog *
524  * opens up a window to edit price information *
525  * *
526  * Args: parent - the parent of the window to be created *
527  * Return: nothing *
528 \********************************************************************/
529 void
530 gnc_price_edit_dialog (GtkWidget * parent,
531  QofSession *session,
532  GNCPrice * price,
533  GNCPriceEditType type)
534 {
535  PriceEditDialog *pedit_dialog;
536  gint component_id;
537 
538  if ((type == GNC_PRICE_EDIT) &&
539  (gnc_forall_gui_components (DIALOG_PRICE_EDIT_CM_CLASS,
540  show_handler, price)))
541  return;
542 
543  pedit_dialog = g_new0 (PriceEditDialog, 1);
544  gnc_price_pedit_dialog_create (parent, pedit_dialog, session);
545  gnc_restore_window_size(GNC_PREFS_GROUP, GTK_WINDOW(pedit_dialog->dialog));
546  pedit_dialog->type = type;
547 
548  switch (type)
549  {
550  case GNC_PRICE_NEW:
551  if (price)
552  {
553  price = gnc_price_clone(price, pedit_dialog->book);
554 // } else {
555 // price = gnc_price_create (pedit_dialog->book);
556  gnc_price_set_source (price, DIALOG_PRICE_EDIT_SOURCE);
557  }
558 
559  pedit_dialog->is_new = TRUE;
560  /* New price will only have one ref, this dialog. */
561  break;
562  case GNC_PRICE_EDIT:
563  gnc_price_ref(price); /* Add ref from this dialog */
564  pedit_dialog->is_new = FALSE;
565  break;
566  }
567 
568  pedit_dialog->price = price;
569  price_to_gui(pedit_dialog);
570  gnc_prices_set_changed (pedit_dialog, FALSE);
571  component_id = gnc_register_gui_component (DIALOG_PRICE_EDIT_CM_CLASS,
572  refresh_handler, close_handler,
573  pedit_dialog);
574  gnc_gui_component_set_session (component_id, pedit_dialog->session);
575  gtk_widget_grab_focus (pedit_dialog->commodity_cbwe);
576  gtk_widget_show (pedit_dialog->dialog);
577 }
578 
579 
580 /********************************************************************\
581  * gnc_price_edit_by_guid *
582  * opens up a window to edit price information *
583  * *
584  * Args: parent - the parent of the window to be created *
585  * Return: nothing *
586 \********************************************************************/
587 GNCPrice *
588 gnc_price_edit_by_guid (GtkWidget * parent, const GncGUID * guid)
589 {
590  GNCPrice *price;
591  QofSession *session;
592 
593  session = gnc_get_current_session ();
594  price = gnc_price_lookup (guid, qof_session_get_book(session));
595  if (price == NULL)
596  return(NULL);
597 
598  gnc_price_edit_dialog(parent, session, price, GNC_PRICE_EDIT);
599  return price;
600 }
void gnc_price_list_destroy(PriceList *prices)
Definition: gnc-pricedb.c:701
GNCPrice * gnc_price_create(QofBook *book)
Definition: gnc-pricedb.c:236
void gnc_currency_edit_set_currency(GNCCurrencyEdit *gce, const gnc_commodity *currency)
a simple price database for gnucash
utility functions for the GnuCash UI
gtk helper routines.
gchar * gnc_ui_namespace_picker_ns(GtkWidget *cbwe)
void gnc_price_unref(GNCPrice *p)
Definition: gnc-pricedb.c:272
gboolean gnc_pricedb_add_price(GNCPriceDB *db, GNCPrice *p)
Definition: gnc-pricedb.c:1053
Use a 64-bit unsigned int timespec.
Definition: gnc-date.h:299
const char * gnc_commodity_get_namespace(const gnc_commodity *cm)
GNCPriceDB * gnc_pricedb_get_db(QofBook *book)
Definition: gnc-pricedb.c:872
Definition: guid.h:65
gnc_commodity * gnc_default_currency(void)
Definition: gnc-ui-util.c:939
Currency selection widget.
QofBook * qof_session_get_book(const QofSession *session)
void gnc_ui_update_commodity_picker(GtkWidget *cbwe, const gchar *name_space, const gchar *init_string)
gnc_commodity * gnc_currency_edit_get_currency(GNCCurrencyEdit *gce)
PriceList * gnc_pricedb_lookup_latest_any_currency(GNCPriceDB *db, const gnc_commodity *commodity)
Definition: gnc-pricedb.c:1373
const char * gnc_commodity_get_printname(const gnc_commodity *cm)
GtkWidget * gnc_currency_edit_new(void)
GNCPrice * gnc_price_clone(GNCPrice *p, QofBook *book)
Definition: gnc-pricedb.c:295
time64 gnc_time(time64 *tbuf)
get the current local time
void gnc_ui_update_namespace_picker(GtkWidget *cbwe, const gchar *sel, dialog_commodity_mode mode)
"select" and "new" commodity windows
void gnc_price_ref(GNCPrice *p)
Definition: gnc-pricedb.c:265
const gchar * QofLogModule
Definition: qofid.h:89