GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Modules | Files | Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
GUI

Modules

 Window/Plugin Structure
 
 Dialogs
 
 Druids
 
 Utility functions for the GnuCash GUI
 
 Auto-complete typed user input.
 
 Creating and editing accounts in the GUI
 
 Commodity windows
 
 GncCurrencyEdit
 
 Gnome-specific GUI handling.
 
 GUIUtility
 
 GnuCash Tree Model
 
 GncTreeView
 
 Registers, Ledgers and Journals
 
 Reports
 

Files

file  gnc-accounting-period.c
 General utilities for dealing with accounting periods.
 
file  gnc-accounting-period.h
 General utilities for dealing with accounting periods.
 
file  dialog-book-close.h
 
file  dialog-file-access.h
 
file  dialog-object-references.h
 
file  gnc-period-select.c
 A custom widget for selecting accounting periods.
 
file  gnc-period-select.h
 A custom widget for selecting accounting periods.
 
file  gnc-tree-view-sx-list.h
 GncTreeView implementation for Scheduled Transaction List.
 
file  gnc-tree-view.h
 common utilities for manipulating a GtkTreeView within gnucash
 

Data Structures

struct  _GncPeriodSelectPrivate
 
struct  GncPeriodSelect
 
struct  GncPeriodSelectClass
 
struct  GncTreeViewSxList
 
struct  GncTreeViewSxListClass
 
struct  GncTreeView
 
struct  GncTreeViewClass
 

Macros

#define GNC_PERIOD_SELECT_GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PERIOD_SELECT, GncPeriodSelectPrivate))
 
#define GNC_TYPE_PERIOD_SELECT   (gnc_period_select_get_type())
 
#define GNC_PERIOD_SELECT(o)   (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_PERIOD_SELECT, GncPeriodSelect))
 
#define GNC_PERIOD_SELECT_CLASS(k)   (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_PERIOD_SELECT, GncPeriodSelectClass))
 
#define GNC_IS_PERIOD_SELECT(o)   (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_PERIOD_SELECT))
 
#define GNC_TYPE_TREE_VIEW_SX_LIST   (gnc_tree_view_sx_list_get_type ())
 
#define GNC_TREE_VIEW_SX_LIST(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_VIEW_SX_LIST, GncTreeViewSxList))
 
#define GNC_TREE_VIEW_SX_LIST_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_VIEW_SX_LIST, GncTreeViewSxListClass))
 
#define GNC_IS_TREE_VIEW_SX_LIST(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_VIEW_SX_LIST))
 
#define GNC_IS_TREE_VIEW_SX_LIST_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_VIEW_SX_LIST))
 
#define GNC_TREE_VIEW_SX_LIST_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_VIEW_SX_LIST, GncTreeViewSxListClass))
 
#define GNC_TYPE_TREE_VIEW   (gnc_tree_view_get_type ())
 
#define GNC_TREE_VIEW(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_VIEW, GncTreeView))
 
#define GNC_TREE_VIEW_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_VIEW, GncTreeViewClass))
 
#define GNC_IS_TREE_VIEW(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_VIEW))
 
#define GNC_IS_TREE_VIEW_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_VIEW))
 
#define GNC_TREE_VIEW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_VIEW, GncTreeViewClass))
 
#define GNC_TREE_VIEW_NAME   "GncTreeView"
 
#define MODEL_COLUMN   "model_column"
 
#define REAL_TITLE   "real_title"
 
#define PREF_NAME   "pref-name"
 
#define ALWAYS_VISIBLE   "always-visible"
 
#define DEFAULT_VISIBLE   "default-visible"
 
#define GNC_TREE_VIEW_COLUMN_DATA_NONE   -1
 
#define GNC_TREE_VIEW_COLUMN_COLOR_NONE   -1
 
#define GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS   -1
 

Typedefs

typedef struct
_GncPeriodSelectPrivate 
GncPeriodSelectPrivate
 
typedef void(* renderer_toggled )(GtkCellRendererToggle *cell_renderer_toggle, const gchar *path, gpointer user_data)
 

Enumerations

enum  GncAccountingPeriod {
  GNC_ACCOUNTING_PERIOD_INVALID = -1, GNC_ACCOUNTING_PERIOD_TODAY, GNC_ACCOUNTING_PERIOD_MONTH, GNC_ACCOUNTING_PERIOD_MONTH_PREV,
  GNC_ACCOUNTING_PERIOD_QUARTER, GNC_ACCOUNTING_PERIOD_QUARTER_PREV, GNC_ACCOUNTING_PERIOD_CYEAR, GNC_ACCOUNTING_PERIOD_CYEAR_PREV,
  GNC_ACCOUNTING_PERIOD_CYEAR_LAST, GNC_ACCOUNTING_PERIOD_FYEAR = GNC_ACCOUNTING_PERIOD_CYEAR_LAST, GNC_ACCOUNTING_PERIOD_FYEAR_PREV, GNC_ACCOUNTING_PERIOD_FYEAR_LAST,
  GNC_ACCOUNTING_PERIOD_LAST = GNC_ACCOUNTING_PERIOD_FYEAR_LAST
}
 
enum  {
  PROP_0, PROP_FY_END, PROP_SHOW_DATE, PROP_DATE_BASE,
  PROP_PS_ACTIVE
}
 
enum  { CHANGED, LAST_SIGNAL }
 

Functions

void gnc_ui_close_book (QofBook *book)
 
void gnc_ui_file_access_for_open (void)
 
void gnc_ui_file_access_for_save_as (void)
 
void gnc_ui_file_access_for_export (void)
 
void gnc_ui_object_references_show (const gchar *explanation, GList *objlist)
 
void gnc_period_select_set_active (GncPeriodSelect *period, GncAccountingPeriod which)
 
GncAccountingPeriod gnc_period_select_get_active (GncPeriodSelect *period)
 
GDate * gnc_period_select_get_date (GncPeriodSelect *period)
 
GType gnc_tree_view_sx_list_get_type (void)
 
GtkTreeView * gnc_tree_view_sx_list_new (GncSxInstanceModel *sx_instances)
 
SchedXactiongnc_tree_view_sx_list_get_sx_from_path (GncTreeViewSxList *view, GtkTreePath *path)
 
GType gnc_tree_view_get_type (void)
 

Variables

const gchar * start_strings [GNC_ACCOUNTING_PERIOD_LAST]
 
const gchar * end_strings [GNC_ACCOUNTING_PERIOD_LAST]
 

Accounting Periods

time64 gnc_accounting_period_fiscal_start (void)
 
time64 gnc_accounting_period_fiscal_end (void)
 
GDate * gnc_accounting_period_start_gdate (GncAccountingPeriod which, const GDate *fy_end, const GDate *contains)
 
GDate * gnc_accounting_period_end_gdate (GncAccountingPeriod which, const GDate *fy_end, const GDate *contains)
 

GncPeriodSelect Properties

GDate * gnc_period_select_get_fy_end (GncPeriodSelect *period)
 
void gnc_period_select_set_fy_end (GncPeriodSelect *period, const GDate *fy_end)
 
gboolean gnc_period_select_get_show_date (GncPeriodSelect *period)
 
void gnc_period_select_set_show_date (GncPeriodSelect *period, const gboolean show_date)
 
GDate * gnc_period_select_get_date_base (GncPeriodSelect *period)
 
void gnc_period_select_set_date_base (GncPeriodSelect *period, const GDate *date_base)
 

GncPeriodSelect Core Implementation

GType gnc_period_select_get_type (void)
 
GtkWidget * gnc_period_select_new (gboolean starting_labels)
 
GtkWidget * gnc_period_select_new_glade (gchar *widget_name, gchar *string1, gchar *string2, gint int1, gint int2)
 

Tree View Creation

GtkTreeViewColumn * gnc_tree_view_add_toggle_column (GncTreeView *view, const gchar *column_title, const gchar *column_short_title, const gchar *pref_name, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn, renderer_toggled toggle_edited_cb)
 
GtkTreeViewColumn * gnc_tree_view_add_text_column (GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *stock_icon_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn)
 
GtkTreeViewColumn * gnc_tree_view_add_combo_column (GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeModel *combo_tree_model, gint combo_model_text_column, GtkTreeIterCompareFunc column_sort_fn)
 
GtkTreeViewColumn * gnc_tree_view_add_date_column (GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *stock_icon_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn)
 
GtkTreeViewColumn * gnc_tree_view_add_numeric_column (GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *sizing_text, gint model_data_column, gint model_color_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn)
 
gint gnc_tree_view_append_column (GncTreeView *view, GtkTreeViewColumn *column)
 

Tree View Properties

void gnc_tree_view_configure_columns (GncTreeView *view)
 
GtkTreeViewColumn * gnc_tree_view_find_column_by_name (GncTreeView *view, const gchar *wanted)
 
void gnc_tree_view_set_state_section (GncTreeView *view, const gchar *section)
 
const gchar * gnc_tree_view_get_state_section (GncTreeView *view)
 
void gnc_tree_view_remove_state_information (GncTreeView *view)
 
void gnc_tree_view_save_state (GncTreeView *view)
 
void gnc_tree_view_expand_columns (GncTreeView *view, gchar *first_column_name,...)
 
void gnc_tree_view_set_control_column_background (GncTreeView *view, gint column, GtkTreeCellDataFunc func)
 
void gnc_tree_view_set_sort_user_data (GncTreeView *view, GtkTreeModel *s_model)
 
void gnc_tree_view_set_show_column_menu (GncTreeView *view, gboolean visible)
 
gboolean gnc_tree_view_get_show_column_menu (GncTreeView *view)
 
GtkCellRenderer * gnc_tree_view_column_get_renderer (GtkTreeViewColumn *column)
 
void gnc_tree_view_keynav (GncTreeView *view, GtkTreeViewColumn **col, GtkTreePath *path, GdkEventKey *event)
 
gboolean gnc_tree_view_path_is_valid (GncTreeView *view, GtkTreePath *path)
 

Detailed Description

gnc-plugin-page-report.h – A GncPlugin page for a report.

Copyright (C) 2004 Joshua Sled Author: Joshua Sled jsled.nosp@m.@asy.nosp@m.nchro.nosp@m.nous.nosp@m..org

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, contact:

Free Software Foundation Voice: +1-617-542-5942 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 Boston, MA 02110-1301, USA gnu@g.nosp@m.nu.o.nosp@m.rg

Typedef Documentation

Private Data Structure

Definition at line 102 of file gnc-period-select.c.

Enumeration Type Documentation

This specifies a time interval.

Definition at line 53 of file gnc-accounting-period.h.

54 {
55  GNC_ACCOUNTING_PERIOD_INVALID = -1, //Force Clang to use a signed enum
56  GNC_ACCOUNTING_PERIOD_TODAY,
57  GNC_ACCOUNTING_PERIOD_MONTH,
58  GNC_ACCOUNTING_PERIOD_MONTH_PREV,
59  GNC_ACCOUNTING_PERIOD_QUARTER,
60  GNC_ACCOUNTING_PERIOD_QUARTER_PREV,
61  GNC_ACCOUNTING_PERIOD_CYEAR,
62  GNC_ACCOUNTING_PERIOD_CYEAR_PREV,
63  GNC_ACCOUNTING_PERIOD_CYEAR_LAST,
64 
65  GNC_ACCOUNTING_PERIOD_FYEAR = GNC_ACCOUNTING_PERIOD_CYEAR_LAST,
66  GNC_ACCOUNTING_PERIOD_FYEAR_PREV,
67  GNC_ACCOUNTING_PERIOD_FYEAR_LAST,
68  GNC_ACCOUNTING_PERIOD_LAST = GNC_ACCOUNTING_PERIOD_FYEAR_LAST,
GncAccountingPeriod

Function Documentation

GDate * gnc_accounting_period_end_gdate ( GncAccountingPeriod  which,
const GDate *  fy_end,
const GDate *  contains 
)

This function returns the ending date for an accounting period. The date will be computed based upon the type of accounting interval requested, an optional fiscal year end value, and an optional time value.

Parameters
whichAn enum specifying the type of accounting period.
fy_endThis argument specifies the month and day of the fiscal year end. If the accounting period specified in the 'which' parameter is not a fiscal accounting period, this variable is ignored and may be NULL. Note: the year field of this argument is always ignored.
containsThis argument specifies the origin time value used by the calculations in this function. If this value is NULL, the origin will be the current time.
Returns
The final day of the specified time interval, as a GDate.

Definition at line 232 of file gnc-accounting-period.c.

235 {
236  GDate *date;
237 
238  if (contains)
239  {
240  date = g_date_new_dmy(g_date_get_day(contains),
241  g_date_get_month(contains),
242  g_date_get_year(contains));
243  }
244  else
245  {
246  date = g_date_new ();
247  gnc_gdate_set_today (date);
248  }
249 
250  switch (which)
251  {
252  default:
253  g_message("Undefined relative time constant %d", which);
254  g_date_free(date);
255  return 0;
256 
257  case GNC_ACCOUNTING_PERIOD_TODAY:
258  /* Already have today's date */
259  break;
260 
261  case GNC_ACCOUNTING_PERIOD_MONTH:
263  break;
264 
265  case GNC_ACCOUNTING_PERIOD_MONTH_PREV:
267  break;
268 
269  case GNC_ACCOUNTING_PERIOD_QUARTER:
271  break;
272 
273  case GNC_ACCOUNTING_PERIOD_QUARTER_PREV:
275  break;
276 
277  case GNC_ACCOUNTING_PERIOD_CYEAR:
279  break;
280 
281  case GNC_ACCOUNTING_PERIOD_CYEAR_PREV:
283  break;
284 
285  case GNC_ACCOUNTING_PERIOD_FYEAR:
286  if (fy_end == NULL)
287  {
288  g_message("Request for fisal year value but no fiscal year end value provided.");
289  g_date_free(date);
290  return 0;
291  }
292  gnc_gdate_set_fiscal_year_end(date, fy_end);
293  break;
294 
295  case GNC_ACCOUNTING_PERIOD_FYEAR_PREV:
296  if (fy_end == NULL)
297  {
298  g_message("Request for fisal year value but no fiscal year end value provided.");
299  g_date_free(date);
300  return 0;
301  }
303  break;
304  }
305 
306  return date;
307 }
void gnc_gdate_set_today(GDate *gd)
void gnc_gdate_set_prev_fiscal_year_end(GDate *date, const GDate *fy_end)
void gnc_gdate_set_month_end(GDate *date)
void gnc_gdate_set_prev_year_end(GDate *date)
void gnc_gdate_set_prev_quarter_end(GDate *date)
void gnc_gdate_set_quarter_end(GDate *date)
void gnc_gdate_set_year_end(GDate *date)
void gnc_gdate_set_prev_month_end(GDate *date)
void gnc_gdate_set_fiscal_year_end(GDate *date, const GDate *fy_end)
GDate * gnc_accounting_period_start_gdate ( GncAccountingPeriod  which,
const GDate *  fy_end,
const GDate *  contains 
)

This function returns the starting date for an accounting period. The date will be computed based upon the type of accounting interval requested, an optional fiscal year end value, and an optional time value.

Parameters
whichAn enum specifying the type of accounting period.
fy_endThis argument specifies the month and day of the fiscal year end. If the accounting period specified in the 'which' parameter is not a fiscal accounting period, this variable is ignored and may be NULL. Note: the year field of this argument is always ignored.
containsThis argument specifies the origin time value used by the calculations in this function. If this value is NULL, the origin will be the current time.
Returns
The starting day of the specified time interval, as a GDate.

Definition at line 138 of file gnc-accounting-period.c.

141 {
142  GDate *date;
143 
144  if (contains)
145  {
146  date = g_date_new_dmy(g_date_get_day(contains),
147  g_date_get_month(contains),
148  g_date_get_year(contains));
149  }
150  else
151  {
152  date = g_date_new ();
153  gnc_gdate_set_today (date);
154  }
155 
156  switch (which)
157  {
158  default:
159  g_message("Undefined relative time constant %d", which);
160  g_date_free(date);
161  return NULL;
162 
163  case GNC_ACCOUNTING_PERIOD_TODAY:
164  /* Already have today's date */
165  break;
166 
167  case GNC_ACCOUNTING_PERIOD_MONTH:
169  break;
170 
171  case GNC_ACCOUNTING_PERIOD_MONTH_PREV:
173  break;
174 
175  case GNC_ACCOUNTING_PERIOD_QUARTER:
177  break;
178 
179  case GNC_ACCOUNTING_PERIOD_QUARTER_PREV:
181  break;
182 
183  case GNC_ACCOUNTING_PERIOD_CYEAR:
185  break;
186 
187  case GNC_ACCOUNTING_PERIOD_CYEAR_PREV:
189  break;
190 
191  case GNC_ACCOUNTING_PERIOD_FYEAR:
192  if (fy_end == NULL)
193  {
194  g_message("Request for fisal year value but no fiscal year end value provided.");
195  g_date_free(date);
196  return NULL;
197  }
198  gnc_gdate_set_fiscal_year_start(date, fy_end);
199  break;
200 
201  case GNC_ACCOUNTING_PERIOD_FYEAR_PREV:
202  if (fy_end == NULL)
203  {
204  g_message("Request for fisal year value but no fiscal year end value provided.");
205  g_date_free(date);
206  return NULL;
207  }
209  break;
210  }
211  return date;
212 }
void gnc_gdate_set_today(GDate *gd)
void gnc_gdate_set_prev_quarter_start(GDate *date)
void gnc_gdate_set_month_start(GDate *date)
void gnc_gdate_set_quarter_start(GDate *date)
void gnc_gdate_set_prev_year_start(GDate *date)
void gnc_gdate_set_fiscal_year_start(GDate *date, const GDate *fy_end)
void gnc_gdate_set_year_start(GDate *date)
void gnc_gdate_set_prev_month_start(GDate *date)
void gnc_gdate_set_prev_fiscal_year_start(GDate *date, const GDate *fy_end)
GncAccountingPeriod gnc_period_select_get_active ( GncPeriodSelect period)

Get the currently selected accounting period from a GncPeriodSelect widget. This is used to retrieve the user's selection in the form of an enum.

Parameters
periodThe selection widget to query.
Returns
An enum indicating the user's choice of accounting period.

Definition at line 756 of file gnc-period-select.c.

757 {
759 
760  g_return_val_if_fail(period != NULL, -1);
761  g_return_val_if_fail(GNC_IS_PERIOD_SELECT(period), -1);
762 
763  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
764  return gtk_combo_box_get_active(GTK_COMBO_BOX(priv->selector));
765 }
GDate * gnc_period_select_get_date ( GncPeriodSelect period)

Get the currently selected accounting period choice from a GncPeriodSelect widget. This is used to retrieve the user's selection in the form of a GDate.

Parameters
periodThe selection widget to query.
Returns
The starting/ending time.

Definition at line 773 of file gnc-period-select.c.

774 {
776  GncAccountingPeriod which;
777 
778  g_return_val_if_fail(period != NULL, 0);
779  g_return_val_if_fail(GNC_IS_PERIOD_SELECT(period), 0);
780 
781  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
782  which = gtk_combo_box_get_active(GTK_COMBO_BOX(priv->selector));
783  if (which == -1)
784  return NULL;
785 
786  if (priv->start)
787  return gnc_accounting_period_start_gdate(which, priv->fy_end,
788  priv->date_base);
789  return gnc_accounting_period_end_gdate(which, priv->fy_end,
790  priv->date_base);
791 }
GncAccountingPeriod
GDate * gnc_accounting_period_end_gdate(GncAccountingPeriod which, const GDate *fy_end, const GDate *contains)
GDate * gnc_accounting_period_start_gdate(GncAccountingPeriod which, const GDate *fy_end, const GDate *contains)
GDate * gnc_period_select_get_fy_end ( GncPeriodSelect period)

Get the current value of the fiscal year end setting from a GncPeriodSelect widget. If the result is NULL then fiscal years are not currently supported.

Parameters
periodThe GncPeriodSelect widget to query.
Returns
A pointer to a GDate containing the fiscal year end value, or NULL if no fiscal year end is set. Note that only the month and day fields are valid in the returned GDate.

Definition at line 254 of file gnc-period-select.c.

255 {
257  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
258 
259  g_return_val_if_fail(period != NULL, NULL);
260  g_return_val_if_fail(GNC_IS_PERIOD_SELECT(period), NULL);
261 
262  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
263  if (!priv->fy_end)
264  return NULL;
265  return g_date_new_dmy(g_date_get_day(priv->fy_end),
266  g_date_get_month(priv->fy_end),
267  G_DATE_BAD_YEAR);
268 }
gboolean gnc_period_select_get_show_date ( GncPeriodSelect period)

Get the current value of the "show sample" setting from a GncPeriodSelect widget.

Definition at line 359 of file gnc-period-select.c.

360 {
362 
363  g_return_val_if_fail(period != NULL, FALSE);
364  g_return_val_if_fail(GNC_IS_PERIOD_SELECT(period), FALSE);
365 
366  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
367  return (priv->date_base != NULL);
368 }
GType gnc_period_select_get_type ( void  )

Returns the GType of a GncPeriodSelect widget.

Definition at line 509 of file gnc-period-select.c.

510 {
511  static GType period_select_type = 0;
512 
513  if (period_select_type == 0)
514  {
515  static const GTypeInfo period_select_info =
516  {
517  sizeof (GncPeriodSelectClass),
518  NULL,
519  NULL,
520  (GClassInitFunc) gnc_period_select_class_init,
521  NULL,
522  NULL,
523  sizeof (GncPeriodSelect),
524  0, /* n_preallocs */
525  (GInstanceInitFunc) gnc_period_select_init,
526  NULL
527  };
528 
529  period_select_type = g_type_register_static(GTK_TYPE_HBOX,
530  "GncPeriodSelect",
531  &period_select_info, 0);
532  }
533 
534  return period_select_type;
535 }
GtkWidget * gnc_period_select_new ( gboolean  starting_labels)

Create a new GncPeriodSelect widget which is used to select a accounting period like "previous month" or "this year".

Parameters
starting_labelsIf set to TRUE then all the labels will refer to the "Start of...". If FALSE, labels will refer to "End of...".
Returns
A newly created GncPeriodSelect widget.

Definition at line 672 of file gnc-period-select.c.

673 {
675  GncPeriodSelect *period;
676  const gchar *label;
677  gint i;
678 
679  period = g_object_new(GNC_TYPE_PERIOD_SELECT, NULL);
680 
681  /* Set up private data structures */
682  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
683  priv->selector = gtk_combo_box_text_new();
684  priv->start = starting_labels;
685 
686  /* Add the internal widgets to the hbox */
687  gtk_box_pack_start(GTK_BOX(period), priv->selector, TRUE, TRUE, 0);
688  gtk_widget_show(priv->selector);
689 
690  /* Find out when the combo box changes */
691  g_signal_connect(G_OBJECT(priv->selector), "changed",
692  G_CALLBACK(gnc_period_sample_combobox_changed), period);
693 
694  /* Build all the labels except the fiscal year labels */
695  for (i = 0; i < GNC_ACCOUNTING_PERIOD_CYEAR_LAST; i++)
696  {
697  label = starting_labels ? _(start_strings[i]) : _(end_strings[i]);
698  gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(priv->selector), label);
699  }
700 
701  /* Track changes to date formatting */
702  gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_DATE_FORMAT,
703  gnc_period_sample_new_date_format, period);
704 
705  return GTK_WIDGET (period);
706 }
gulong gnc_prefs_register_cb(const char *group, const gchar *pref_name, gpointer func, gpointer user_data)
Definition: gnc-prefs.c:128
GtkWidget * gnc_period_select_new_glade ( gchar *  widget_name,
gchar *  string1,
gchar *  string2,
gint  int1,
gint  int2 
)

Create a new GncPeriodSelect widget from a glade file. The int1 argument passed from glade is used to determine whether the widget uses labels for start times or end times. A non-zero int2 argument indicates that an example date should be shown.

Returns
A newly created GncPeriodSelect widget.

Definition at line 715 of file gnc-period-select.c.

718 {
719  GtkWidget *widget;
720  widget = gnc_period_select_new(int1 != 0);
721  if (int2)
722  gnc_period_select_set_show_date(GNC_PERIOD_SELECT(widget), TRUE);
723  gtk_widget_show(widget);
724  return widget;
725 }
void gnc_period_select_set_show_date(GncPeriodSelect *period, const gboolean show_date)
GtkWidget * gnc_period_select_new(gboolean starting_labels)
void gnc_period_select_set_active ( GncPeriodSelect period,
GncAccountingPeriod  which 
)

Set which item in the GncPeriodSelect is initially selected. This is used to set the initial selection before the widget is shown to the user.

Parameters
periodThe selection widget to update.
whichThe accounting period that should be selected.

Definition at line 739 of file gnc-period-select.c.

741 {
742  g_return_if_fail(period != NULL);
743  g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
744  g_return_if_fail(which >= 0);
745  g_return_if_fail(which < GNC_ACCOUNTING_PERIOD_LAST);
746 
747  g_object_set (G_OBJECT (period), "active", which, NULL);
748 }
void gnc_period_select_set_fy_end ( GncPeriodSelect period,
const GDate *  fy_end 
)

Set the fiscal year end on a GncPeriodSelect widget. If set to a value other than NULL then widget will include fiscal accounting period like "this fiscal year".

Parameters
periodThe GncPeriodSelect widget to update.
fy_endThe new fiscal year end value, or NULL if no fiscal year is set. Note that only the month and day fields need be valid in the provided GDate.

Definition at line 276 of file gnc-period-select.c.

277 {
279  const gchar *label;
280  gint i;
281 
282  g_return_if_fail(period != NULL);
283  g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
284 
285  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
286  if (priv->fy_end)
287  g_date_free(priv->fy_end);
288 
289  if (fy_end)
290  {
291  priv->fy_end = g_date_new_dmy(g_date_get_day(fy_end),
292  g_date_get_month(fy_end),
293  G_DATE_BAD_YEAR);
294  }
295  else
296  {
297  priv->fy_end = NULL;
298  }
299 
300  if (fy_end)
301  {
302  for (i = GNC_ACCOUNTING_PERIOD_CYEAR_LAST; i < GNC_ACCOUNTING_PERIOD_FYEAR_LAST; i++)
303  {
304  label = priv->start ? _(start_strings[i]) : _(end_strings[i]);
305  gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(priv->selector), label);
306  }
307  }
308  else
309  {
310  for (i = GNC_ACCOUNTING_PERIOD_FYEAR_LAST - 1; i >= GNC_ACCOUNTING_PERIOD_FYEAR_LAST; i--)
311  {
312  gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(priv->selector), i);
313  }
314  }
315 }
void gnc_period_select_set_show_date ( GncPeriodSelect period,
const gboolean  show_date 
)

Set the "show sample" setting on a GncPeriodSelect widget. If set to TRUE then a GtkLabel will be used to show the date corresponding to the selected time period.

Definition at line 375 of file gnc-period-select.c.

376 {
377  GDate date;
378 
379  g_return_if_fail(period != NULL);
380  g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
381 
382  if (show_date)
383  {
384  g_date_clear(&date, 1);
385  gnc_gdate_set_time64(&date, gnc_time (NULL));
386  gnc_period_select_set_date_common(period, &date);
387  }
388  else
389  {
390  gnc_period_select_set_date_common(period, NULL);
391  }
392 }
time64 gnc_time(time64 *tbuf)
get the current local time
void gnc_gdate_set_time64(GDate *gd, time64 time)
GtkTreeViewColumn* gnc_tree_view_add_combo_column ( GncTreeView view,
const gchar *  column_title,
const gchar *  pref_name,
const gchar *  sizing_text,
gint  model_data_column,
gint  model_visibility_column,
GtkTreeModel *  combo_tree_model,
gint  combo_model_text_column,
GtkTreeIterCompareFunc  column_sort_fn 
)

This function adds a new combobox column to a GncTreeView base view. The parameters it takes in common with gnc_tree_view_add_text_column() behave the same as there. In addition, it will use combo_tree_model as the GtkTreeModel for the combobox, and combo_model_text_column will be the column in the model used for displaying the text in the combobox.

Definition at line 1897 of file gnc-tree-view.c.

1906 {
1907  GtkTreeViewColumn *column;
1908  GtkCellRenderer *renderer;
1909  PangoLayout* layout;
1910  int default_width, title_width;
1911 
1912  g_return_val_if_fail (GNC_IS_TREE_VIEW(view), NULL);
1913 
1914  column = gtk_tree_view_column_new ();
1915  gtk_tree_view_column_set_title (column, gettext(column_title));
1916 
1917  /* Set up a renderer and attributes */
1918  renderer = gtk_cell_renderer_combo_new ();
1919  gtk_tree_view_column_pack_start (column, renderer, TRUE);
1920 
1921  /* Set renderer attributes controlled by the model */
1922  if (model_data_column != GNC_TREE_VIEW_COLUMN_DATA_NONE)
1923  gtk_tree_view_column_add_attribute (column, renderer,
1924  "text", model_data_column);
1925  if (model_visibility_column != GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS)
1926  gtk_tree_view_column_add_attribute (column, renderer,
1927  "visible", model_visibility_column);
1928 
1929  /* Default size is the larger of the column title and the sizing text */
1930  layout = gtk_widget_create_pango_layout (GTK_WIDGET(view), column_title);
1931  pango_layout_get_pixel_size(layout, &title_width, NULL);
1932  g_object_unref(layout);
1933  layout = gtk_widget_create_pango_layout (GTK_WIDGET(view), sizing_text);
1934  pango_layout_get_pixel_size(layout, &default_width, NULL);
1935  g_object_unref(layout);
1936  default_width = MAX(default_width, title_width);
1937  if (default_width)
1938  default_width += 10; /* padding on either side */
1939 
1940  gnc_tree_view_column_properties (view, column, pref_name, model_data_column,
1941  default_width, TRUE, column_sort_fn);
1942 
1943  /* Stuff specific to combo */
1944  if (combo_tree_model)
1945  {
1946  g_object_set(G_OBJECT(renderer), "model", combo_tree_model,
1947  "text-column", combo_model_text_column, NULL);
1948  }
1949  /* TODO: has-entry? */
1950 
1951  gnc_tree_view_append_column (view, column);
1952  return column;
1953 }
gint gnc_tree_view_append_column(GncTreeView *view, GtkTreeViewColumn *column)
GtkTreeViewColumn* gnc_tree_view_add_date_column ( GncTreeView view,
const gchar *  column_title,
const gchar *  pref_name,
const gchar *  stock_icon_name,
const gchar *  sizing_text,
gint  model_data_column,
gint  model_visibility_column,
GtkTreeIterCompareFunc  column_sort_fn 
)

This function adds a new date column to a GncTreeView base view. The parameters it takes in common with gnc_tree_view_add_text_column() behave the same as there.

This function adds a new date column to a GncTreeView base view. It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. If the tree has a state section associated with it, this function also wires up the column so that its visibility and width are remembered.

Parameters are defined in gnc-tree-view.h

Definition at line 1839 of file gnc-tree-view.c.

1847 {
1848  GtkTreeViewColumn *column;
1849  GtkCellRenderer *renderer;
1850  PangoLayout* layout;
1851  int default_width, title_width;
1852 
1853  g_return_val_if_fail (GNC_IS_TREE_VIEW(view), NULL);
1854 
1855  column = gtk_tree_view_column_new ();
1856  gtk_tree_view_column_set_title (column, column_title);
1857 
1858  /* Set up an icon renderer if requested */
1859  if (stock_icon_name)
1860  {
1861  renderer = gtk_cell_renderer_pixbuf_new ();
1862  g_object_set (renderer, "stock-id", stock_icon_name, NULL);
1863  gtk_tree_view_column_pack_start (column, renderer, FALSE);
1864  }
1865 
1866  /* Set up a text renderer and attributes */
1867  renderer = gnc_cell_renderer_date_new(TRUE);
1868  gtk_tree_view_column_pack_start (column, renderer, TRUE);
1869 
1870  /* Set renderer attributes controlled by the model */
1871  if (model_data_column != GNC_TREE_VIEW_COLUMN_DATA_NONE)
1872  gtk_tree_view_column_add_attribute (column, renderer,
1873  "text", model_data_column);
1874  if (model_visibility_column != GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS)
1875  gtk_tree_view_column_add_attribute (column, renderer,
1876  "visible", model_visibility_column);
1877 
1878  /* Default size is the larger of the column title and the sizing text */
1879  layout = gtk_widget_create_pango_layout (GTK_WIDGET(view), column_title);
1880  pango_layout_get_pixel_size(layout, &title_width, NULL);
1881  g_object_unref(layout);
1882  layout = gtk_widget_create_pango_layout (GTK_WIDGET(view), sizing_text);
1883  pango_layout_get_pixel_size(layout, &default_width, NULL);
1884  g_object_unref(layout);
1885  default_width = MAX(default_width, title_width);
1886  if (default_width)
1887  default_width += 10; /* padding on either side */
1888  gnc_tree_view_column_properties (view, column, pref_name, model_data_column,
1889  default_width, TRUE, column_sort_fn);
1890 
1891  gnc_tree_view_append_column (view, column);
1892  return column;
1893 }
gint gnc_tree_view_append_column(GncTreeView *view, GtkTreeViewColumn *column)
GtkTreeViewColumn* gnc_tree_view_add_numeric_column ( GncTreeView view,
const gchar *  column_title,
const gchar *  pref_name,
const gchar *  sizing_text,
gint  model_data_column,
gint  model_color_column,
gint  model_visibility_column,
GtkTreeIterCompareFunc  column_sort_fn 
)

This function adds a new numeric column to a GncTreeView base view. It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. A numeric column is nothing more then a text column with a few extra attributes.

Parameters
viewA pointer to a generic GncTreeView.
column_titleThe title for this column.
pref_nameThe internal name of this column. This name is used in several functions to look up the column, and it is also used when saving/restoring the view's state.
sizing_textA string used to compute the default width of the column. This text is never displayed.
model_data_columnThe index of the GtkTreeModel data column used to determine the data that will be displayed in this column for each row in the view. Use GNC_TREE_VIEW_COLUMN_DATA_NONE if you plan on using an non-model data source for this column.
model_color_columnThe index of the GtkTreeModel data column used to determine the foreground color of any text in this column. It should be used to display negative numbers in red. Use GNC_TREE_VIEW_COLUMN_COLOR_NONE if the text in this column should always be displayed in the default theme color for text.
model_visibility_columnThe index of the GtkTreeModel data column used to determine whether or not a checkbox for each row will be displayed at all. Use GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS if the checkbox should be displayed in all rows.
column_sort_fnThe function that GtkTreeModelSort will call to compare two rows to determine their displayed order.
Returns
The newly created GtkTreeViewColumn.

This function adds a new numeric column to a GncTreeView base view. It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. If the tree has a state section associated with it, this function also wires up the column so that its visibility and width are remembered. A numeric column is nothing more then a text column with a few extra attributes.

Parameters are defined in gnc-tree-view.h

Definition at line 1983 of file gnc-tree-view.c.

1991 {
1992  GtkTreeViewColumn *column;
1993  GtkCellRenderer *renderer;
1994 
1995  column = gnc_tree_view_add_text_column (view, column_title, pref_name,
1996  NULL, sizing_text, model_data_column,
1997  model_visibility_column,
1998  column_sort_fn);
1999 
2000  renderer = gnc_tree_view_column_get_renderer(column);
2001 
2002  /* Right align the column title and data */
2003  g_object_set(G_OBJECT(column), "alignment", 1.0, NULL);
2004  g_object_set(G_OBJECT(renderer), "xalign", 1.0, NULL);
2005 
2006  /* Change the text color */
2007  if (model_color_column != GNC_TREE_VIEW_COLUMN_COLOR_NONE)
2008  gtk_tree_view_column_add_attribute (column, renderer,
2009  "foreground", model_color_column);
2010 
2011  return column;
2012 }
GtkTreeViewColumn * gnc_tree_view_add_text_column(GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *stock_icon_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn)
GtkCellRenderer * gnc_tree_view_column_get_renderer(GtkTreeViewColumn *column)
GtkTreeViewColumn* gnc_tree_view_add_text_column ( GncTreeView view,
const gchar *  column_title,
const gchar *  pref_name,
const gchar *  stock_icon_name,
const gchar *  sizing_text,
gint  model_data_column,
gint  model_visibility_column,
GtkTreeIterCompareFunc  column_sort_fn 
)

This function adds a new text column to a GncTreeView base view. It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn.

Parameters
viewA pointer to a generic GncTreeView.
column_titleThe title for this column.
pref_nameThe internal name of this column. This name is used in several functions to look up the column, and it is also used when saving/restoring the view's state.
stock_icon_nameThe name of the stock icon to display to the left of the text in this column. Used for adding icons like the "account" icon to a view. This must be a registered stock icon, not a filename.
sizing_textA string used to compute the default width of the column. This text is never displayed.
model_data_columnThe index of the GtkTreeModel data column used to determine the data that will be displayed in this column for each row in the view. Use GNC_TREE_VIEW_COLUMN_DATA_NONE if you plan on using a non-model data source for this column. This index is connected to the "text" attribute of the cell renderer.
model_visibility_columnThe index of the GtkTreeModel data column used to determine whether or not a checkbox for each row will be displayed at all. Use GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS if the checkbox should be displayed in all rows.
column_sort_fnThe function that GtkTreeModelSort will call to compare two rows to determine their displayed order.
Returns
The newly created GtkTreeViewColumn.

This function adds a new text column to a GncTreeView base view. It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. If the tree has a state section associated with it, this function also wires up the column so that its visibility and width are remembered.

Parameters are defined in gnc-tree-view.h

Definition at line 1772 of file gnc-tree-view.c.

1780 {
1781  GtkTreeViewColumn *column;
1782  GtkCellRenderer *renderer;
1783  PangoLayout* layout;
1784  int default_width, title_width;
1785 
1786  g_return_val_if_fail (GNC_IS_TREE_VIEW(view), NULL);
1787 
1788  column = gtk_tree_view_column_new ();
1789  gtk_tree_view_column_set_title (column, column_title);
1790 
1791  /* Set up an icon renderer if requested */
1792  if (stock_icon_name)
1793  {
1794  renderer = gtk_cell_renderer_pixbuf_new ();
1795  g_object_set (renderer, "stock-id", stock_icon_name, NULL);
1796  gtk_tree_view_column_pack_start (column, renderer, FALSE);
1797  }
1798 
1799  /* Set up a text renderer and attributes */
1800  renderer = gtk_cell_renderer_text_new ();
1801  gtk_tree_view_column_pack_start (column, renderer, TRUE);
1802 
1803  /* Set renderer attributes controlled by the model */
1804  if (model_data_column != GNC_TREE_VIEW_COLUMN_DATA_NONE)
1805  gtk_tree_view_column_add_attribute (column, renderer,
1806  "text", model_data_column);
1807  if (model_visibility_column != GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS)
1808  gtk_tree_view_column_add_attribute (column, renderer,
1809  "visible", model_visibility_column);
1810 
1811  /* Default size is the larger of the column title and the sizing text */
1812  layout = gtk_widget_create_pango_layout (GTK_WIDGET(view), column_title);
1813  pango_layout_get_pixel_size(layout, &title_width, NULL);
1814  g_object_unref(layout);
1815  layout = gtk_widget_create_pango_layout (GTK_WIDGET(view), sizing_text);
1816  pango_layout_get_pixel_size(layout, &default_width, NULL);
1817  g_object_unref(layout);
1818  default_width = MAX(default_width, title_width);
1819  if (default_width)
1820  default_width += 10; /* padding on either side */
1821  gnc_tree_view_column_properties (view, column, pref_name, model_data_column,
1822  default_width, TRUE, column_sort_fn);
1823 
1824  gnc_tree_view_append_column (view, column);
1825  return column;
1826 }
gint gnc_tree_view_append_column(GncTreeView *view, GtkTreeViewColumn *column)
GtkTreeViewColumn* gnc_tree_view_add_toggle_column ( GncTreeView view,
const gchar *  column_title,
const gchar *  column_short_title,
const gchar *  pref_name,
gint  model_data_column,
gint  model_visibility_column,
GtkTreeIterCompareFunc  column_sort_fn,
renderer_toggled  toggle_edited_cb 
)

This function adds a new toggle column to a GncTreeView base view. It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. It handles creating a tooltip to show the full title name, and setting the sort and edit callback functions.

Parameters
viewA pointer to a generic GncTreeView.
column_titleThe full title for this column. This will be added as a tooltip what will be displayed when the mouse is hovered over the column title button.
column_short_titleThis is what will actually be displayed as the title of the column. This should be a single character, as anything more will unnecessarily expand the width of the column.
pref_nameThe internal name of this column. This name is used in several functions to look up the column, and it is also used when saving/restoring the view's state.
model_data_columnThe index of the GtkTreeModel data column used to determine whether the displayed checkbox for each row will be show as checked or empty. Use GNC_TREE_VIEW_COLUMN_DATA_NONE if you plan on using an non-model data source for this column.
model_visibility_columnThe index of the GtkTreeModel data column used to determine whether or not a checkbox for each row will be displayed at all. Use GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS if the checkbox should be displayed in all rows.
column_sort_fnThe function that GtkTreeModelSort will call to compare two rows to determine their displayed order.
toggle_edited_cbThe function to call when the user toggles the state of a checkbox.
Returns
The newly created GtkTreeViewColumn.

This function adds a new toggle column to a GncTreeView base view. It takes all the parameters necessary to hook a GtkTreeModel column to a GtkTreeViewColumn. It handles creating a tooltip to show the full title name, and setting the sort and edit callback functions. If the tree has a state section associated with it, this function also wires up the column so that its visibility and width are remembered.

Parameters are defined in gnc-tree-view.h

Definition at line 1719 of file gnc-tree-view.c.

1727 {
1728  GtkTreeViewColumn *column;
1729  GtkCellRenderer *renderer;
1730 
1731  g_return_val_if_fail (GNC_IS_TREE_VIEW(view), NULL);
1732 
1733  renderer = gtk_cell_renderer_toggle_new ();
1734  column =
1735  gtk_tree_view_column_new_with_attributes (column_short_title,
1736  renderer,
1737  "active", model_data_column,
1738  NULL);
1739 
1740  /* Add the full title to the object for menu creation */
1741  g_object_set_data_full(G_OBJECT(column), REAL_TITLE,
1742  g_strdup(column_title), g_free);
1743  if (toggle_edited_cb)
1744  g_signal_connect(G_OBJECT(renderer), "toggled",
1745  G_CALLBACK(toggle_edited_cb), view);
1746 
1747  if (model_visibility_column != GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS)
1748  gtk_tree_view_column_add_attribute (column, renderer,
1749  "visible", model_visibility_column);
1750 
1751 
1752  gnc_tree_view_column_properties (view, column, pref_name, model_data_column,
1753  0, FALSE, column_sort_fn);
1754 
1755  gnc_tree_view_append_column (view, column);
1756 
1757  /* Also add the full title to the object as a tooltip */
1758  gtk_widget_set_tooltip_text(column->button, column_title);
1759 
1760  return column;
1761 }
gint gnc_tree_view_append_column(GncTreeView *view, GtkTreeViewColumn *column)
gint gnc_tree_view_append_column ( GncTreeView view,
GtkTreeViewColumn *  column 
)

Add a column to a view based upon a GncTreeView. This function knows about the two special columns on the right side of this type of view, and adds the new column before these two columns. You could say that it appends to the data columns and ignores the infrastructure columns.

Parameters
viewA pointer to a generic GncTreeView.
columnThe column to append.
Returns
The index of the newly added column.

Add a column to a view based upon a GncTreeView. This function knows about the two special columns on the right side of this type of view, and adds the new column before these two columns. You could say that it appends to the data columns and ignores the infrastructure columns.

Parameters are defined in gnc-tree-view.h

Definition at line 2023 of file gnc-tree-view.c.

2025 {
2026  GList *columns;
2027  int n;
2028 
2029  /* There's no easy way to get this number. */
2030  columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(view));
2031  n = g_list_length(columns);
2032  g_list_free(columns);
2033 
2034  /* Ignore the initial two columns (the spacer and the selection menu) */
2035  if (n >= 2)
2036  n -= 2;
2037  return gtk_tree_view_insert_column (GTK_TREE_VIEW(view), column, n);
2038 }
GtkCellRenderer* gnc_tree_view_column_get_renderer ( GtkTreeViewColumn *  column)

Return the "main" cell renderer from a GtkTreeViewColumn added to a GncTreeView my one of the convenience routines.

Parameters
columnThe tree view column that was added to the GncTreeView
Returns
The cell renderer in use in the column.

Definition at line 1956 of file gnc-tree-view.c.

1957 {
1958  GList *renderers;
1959  GtkCellRenderer *cr = NULL;
1960 
1961  g_return_val_if_fail(GTK_TREE_VIEW_COLUMN(column), NULL);
1962 
1963  /* Get the list of one renderer */
1964  renderers = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(column));
1965  if (g_list_length(renderers) > 0)
1966  cr = GTK_CELL_RENDERER(renderers->data);
1967  g_list_free(renderers);
1968 
1969  return cr;
1970 }
void gnc_tree_view_configure_columns ( GncTreeView view)

Make all the correct columns visible, respecting their default visibility setting, their "always" visibility setting, and the last saved state if available.

Parameters
viewA pointer to an gnc tree view.

Definition at line 1546 of file gnc-tree-view.c.

1547 {
1548  GncTreeViewPrivate *priv;
1549  GtkTreeViewColumn *column;
1550  GList *columns;
1551  gboolean hide_spacer;
1552 
1553  g_return_if_fail(GNC_IS_TREE_VIEW(view));
1554 
1555  ENTER(" ");
1556 
1557  /* Update the view and saved state */
1558  columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(view));
1559  g_list_foreach(columns, (GFunc)gnc_tree_view_update_visibility, view);
1560  g_list_free(columns);
1561 
1562  priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1563  if (priv->state_section)
1564  priv->seen_state_visibility = TRUE;
1565 
1566  /* If only the first column is visible, hide the spacer and make that
1567  * column expand. */
1568  hide_spacer = (gnc_tree_view_count_visible_columns(view) == 1);
1569  column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), 0);
1570  gtk_tree_view_column_set_expand(column, hide_spacer);
1571  gtk_tree_view_column_set_visible(priv->spacer_column, !hide_spacer);
1572  gtk_tree_view_column_set_visible(priv->selection_column, !hide_spacer);
1573 
1574  LEAVE(" ");
1575 }
#define ENTER(format, args...)
Definition: qoflog.h:261
#define LEAVE(format, args...)
Definition: qoflog.h:271
void gnc_tree_view_expand_columns ( GncTreeView view,
gchar *  first_column_name,
  ... 
)

This function set the columns that will be allocated the free space in the view.

Parameters
viewThe tree view.
listof column names.

Definition at line 1374 of file gnc-tree-view.c.

1377 {
1378  GncTreeViewPrivate *priv;
1379  GtkTreeViewColumn *column;
1380  gboolean hide_spacer;
1381  GList *columns, *tmp;
1382  gchar *name, *pref_name;
1383  va_list args;
1384 
1385  g_return_if_fail (GNC_IS_TREE_VIEW (view));
1386  ENTER(" ");
1387  va_start (args, first_column_name);
1388  priv = GNC_TREE_VIEW_GET_PRIVATE (view);
1389  name = first_column_name;
1390  hide_spacer = FALSE;
1391 
1392  /* First disable the expand property on all (non-infrastructure) columns. */
1393  columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(view));
1394  for (tmp = columns; tmp; tmp = g_list_next(tmp))
1395  {
1396  column = tmp->data;
1397  pref_name = g_object_get_data(G_OBJECT(column), PREF_NAME);
1398  if (pref_name != NULL)
1399  gtk_tree_view_column_set_expand(column, FALSE);
1400  }
1401  g_list_free(columns);
1402 
1403  /* Now enable it on the requested columns. */
1404  while (name != NULL)
1405  {
1406  column = gnc_tree_view_find_column_by_name(view, name);
1407  if (column != NULL)
1408  {
1409  gtk_tree_view_column_set_expand(column, TRUE);
1410  hide_spacer = TRUE;
1411  }
1412  name = va_arg (args, gchar*);
1413  }
1414  va_end (args);
1415 
1416  gtk_tree_view_column_set_visible (priv->spacer_column, !hide_spacer);
1417 
1418  LEAVE(" ");
1419 }
GtkTreeViewColumn * gnc_tree_view_find_column_by_name(GncTreeView *view, const gchar *wanted)
#define ENTER(format, args...)
Definition: qoflog.h:261
#define LEAVE(format, args...)
Definition: qoflog.h:271
GtkTreeViewColumn* gnc_tree_view_find_column_by_name ( GncTreeView view,
const gchar *  wanted 
)

Find a tree column given the "pref name". This function simply runs the list of all (visible and invisible) columns looking for a match. Column names were attached to each column at the time the column was created.

Parameters
viewThe visible tree widget.
wantedThe "pref name" to find.

Find a tree column given the "pref name" used with saved state. This function simply runs the list of all (visible and invisible) columns looking for a match. Column names were attached to each column at the time the column was created.

Parameters
viewThe visible tree widget.
wantedThe "pref name" to find.

Definition at line 490 of file gnc-tree-view.c.

492 {
493  GtkTreeViewColumn *column, *found = NULL;
494  GList *column_list, *tmp;
495  const gchar *name;
496 
497  // ENTER("view %p, wanted %s", view, wanted);
498  column_list = gtk_tree_view_get_columns(GTK_TREE_VIEW(view));
499  for (tmp = column_list; tmp; tmp = g_list_next(tmp))
500  {
501  column = tmp->data;
502  name = g_object_get_data(G_OBJECT(column), PREF_NAME);
503  if (!name || (strcmp(name, wanted) != 0))
504  continue;
505  found = column;
506  break;
507  }
508  g_list_free(column_list);
509 
510  // LEAVE("column %p", found);
511  return found;
512 }
gboolean gnc_tree_view_get_show_column_menu ( GncTreeView view)

This function is called to get the current value of the "show-column-menu" property. It returns the same value passed to gnc_tree_view_set_show_menu_column().

Parameters
viewThe tree view.
Returns
Whether or not the column selection menu should be shown.

This function is called to get the current value of the "show-column-menu" property. It returns the same value passed to gnc_tree_view_set_show_menu_column().

Parameters are defined in gnc-tree-view.h

Definition at line 1510 of file gnc-tree-view.c.

1511 {
1512  GncTreeViewPrivate *priv;
1513 
1514  g_return_val_if_fail(GNC_IS_TREE_VIEW(view), FALSE);
1515 
1516  priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1517  return(priv->show_column_menu);
1518 }
const gchar* gnc_tree_view_get_state_section ( GncTreeView view)

This function is called to get the current association between a saved state section and the display of a view. It returns the same value passed to gnc_tree_view_set_state_section().

Parameters
viewThe tree view.
Returns
The current state section.

Get the name of the state section this tree view is associated with. It returns the same value passed to gnc_tree_view_set_state_section(); i.e. a string like "dialogs/edit_prices".

Parameters are defined in gnc-tree-view.h

Definition at line 1076 of file gnc-tree-view.c.

1077 {
1078  GncTreeViewPrivate *priv;
1079 
1080  g_return_val_if_fail (GNC_IS_TREE_VIEW (view), NULL);
1081 
1082  priv = GNC_TREE_VIEW_GET_PRIVATE (view);
1083  return priv->state_section;
1084 }
GType gnc_tree_view_get_type ( void  )

Create a new glib type for the base gnucash tree view.

Definition at line 146 of file gnc-tree-view.c.

147 {
148  static GType gnc_tree_view_type = 0;
149 
150  if (gnc_tree_view_type == 0)
151  {
152  static const GTypeInfo our_info =
153  {
154  sizeof (GncTreeViewClass),
155  NULL,
156  NULL,
157  (GClassInitFunc) gnc_tree_view_class_init,
158  NULL,
159  NULL,
160  sizeof (GncTreeView),
161  0,
162  (GInstanceInitFunc) gnc_tree_view_init
163  };
164 
165  gnc_tree_view_type = g_type_register_static (GTK_TYPE_TREE_VIEW,
166  GNC_TREE_VIEW_NAME,
167  &our_info, 0);
168  }
169 
170  return gnc_tree_view_type;
171 }
void gnc_tree_view_remove_state_information ( GncTreeView view)

This function is called to completely wipe the treeview's state information (column visibility, width, sorting order,..). This function may be called at any time; either when the user wants to disconnect or when the view object is being destroyed.

Parameters
viewThe tree view.

Completely wipe the treeview's state information (column visibility, width, sorting order,..). This function may be called at any time; either when the user wants to disconnect or when the view object is being destroyed.

Parameters
viewThe tree view.

Definition at line 943 of file gnc-tree-view.c.

944 {
945  GncTreeViewPrivate *priv;
946  GKeyFile *state_file = gnc_state_get_current ();
947 
948  ENTER(" ");
949  priv = GNC_TREE_VIEW_GET_PRIVATE(view);
950  if (!priv->state_section)
951  {
952  LEAVE("no state section");
953  return;
954  }
955 
956  g_key_file_remove_group (state_file, priv->state_section, NULL);
957  g_free(priv->state_section);
958  priv->state_section = NULL;
959  LEAVE(" ");
960 }
#define ENTER(format, args...)
Definition: qoflog.h:261
GKeyFile * gnc_state_get_current(void)
Definition: gnc-state.c:252
#define LEAVE(format, args...)
Definition: qoflog.h:271
void gnc_tree_view_save_state ( GncTreeView view)

This function is called to write the treeview's state information (column visibility, width, sorting order,..) to the state file.

Parameters
viewThe tree view.

Definition at line 1086 of file gnc-tree-view.c.

1087 {
1088  GncTreeViewPrivate *priv;
1089 
1090  ENTER("view %p", view);
1091  g_return_if_fail (view != NULL);
1092  g_return_if_fail (GNC_IS_TREE_VIEW (view));
1093 
1094  priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1095 
1096  if (priv->state_section)
1097  {
1098  /* Save state. Only store non-default values when possible. */
1099  GList *column_list, *tmp;
1100  GKeyFile *state_file = gnc_state_get_current();
1101  gsize num_cols = 0;
1102  gchar *sort_column = gnc_tree_view_get_sort_column (view);
1103  gchar *sort_order = gnc_tree_view_get_sort_order (view);
1104  gchar **col_order = gnc_tree_view_get_column_order (view, &num_cols);
1105 
1106  /* Default sort column is the first column */
1107  if (sort_column &&
1108  (gnc_tree_view_find_column_by_name (view, sort_column) !=
1109  gtk_tree_view_get_column (GTK_TREE_VIEW (view), 0)))
1110  g_key_file_set_string (state_file, priv->state_section, STATE_KEY_SORT_COLUMN, sort_column);
1111  else if (g_key_file_has_key (state_file, priv->state_section, STATE_KEY_SORT_COLUMN, NULL))
1112  g_key_file_remove_key (state_file, priv->state_section, STATE_KEY_SORT_COLUMN, NULL);
1113  g_free (sort_column);
1114 
1115 
1116  /* Default sort order is "ascending" */
1117  if (g_strcmp0 (sort_order, "descending") == 0)
1118  g_key_file_set_string (state_file, priv->state_section, STATE_KEY_SORT_ORDER, sort_order);
1119  else if (g_key_file_has_key (state_file, priv->state_section, STATE_KEY_SORT_ORDER, NULL))
1120  g_key_file_remove_key (state_file, priv->state_section, STATE_KEY_SORT_ORDER, NULL);
1121  g_free (sort_order);
1122 
1123  if (col_order && (num_cols > 0))
1124  g_key_file_set_string_list (state_file, priv->state_section, STATE_KEY_COLUMN_ORDER,
1125  (const gchar**) col_order, num_cols);
1126  else if (g_key_file_has_key (state_file, priv->state_section, STATE_KEY_COLUMN_ORDER, NULL))
1127  g_key_file_remove_key (state_file, priv->state_section, STATE_KEY_COLUMN_ORDER, NULL);
1128 
1129 
1130  // ENTER("view %p, wanted %s", view, wanted);
1131  column_list = gtk_tree_view_get_columns (GTK_TREE_VIEW (view));
1132  for (tmp = column_list; tmp; tmp = g_list_next (tmp))
1133  {
1134  GtkTreeViewColumn *column = tmp->data;
1135  gchar *key=NULL;
1136  const gchar *name = g_object_get_data (G_OBJECT (column), PREF_NAME);
1137  if (!name)
1138  continue;
1139 
1140  if (!g_object_get_data (G_OBJECT (column), ALWAYS_VISIBLE))
1141  {
1142  key = g_strjoin ("_", name, STATE_KEY_SUFF_VISIBLE, NULL);
1143  g_key_file_set_boolean (state_file, priv->state_section, key,
1144  gtk_tree_view_column_get_visible (column));
1145  g_free (key);
1146  }
1147 
1148  key = g_strjoin ("_", name, STATE_KEY_SUFF_WIDTH, NULL);
1149  if (g_object_get_data (G_OBJECT(column), "default-width") &&
1150  (GPOINTER_TO_INT((g_object_get_data (G_OBJECT(column), "default-width")))
1151  != gtk_tree_view_column_get_width (column)))
1152  {
1153  g_key_file_set_integer (state_file, priv->state_section, key,
1154  gtk_tree_view_column_get_width (column));
1155  }
1156  else if (g_key_file_has_key (state_file, priv->state_section, key, NULL))
1157  g_key_file_remove_key (state_file, priv->state_section, key, NULL);
1158  g_free (key);
1159  }
1160  g_list_free(column_list);
1161  }
1162 
1163  LEAVE(" ");
1164 }
GtkTreeViewColumn * gnc_tree_view_find_column_by_name(GncTreeView *view, const gchar *wanted)
#define ENTER(format, args...)
Definition: qoflog.h:261
GKeyFile * gnc_state_get_current(void)
Definition: gnc-state.c:252
#define LEAVE(format, args...)
Definition: qoflog.h:271
void gnc_tree_view_set_control_column_background ( GncTreeView view,
gint  column,
GtkTreeCellDataFunc  func 
)

This function links the cell backgrounds of the two control columns to a column in the model that has color strings or a cell data function that sets the "cell-background" property.

Parameters
viewThe tree view.
columnThe column in the model containing color strings.
funcThis is a cell data function that sets the "cell-background".

Definition at line 1449 of file gnc-tree-view.c.

1450 {
1451  GncTreeViewPrivate *priv;
1452 
1453  g_return_if_fail (GNC_IS_TREE_VIEW (view));
1454 
1455  ENTER("view %p, column %d, func %p", view, column, func);
1456  priv = GNC_TREE_VIEW_GET_PRIVATE (view);
1457 
1458  update_control_cell_renderers_background (view, priv->spacer_column, column, func);
1459  update_control_cell_renderers_background (view, priv->selection_column, column, func);
1460 
1461  LEAVE(" ");
1462 }
#define ENTER(format, args...)
Definition: qoflog.h:261
#define LEAVE(format, args...)
Definition: qoflog.h:271
void gnc_tree_view_set_show_column_menu ( GncTreeView view,
gboolean  visible 
)

This function is called to set the "show-column-menu" property on this view. This function has no visible effect if the "state-section" property has not been set.

Parameters
viewThe tree view.
visibleCreate the column selection menu if TRUE.

This function is called to set the "show-column-menu" property on this view. This function has no visible effect if the "state-section" property has not been set.

Parameters are defined in gnc-tree-view.h

Definition at line 1489 of file gnc-tree-view.c.

1491 {
1492  GncTreeViewPrivate *priv;
1493 
1494  g_return_if_fail(GNC_IS_TREE_VIEW(view));
1495 
1496  ENTER("view %p, show menu %d", view, visible);
1497  priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1498  priv->show_column_menu = visible;
1499  gnc_tree_view_build_column_menu(view);
1500  LEAVE(" ");
1501 }
#define ENTER(format, args...)
Definition: qoflog.h:261
#define LEAVE(format, args...)
Definition: qoflog.h:271
void gnc_tree_view_set_sort_user_data ( GncTreeView view,
GtkTreeModel *  s_model 
)

This allows the columns to be setup without the model connected

Parameters
viewThe tree view.
sortmodel.

Definition at line 1468 of file gnc-tree-view.c.

1469 {
1470  GncTreeViewPrivate *priv;
1471 
1472  g_return_if_fail (GNC_IS_TREE_VIEW (view));
1473 
1474  ENTER("view %p, sort_model %p", view, s_model);
1475  priv = GNC_TREE_VIEW_GET_PRIVATE (view);
1476 
1477  priv->sort_model = s_model;
1478  LEAVE(" ");
1479 }
#define ENTER(format, args...)
Definition: qoflog.h:261
#define LEAVE(format, args...)
Definition: qoflog.h:271
void gnc_tree_view_set_state_section ( GncTreeView view,
const gchar *  section 
)

This function is called to set up or remove an association between a saved state section and the display of a view. It will first remove any existing association, and then install the new one.

Note
This function currently marks the first column as autosized and all other columns as fixed size. This may change in the future. It must change if we want to take advantage of the "fixed row height" performance enhancements added to GtkTreeView in gtk-2.4
Parameters
viewThe tree view.
sectionLink the view to this saved state section. Use NULL to disconnect saved state association.

Set up or remove an association between a saved state section and the display of a view. It will first remove any existing association, and then install the new one. If the new section has state information, update the view with this information.

Parameters are defined in gnc-tree-view.h

Definition at line 970 of file gnc-tree-view.c.

972 {
973  GncTreeViewPrivate *priv;
974  GKeyFile *state_file;
975 
976  g_return_if_fail(GNC_IS_TREE_VIEW(view));
977 
978  ENTER("view %p, section %s", view, section);
979 
980  priv = GNC_TREE_VIEW_GET_PRIVATE(view);
981 
982  /* Drop any previous state section */
983  if (priv->state_section)
985 
986  if (!section)
987  {
988  LEAVE("cleared state section");
989  return;
990  }
991 
992  /* Catch changes in state. Propagate to view. */
993  priv->state_section = g_strdup(section);
994 
995  state_file = gnc_state_get_current ();
996  if (g_key_file_has_group (state_file, priv->state_section))
997  {
998  gsize num_keys, idx;
999  gchar **keys = g_key_file_get_keys (state_file, priv->state_section, &num_keys, NULL);
1000  for (idx = 0; idx < num_keys; idx++)
1001  {
1002  gchar *key = keys[idx];
1003  if (g_strcmp0 (key, STATE_KEY_SORT_COLUMN) == 0)
1004  {
1005  gnc_tree_view_set_sort_column (view,
1006  g_key_file_get_string (state_file, priv->state_section, key, NULL));
1007  }
1008  else if (g_strcmp0 (key, STATE_KEY_SORT_ORDER) == 0)
1009  {
1010  gnc_tree_view_set_sort_order (view,
1011  g_key_file_get_string (state_file, priv->state_section, key, NULL));
1012  }
1013  else if (g_strcmp0 (key, STATE_KEY_COLUMN_ORDER) == 0)
1014  {
1015  gsize length;
1016  gchar **columns = g_key_file_get_string_list (state_file, priv->state_section,
1017  key, &length, NULL);
1018  gnc_tree_view_set_column_order (view, columns, length);
1019  g_strfreev (columns);
1020  }
1021  else
1022  {
1023  /* Make a copy of the local part of the key so it can be split
1024  * into column name and key type */
1025  gboolean known = FALSE;
1026  gchar *column_name = g_strdup (key);
1027  gchar *type_name = g_strrstr (column_name, "_");
1028  *type_name++ = '\0';
1029 
1030  if (g_strcmp0 (type_name, STATE_KEY_SUFF_VISIBLE) == 0)
1031  {
1032  GtkTreeViewColumn *column = gnc_tree_view_find_column_by_name (view, column_name);
1033  if (column)
1034  {
1035  known = TRUE;
1036  if (!g_object_get_data (G_OBJECT (column), ALWAYS_VISIBLE))
1037  {
1038  gtk_tree_view_column_set_visible (column,
1039  g_key_file_get_boolean (state_file, priv->state_section, key, NULL));
1040  }
1041  }
1042  }
1043  else if (g_strcmp0 (type_name, STATE_KEY_SUFF_WIDTH) == 0)
1044  {
1045  gint width = g_key_file_get_integer (state_file, priv->state_section, key, NULL);
1046  GtkTreeViewColumn *column = gnc_tree_view_find_column_by_name (view, column_name);
1047  if (column)
1048  {
1049  known = TRUE;
1050  if (width && (width != gtk_tree_view_column_get_width (column)))
1051  {
1052  gtk_tree_view_column_set_fixed_width (column, width);
1053  }
1054  }
1055  }
1056  if (!known)
1057  DEBUG ("Ignored key %s", key);
1058 
1059  g_free (column_name);
1060  }
1061  }
1062  }
1063 
1064  /* Rebuild the column visibility menu */
1065  gnc_tree_view_build_column_menu (view);
1066  LEAVE ("set state section");
1067 }
#define DEBUG(format, args...)
Definition: qoflog.h:255
void gnc_tree_view_remove_state_information(GncTreeView *view)
GtkTreeViewColumn * gnc_tree_view_find_column_by_name(GncTreeView *view, const gchar *wanted)
#define ENTER(format, args...)
Definition: qoflog.h:261
GKeyFile * gnc_state_get_current(void)
Definition: gnc-state.c:252
#define LEAVE(format, args...)
Definition: qoflog.h:271
void gnc_ui_close_book ( QofBook book)

Create and run the dialog to close the book.

Parameters
bookThis parameter specifies the book whose data will be closed.

Definition at line 325 of file dialog-book-close.c.

326 {
327  struct CloseBookWindow *cbw;
328  GtkBuilder* builder;
329  GtkWidget* box;
330  GList* equity_list = NULL;
331 
332  g_return_if_fail(book);
333 
334  cbw = g_new0(struct CloseBookWindow, 1);
335  g_return_if_fail(cbw);
336  cbw->book = book;
337 
338  /* Open the dialog */
339  builder = gtk_builder_new();
340  gnc_builder_add_from_file (builder, "dialog-book-close.glade", "Close Book");
341  cbw->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "Close Book"));
342 
343  PINFO("Closed Book Window is %p, Dialog is %p", cbw, cbw->dialog);
344 
345  /* close date */
346  box = GTK_WIDGET(gtk_builder_get_object (builder, "date_box"));
347  cbw->close_date_widget = gnc_date_edit_new(gnc_time (NULL), FALSE, FALSE);
348  gtk_box_pack_start(GTK_BOX(box), cbw->close_date_widget, TRUE, TRUE, 0);
349 
350  /* income acct */
351  equity_list = g_list_prepend(equity_list, GINT_TO_POINTER(ACCT_TYPE_EQUITY));
352  box = GTK_WIDGET(gtk_builder_get_object (builder, "income_acct_box"));
353  cbw->income_acct_widget = gnc_account_sel_new();
354  gnc_account_sel_set_acct_filters(GNC_ACCOUNT_SEL(cbw->income_acct_widget),
355  equity_list, NULL);
356  gnc_account_sel_set_new_account_ability(GNC_ACCOUNT_SEL(cbw->income_acct_widget), TRUE);
357  gtk_box_pack_start(GTK_BOX(box), cbw->income_acct_widget, TRUE, TRUE, 0);
358 
359  /* expense acct */
360  box = GTK_WIDGET(gtk_builder_get_object (builder, "expense_acct_box"));
361  cbw->expense_acct_widget = gnc_account_sel_new();
362  gnc_account_sel_set_acct_filters(GNC_ACCOUNT_SEL(cbw->expense_acct_widget),
363  equity_list, NULL);
364  gnc_account_sel_set_new_account_ability(GNC_ACCOUNT_SEL(cbw->expense_acct_widget), TRUE);
365  gtk_box_pack_start(GTK_BOX(box), cbw->expense_acct_widget, TRUE, TRUE, 0);
366 
367  /* desc */
368  cbw->desc_widget = GTK_WIDGET(gtk_builder_get_object (builder, "desc_entry"));
369 
370  /* Autoconnect signals */
371  gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, cbw->dialog);
372 
373  /* Register dialog with component manager */
374  cbw->component_manager_id =
375  gnc_register_gui_component(DIALOG_BOOK_CLOSE_CM_CLASS, NULL, close_handler,
376  cbw->dialog);
377  gnc_gui_component_set_session(cbw->component_manager_id,
378  gnc_get_current_session());
379  g_signal_connect(cbw->dialog, "destroy", G_CALLBACK(destroy_cb), NULL);
380 
381  /* Clean up the data structure when the dialog is destroyed */
382  g_object_set_data_full(G_OBJECT(cbw->dialog), "CloseBookWindow", cbw, g_free);
383 
384  g_object_unref(G_OBJECT(builder));
385 
386  /* Run the dialog */
387  gtk_widget_show_all(cbw->dialog);
388 
389  g_list_free(equity_list);
390 }
#define PINFO(format, args...)
Definition: qoflog.h:249
time64 gnc_time(time64 *tbuf)
get the current local time

Variable Documentation

const gchar* end_strings[GNC_ACCOUNTING_PERIOD_LAST]
Initial value:
=
{
N_("Today"),
N_("End of this month"),
N_("End of previous month"),
N_("End of this quarter"),
N_("End of previous quarter"),
N_("End of this year"),
N_("End of previous year"),
N_("End of this accounting period"),
N_("End of previous accounting period"),
}

Definition at line 83 of file gnc-period-select.c.

const gchar* start_strings[GNC_ACCOUNTING_PERIOD_LAST]
Initial value:
=
{
N_("Today"),
N_("Start of this month"),
N_("Start of previous month"),
N_("Start of this quarter"),
N_("Start of previous quarter"),
N_("Start of this year"),
N_("Start of previous year"),
N_("Start of this accounting period"),
N_("Start of previous accounting period"),
}

Definition at line 67 of file gnc-period-select.c.