GnuCash c935c2f+
Loading...
Searching...
No Matches
Modules | Files | Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
GUI

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

Modules

 Window/Plugin Structure
 
 Dialogs
 
 Assistants
 
 Utility functions for the GnuCash GUI
 
 Auto-complete typed user input.
 QuickFill is meant to be used by the GUI to auto-complete (e.g.
 
 Creating and editing accounts in the GUI
 
 Commodity windows
 
 Options Dialog
 
 GncCurrencyEdit
 
 Gnome-specific GUI handling.
 
 GUIUtility
 
 GnuCash Tree Model
 
 GncTreeView
 
 Reports
 
 Registers, Ledgers and Journals
 

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
 This file contains the functions to present a GUI to select a book closing date and accounts into which to close the Income and Expense accounts.
 
file  dialog-file-access.h
 This file contains the functions to present a GUI to select a file or a database connection.
 
file  dialog-object-references.h
 This file contains the functions to present a dialog box with a list of object references and an explanation that these objects must be modified to not refer to another specific object so that that object may be deleted.
 
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  _GncPeriodSelect
 Private Data Structure. More...
 
struct  _GncTreeViewClass
 

Macros

#define GNC_TYPE_PERIOD_SELECT   (gnc_period_select_get_type())
 
#define GNC_TYPE_TREE_VIEW_SX_LIST   (gnc_tree_view_sx_list_get_type ())
 
#define GNC_TYPE_TREE_VIEW   (gnc_tree_view_get_type ())
 
#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 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
}
 This specifies a time interval. More...
 
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, GtkWindow *parent)
 Create and run the dialog to close the book.
 
void gnc_ui_file_access_for_open (GtkWindow *parent)
 
void gnc_ui_file_access_for_save_as (GtkWindow *parent)
 
void gnc_ui_file_access_for_export (GtkWindow *parent)
 
void gnc_ui_object_references_show (const gchar *explanation, GList *objlist)
 
 GncOptionsDialog::GncOptionsDialog (const char *title, GtkWindow *parent)
 
 GncOptionsDialog::GncOptionsDialog (bool modal, const char *title, const char *component_class, GtkWindow *parent)
 Constructs a GncOptionsDialog.
 
 GncOptionsDialog::GncOptionsDialog (const GncOptionsDialog &)=default
 
 GncOptionsDialog::GncOptionsDialog (GncOptionsDialog &&)=default
 
GtkWidget * GncOptionsDialog::get_widget () const noexcept
 
GtkWidget * GncOptionsDialog::get_page_list () const noexcept
 
GtkWidget * GncOptionsDialog::get_page_list_view () const noexcept
 
GtkWidget * GncOptionsDialog::get_notebook () const noexcept
 
GncOptionDBGncOptionsDialog::get_option_db () noexcept
 
void GncOptionsDialog::build_contents (GncOptionDB *odb)
 
void GncOptionsDialog::build_contents (GncOptionDB *odb, bool show_dialog)
 Populate the dialog's notebook with the contents of odb.
 
void GncOptionsDialog::set_sensitive (bool sensitive) noexcept
 
void GncOptionsDialog::changed () noexcept
 
void GncOptionsDialog::set_apply_cb (GncOptionsDialogCallback, void *cb_data) noexcept
 
void GncOptionsDialog::call_apply_cb () noexcept
 
void GncOptionsDialog::set_help_cb (GncOptionsDialogCallback, void *cb_data) noexcept
 
void GncOptionsDialog::call_help_cb () noexcept
 
void GncOptionsDialog::set_close_cb (GncOptionsDialogCallback, void *cb_data) noexcept
 
void GncOptionsDialog::call_close_cb () noexcept
 
void GncOptionsDialog::set_book_help_cb () noexcept
 
void GncOptionsDialog::call_book_help_cb () noexcept
 
void GncOptionsDialog::set_style_sheet_help_cb () noexcept
 
void GncOptionsDialog::call_style_sheet_help_cb () noexcept
 
void gnc_period_select_set_active (GncPeriodSelect *period, GncAccountingPeriod which)
 Set which item in the GncPeriodSelect is initially selected.
 
GncAccountingPeriod gnc_period_select_get_active (GncPeriodSelect *period)
 Get the currently selected accounting period from a GncPeriodSelect widget.
 
GDate * gnc_period_select_get_date (GncPeriodSelect *period)
 Get the currently selected accounting period choice from a GncPeriodSelect widget.
 
 G_DECLARE_FINAL_TYPE (GncTreeViewSxList, gnc_tree_view_sx_list, GNC, TREE_VIEW_SX_LIST, GncTreeView) GtkTreeView *gnc_tree_view_sx_list_new(GncSxInstanceModel *sx_instances)
 
SchedXaction * gnc_tree_view_sx_list_get_sx_from_path (GncTreeViewSxList *view, GtkTreePath *path)
 

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)
 This function returns the starting date for an accounting period.
 
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.
 

GncPeriodSelect Core Implementation

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".
 
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.
 

GncPeriodSelect Properties

GDate * gnc_period_select_get_fy_end (GncPeriodSelect *period)
 Get the current value of the fiscal year end setting from a GncPeriodSelect widget.
 
void gnc_period_select_set_fy_end (GncPeriodSelect *period, const GDate *fy_end)
 Set the fiscal year end on a GncPeriodSelect widget.
 
gboolean gnc_period_select_get_show_date (GncPeriodSelect *period)
 Get the current value of the "show sample" setting from a GncPeriodSelect widget.
 
void gnc_period_select_set_show_date (GncPeriodSelect *period, const gboolean show_date)
 Set the "show sample" setting on a GncPeriodSelect widget.
 
GDate * gnc_period_select_get_date_base (GncPeriodSelect *period)
 
void gnc_period_select_set_date_base (GncPeriodSelect *period, const GDate *date_base)
 

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)
 This function adds a new toggle column to a GncTreeView base view.
 
GtkTreeViewColumn * gnc_tree_view_add_text_column (GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *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.
 
GtkTreeViewColumn * gnc_tree_view_add_text_view_column (GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *icon_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn)
 This function adds a new text view column to a GncTreeView base view.
 
GtkTreeViewColumn * gnc_tree_view_add_pix_column (GncTreeView *view, const gchar *column_title, const gchar *pref_name, const gchar *sizing_text, gint model_data_column, gint model_visibility_column, GtkTreeIterCompareFunc column_sort_fn)
 This function adds a pixbuf view column to a GncTreeView base view.
 
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.
 
gint gnc_tree_view_append_column (GncTreeView *view, GtkTreeViewColumn *column)
 Add a column to a view based upon a GncTreeView.
 

Tree View Properties

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.
 
GtkTreeViewColumn * gnc_tree_view_find_column_by_name (GncTreeView *view, const gchar *wanted)
 Find a tree column given the "pref name".
 
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.
 
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.
 
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,..).
 
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.
 
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.
 
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.
 
void gnc_tree_view_set_sort_user_data (GncTreeView *view, GtkTreeModel *s_model)
 This allows the columns to be setup without the model connected.
 
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.
 
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.
 
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.
 
void gnc_tree_view_keynav (GncTreeView *view, GtkTreeViewColumn **col, GtkTreePath *path, GdkEventKey *event)
 
gboolean gnc_tree_view_path_is_valid (GncTreeView *view, GtkTreePath *path)
 
void gnc_tree_view_set_editing_started_cb (GncTreeView *view, GFunc editing_started_cb, gpointer editing_cb_data)
 Setup a callback for when the user starts editing so appropriate actions can be taken like disable the actions delete menu option.
 
void gnc_tree_view_set_editing_finished_cb (GncTreeView *view, GFunc editing_finished_cb, gpointer editing_cb_data)
 Setup a callback for when the user finishes editing so appropriate actions can be taken like enable the actions delete menu option.
 

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

Macro Definition Documentation

◆ ALWAYS_VISIBLE

#define ALWAYS_VISIBLE   "always-visible"

Definition at line 74 of file gnc-tree-view.h.

◆ DEFAULT_VISIBLE

#define DEFAULT_VISIBLE   "default-visible"

Definition at line 79 of file gnc-tree-view.h.

◆ GNC_TREE_VIEW_COLUMN_COLOR_NONE

#define GNC_TREE_VIEW_COLUMN_COLOR_NONE   -1

Definition at line 82 of file gnc-tree-view.h.

◆ GNC_TREE_VIEW_COLUMN_DATA_NONE

#define GNC_TREE_VIEW_COLUMN_DATA_NONE   -1

Definition at line 81 of file gnc-tree-view.h.

◆ GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS

#define GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS   -1

Definition at line 83 of file gnc-tree-view.h.

◆ GNC_TREE_VIEW_NAME

#define GNC_TREE_VIEW_NAME   "GncTreeView"

Definition at line 43 of file gnc-tree-view.h.

◆ GNC_TYPE_PERIOD_SELECT

#define GNC_TYPE_PERIOD_SELECT   (gnc_period_select_get_type())

Definition at line 39 of file gnc-period-select.h.

◆ GNC_TYPE_TREE_VIEW

#define GNC_TYPE_TREE_VIEW   (gnc_tree_view_get_type ())

Definition at line 40 of file gnc-tree-view.h.

◆ GNC_TYPE_TREE_VIEW_SX_LIST

#define GNC_TYPE_TREE_VIEW_SX_LIST   (gnc_tree_view_sx_list_get_type ())

Definition at line 41 of file gnc-tree-view-sx-list.h.

◆ MODEL_COLUMN

#define MODEL_COLUMN   "model_column"

Definition at line 63 of file gnc-tree-view.h.

◆ PREF_NAME

#define PREF_NAME   "pref-name"

Definition at line 70 of file gnc-tree-view.h.

◆ REAL_TITLE

#define REAL_TITLE   "real_title"

Definition at line 66 of file gnc-tree-view.h.

Typedef Documentation

◆ renderer_toggled

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

Definition at line 86 of file gnc-tree-view.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

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

43{
44 PROP_0,
45 PROP_FY_END,
46 PROP_SHOW_DATE,
47 PROP_DATE_BASE,
48 PROP_PS_ACTIVE,
49};

◆ anonymous enum

anonymous enum

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

52{
53 CHANGED,
54 LAST_SIGNAL
55};

◆ GncAccountingPeriod

This specifies a time interval.

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

58{
59 GNC_ACCOUNTING_PERIOD_INVALID = -1, //Force Clang to use a signed enum
60 GNC_ACCOUNTING_PERIOD_TODAY,
61 GNC_ACCOUNTING_PERIOD_MONTH,
62 GNC_ACCOUNTING_PERIOD_MONTH_PREV,
63 GNC_ACCOUNTING_PERIOD_QUARTER,
64 GNC_ACCOUNTING_PERIOD_QUARTER_PREV,
65 GNC_ACCOUNTING_PERIOD_CYEAR,
66 GNC_ACCOUNTING_PERIOD_CYEAR_PREV,
67 GNC_ACCOUNTING_PERIOD_CYEAR_LAST,
68
69 GNC_ACCOUNTING_PERIOD_FYEAR = GNC_ACCOUNTING_PERIOD_CYEAR_LAST,
70 GNC_ACCOUNTING_PERIOD_FYEAR_PREV,
71 GNC_ACCOUNTING_PERIOD_FYEAR_LAST,
72 GNC_ACCOUNTING_PERIOD_LAST = GNC_ACCOUNTING_PERIOD_FYEAR_LAST,
GncAccountingPeriod
This specifies a time interval.

Function Documentation

◆ build_contents() [1/2]

void GncOptionsDialog::build_contents ( GncOptionDB odb)
inline

Definition at line 87 of file dialog-options.hpp.

87 {
88 build_contents(odb, true); }

◆ build_contents() [2/2]

void GncOptionsDialog::build_contents ( GncOptionDB odb,
bool  show_dialog 
)

Populate the dialog's notebook with the contents of odb.

Parameters
odb- option database to use *
show_dialog- should dialog be made visible or not *

Definition at line 336 of file dialog-options.cpp.

337{
338 gint default_page = -1;
339
340 g_return_if_fail (odb != NULL);
341
342 m_option_db = odb;
343
344 auto default_section = odb->get_default_section();
345
346 PINFO("Default Section name is %s",
347 default_section ? default_section->get_name().c_str() : "NULL");
348
349 odb->foreach_section(
350 [this, default_section, &default_page]
351 (GncOptionSectionPtr& section) {
352 auto page = dialog_append_page(this, section);
353 if (default_section && section.get() == default_section)
354 default_page = page;
355 });
356
357 gtk_notebook_popup_enable(GTK_NOTEBOOK(m_notebook));
358 if (default_page >= 0)
359 {
360 /* Find the page list and set the selection to the default page */
361 auto selection{gtk_tree_view_get_selection(GTK_TREE_VIEW(m_page_list_view))};
362 GtkTreeIter iter;
363
364 auto model{gtk_tree_view_get_model(GTK_TREE_VIEW(m_page_list_view))};
365 gtk_tree_model_iter_nth_child(model, &iter, NULL, default_page);
366 gtk_tree_selection_select_iter (selection, &iter);
367 gtk_notebook_set_current_page(GTK_NOTEBOOK(m_notebook), default_page);
368 }
369 dialog_changed_internal(m_window, FALSE);
370 if (show_dialog)
371 gtk_widget_show(m_window);
372}
#define PINFO(format, args...)
Print an informational note.
Definition qoflog.h:256

◆ call_apply_cb()

void GncOptionsDialog::call_apply_cb ( )
noexcept

Definition at line 374 of file dialog-options.cpp.

375{
376 auto close_cb = m_close_cb;
377
378 m_close_cb = nullptr;
379 if (m_apply_cb)
380 (m_apply_cb)(this, m_apply_cb_data);
381 m_close_cb = close_cb;
382 set_sensitive(false);
383}

◆ call_book_help_cb()

void GncOptionsDialog::call_book_help_cb ( )
noexcept

Definition at line 404 of file dialog-options.cpp.

405{
406/* if (m_book_options_help_cb)
407 (m_book_options_help_cb)(this, m_book_options_help_cb_data);
408*/
409}

◆ call_close_cb()

void GncOptionsDialog::call_close_cb ( )
noexcept

Definition at line 391 of file dialog-options.cpp.

392{
393 if (m_close_cb)
394 {
395 gtk_window_close(GTK_WINDOW(m_window));
396 (m_close_cb)(this, m_close_cb_data);
397 }
398 else
399 {
400 gtk_widget_hide(m_window);
401 }
402}

◆ call_help_cb()

void GncOptionsDialog::call_help_cb ( )
noexcept

Definition at line 385 of file dialog-options.cpp.

386{
387 if (m_help_cb)
388 (m_help_cb)(this, m_help_cb_data);
389}

◆ call_style_sheet_help_cb()

void GncOptionsDialog::call_style_sheet_help_cb ( )
noexcept

Definition at line 411 of file dialog-options.cpp.

412{
413/*
414 if (m_style_sheet_help_cb)
415 (m_style_shet_help_cb)(this, m_style_sheet_help_cb_data);
416*/
417}

◆ changed()

void GncOptionsDialog::changed ( )
noexcept

Definition at line 118 of file dialog-options.cpp.

119{
120 set_sensitive(true);
121}

◆ get_notebook()

GtkWidget * GncOptionsDialog::get_notebook ( ) const
inlinenoexcept

Definition at line 85 of file dialog-options.hpp.

85{ return m_notebook; }

◆ get_option_db()

GncOptionDB * GncOptionsDialog::get_option_db ( )
inlinenoexcept

Definition at line 86 of file dialog-options.hpp.

86{ return m_option_db; }

◆ get_page_list()

GtkWidget * GncOptionsDialog::get_page_list ( ) const
inlinenoexcept

Definition at line 83 of file dialog-options.hpp.

83{ return m_page_list; }

◆ get_page_list_view()

GtkWidget * GncOptionsDialog::get_page_list_view ( ) const
inlinenoexcept

Definition at line 84 of file dialog-options.hpp.

84{ return m_page_list_view; }

◆ get_widget()

GtkWidget * GncOptionsDialog::get_widget ( ) const
inlinenoexcept

Definition at line 82 of file dialog-options.hpp.

82{ return m_window; }

◆ gnc_accounting_period_end_gdate()

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 229 of file gnc-accounting-period.c.

232{
233 GDate *date;
234
235 if (contains)
236 {
237 date = g_date_new_dmy (g_date_get_day (contains),
238 g_date_get_month (contains),
239 g_date_get_year (contains));
240 }
241 else
242 {
243 date = g_date_new ();
244 gnc_gdate_set_today (date);
245 }
246
247 switch (which)
248 {
249 default:
250 PINFO ("Undefined relative time constant %d", which);
251 g_date_free (date);
252 return 0;
253
254 case GNC_ACCOUNTING_PERIOD_TODAY:
255 /* Already have today's date */
256 break;
257
258 case GNC_ACCOUNTING_PERIOD_MONTH:
260 break;
261
262 case GNC_ACCOUNTING_PERIOD_MONTH_PREV:
264 break;
265
266 case GNC_ACCOUNTING_PERIOD_QUARTER:
268 break;
269
270 case GNC_ACCOUNTING_PERIOD_QUARTER_PREV:
272 break;
273
274 case GNC_ACCOUNTING_PERIOD_CYEAR:
276 break;
277
278 case GNC_ACCOUNTING_PERIOD_CYEAR_PREV:
280 break;
281
282 case GNC_ACCOUNTING_PERIOD_FYEAR:
283 if (fy_end == NULL)
284 {
285 PINFO ("Request for fisal year value but no fiscal year end value provided.");
286 g_date_free (date);
287 return 0;
288 }
289 gnc_gdate_set_fiscal_year_end (date, fy_end);
290 break;
291
292 case GNC_ACCOUNTING_PERIOD_FYEAR_PREV:
293 if (fy_end == NULL)
294 {
295 PINFO ("Request for fisal year value but no fiscal year end value provided.");
296 g_date_free (date);
297 return 0;
298 }
300 break;
301 }
302
303 return date;
304}
void gnc_gdate_set_prev_year_end(GDate *date)
This function modifies a GDate to set it to the last day of the year prior to the one in which it fal...
void gnc_gdate_set_year_end(GDate *date)
This function modifies a GDate to set it to the last day of the year in which it falls.
void gnc_gdate_set_prev_month_end(GDate *date)
Convert a GDate to the last day of the prebvious month.
void gnc_gdate_set_quarter_end(GDate *date)
This function modifies a GDate to set it to the last day of the quarter in which it falls.
void gnc_gdate_set_prev_quarter_end(GDate *date)
This function modifies a GDate to set it to the last day of the quarter prior to the one in which it ...
void gnc_gdate_set_today(GDate *gd)
Set a GDate to the current day.
void gnc_gdate_set_month_end(GDate *date)
Convert a GDate to the last day of the month.
void gnc_gdate_set_fiscal_year_end(GDate *date, const GDate *fy_end)
This function modifies a GDate to set it to the last day of the fiscal year in which it falls.
void gnc_gdate_set_prev_fiscal_year_end(GDate *date, const GDate *fy_end)
This function modifies a GDate to set it to the last day of the fiscal year prior to the one in which...

◆ gnc_accounting_period_fiscal_end()

time64 gnc_accounting_period_fiscal_end ( void  )

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

124{
125 time64 t;
126 GDate *fy_end = get_fy_end();
127
128 t = lookup_end_date_option (fy_end);
129 if (fy_end)
130 g_date_free (fy_end);
131 return t;
132}
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
Definition gnc-date.h:87

◆ gnc_accounting_period_fiscal_start()

time64 gnc_accounting_period_fiscal_start ( void  )

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

113{
114 time64 t;
115 GDate *fy_end = get_fy_end();
116 t = lookup_start_date_option (fy_end);
117 if (fy_end)
118 g_date_free (fy_end);
119 return t;
120}

◆ gnc_accounting_period_start_gdate()

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 135 of file gnc-accounting-period.c.

138{
139 GDate *date;
140
141 if (contains)
142 {
143 date = g_date_new_dmy (g_date_get_day (contains),
144 g_date_get_month (contains),
145 g_date_get_year (contains));
146 }
147 else
148 {
149 date = g_date_new ();
150 gnc_gdate_set_today (date);
151 }
152
153 switch (which)
154 {
155 default:
156 PINFO ("Undefined relative time constant %d", which);
157 g_date_free (date);
158 return NULL;
159
160 case GNC_ACCOUNTING_PERIOD_TODAY:
161 /* Already have today's date */
162 break;
163
164 case GNC_ACCOUNTING_PERIOD_MONTH:
166 break;
167
168 case GNC_ACCOUNTING_PERIOD_MONTH_PREV:
170 break;
171
172 case GNC_ACCOUNTING_PERIOD_QUARTER:
174 break;
175
176 case GNC_ACCOUNTING_PERIOD_QUARTER_PREV:
178 break;
179
180 case GNC_ACCOUNTING_PERIOD_CYEAR:
182 break;
183
184 case GNC_ACCOUNTING_PERIOD_CYEAR_PREV:
186 break;
187
188 case GNC_ACCOUNTING_PERIOD_FYEAR:
189 if (fy_end == NULL)
190 {
191 PINFO ("Request for fiscal year value but no fiscal year end value provided.");
192 g_date_free (date);
193 return NULL;
194 }
195 gnc_gdate_set_fiscal_year_start (date, fy_end);
196 break;
197
198 case GNC_ACCOUNTING_PERIOD_FYEAR_PREV:
199 if (fy_end == NULL)
200 {
201 PINFO ("Request for fiscal year value but no fiscal year end value provided.");
202 g_date_free (date);
203 return NULL;
204 }
206 break;
207 }
208 return date;
209}
void gnc_gdate_set_year_start(GDate *date)
This function modifies a GDate to set it to the first day of the year in which it falls.
void gnc_gdate_set_prev_year_start(GDate *date)
This function modifies a GDate to set it to the first day of the year prior to the one in which it fa...
void gnc_gdate_set_quarter_start(GDate *date)
This function modifies a GDate to set it to the first day of the quarter in which it falls.
void gnc_gdate_set_fiscal_year_start(GDate *date, const GDate *fy_end)
This function modifies a GDate to set it to the first day of the fiscal year in which it falls.
void gnc_gdate_set_month_start(GDate *date)
This function modifies a GDate to set it to the first day of the month in which it falls.
void gnc_gdate_set_prev_fiscal_year_start(GDate *date, const GDate *fy_end)
This function modifies a GDate to set it to the first day of the fiscal year prior to the one in whic...
void gnc_gdate_set_prev_quarter_start(GDate *date)
This function modifies a GDate to set it to the first day of the quarter prior to the one in which it...
void gnc_gdate_set_prev_month_start(GDate *date)
Convert a GDate to the first day of the prebvious month.

◆ gnc_period_select_get_active()

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 684 of file gnc-period-select.c.

685{
686 g_return_val_if_fail(period != NULL, -1);
687 g_return_val_if_fail(GNC_IS_PERIOD_SELECT(period), -1);
688
689 return gtk_combo_box_get_active(GTK_COMBO_BOX(period->selector));
690}

◆ gnc_period_select_get_date()

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 698 of file gnc-period-select.c.

699{
701
702 g_return_val_if_fail(period != NULL, 0);
703 g_return_val_if_fail(GNC_IS_PERIOD_SELECT(period), 0);
704
705 which = gtk_combo_box_get_active(GTK_COMBO_BOX(period->selector));
706 if (which == -1)
707 return NULL;
708
709 if (period->start)
710 return gnc_accounting_period_start_gdate(which, period->fy_end,
711 period->date_base);
712 return gnc_accounting_period_end_gdate(which, period->fy_end,
713 period->date_base);
714}
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.
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.

◆ gnc_period_select_get_date_base()

GDate * gnc_period_select_get_date_base ( GncPeriodSelect *  period)

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

368{
369 g_return_val_if_fail(period != NULL, NULL);
370 g_return_val_if_fail(GNC_IS_PERIOD_SELECT(period), NULL);
371
372 if (!period->date_base)
373 return NULL;
374 return g_date_new_dmy(g_date_get_day(period->date_base),
375 g_date_get_month(period->date_base),
376 g_date_get_year(period->date_base));
377}

◆ gnc_period_select_get_fy_end()

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 242 of file gnc-period-select.c.

243{
244 g_return_val_if_fail(period != NULL, NULL);
245 g_return_val_if_fail(GNC_IS_PERIOD_SELECT(period), NULL);
246
247 if (!period->fy_end)
248 return NULL;
249 return g_date_new_dmy(g_date_get_day(period->fy_end),
250 g_date_get_month(period->fy_end),
251 G_DATE_BAD_YEAR);
252}

◆ gnc_period_select_get_show_date()

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 333 of file gnc-period-select.c.

334{
335 g_return_val_if_fail(period != NULL, FALSE);
336 g_return_val_if_fail(GNC_IS_PERIOD_SELECT(period), FALSE);
337
338 return (period->date_base != NULL);
339}

◆ gnc_period_select_new()

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 602 of file gnc-period-select.c.

603{
604 GncPeriodSelect *period;
605 const gchar *label;
606 gint i;
607
608 period = g_object_new(GNC_TYPE_PERIOD_SELECT, NULL);
609
610 /* Set up private data structures */
611 period->selector = gtk_combo_box_text_new();
612 period->start = starting_labels;
613
614 /* Add the internal widgets to the hbox */
615 gtk_box_pack_start(GTK_BOX(period), period->selector, TRUE, TRUE, 0);
616 gtk_widget_show(period->selector);
617
618 /* Find out when the combo box changes */
619 g_signal_connect(G_OBJECT(period->selector), "changed",
620 G_CALLBACK(gnc_period_sample_combobox_changed), period);
621
622 /* Build all the labels except the fiscal year labels */
623 for (i = 0; i < GNC_ACCOUNTING_PERIOD_CYEAR_LAST; i++)
624 {
625 label = starting_labels ? _(start_strings[i]) : _(end_strings[i]);
626 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(period->selector), label);
627 }
628
629 /* Track changes to date formatting */
630 gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_DATE_FORMAT,
631 gnc_period_sample_new_date_format, period);
632
633 return GTK_WIDGET (period);
634}
gulong gnc_prefs_register_cb(const char *group, const gchar *pref_name, gpointer func, gpointer user_data)
Register a callback that gets triggered when the given preference changes.

◆ gnc_period_select_new_glade()

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 643 of file gnc-period-select.c.

646{
647 GtkWidget *widget;
648 widget = gnc_period_select_new(int1 != 0);
649 if (int2)
650 gnc_period_select_set_show_date(GNC_PERIOD_SELECT(widget), TRUE);
651 gtk_widget_show(widget);
652 return widget;
653}
void gnc_period_select_set_show_date(GncPeriodSelect *period, const gboolean show_date)
Set the "show sample" setting on a GncPeriodSelect widget.
GtkWidget * gnc_period_select_new(gboolean starting_labels)
Create a new GncPeriodSelect widget which is used to select a accounting period like "previous month"...

◆ gnc_period_select_set_active()

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 667 of file gnc-period-select.c.

669{
670 g_return_if_fail(period != NULL);
671 g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
672 g_return_if_fail(which >= 0);
673 g_return_if_fail(which < GNC_ACCOUNTING_PERIOD_LAST);
674
675 g_object_set (G_OBJECT (period), "active", which, NULL);
676}

◆ gnc_period_select_set_date_base()

void gnc_period_select_set_date_base ( GncPeriodSelect *  period,
const GDate *  date_base 
)

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

385{
386 g_return_if_fail(period != NULL);
387 g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
388
389 gnc_period_select_set_date_common(period, date_base);
390}

◆ gnc_period_select_set_fy_end()

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 260 of file gnc-period-select.c.

261{
262 const gchar *label;
263 gint i;
264
265 g_return_if_fail(period != NULL);
266 g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
267
268 if (period->fy_end)
269 g_date_free(period->fy_end);
270
271 if (fy_end)
272 {
273 period->fy_end = g_date_copy (fy_end);
274 }
275 else
276 {
277 period->fy_end = NULL;
278 }
279
280 if (fy_end)
281 {
282 for (i = GNC_ACCOUNTING_PERIOD_CYEAR_LAST; i < GNC_ACCOUNTING_PERIOD_FYEAR_LAST; i++)
283 {
284 label = period->start ? _(start_strings[i]) : _(end_strings[i]);
285 gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(period->selector), label);
286 }
287 }
288 else
289 {
290 for (i = GNC_ACCOUNTING_PERIOD_FYEAR_LAST - 1; i >= GNC_ACCOUNTING_PERIOD_FYEAR_LAST; i--)
291 {
292 gtk_combo_box_text_remove(GTK_COMBO_BOX_TEXT(period->selector), i);
293 }
294 }
295}

◆ gnc_period_select_set_show_date()

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 346 of file gnc-period-select.c.

347{
348 GDate date;
349
350 g_return_if_fail(period != NULL);
351 g_return_if_fail(GNC_IS_PERIOD_SELECT(period));
352
353 if (show_date)
354 {
355 g_date_clear(&date, 1);
356 gnc_gdate_set_time64(&date, gnc_time (NULL));
357 gnc_period_select_set_date_common(period, &date);
358 }
359 else
360 {
361 gnc_period_select_set_date_common(period, NULL);
362 }
363}
void gnc_gdate_set_time64(GDate *gd, time64 time)
Set a GDate to a time64.
time64 gnc_time(time64 *tbuf)
get the current time
Definition gnc-date.cpp:262

◆ gnc_tree_view_add_numeric_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.

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 2061 of file gnc-tree-view.c.

2069{
2070 GtkTreeViewColumn *column;
2071 GtkCellRenderer *renderer;
2072 gfloat alignment = 1.0;
2073
2074 /* Use GncCellRendererLabel so the user can click a cell and select
2075 * its text (e.g. to copy it to the clipboard), without being able
2076 * to modify the underlying data. */
2077 renderer = gnc_cell_renderer_label_new ();
2078 column = add_text_column_variant (view, renderer, column_title, pref_name,
2079 NULL, sizing_text, model_data_column,
2080 model_visibility_column, column_sort_fn);
2081
2082 /* Right align the column title and data for both ltr and rtl */
2083 if (gtk_widget_get_direction (GTK_WIDGET(view)) == GTK_TEXT_DIR_RTL)
2084 alignment = 0.0;
2085
2086 g_object_set (G_OBJECT(column), "alignment", alignment, NULL);
2087 g_object_set (G_OBJECT(renderer), "xalign", alignment, NULL);
2088
2089 /* Change the text color */
2090 if (model_color_column != GNC_TREE_VIEW_COLUMN_COLOR_NONE)
2091 gtk_tree_view_column_add_attribute (column, renderer,
2092 "foreground", model_color_column);
2093
2094 return column;
2095}

◆ gnc_tree_view_add_pix_column()

GtkTreeViewColumn * gnc_tree_view_add_pix_column ( GncTreeView *  view,
const gchar *  column_title,
const gchar *  pref_name,
const gchar *  sizing_text,
gint  model_data_column,
gint  model_visibility_column,
GtkTreeIterCompareFunc  column_sort_fn 
)

This function adds a pixbuf view 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.
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 "icon-name" 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 pixbuf view 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 1985 of file gnc-tree-view.c.

1992{
1993 GtkTreeViewColumn *column;
1994 PangoLayout* layout;
1995 int default_width, title_width;
1996 GtkCellRenderer *renderer;
1997
1998 g_return_val_if_fail (GNC_IS_TREE_VIEW(view), NULL);
1999
2000 renderer = gtk_cell_renderer_pixbuf_new ();
2001
2002 column = gtk_tree_view_column_new ();
2003 gtk_tree_view_column_set_title (column, column_title);
2004
2005 /* Set up a text renderer and attributes */
2006 gtk_tree_view_column_pack_start (column, renderer, TRUE);
2007
2008 /* Set renderer attributes controlled by the model */
2009 if (model_data_column != GNC_TREE_VIEW_COLUMN_DATA_NONE)
2010 gtk_tree_view_column_add_attribute (column, renderer,
2011 "icon-name", model_data_column);
2012 if (model_visibility_column != GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS)
2013 gtk_tree_view_column_add_attribute (column, renderer,
2014 "visible", model_visibility_column);
2015
2016 /* Default size is the larger of the column title and the sizing text */
2017 layout = gtk_widget_create_pango_layout (GTK_WIDGET(view), column_title);
2018 pango_layout_get_pixel_size (layout, &title_width, NULL);
2019 g_object_unref (layout);
2020 layout = gtk_widget_create_pango_layout (GTK_WIDGET(view), sizing_text);
2021 pango_layout_get_pixel_size (layout, &default_width, NULL);
2022 g_object_unref (layout);
2023 default_width = MAX(default_width, title_width);
2024 if (default_width)
2025 default_width += 10; /* padding on either side */
2026 gnc_tree_view_column_properties (view, column, pref_name, model_data_column,
2027 default_width, TRUE, column_sort_fn);
2028
2029 gnc_tree_view_append_column (view, column);
2030 return column;
2031}
gint gnc_tree_view_append_column(GncTreeView *view, GtkTreeViewColumn *column)
Add a column to a view based upon a GncTreeView.

◆ gnc_tree_view_add_text_column()

GtkTreeViewColumn * gnc_tree_view_add_text_column ( GncTreeView *  view,
const gchar *  column_title,
const gchar *  pref_name,
const gchar *  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.
icon_nameThe name of the 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 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.

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 1921 of file gnc-tree-view.c.

1929{
1930 GtkCellRenderer *renderer;
1931
1932 g_return_val_if_fail (GNC_IS_TREE_VIEW(view), NULL);
1933
1934 renderer = gtk_cell_renderer_text_new ();
1935
1936 return add_text_column_variant (view, renderer,
1937 column_title, pref_name,
1938 icon_name, sizing_text,
1939 model_data_column,
1940 model_visibility_column,
1941 column_sort_fn);
1942}

◆ gnc_tree_view_add_text_view_column()

GtkTreeViewColumn * gnc_tree_view_add_text_view_column ( GncTreeView *  view,
const gchar *  column_title,
const gchar *  pref_name,
const gchar *  icon_name,
const gchar *  sizing_text,
gint  model_data_column,
gint  model_visibility_column,
GtkTreeIterCompareFunc  column_sort_fn 
)

This function adds a new text view 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.
icon_nameThe name of the 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 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.

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 1953 of file gnc-tree-view.c.

1961{
1962 GtkCellRenderer *renderer;
1963
1964 g_return_val_if_fail (GNC_IS_TREE_VIEW(view), NULL);
1965
1966 renderer = gnc_cell_renderer_text_view_new ();
1967
1968 return add_text_column_variant (view, renderer,
1969 column_title, pref_name,
1970 icon_name, sizing_text,
1971 model_data_column,
1972 model_visibility_column,
1973 column_sort_fn);
1974}

◆ gnc_tree_view_add_toggle_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.

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 1768 of file gnc-tree-view.c.

1776{
1777 GtkTreeViewColumn *column;
1778 GtkCellRenderer *renderer;
1779
1780 g_return_val_if_fail (GNC_IS_TREE_VIEW(view), NULL);
1781
1782 renderer = gtk_cell_renderer_toggle_new ();
1783 if (!toggle_edited_cb)
1784 {
1785 gtk_cell_renderer_toggle_set_activatable (GTK_CELL_RENDERER_TOGGLE(renderer), FALSE);
1786 }
1787 column =
1788 gtk_tree_view_column_new_with_attributes (column_short_title,
1789 renderer,
1790 "active", model_data_column,
1791 NULL);
1792
1793 /* Add the full title to the object for menu creation */
1794 g_object_set_data_full (G_OBJECT(column), REAL_TITLE,
1795 g_strdup(column_title), g_free);
1796 if (toggle_edited_cb)
1797 g_signal_connect (G_OBJECT(renderer), "toggled",
1798 G_CALLBACK(toggle_edited_cb), view);
1799
1800 if (model_visibility_column != GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS)
1801 gtk_tree_view_column_add_attribute (column, renderer,
1802 "visible", model_visibility_column);
1803
1804
1805 gnc_tree_view_column_properties (view, column, pref_name, model_data_column,
1806 0, FALSE, column_sort_fn);
1807
1808 gnc_tree_view_append_column (view, column);
1809
1810 /* Also add the full title to the object as a tooltip */
1811 gtk_widget_set_tooltip_text (gtk_tree_view_column_get_button (column), column_title);
1812
1813 return column;
1814}

◆ gnc_tree_view_append_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.

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 2106 of file gnc-tree-view.c.

2108{
2109 int n = gtk_tree_view_get_n_columns (GTK_TREE_VIEW(view));
2110
2111 /* Ignore the initial column, the selection menu */
2112 if (n >= 1)
2113 n -= 1;
2114 return gtk_tree_view_insert_column (GTK_TREE_VIEW(view), column, n);
2115}

◆ gnc_tree_view_column_get_renderer()

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 2034 of file gnc-tree-view.c.

2035{
2036 GList *renderers;
2037 GtkCellRenderer *cr = NULL;
2038
2039 g_return_val_if_fail (GTK_TREE_VIEW_COLUMN(column), NULL);
2040
2041 /* Get the list of one renderer */
2042 renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT(column));
2043 if (g_list_length (renderers) > 0)
2044 cr = GTK_CELL_RENDERER(renderers->data);
2045 g_list_free (renderers);
2046
2047 return cr;
2048}

◆ gnc_tree_view_configure_columns()

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 1598 of file gnc-tree-view.c.

1599{
1600 GncTreeViewPrivate *priv;
1601 GtkTreeViewColumn *column;
1602 GList *columns;
1603 gboolean hide_menu_column;
1604
1605 g_return_if_fail (GNC_IS_TREE_VIEW(view));
1606
1607 ENTER(" ");
1608
1609 /* Update the view and saved state */
1610 columns = gtk_tree_view_get_columns (GTK_TREE_VIEW(view));
1611 g_list_foreach (columns, (GFunc)gnc_tree_view_update_visibility, view);
1612 g_list_free (columns);
1613
1614 priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1615 if (priv->state_section)
1616 priv->seen_state_visibility = TRUE;
1617
1618 /* If only the first column is visible, hide the spacer and make that
1619 * column expand. */
1620 hide_menu_column = (gnc_tree_view_count_visible_columns (view) == 1);
1621 column = gtk_tree_view_get_column (GTK_TREE_VIEW(view), 0);
1622 gtk_tree_view_column_set_expand (column, hide_menu_column);
1623 gtk_tree_view_column_set_visible (priv->column_menu_column, !hide_menu_column);
1624
1625 LEAVE(" ");
1626}
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition qoflog.h:282
#define ENTER(format, args...)
Print a function entry debugging message.
Definition qoflog.h:272
Private Data Structure.

◆ gnc_tree_view_expand_columns()

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 1433 of file gnc-tree-view.c.

1436{
1437 GtkTreeViewColumn *column;
1438 GList *columns, *tmp;
1439 gchar *name, *pref_name;
1440 va_list args;
1441
1442 g_return_if_fail (GNC_IS_TREE_VIEW(view));
1443 ENTER(" ");
1444 va_start (args, first_column_name);
1445 name = first_column_name;
1446
1447 /* First disable the expand property on all (non-infrastructure) columns. */
1448 columns = gtk_tree_view_get_columns (GTK_TREE_VIEW(view));
1449 for (tmp = columns; tmp; tmp = g_list_next (tmp))
1450 {
1451 column = tmp->data;
1452 pref_name = g_object_get_data (G_OBJECT(column), PREF_NAME);
1453 if (pref_name != NULL)
1454 gtk_tree_view_column_set_expand (column, FALSE);
1455 }
1456 g_list_free(columns);
1457
1458 /* Now enable it on the requested columns. */
1459 while (name != NULL)
1460 {
1461 column = gnc_tree_view_find_column_by_name (view, name);
1462 if (column != NULL)
1463 {
1464 gtk_tree_view_column_set_expand (column, TRUE);
1465 }
1466 name = va_arg (args, gchar*);
1467 }
1468 va_end (args);
1469
1470 LEAVE(" ");
1471}
GtkTreeViewColumn * gnc_tree_view_find_column_by_name(GncTreeView *view, const gchar *wanted)
Find a tree column given the "pref name" used with saved state.

◆ gnc_tree_view_find_column_by_name()

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".

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 538 of file gnc-tree-view.c.

540{
541 GtkTreeViewColumn *column, *found = NULL;
542 GList *column_list, *tmp;
543 const gchar *name;
544
545 // ENTER("view %p, wanted %s", view, wanted);
546 column_list = gtk_tree_view_get_columns(GTK_TREE_VIEW(view));
547 for (tmp = column_list; tmp; tmp = g_list_next (tmp))
548 {
549 column = tmp->data;
550 name = g_object_get_data (G_OBJECT(column), PREF_NAME);
551 if (!name || (strcmp(name, wanted) != 0))
552 continue;
553 found = column;
554 break;
555 }
556 g_list_free (column_list);
557
558 // LEAVE("column %p", found);
559 return found;
560}

◆ gnc_tree_view_get_show_column_menu()

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.

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 1562 of file gnc-tree-view.c.

1563{
1564 GncTreeViewPrivate *priv;
1565
1566 g_return_val_if_fail (GNC_IS_TREE_VIEW(view), FALSE);
1567
1568 priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1569 return (priv->show_column_menu);
1570}

◆ gnc_tree_view_get_state_section()

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.

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(); i.e. a string like "dialogs/edit_prices".

Parameters are defined in gnc-tree-view.h

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

1125{
1126 GncTreeViewPrivate *priv;
1127
1128 g_return_val_if_fail (GNC_IS_TREE_VIEW(view), NULL);
1129
1130 priv = GNC_TREE_VIEW_GET_PRIVATE (view);
1131 return priv->state_section;
1132}

◆ gnc_tree_view_keynav()

void gnc_tree_view_keynav ( GncTreeView *  view,
GtkTreeViewColumn **  col,
GtkTreePath *  path,
GdkEventKey *  event 
)

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

2164{
2165 GtkTreeView *tv = GTK_TREE_VIEW(view);
2166 gint depth;
2167 gboolean shifted;
2168
2169 if (event->type != GDK_KEY_PRESS) return;
2170
2171 switch (event->keyval)
2172 {
2173 case GDK_KEY_Tab:
2174 case GDK_KEY_ISO_Left_Tab:
2175 case GDK_KEY_KP_Tab:
2176 shifted = event->state & GDK_SHIFT_MASK;
2177 if (get_column_next_to (tv, col, shifted))
2178 {
2179 /* This is the end (or beginning) of the line, buddy. */
2180 depth = gtk_tree_path_get_depth (path);
2181 if (shifted)
2182 {
2183 if (!gtk_tree_path_prev (path) && depth > 1)
2184 {
2185 gtk_tree_path_up (path);
2186 }
2187 }
2188 else if (gtk_tree_view_row_expanded (tv, path))
2189 {
2190 gtk_tree_path_down (path);
2191 }
2192 else
2193 {
2194 gtk_tree_path_next (path);
2195 if (!gnc_tree_view_path_is_valid (view, path) && depth > 2)
2196 {
2197 gtk_tree_path_prev (path);
2198 gtk_tree_path_up (path);
2199 gtk_tree_path_next (path);
2200 }
2201 if (!gnc_tree_view_path_is_valid (view, path) && depth > 1)
2202 {
2203 gtk_tree_path_prev (path);
2204 gtk_tree_path_up (path);
2205 gtk_tree_path_next (path);
2206 }
2207 }
2208 }
2209 break;
2210
2211 case GDK_KEY_Return:
2212 case GDK_KEY_KP_Enter:
2213 if (gtk_tree_view_row_expanded (tv, path))
2214 {
2215 gtk_tree_path_down (path);
2216 }
2217 else
2218 {
2219 depth = gtk_tree_path_get_depth (path);
2220 gtk_tree_path_next (path);
2221 if (!gnc_tree_view_path_is_valid (view, path) && depth > 1)
2222 {
2223 gtk_tree_path_prev (path);
2224 gtk_tree_path_up (path);
2225 gtk_tree_path_next (path);
2226 }
2227 }
2228 break;
2229 }
2230 return;
2231}

◆ gnc_tree_view_path_is_valid()

gboolean gnc_tree_view_path_is_valid ( GncTreeView *  view,
GtkTreePath *  path 
)

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

2152{
2153 GtkTreeView *tv = GTK_TREE_VIEW(view);
2154 GtkTreeModel *s_model;
2155 GtkTreeIter iter;
2156
2157 s_model = gtk_tree_view_get_model (tv);
2158 return gtk_tree_model_get_iter (s_model, &iter, path);
2159}

◆ gnc_tree_view_remove_state_information()

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.

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.

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

983{
984 GncTreeViewPrivate *priv;
985 GKeyFile *state_file = gnc_state_get_current ();
986
987 ENTER(" ");
988 priv = GNC_TREE_VIEW_GET_PRIVATE(view);
989 if (!priv->state_section)
990 {
991 LEAVE("no state section");
992 return;
993 }
994
995 g_key_file_remove_group (state_file, priv->state_section, NULL);
996 g_free (priv->state_section);
997 priv->state_section = NULL;
998 LEAVE(" ");
999}
GKeyFile * gnc_state_get_current(void)
Returns a pointer to the most recently loaded state.
Definition gnc-state.c:248

◆ gnc_tree_view_save_state()

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 1134 of file gnc-tree-view.c.

1135{
1136 GncTreeViewPrivate *priv;
1137
1138 ENTER("view %p", view);
1139 g_return_if_fail (view != NULL);
1140 g_return_if_fail (GNC_IS_TREE_VIEW(view));
1141
1142 priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1143
1144 if (priv->state_section)
1145 {
1146 /* Save state. Only store non-default values when possible. */
1147 GList *column_list, *tmp;
1148 GKeyFile *state_file = gnc_state_get_current();
1149 gsize num_cols = 0;
1150 gchar *sort_column = gnc_tree_view_get_sort_column (view);
1151 gchar *sort_order = gnc_tree_view_get_sort_order (view);
1152 gchar **col_order = gnc_tree_view_get_column_order (view, &num_cols);
1153
1154 /* Default sort column is the name column */
1155 if (sort_column && (g_strcmp0 (sort_column, "name") != 0))
1156 g_key_file_set_string (state_file, priv->state_section, STATE_KEY_SORT_COLUMN, sort_column);
1157 else if (g_key_file_has_key (state_file, priv->state_section, STATE_KEY_SORT_COLUMN, NULL))
1158 g_key_file_remove_key (state_file, priv->state_section, STATE_KEY_SORT_COLUMN, NULL);
1159 g_free (sort_column);
1160
1161
1162 /* Default sort order is "ascending" */
1163 if (g_strcmp0 (sort_order, "descending") == 0)
1164 g_key_file_set_string (state_file, priv->state_section, STATE_KEY_SORT_ORDER, sort_order);
1165 else if (g_key_file_has_key (state_file, priv->state_section, STATE_KEY_SORT_ORDER, NULL))
1166 g_key_file_remove_key (state_file, priv->state_section, STATE_KEY_SORT_ORDER, NULL);
1167 g_free (sort_order);
1168
1169 if (col_order && (num_cols > 0))
1170 g_key_file_set_string_list (state_file, priv->state_section, STATE_KEY_COLUMN_ORDER,
1171 (const gchar**) col_order, num_cols);
1172 else if (g_key_file_has_key (state_file, priv->state_section, STATE_KEY_COLUMN_ORDER, NULL))
1173 g_key_file_remove_key (state_file, priv->state_section, STATE_KEY_COLUMN_ORDER, NULL);
1174
1175 g_strfreev (col_order);
1176
1177
1178 // ENTER("view %p, wanted %s", view, wanted);
1179 column_list = gtk_tree_view_get_columns (GTK_TREE_VIEW(view));
1180 for (tmp = column_list; tmp; tmp = g_list_next (tmp))
1181 {
1182 GtkTreeViewColumn *column = tmp->data;
1183 gchar *key=NULL;
1184 const gchar *name = g_object_get_data (G_OBJECT(column), PREF_NAME);
1185 if (!name)
1186 continue;
1187
1188 if (!g_object_get_data (G_OBJECT(column), ALWAYS_VISIBLE))
1189 {
1190 key = g_strjoin ("_", name, STATE_KEY_SUFF_VISIBLE, NULL);
1191 g_key_file_set_boolean (state_file, priv->state_section, key,
1192 gtk_tree_view_column_get_visible (column));
1193 g_free (key);
1194 }
1195
1196 key = g_strjoin ("_", name, STATE_KEY_SUFF_WIDTH, NULL);
1197 if (g_object_get_data (G_OBJECT(column), "default-width") &&
1198 (GPOINTER_TO_INT((g_object_get_data (G_OBJECT(column), "default-width")))
1199 != gtk_tree_view_column_get_width (column)))
1200 {
1201 g_key_file_set_integer (state_file, priv->state_section, key,
1202 gtk_tree_view_column_get_width (column));
1203 }
1204 else if (g_key_file_has_key (state_file, priv->state_section, key, NULL))
1205 g_key_file_remove_key (state_file, priv->state_section, key, NULL);
1206 g_free (key);
1207 }
1208 g_list_free (column_list);
1209 }
1210
1211 LEAVE(" ");
1212}

◆ gnc_tree_view_set_control_column_background()

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 1502 of file gnc-tree-view.c.

1503{
1504 GncTreeViewPrivate *priv;
1505
1506 g_return_if_fail (GNC_IS_TREE_VIEW(view));
1507
1508 ENTER("view %p, column %d, func %p", view, column, func);
1509 priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1510
1511 update_control_cell_renderers_background (view, priv->column_menu_column, column, func);
1512
1513 LEAVE(" ");
1514}

◆ gnc_tree_view_set_editing_finished_cb()

void gnc_tree_view_set_editing_finished_cb ( GncTreeView *  view,
GFunc  editing_finished_cb,
gpointer  editing_cb_data 
)

Setup a callback for when the user finishes editing so appropriate actions can be taken like enable the actions delete menu option.

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

2249{
2250 GncTreeViewPrivate *priv;
2251
2252 if (!view && !editing_finished_cb)
2253 return;
2254
2255 priv = GNC_TREE_VIEW_GET_PRIVATE(view);
2256
2257 priv->editing_finished_cb = editing_finished_cb;
2258 priv->editing_cb_data = editing_cb_data;
2259}

◆ gnc_tree_view_set_editing_started_cb()

void gnc_tree_view_set_editing_started_cb ( GncTreeView *  view,
GFunc  editing_started_cb,
gpointer  editing_cb_data 
)

Setup a callback for when the user starts editing so appropriate actions can be taken like disable the actions delete menu option.

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

2235{
2236 GncTreeViewPrivate *priv;
2237
2238 if (!view && !editing_started_cb)
2239 return;
2240
2241 priv = GNC_TREE_VIEW_GET_PRIVATE(view);
2242
2243 priv->editing_started_cb = editing_started_cb;
2244 priv->editing_cb_data = editing_cb_data;
2245}

◆ gnc_tree_view_set_show_column_menu()

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 has no visible effect if the "state-section" property has not been set.

Parameters are defined in gnc-tree-view.h

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

1543{
1544 GncTreeViewPrivate *priv;
1545
1546 g_return_if_fail (GNC_IS_TREE_VIEW(view));
1547
1548 ENTER("view %p, show menu %d", view, visible);
1549 priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1550 priv->show_column_menu = visible;
1551 gnc_tree_view_build_column_menu (view);
1552 LEAVE(" ");
1553}

◆ gnc_tree_view_set_sort_user_data()

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 1520 of file gnc-tree-view.c.

1521{
1522 GncTreeViewPrivate *priv;
1523
1524 g_return_if_fail (GNC_IS_TREE_VIEW(view));
1525
1526 ENTER("view %p, sort_model %p", view, s_model);
1527 priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1528
1529 priv->sort_model = s_model;
1530 LEAVE(" ");
1531}

◆ gnc_tree_view_set_state_section()

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.

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. If the new section has state information, update the view with this information.

Parameters are defined in gnc-tree-view.h

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

1011{
1012 GncTreeViewPrivate *priv;
1013 GKeyFile *state_file;
1014
1015 g_return_if_fail (GNC_IS_TREE_VIEW(view));
1016
1017 ENTER("view %p, section %s", view, section);
1018
1019 priv = GNC_TREE_VIEW_GET_PRIVATE(view);
1020
1021 /* Drop any previous state section */
1022 if (priv->state_section)
1024
1025 if (!section)
1026 {
1027 LEAVE("cleared state section");
1028 return;
1029 }
1030
1031 /* Catch changes in state. Propagate to view. */
1032 priv->state_section = g_strdup (section);
1033
1034 state_file = gnc_state_get_current ();
1035 if (g_key_file_has_group (state_file, priv->state_section))
1036 {
1037 gsize num_keys, idx;
1038 gchar **keys = g_key_file_get_keys (state_file, priv->state_section, &num_keys, NULL);
1039 for (idx = 0; idx < num_keys; idx++)
1040 {
1041 gchar *key = keys[idx];
1042 if (g_strcmp0 (key, STATE_KEY_SORT_COLUMN) == 0)
1043 {
1044 gchar *name = g_key_file_get_string (state_file, priv->state_section,
1045 key, NULL);
1046 gnc_tree_view_set_sort_column (view, name);
1047 g_free (name);
1048 }
1049 else if (g_strcmp0 (key, STATE_KEY_SORT_ORDER) == 0)
1050 {
1051 gchar *name = g_key_file_get_string (state_file, priv->state_section,
1052 key, NULL);
1053 gnc_tree_view_set_sort_order (view, name);
1054 g_free (name);
1055 }
1056 else if (g_strcmp0 (key, STATE_KEY_COLUMN_ORDER) == 0)
1057 {
1058 gsize length;
1059 gchar **columns = g_key_file_get_string_list (state_file, priv->state_section,
1060 key, &length, NULL);
1061 gnc_tree_view_set_column_order (view, columns, length);
1062 g_strfreev (columns);
1063 }
1064 else
1065 {
1066 /* Make a copy of the local part of the key so it can be split
1067 * into column name and key type */
1068 gboolean known = FALSE;
1069 gchar *column_name = g_strdup (key);
1070 gchar *type_name = g_strrstr (column_name, "_");
1071
1072 if (type_name != NULL) //guard against not finding '_'
1073 {
1074 *type_name++ = '\0';
1075
1076 if (g_strcmp0 (type_name, STATE_KEY_SUFF_VISIBLE) == 0)
1077 {
1078 GtkTreeViewColumn *column = gnc_tree_view_find_column_by_name (view, column_name);
1079 if (column)
1080 {
1081 known = TRUE;
1082 if (!g_object_get_data (G_OBJECT (column), ALWAYS_VISIBLE))
1083 {
1084 gtk_tree_view_column_set_visible (column,
1085 g_key_file_get_boolean (state_file, priv->state_section, key, NULL));
1086 }
1087 }
1088 }
1089 else if (g_strcmp0 (type_name, STATE_KEY_SUFF_WIDTH) == 0)
1090 {
1091 gint width = g_key_file_get_integer (state_file, priv->state_section, key, NULL);
1092 GtkTreeViewColumn *column = gnc_tree_view_find_column_by_name (view, column_name);
1093 if (column)
1094 {
1095 known = TRUE;
1096 if (width && (width != gtk_tree_view_column_get_width (column)))
1097 {
1098 gtk_tree_view_column_set_fixed_width (column, width);
1099 }
1100 }
1101 }
1102 if (!known)
1103 DEBUG ("Ignored key %s", key);
1104
1105 g_free (column_name);
1106 }
1107 }
1108 }
1109 g_strfreev (keys);
1110 }
1111
1112 /* Rebuild the column visibility menu */
1113 gnc_tree_view_build_column_menu (view);
1114 LEAVE ("set state section");
1115}
void gnc_tree_view_remove_state_information(GncTreeView *view)
Completely wipe the treeview's state information (column visibility, width, sorting order,...
#define DEBUG(format, args...)
Print a debugging message.
Definition qoflog.h:264

◆ gnc_tree_view_sx_list_get_sx_from_path()

SchedXaction * gnc_tree_view_sx_list_get_sx_from_path ( GncTreeViewSxList *  view,
GtkTreePath *  path 
)

Definition at line 242 of file gnc-tree-view-sx-list.c.

243{
244 GtkTreeIter iter;
245 gtk_tree_model_get_iter (GTK_TREE_MODEL(view->tree_model), &iter, path);
246 return gnc_sx_list_tree_model_adapter_get_sx_instances(
247 GNC_SX_LIST_TREE_MODEL_ADAPTER(view->tree_model), &iter)->sx;
248}

◆ gnc_ui_close_book()

void gnc_ui_close_book ( QofBook book,
GtkWindow *  parent 
)

Create and run the dialog to close the book.

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

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

319{
320 struct CloseBookWindow *cbw;
321 GtkBuilder* builder;
322 GtkWidget* box;
323 GList* equity_list = NULL;
324
325 g_return_if_fail(book);
326
327 cbw = g_new0(struct CloseBookWindow, 1);
328 g_return_if_fail(cbw);
329 cbw->book = book;
330
331 /* Open the dialog */
332 builder = gtk_builder_new();
333 gnc_builder_add_from_file (builder, "dialog-book-close.glade", "close_book_dialog");
334 cbw->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "close_book_dialog"));
335
336 // Set the name for this dialog so it can be easily manipulated with css
337 gtk_widget_set_name (GTK_WIDGET(cbw->dialog), "gnc-id-book-close");
338
339 /* parent */
340 if (parent != NULL)
341 gtk_window_set_transient_for (GTK_WINDOW(cbw->dialog), GTK_WINDOW(parent));
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}

◆ gnc_ui_file_access_for_export()

void gnc_ui_file_access_for_export ( GtkWindow *  parent)

Definition at line 515 of file dialog-file-access.c.

516{
517 gnc_ui_file_access (parent, FILE_ACCESS_EXPORT);
518}

◆ gnc_ui_file_access_for_open()

void gnc_ui_file_access_for_open ( GtkWindow *  parent)

Definition at line 501 of file dialog-file-access.c.

502{
503 gnc_ui_file_access (parent, FILE_ACCESS_OPEN);
504}

◆ gnc_ui_file_access_for_save_as()

void gnc_ui_file_access_for_save_as ( GtkWindow *  parent)

Definition at line 508 of file dialog-file-access.c.

509{
510 gnc_ui_file_access (parent, FILE_ACCESS_SAVE_AS);
511}

◆ gnc_ui_object_references_show()

void gnc_ui_object_references_show ( const gchar *  explanation,
GList *  objlist 
)

Definition at line 38 of file dialog-object-references.c.

39{
40 GtkWidget* dialog;
41 GtkBuilder* builder;
42 GtkWidget* box;
43 GList* node;
44 GtkLabel* explanation;
45 GtkListStore* store;
46 GtkWidget* listview;
47 GtkTreeViewColumn* column;
48 GtkCellRenderer* renderer;
49
50 ENTER("");
51
52 /* Open the dialog */
53 builder = gtk_builder_new();
54 gnc_builder_add_from_file (builder, "dialog-object-references.glade", "object_references_dialog" );
55 dialog = GTK_WIDGET(gtk_builder_get_object (builder, "object_references_dialog" ));
56
57 // Set the name for this dialog so it can be easily manipulated with css
58 gtk_widget_set_name (GTK_WIDGET(dialog), "gnc-id-object-reference");
59
60 explanation = GTK_LABEL(gtk_builder_get_object (builder, "lbl_explanation" ));
61 gtk_label_set_text( explanation, explanation_text );
62
63 /* Set up the list store */
64 store = gtk_list_store_new( 1, G_TYPE_STRING );
65 for ( node = objlist; node != NULL; node = node->next )
66 {
67 QofInstance* inst = node->data;
68 GtkTreeIter iter;
69
70 gtk_list_store_append( store, &iter );
71 gtk_list_store_set( store, &iter, 0, qof_instance_get_display_name( inst ), -1 );
72 }
73
74 /* Set up the list view */
75 listview = gtk_tree_view_new_with_model( GTK_TREE_MODEL(store) );
76 renderer = gtk_cell_renderer_text_new();
77 column = gtk_tree_view_column_new_with_attributes( "Object", renderer, "text", 0, NULL );
78 gtk_tree_view_append_column( GTK_TREE_VIEW(listview), column );
79
80 box = GTK_WIDGET(gtk_builder_get_object (builder, "hbox_list" ));
81 gtk_container_add( GTK_CONTAINER(box), listview );
82
83 /* Autoconnect signals */
84 gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, dialog);
85
86 /* Run the dialog */
87 gtk_widget_show_all( dialog );
88 gtk_dialog_run( GTK_DIALOG(dialog) );
89 g_object_unref(G_OBJECT(builder));
90 g_object_unref (store);
91 gtk_widget_destroy( dialog );
92
93 LEAVE("");
94}
gchar * qof_instance_get_display_name(const QofInstance *inst)
Returns a displayable name for this object.

◆ GncOptionsDialog() [1/2]

GncOptionsDialog::GncOptionsDialog ( bool  modal,
const char *  title,
const char *  component_class,
GtkWindow *  parent 
)

Constructs a GncOptionsDialog.

Based on the description in the GtkBuilder file. Initializes signals. Two component classes might be used, DIALOG_BOOK_OPTIONS_CM_CLASS or DIALOG_OPTIONS_CM_CLASS of which the latter is the default.

Parameters
modalIf true the "Apply" button is hidden. It doesn't make the dialog run in its own event loop so it's not truly modal.
titleThe title that will appear in the dialog's title bar.
component_classFor registering the dialog in the component manager.
parentThe widget for which the dialog will be transient-for.

Definition at line 534 of file dialog-options.cpp.

536 :
537 m_component_class{component_class ? component_class : DIALOG_OPTIONS_CM_CLASS}
538{
539 auto builder = gtk_builder_new();
540 gnc_builder_add_from_file (builder, "dialog-options.glade", "gnucash_options_window");
541 m_window = GTK_WIDGET(gtk_builder_get_object (builder, "gnucash_options_window"));
542 g_object_ref(m_window);
543 m_page_list = GTK_WIDGET(gtk_builder_get_object (builder, "page_list_scroll"));
544 g_object_set_data(G_OBJECT(m_window), "optionwin", this);
545
546 // Set the name for this dialog so it can be easily manipulated with css
547 gtk_widget_set_name (GTK_WIDGET(m_window), "gnc-id-options");
548
549 /* Page List */
550
551 m_page_list_view = GTK_WIDGET(gtk_builder_get_object (builder, "page_list_treeview"));
552
553 auto view = GTK_TREE_VIEW(m_page_list_view);
554
555 auto store = gtk_list_store_new(NUM_COLUMNS, G_TYPE_INT, G_TYPE_STRING);
556 gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
557 g_object_unref(store);
558
559 auto renderer = gtk_cell_renderer_text_new();
560 auto column =
561 gtk_tree_view_column_new_with_attributes(_("Page"), renderer,
562 "text", PAGE_NAME,
563 nullptr);
564 gtk_tree_view_append_column(view, column);
565
566 gtk_tree_view_column_set_alignment(column, 0.5);
567
568 auto selection = gtk_tree_view_get_selection(view);
569 gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
570 g_signal_connect (selection, "changed",
571 G_CALLBACK (dialog_list_select_cb), this);
572
573 m_help_button = GTK_BUTTON(gtk_builder_get_object (builder, "helpbutton"));
574 g_signal_connect(m_help_button, "clicked",
575 G_CALLBACK(dialog_help_button_cb), this);
576 m_cancel_button = GTK_BUTTON(gtk_builder_get_object (builder, "cancelbutton"));
577 g_signal_connect(m_cancel_button, "clicked",
578 G_CALLBACK(dialog_cancel_button_cb), this);
579 m_apply_button = GTK_BUTTON(gtk_builder_get_object (builder, "applybutton"));
580 g_signal_connect(m_apply_button, "clicked",
581 G_CALLBACK(dialog_apply_button_cb), this);
582 m_ok_button = GTK_BUTTON(gtk_builder_get_object (builder, "okbutton"));
583 g_signal_connect(m_ok_button, "clicked",
584 G_CALLBACK(dialog_ok_button_cb), this);
585
586 gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func,
587 this);
588
589 // when added to a page of the hierarchy assistant there will be no parent
590 if (parent)
591 gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(m_window),
592 parent);
593
594 if (title)
595 gtk_window_set_title(GTK_WINDOW(m_window), title);
596
597 /* modal */
598 if (modal)
599 gtk_widget_hide (GTK_WIDGET(m_apply_button));
600
601 /* glade doesn't support a notebook with zero pages */
602 auto hbox = GTK_WIDGET(gtk_builder_get_object (builder,
603 "notebook_placeholder"));
604 m_notebook = gtk_notebook_new();
605
606 gtk_widget_set_vexpand (m_notebook, TRUE);
607
608 gtk_widget_show(m_notebook);
609 gtk_box_pack_start(GTK_BOX(hbox), m_notebook, TRUE, TRUE, 5);
610
611 auto component_id = gnc_register_gui_component (m_component_class,
612 nullptr,
613 component_close_handler,
614 this);
615 gnc_gui_component_set_session (component_id, gnc_get_current_session());
616
617 g_signal_connect (m_window, "destroy", G_CALLBACK(dialog_destroy_cb), this);
618
619 g_signal_connect (m_window, "key_press_event",
620 G_CALLBACK(dialog_window_key_press_cb), this);
621
622 g_object_unref(G_OBJECT(builder));
623}

◆ GncOptionsDialog() [2/2]

GncOptionsDialog::GncOptionsDialog ( const char *  title,
GtkWindow *  parent 
)
inline

Definition at line 74 of file dialog-options.hpp.

74 :
75 GncOptionsDialog(false, title, nullptr, parent) {}

◆ set_apply_cb()

void GncOptionsDialog::set_apply_cb ( GncOptionsDialogCallback  ,
void *  cb_data 
)
noexcept

Definition at line 644 of file dialog-options.cpp.

645{
646 m_apply_cb = cb;
647 m_apply_cb_data = data;
648}

◆ set_book_help_cb()

void GncOptionsDialog::set_book_help_cb ( )
noexcept

Definition at line 672 of file dialog-options.cpp.

673{
674 set_help_cb((GncOptionsDialogCallback)gnc_book_options_help_cb, nullptr);
675}

◆ set_close_cb()

void GncOptionsDialog::set_close_cb ( GncOptionsDialogCallback  ,
void *  cb_data 
)
noexcept

Definition at line 658 of file dialog-options.cpp.

659{
660 m_close_cb = cb;
661 m_close_cb_data = data;
662}

◆ set_help_cb()

void GncOptionsDialog::set_help_cb ( GncOptionsDialogCallback  ,
void *  cb_data 
)
noexcept

Definition at line 651 of file dialog-options.cpp.

652{
653 m_help_cb = cb;
654 m_help_cb_data = data;
655}

◆ set_sensitive()

void GncOptionsDialog::set_sensitive ( bool  sensitive)
noexcept

Definition at line 109 of file dialog-options.cpp.

110{
111 gtk_widget_set_sensitive (GTK_WIDGET(m_apply_button), sensitive);
112 gtk_widget_set_sensitive (GTK_WIDGET(m_ok_button), sensitive);
113 gtk_button_set_label (m_cancel_button,
114 sensitive ? _("_Cancel") : _("_Close"));
115}

◆ set_style_sheet_help_cb()

void GncOptionsDialog::set_style_sheet_help_cb ( )
noexcept

Definition at line 684 of file dialog-options.cpp.

685{
686 set_help_cb ((GncOptionsDialogCallback)gnc_style_sheet_options_help_cb,
687 nullptr);
688}

◆ ~GncOptionsDialog()

GncOptionsDialog::~GncOptionsDialog ( )

Definition at line 625 of file dialog-options.cpp.

626{
627 if (m_destroying)
628 return;
629 m_destroying = true;
630 gnc_unregister_gui_component_by_data(m_component_class, this);
631 g_signal_handlers_disconnect_by_func(m_window, (gpointer)dialog_destroy_cb, this);
632 g_signal_handlers_disconnect_by_func(m_window, (gpointer)dialog_window_key_press_cb, this);
633 m_option_db->foreach_section([](GncOptionSectionPtr& section)
634 {
635 section->foreach_option([](GncOption& option)
636 {
637 option.set_ui_item(std::unique_ptr<GncOptionUIItem>(nullptr));
638 });
639 });
640 g_object_unref(m_window);
641}
Represents the public interface for an option.

Variable Documentation

◆ end_strings

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 78 of file gnc-period-select.c.

79{
80 /* CY (current year) Strings */
81 N_("Today"),
82 N_("End of this month"),
83 N_("End of previous month"),
84 N_("End of this quarter"),
85 N_("End of previous quarter"),
86 N_("End of this year"),
87 N_("End of previous year"),
88
89 /* FY (fiscal year) Strings */
90 N_("End of this accounting period"),
91 N_("End of previous accounting period"),
92};

◆ start_strings

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 62 of file gnc-period-select.c.

63{
64 /* CY (current year) Strings */
65 N_("Today"),
66 N_("Start of this month"),
67 N_("Start of previous month"),
68 N_("Start of this quarter"),
69 N_("Start of previous quarter"),
70 N_("Start of this year"),
71 N_("Start of previous year"),
72
73 /* FY (fiscal year) Strings */
74 N_("Start of this accounting period"),
75 N_("Start of previous accounting period"),
76};