GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-period-select.c
Go to the documentation of this file.
1 /*
2  * gnc-period-select.c -- Accounting Period selection widget
3  *
4  * Copyright (c) 2005 David Hampton <[email protected]>
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 [email protected]
23  */
24 
32 #include "config.h"
33 
34 #include <gtk/gtk.h>
35 #include <glib/gi18n.h>
36 
37 #include "gnc-date.h"
38 #include "gnc-period-select.h"
39 #include "gnc-prefs.h"
40 #include <gnc-gdate-utils.h>
41 
42 enum
43 {
44  PROP_0,
45  PROP_FY_END,
46  PROP_SHOW_DATE,
47  PROP_DATE_BASE,
48  PROP_PS_ACTIVE,
49 };
50 
51 enum
52 {
53  CHANGED,
54  LAST_SIGNAL
55 };
56 
57 static guint signals[LAST_SIGNAL] = { 0 };
58 
60 static void gnc_period_select_init (GncPeriodSelect *gce);
61 static void gnc_period_select_class_init (GncPeriodSelectClass *klass);
62 static void gnc_period_select_finalize (GObject *object);
63 
64 static GtkComboBoxClass *parent_class;
65 
66 
67 const gchar *start_strings[GNC_ACCOUNTING_PERIOD_LAST] =
68 {
69  /* CY Strings */
70  N_("Today"),
71  N_("Start of this month"),
72  N_("Start of previous month"),
73  N_("Start of this quarter"),
74  N_("Start of previous quarter"),
75  N_("Start of this year"),
76  N_("Start of previous year"),
77 
78  /* FY Strings */
79  N_("Start of this accounting period"),
80  N_("Start of previous accounting period"),
81 };
82 
83 const gchar *end_strings[GNC_ACCOUNTING_PERIOD_LAST] =
84 {
85  /* CY Strings */
86  N_("Today"),
87  N_("End of this month"),
88  N_("End of previous month"),
89  N_("End of this quarter"),
90  N_("End of previous quarter"),
91  N_("End of this year"),
92  N_("End of previous year"),
93 
94  /* FY Strings */
95  N_("End of this accounting period"),
96  N_("End of previous accounting period"),
97 };
98 
99 
104 {
105  GtkWidget *selector;
106 
107  gboolean start;
108  GDate *fy_end;
109 
110  GDate *date_base;
111  GtkWidget *date_label;
112  GtkWidget *date_align;
113 };
114 
115 #define GNC_PERIOD_SELECT_GET_PRIVATE(o) \
116  (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PERIOD_SELECT, GncPeriodSelectPrivate))
117 
118 
119 /************************************************************/
120 /* Signal Functions */
121 /************************************************************/
122 
123 /* Tells a GncPeriodSelect object to emit a "changed" signal.
124  */
125 static void
126 gnc_period_select_changed (GncPeriodSelect *period)
127 {
128  g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
129 
130  g_signal_emit(G_OBJECT(period), signals[CHANGED], 0);
131 }
132 
133 
139 static void
140 gnc_period_sample_update_date_label (GncPeriodSelect *period)
141 {
143  gchar time_string[MAX_DATE_LENGTH];
144  GDate *date;
145  GncAccountingPeriod which;
146 
147  g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
148  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
149  if (!priv->date_label)
150  return;
151  which = gtk_combo_box_get_active (GTK_COMBO_BOX (priv->selector));
152  if (which == -1)
153  date = g_date_new_dmy (31, 7, 2013);
154 
155  else if (priv->start)
156  date = gnc_accounting_period_start_gdate (which, priv->fy_end,
157  priv->date_base);
158  else
159  date = gnc_accounting_period_end_gdate (which, priv->fy_end,
160  priv->date_base);
161  qof_print_gdate (time_string, MAX_DATE_LENGTH, date);
162  gtk_label_set_label (GTK_LABEL(priv->date_label), time_string);
163  g_date_free (date);
164 }
165 
166 
176 static void
177 gnc_period_sample_combobox_changed (GtkComboBox *box, GncPeriodSelect *period)
178 {
179  g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
180 
181  g_object_set (G_OBJECT (period),
182  "active",
183  gtk_combo_box_get_active (box),
184  NULL);
185 }
186 
187 
200 static void
201 gnc_period_sample_new_date_format (gpointer prefs, gchar *pref,
202  GncPeriodSelect *period)
203 {
204  gnc_period_sample_update_date_label(period);
205 }
206 
207 
208 /************************************************************/
209 /* Property Functions */
210 /************************************************************/
211 
212 /* Set an item in the GncPeriodSelect to be the active one.
213  * This will first update the internal GtkCombobox (blocking
214  * its "changed" callback to prevent an infinite loop).
215  * Then it will update the sample label and finally it will
216  * emit a "changed" signal of it's own for other objects
217  * listening for this signal.
218  */
219 static void
220 gnc_period_select_set_active_internal (GncPeriodSelect *period,
221  GncAccountingPeriod which)
222 {
224 
225  g_return_if_fail(period != NULL);
226  g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
227  g_return_if_fail(which >= 0);
228  g_return_if_fail(which < GNC_ACCOUNTING_PERIOD_LAST);
229 
230  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
231 
232  g_signal_handlers_block_by_func(G_OBJECT(period),
233  G_CALLBACK(gnc_period_sample_combobox_changed), period);
234  gtk_combo_box_set_active(GTK_COMBO_BOX(priv->selector), which);
235  g_signal_handlers_unblock_by_func(G_OBJECT(period),
236  G_CALLBACK(gnc_period_sample_combobox_changed), period);
237 
238  /* Update this widget */
239  gnc_period_sample_update_date_label(period);
240 
241  /* Pass it on... */
242  gnc_period_select_changed(period);
243 }
244 
245 
249 /* Get the current value of the fiscal year end setting from a
250  * GncPeriodSelect widget. If the result is NULL then fiscal years
251  * are not currently supported.
252  */
253 GDate *
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 }
269 
270 
271 /* Set the fiscal year end on a GncPeriodSelect widget. If set to a
272  * value other than NULL then widget will include fiscal accounting
273  * period like "this fiscal year".
274  */
275 void
276 gnc_period_select_set_fy_end (GncPeriodSelect *period, const GDate *fy_end)
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 }
316 
317 
318 static void
319 gnc_period_select_set_date_common (GncPeriodSelect *period, const GDate *date)
320 {
322 
323  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
324  if (date)
325  {
326  if (priv->date_base)
327  g_date_free(priv->date_base);
328  priv->date_base = g_date_new_dmy(g_date_get_day(date),
329  g_date_get_month(date),
330  g_date_get_year(date));
331  if (priv->date_label == NULL)
332  {
333  priv->date_align = gtk_alignment_new(0.5, 0.5, 0, 0);
334  gtk_alignment_set_padding(GTK_ALIGNMENT(priv->date_align), 0, 0, 6, 0);
335  gtk_box_pack_start(GTK_BOX(period), priv->date_align, TRUE, TRUE, 0);
336  priv->date_label = gtk_label_new("");
337  gtk_container_add(GTK_CONTAINER(priv->date_align), priv->date_label);
338  gtk_widget_show_all(priv->date_align);
339  }
340  gnc_period_sample_update_date_label(period);
341  return;
342  }
343 
344  if (priv->date_base)
345  {
346  g_date_free(priv->date_base);
347  priv->date_base = NULL;
348  gtk_widget_destroy(priv->date_align);
349  priv->date_align = NULL;
350  priv->date_label = NULL;
351  }
352 }
353 
354 
355 /* Get the current value of the "show date" setting from a
356  * GncPeriodSelect widget.
357  */
358 gboolean
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 }
369 
370 /* Set the "show date" setting on a GncPeriodSelect widget. If set
371  * to TRUE then a GtkLabel will be used to show the date
372  * corresponding to the selected time period.
373  */
374 void
375 gnc_period_select_set_show_date (GncPeriodSelect *period, const gboolean show_date)
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 }
393 
394 
395 GDate *
396 gnc_period_select_get_date_base (GncPeriodSelect *period)
397 {
399 
400  g_return_val_if_fail(period != NULL, NULL);
401  g_return_val_if_fail(GNC_IS_PERIOD_SELECT(period), NULL);
402 
403  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
404  if (!priv->date_base)
405  return NULL;
406  return g_date_new_dmy(g_date_get_day(priv->date_base),
407  g_date_get_month(priv->date_base),
408  g_date_get_year(priv->date_base));
409 }
410 
411 
412 /* Set the base date used by a GncPeriodSelect widget. All example
413  * dates presented by the widget will be computed from this date.
414  */
415 void
416 gnc_period_select_set_date_base (GncPeriodSelect *period, const GDate *date_base)
417 {
418  g_return_if_fail(period != NULL);
419  g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
420 
421  gnc_period_select_set_date_common(period, date_base);
422 }
423 
424 
432 static void
433 gnc_period_select_get_property (GObject *object,
434  guint prop_id,
435  GValue *value,
436  GParamSpec *pspec)
437 {
438  GncPeriodSelect *period = GNC_PERIOD_SELECT(object);
439 
440  switch (prop_id)
441  {
442  case PROP_FY_END:
443  g_value_set_pointer(value, gnc_period_select_get_fy_end(period));
444  break;
445  case PROP_SHOW_DATE:
446  g_value_set_boolean(value, gnc_period_select_get_show_date(period));
447  break;
448  case PROP_DATE_BASE:
449  g_value_set_pointer(value, gnc_period_select_get_date_base(period));
450  break;
451  case PROP_PS_ACTIVE:
452  g_value_set_int(value, gnc_period_select_get_active(period));
453  break;
454  default:
455  G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
456  break;
457  }
458 }
459 
460 
469 static void
470 gnc_period_select_set_property (GObject *object,
471  guint prop_id,
472  const GValue *value,
473  GParamSpec *pspec)
474 {
475  GncPeriodSelect *period = GNC_PERIOD_SELECT(object);
476 
477  switch (prop_id)
478  {
479  case PROP_FY_END:
480  gnc_period_select_set_fy_end(period, g_value_get_pointer(value));
481  break;
482  case PROP_SHOW_DATE:
483  gnc_period_select_set_show_date(period, g_value_get_boolean(value));
484  break;
485  case PROP_DATE_BASE:
486  gnc_period_select_set_date_base(period, g_value_get_pointer(value));
487  break;
488  case PROP_PS_ACTIVE:
489  gnc_period_select_set_active_internal(period, g_value_get_int(value));
490  break;
491  default:
492  G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
493  break;
494  }
495 }
496 
499 /************************************************************/
500 /* Core Implementation */
501 /************************************************************/
502 
506 /* Returns the GType of a GncPeriodSelect widget.
507  */
508 GType
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 }
536 
537 
547 static void
548 gnc_period_select_class_init (GncPeriodSelectClass *klass)
549 {
550  GObjectClass *gobject_class;
551 
552  parent_class = g_type_class_peek_parent(klass);
553 
554  gobject_class = G_OBJECT_CLASS(klass);
555  gobject_class->set_property = gnc_period_select_set_property;
556  gobject_class->get_property = gnc_period_select_get_property;
557  gobject_class->finalize = gnc_period_select_finalize;
558 
559 
560  signals[CHANGED] = g_signal_new("changed",
561  G_OBJECT_CLASS_TYPE (klass),
562  G_SIGNAL_RUN_FIRST,
563  G_STRUCT_OFFSET(GncPeriodSelectClass, changed),
564  NULL, NULL,
565  g_cclosure_marshal_VOID__VOID,
566  G_TYPE_NONE,
567  0);
568 
569 
570  g_object_class_install_property(gobject_class,
571  PROP_FY_END,
572  g_param_spec_pointer("fy-end",
573  "Fiscal Year End",
574  "The fiscal year to use for this widget",
575  G_PARAM_READWRITE));
576  g_object_class_install_property(gobject_class,
577  PROP_SHOW_DATE,
578  g_param_spec_boolean("show-date",
579  "Show Date",
580  "Show the start/end date of the accounting period in this widget",
581  FALSE,
582  G_PARAM_READWRITE));
583  g_object_class_install_property(gobject_class,
584  PROP_DATE_BASE,
585  g_param_spec_pointer("date-base",
586  "Date Base",
587  "The starting date to use for display calculations",
588  G_PARAM_READWRITE));
589  g_object_class_install_property(gobject_class,
590  PROP_PS_ACTIVE,
591  g_param_spec_int("active",
592  "Active period",
593  "The currently selected period in the list of periods",
594  -1,
595  G_MAXINT,
596  0,
597  G_PARAM_READWRITE));
598 
599  g_type_class_add_private(klass, sizeof(GncPeriodSelectPrivate));
600 }
601 
602 
611 static void
612 gnc_period_select_init (GncPeriodSelect *period)
613 {
615 
616  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
617  priv->start = TRUE;
618 }
619 
620 
631 static void
632 gnc_period_select_finalize (GObject *object)
633 {
635  GncPeriodSelect *period;
636 
637  g_return_if_fail (object != NULL);
638  g_return_if_fail (GNC_IS_PERIOD_SELECT (object));
639 
640  period = GNC_PERIOD_SELECT(object);
641  priv = GNC_PERIOD_SELECT_GET_PRIVATE(period);
642 
643  /* Stop tracking changes to date formatting */
644  gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_DATE_FORMAT,
645  gnc_period_sample_new_date_format, period);
646 
647  /* The selector and date_label were added to the hbox. They will be
648  * freed automatically. */
649  if (priv->fy_end)
650  g_date_free(priv->fy_end);
651  if (priv->date_base)
652  g_date_free(priv->date_base);
653 
654  /* Do not free the private data structure. It is part of a larger
655  * memory block allocated by the type system. */
656 
657  if (G_OBJECT_CLASS(parent_class)->finalize)
658  (* G_OBJECT_CLASS(parent_class)->finalize) (object);
659 }
660 
661 
662 /* Create a new GncPeriodSelect widget which is used to select a
663  * accounting period like "previous month" or "this year".
664  *
665  * @param starting_labels If set to TRUE then all the labels will
666  * refer to the "Start of...". If FALSE, labels will refer to "End
667  * of...".
668  *
669  * @return A GncPeriodSelect widget.
670  */
671 GtkWidget *
672 gnc_period_select_new (gboolean starting_labels)
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 }
707 
708 
709 /* Create a new GncPeriodSelect widget from a glade file. The int1
710  * argument passed from glade is used to determine whether the widget
711  * uses labels for start times or end times. A non-zero int2
712  * argument indicates that an example date should be shown.
713  */
714 GtkWidget *
715 gnc_period_select_new_glade (gchar *widget_name,
716  gchar *string1, gchar *string2,
717  gint int1, gint int2)
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 }
726 
729 /************************************************************/
730 /* Auxiliary Functions */
731 /************************************************************/
732 
733 
734 /* Set which item in the GncPeriodSelect is initially selected. This
735  * is used to set the initial selection before the widget is shown to
736  * the user.
737  */
738 void
740  GncAccountingPeriod which)
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 }
749 
750 
751 /* Get the currently selected accounting period from a
752  * GncPeriodSelect widget. This is used to retrieve the user's
753  * selection in the form of an enum.
754  */
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 }
766 
767 
768 /* Get the currently selected accounting period choice from a
769  * GncPeriodSelect widget. This is used to retrieve the user's
770  * selection in the form of a GDate.
771  */
772 GDate *
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 }
792 
Date and Time handling routines.
gulong gnc_prefs_register_cb(const char *group, const gchar *pref_name, gpointer func, gpointer user_data)
Definition: gnc-prefs.c:128
GncAccountingPeriod gnc_period_select_get_active(GncPeriodSelect *period)
void gnc_period_select_set_show_date(GncPeriodSelect *period, const gboolean show_date)
GDate * gnc_period_select_get_date(GncPeriodSelect *period)
GType gnc_period_select_get_type(void)
GncAccountingPeriod
GDate * gnc_period_select_get_fy_end(GncPeriodSelect *period)
void gnc_period_select_set_fy_end(GncPeriodSelect *period, const GDate *fy_end)
#define MAX_DATE_LENGTH
Definition: gnc-date.h:106
Generic api to store and retrieve preferences.
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 helper routines.
gboolean gnc_period_select_get_show_date(GncPeriodSelect *period)
GtkWidget * gnc_period_select_new_glade(gchar *widget_name, gchar *string1, gchar *string2, gint int1, gint int2)
time64 gnc_time(time64 *tbuf)
get the current local time
GtkWidget * gnc_period_select_new(gboolean starting_labels)
void gnc_period_select_set_active(GncPeriodSelect *period, GncAccountingPeriod which)
A custom widget for selecting accounting periods.
size_t qof_print_gdate(char *buf, size_t bufflen, const GDate *gd)
void gnc_gdate_set_time64(GDate *gd, time64 time)
void gnc_prefs_remove_cb_by_func(const gchar *group, const gchar *pref_name, gpointer func, gpointer user_data)
Definition: gnc-prefs.c:148