GnuCash c935c2f+
Loading...
Searching...
No Matches
gnc-commodity-edit.c
1/*
2 * gnc-commodity-edit.c -- Commodity editor widget
3 *
4 * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
5 * All rights reserved.
6 *
7 * Gnucash is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public License
9 * as published by the Free Software Foundation; either version 2 of the
10 * License, or (at your option) any later version.
11 *
12 * Gnucash is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, contact:
19 *
20 * Free Software Foundation Voice: +1-617-542-5942
21 * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
22 * Boston, MA 02110-1301, USA gnu@gnu.org
23 *
24 */
25/*
26 @NOTATION@
27 */
28
29/*
30 * Commodity editor widget
31 *
32 * Authors: Dave Peticolas <dave@krondo.com>
33 * Derek Atkins <warlord@MIT.EDU>
34 */
35
36#include <config.h>
37
38#include <gtk/gtk.h>
39
40#include "dialog-commodity.h"
41#include "gnc-commodity-edit.h"
42
43const char * gnc_commodity_edit_get_string (gpointer ptr)
44{
45 gnc_commodity * comm = (gnc_commodity *)ptr;
46 return gnc_commodity_get_printname(comm);
47}
48
49gpointer gnc_commodity_edit_new_select (gpointer arg, gpointer ptr,
50 GtkWidget *toplevel)
51{
52 gnc_commodity * comm = (gnc_commodity *)ptr;
53 dialog_commodity_mode *mode_ptr = arg;
55
56 mode = mode_ptr ? *mode_ptr : DIAG_COMM_ALL;
57 return gnc_ui_select_commodity_modal(comm, toplevel, mode);
58}
"select" and "new" commodity windows
const char * gnc_commodity_get_printname(const gnc_commodity *cm)
Retrieve the 'print' name for the specified commodity.
dialog_commodity_mode
The dialog commodity types are used to determine what commodity namespaces the currency dialog will p...
gnc_commodity * gnc_ui_select_commodity_modal(gnc_commodity *orig_sel, GtkWidget *parent, dialog_commodity_mode mode)
Ask the user to select a commodity from the existing set of commodities.
@ DIAG_COMM_ALL
Dialog box should allow selection of anything.