GnuCash  5.6-150-g038405b370+
Files | Data Structures | Macros | Enumerations | Functions | Variables
Register Page Filter

Files

file  gnc-plugin-page-register-filter.cpp
 Functions providing a register page filter for the GnuCash UI.
 
file  gnc-plugin-page-register-filter.hpp
 Functions providing a register page filter for the GnuCash UI.
 
file  gnc-plugin-page-register-filter.hpp
 Functions providing a register page filter for the GnuCash UI.
 
file  gnc-plugin-page-register.h
 Functions providing a register page for the GnuCash UI.
 

Data Structures

struct  RegisterFilterDialog
 
struct  status_action
 
struct  FilterData
 
struct  RegisterSortDialog
 
struct  SortData
 
struct  GncPluginPageRegisterPrivate
 
struct  GncPluginPageRegister
 
struct  GncPluginPageRegisterClass
 

Macros

#define DEFAULT_LINES_AMOUNT   50
 
#define CUT_TRANSACTION_LABEL   N_("Cu_t Transaction")
 
#define COPY_TRANSACTION_LABEL   N_("_Copy Transaction")
 
#define PASTE_TRANSACTION_LABEL   N_("_Paste Transaction")
 
#define DUPLICATE_TRANSACTION_LABEL   N_("Dup_licate Transaction")
 
#define DELETE_TRANSACTION_LABEL   N_("_Delete Transaction")
 
#define LINK_TRANSACTION_LABEL   N_("_Manage Document Link…")
 
#define LINK_TRANSACTION_OPEN_LABEL   N_("_Open Linked Document")
 
#define JUMP_LINKED_INVOICE_LABEL   N_("Jump to Business item")
 
#define CUT_SPLIT_LABEL   N_("Cu_t Split")
 
#define COPY_SPLIT_LABEL   N_("_Copy Split")
 
#define PASTE_SPLIT_LABEL   N_("_Paste Split")
 
#define DUPLICATE_SPLIT_LABEL   N_("Dup_licate Split")
 
#define DELETE_SPLIT_LABEL   N_("_Delete Split")
 
#define CUT_TRANSACTION_TIP   N_("Cut the selected transaction into clipboard")
 
#define COPY_TRANSACTION_TIP   N_("Copy the selected transaction into clipboard")
 
#define PASTE_TRANSACTION_TIP   N_("Paste the transaction from the clipboard")
 
#define DUPLICATE_TRANSACTION_TIP   N_("Make a copy of the current transaction")
 
#define DELETE_TRANSACTION_TIP   N_("Delete the current transaction")
 
#define LINK_TRANSACTION_TIP   N_("Add, change, or unlink the document linked with the current transaction")
 
#define LINK_TRANSACTION_OPEN_TIP   N_("Open the linked document for the current transaction")
 
#define JUMP_LINKED_INVOICE_TIP   N_("Jump to the linked invoice, bill, expense or credit note")
 
#define CUT_SPLIT_TIP   N_("Cut the selected split into clipboard")
 
#define COPY_SPLIT_TIP   N_("Copy the selected split into clipboard")
 
#define PASTE_SPLIT_TIP   N_("Paste the split from the clipboard")
 
#define DUPLICATE_SPLIT_TIP   N_("Make a copy of the current split")
 
#define DELETE_SPLIT_TIP   N_("Delete the current split")
 
#define KEY_REGISTER_TYPE   "RegisterType"
 
#define KEY_ACCOUNT_NAME   "AccountName"
 
#define KEY_ACCOUNT_GUID   "AccountGuid"
 
#define KEY_REGISTER_STYLE   "RegisterStyle"
 
#define KEY_DOUBLE_LINE   "DoubleLineMode"
 
#define LABEL_ACCOUNT   "Account"
 
#define LABEL_SUBACCOUNT   "SubAccount"
 
#define LABEL_GL   "GL"
 
#define LABEL_SEARCH   "Search"
 
#define GNC_TYPE_PLUGIN_PAGE_REGISTER   (gnc_plugin_page_register_get_type ())
 
#define GNC_PLUGIN_PAGE_REGISTER(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER, GncPluginPageRegister))
 
#define GNC_PLUGIN_PAGE_REGISTER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE_REGISTER, GncPluginPageRegisterClass))
 
#define GNC_IS_PLUGIN_PAGE_REGISTER(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER))
 
#define GNC_IS_PLUGIN_PAGE_REGISTER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE_REGISTER))
 
#define GNC_PLUGIN_PAGE_REGISTER_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER, GncPluginPageRegisterClass))
 
#define GNC_PLUGIN_PAGE_REGISTER_NAME   "GncPluginPageRegister"
 

Enumerations

enum  GncPrefJumpMultSplits : gint { JUMP_DEFAULT = 0, JUMP_LARGEST_VALUE_FIRST_SPLIT = 1, JUMP_SMALLEST_VALUE_FIRST_SPLIT = 2 }
 

Functions

void gnc_ppr_filter_select_range_cb (GtkRadioButton *button, RegisterFilterDialog *rfd)
 This function is called when the radio buttons changes state. More...
 
void gnc_ppr_filter_start_cb (GtkWidget *radio, RegisterFilterDialog *rfd)
 This function is called when one of the start date radio buttons is selected. More...
 
void gnc_ppr_filter_end_cb (GtkWidget *radio, RegisterFilterDialog *rfd)
 This function is called when one of the end date radio buttons is selected. More...
 
void gnc_ppr_filter_response_cb (GtkDialog *dialog, gint response, RegisterFilterDialog *rfd)
 This function is called when the "Filter By…" dialog is closed. More...
 
void gnc_ppr_filter_status_select_all_cb (GtkButton *button, RegisterFilterDialog *rfd)
 This function is called whenever the "select all" status button is clicked. More...
 
void gnc_ppr_filter_status_clear_all_cb (GtkButton *button, RegisterFilterDialog *rfd)
 This function is called whenever the "clear all" status button is clicked. More...
 
void gnc_ppr_filter_status_one_cb (GtkToggleButton *button, RegisterFilterDialog *rfd)
 This function is called whenever one of the status entries is checked or unchecked. More...
 
void gnc_ppr_filter_save_cb (GtkToggleButton *button, RegisterFilterDialog *rfd)
 This function is called whenever the save status is checked or unchecked. More...
 
void gnc_ppr_filter_days_changed_cb (GtkSpinButton *button, RegisterFilterDialog *rfd)
 This function is called when the "number of days" spin button is changed which is then saved and updates the time limitation on the register query. More...
 
void gnc_ppr_filter_start_toggle_cb (GtkToggleButton *button, RegisterFilterDialog *rfd)
 This function is called when one of the check buttons for start relative or start date is changed. More...
 
void gnc_ppr_filter_end_toggle_cb (GtkToggleButton *button, RegisterFilterDialog *rfd)
 This function is called when one of the check buttons for end relative or end date is changed. More...
 
void gnc_ppr_filter_start_end_days_changed_cb (GtkSpinButton *button, RegisterFilterDialog *rfd)
 This function is called when the "days ago" spin button is changed which is then saved and updates the time limitation on the register query. More...
 
void gnc_ppr_filter_set_tooltip (GncPluginPage *plugin_page, FilterData *fd)
 This function is used to update the tooltip shown in the register which shows a summary of the current filter. More...
 
void gnc_ppr_filter_clear_current_filter (GncPluginPage *plugin_page)
 This function is used to clear the current filter so that a specific split can be shown in the register. More...
 
void gnc_ppr_filter_update_register (GncPluginPage *plugin_page)
 This function is called to update the register. More...
 
void gnc_ppr_filter_by (GncPluginPage *plugin_page, Query *query, FilterData *fd, bool show_save_button)
 This function is called for the filter dialog. More...
 
void gnc_ppr_sort_response_cb (GtkDialog *dialog, gint response, RegisterSortDialog *rsd)
 This function is called when the "Sort By…" dialog is closed. More...
 
void gnc_ppr_sort_button_cb (GtkToggleButton *button, RegisterSortDialog *rsd)
 This function is called when a radio button in the "Sort By…" dialog is clicked. More...
 
void gnc_ppr_sort_order_save_cb (GtkToggleButton *button, RegisterSortDialog *rsd)
 This function is called whenever the save sort order is checked or unchecked which allows saving of the sort order. More...
 
void gnc_ppr_sort_order_reverse_cb (GtkToggleButton *button, RegisterSortDialog *rsd)
 This function is called whenever the reverse sort order is checked or unchecked which allows reversing of the sort order. More...
 
void gnc_ppr_sort_update_register (GncPluginPage *plugin_page)
 This function is called to update the register. More...
 
void gnc_ppr_sort_dialog (GncPluginPage *plugin_page, SplitRegister *reg, SortData *sd, bool show_save_button)
 This function is called for the sort dialog. More...
 
 G_DEFINE_TYPE_WITH_PRIVATE (GncPluginPageRegister, gnc_plugin_page_register, GNC_TYPE_PLUGIN_PAGE) static GncPluginPage *gnc_plugin_page_register_new_common(GNCLedgerDisplay *ledger)
 
GncPluginPagegnc_plugin_page_register_new (Account *account, gboolean subaccounts)
 Create a new "register" plugin page, given a pointer to an account. More...
 
GncPluginPagegnc_plugin_page_register_new_gl (void)
 Create a new "register" plugin page containing a general journal. More...
 
GncPluginPagegnc_plugin_page_register_new_ledger (GNCLedgerDisplay *ledger)
 Create a new "register" plugin page, given a pointer to an already created ledger. More...
 
Accountgnc_plugin_page_register_get_account (GncPluginPageRegister *page)
 Get the Account associated with this register page. More...
 
Transaction * gnc_plugin_page_register_get_current_txn (GncPluginPageRegister *page)
 Get the currently selected transaction in this register page. More...
 
Querygnc_plugin_page_register_get_query (GncPluginPage *plugin_page)
 This function is called to get the query associated with this plugin page. More...
 
void gnc_plugin_page_register_query_update (GncPluginPageRegister *page, Query *query)
 This updates the query after the filters have been applied. More...
 
void gnc_plugin_page_register_update_for_search_query (GncPluginPageRegister *page)
 This checks if the register is a search register and if so saves the query. More...
 
void gnc_plugin_register_set_enable_refresh (GncPluginPageRegister *page, gboolean enable_refresh)
 This allows controlling when refreshes happen, used to reduce refreshes when different aspects of the register filter change, namely date and status. More...
 
void gnc_plugin_page_register_clear_current_filter (GncPluginPage *plugin_page)
 This function clears the registers current filter. More...
 
void gnc_plugin_page_register_set_options (GncPluginPage *plugin_page, gint lines_default, gboolean read_only)
 Set various register options on a newly created "register" plugin page. More...
 
GNCSplitReg * gnc_plugin_page_register_get_gsr (GncPluginPage *plugin_page)
 Get the GNCSplitReg data structure associated with this register page. More...
 
FilterDatagnc_plugin_page_register_get_filter_data (GncPluginPage *plugin_page)
 Get the FilterData data structure associated with this register page. More...
 
SortDatagnc_plugin_page_register_get_sort_data (GncPluginPage *plugin_page)
 Get the SortData data structure associated with this register page. More...
 
GType gnc_plugin_page_register_get_type (void)
 Retrieve the type number for the plugin page. More...
 

Variables

GncPluginPageRegisterFilterDialog::plugin_page
 
GtkWidget * RegisterFilterDialog::dialog
 
GtkWidget * RegisterFilterDialog::table
 
GtkWidget * RegisterFilterDialog::start_earliest
 
GtkWidget * RegisterFilterDialog::start_relative_check
 
GtkWidget * RegisterFilterDialog::start_relative
 
GtkWidget * RegisterFilterDialog::start_date_check
 
GtkWidget * RegisterFilterDialog::start_date
 
GtkWidget * RegisterFilterDialog::start_days_check
 
GtkWidget * RegisterFilterDialog::start_days
 
GtkWidget * RegisterFilterDialog::end_latest
 
GtkWidget * RegisterFilterDialog::end_relative_check
 
GtkWidget * RegisterFilterDialog::end_relative
 
GtkWidget * RegisterFilterDialog::end_date_check
 
GtkWidget * RegisterFilterDialog::end_date
 
GtkWidget * RegisterFilterDialog::end_days_check
 
GtkWidget * RegisterFilterDialog::end_days
 
GtkWidget * RegisterFilterDialog::num_days
 
cleared_match_t RegisterFilterDialog::original_cleared_match
 
GncAccountingPeriod RegisterFilterDialog::original_start_ap
 
time64 RegisterFilterDialog::original_start_time
 
int RegisterFilterDialog::original_start_days
 
GncAccountingPeriod RegisterFilterDialog::original_end_ap
 
time64 RegisterFilterDialog::original_end_time
 
int RegisterFilterDialog::original_end_days
 
int RegisterFilterDialog::original_days
 
bool RegisterFilterDialog::original_save_filter
 
bool RegisterFilterDialog::show_save_button
 
std::string status_action::action_name
 
int status_action::value
 
GtkWidget * status_action::widget
 
GtkWidget * FilterData::dialog
 
cleared_match_t FilterData::cleared_match
 
GncAccountingPeriod FilterData::start_ap
 
time64 FilterData::start_time
 
int FilterData::start_days
 
GncAccountingPeriod FilterData::end_ap
 
time64 FilterData::end_time
 
int FilterData::end_days
 
int FilterData::days
 
bool FilterData::save_filter
 
GncPluginPageRegisterSortDialog::plugin_page
 
SplitRegister * RegisterSortDialog::reg
 
GtkWidget * RegisterSortDialog::dialog
 
GtkWidget * RegisterSortDialog::num_radio
 
GtkWidget * RegisterSortDialog::act_radio
 
SortType RegisterSortDialog::original_sort_type
 
bool RegisterSortDialog::original_reverse_order
 
bool RegisterSortDialog::original_save_order
 
bool RegisterSortDialog::show_save_button
 
GtkWidget * SortData::dialog
 
SortType SortData::sort_type
 
bool SortData::reverse_order
 
bool SortData::save_order
 

Detailed Description

Function Documentation

◆ gnc_plugin_page_register_clear_current_filter()

void gnc_plugin_page_register_clear_current_filter ( GncPluginPage plugin_page)

This function clears the registers current filter.

It is used so jumps to splits from other places can be completed otherwise the jump will be to the last active cell.

Parameters
plugin_pageA pointer to the GncPluginPageRegister.

Definition at line 1922 of file gnc-plugin-page-register.cpp.

1923 {
1924  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
1925 
1927 }
void gnc_ppr_filter_clear_current_filter(GncPluginPage *plugin_page)
This function is used to clear the current filter so that a specific split can be shown in the regist...

◆ gnc_plugin_page_register_get_account()

Account * gnc_plugin_page_register_get_account ( GncPluginPageRegister page)

Get the Account associated with this register page.

Parameters
pageA "register" page.
Returns
The account if the register contains only a single account, or an account and its sub-accounts. NULL otherwise.

Definition at line 580 of file gnc-plugin-page-register.cpp.

581 {
583  GNCLedgerDisplayType ledger_type;
584  Account* leader;
585 
586  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
587  ledger_type = gnc_ledger_display_type (priv->ledger);
588  leader = gnc_ledger_display_leader (priv->ledger);
589 
590  if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
591  return leader;
592  return NULL;
593 }
STRUCTS.
Account * gnc_ledger_display_leader(GNCLedgerDisplay *ld)
Implementations.

◆ gnc_plugin_page_register_get_current_txn()

Transaction * gnc_plugin_page_register_get_current_txn ( GncPluginPageRegister page)

Get the currently selected transaction in this register page.

Parameters
pageA "register" page.
Returns
The currently active transaction or NULL if there currently is no currently selected.

Definition at line 596 of file gnc-plugin-page-register.cpp.

597 {
599  SplitRegister* reg;
600 
601  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
602  reg = gnc_ledger_display_get_split_register (priv->ledger);
604 }
Transaction * gnc_split_register_get_current_trans(SplitRegister *reg)
Gets the transaction at the current cursor location, which may be on the transaction itself or on any...
SplitRegister * gnc_ledger_display_get_split_register(GNCLedgerDisplay *ld)
return the split register associated with a ledger display

◆ gnc_plugin_page_register_get_filter_data()

struct FilterData * gnc_plugin_page_register_get_filter_data ( GncPluginPage plugin_page)

Get the FilterData data structure associated with this register page.

Parameters
plugin_pageA "register" page.

Definition at line 3780 of file gnc-plugin-page-register.cpp.

3781 {
3782  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page), NULL);
3783 
3784  GncPluginPageRegister* page = GNC_PLUGIN_PAGE_REGISTER(plugin_page);
3785  GncPluginPageRegisterPrivate* priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
3786 
3787  return &priv->fd;
3788 }

◆ gnc_plugin_page_register_get_gsr()

GNCSplitReg * gnc_plugin_page_register_get_gsr ( GncPluginPage plugin_page)

Get the GNCSplitReg data structure associated with this register page.

Parameters
plugin_pageA "register" page.

Definition at line 3766 of file gnc-plugin-page-register.cpp.

3767 {
3768  GncPluginPageRegister* page;
3770 
3771  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), NULL);
3772 
3773  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
3774  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
3775 
3776  return priv->gsr;
3777 }

◆ gnc_plugin_page_register_get_query()

Query * gnc_plugin_page_register_get_query ( GncPluginPage plugin_page)

This function is called to get the query associated with this plugin page.

Get the Query associated with this "register" plugin page.

Parameters
pageA pointer to the GncPluginPage.
plugin_pageThe "register" page to modify.
Returns
The query.

Definition at line 1853 of file gnc-plugin-page-register.cpp.

1854 {
1855  GncPluginPageRegister* page;
1857 
1858  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), NULL);
1859 
1860  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
1861  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
1862  return gnc_ledger_display_get_query (priv->ledger);
1863 }
Query * gnc_ledger_display_get_query(GNCLedgerDisplay *ld)
return the query associated with a ledger

◆ gnc_plugin_page_register_get_sort_data()

struct SortData * gnc_plugin_page_register_get_sort_data ( GncPluginPage plugin_page)

Get the SortData data structure associated with this register page.

Parameters
plugin_pageA "register" page.

Definition at line 3791 of file gnc-plugin-page-register.cpp.

3792 {
3793  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page), NULL);
3794 
3795  GncPluginPageRegister* page = GNC_PLUGIN_PAGE_REGISTER(plugin_page);
3796  GncPluginPageRegisterPrivate* priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
3797 
3798  return &priv->sd;
3799 }

◆ gnc_plugin_page_register_get_type()

GType gnc_plugin_page_register_get_type ( void  )

Retrieve the type number for the plugin page.

Returns
The type number.

◆ gnc_plugin_page_register_new()

GncPluginPage * gnc_plugin_page_register_new ( Account account,
gboolean  subaccounts 
)

Create a new "register" plugin page, given a pointer to an account.

Parameters
accountThe pointer to the account to embed in the register.
subaccountsTRUE if all the sub-accounts of the specified account should be included in the register.
Returns
The newly created plugin page.

Definition at line 464 of file gnc-plugin-page-register.cpp.

465 {
466  GNCLedgerDisplay* ledger;
467  GncPluginPage* plugin_page;
469  gnc_commodity* com0;
470  gnc_commodity* com1;
471 
472  ENTER ("account=%p, subaccounts=%s", account,
473  subaccounts ? "TRUE" : "FALSE");
474 
475  com0 = gnc_account_get_currency_or_parent (account);
476  com1 = GNC_COMMODITY(gnc_account_foreach_descendant_until (account,
477  gnc_plug_page_register_check_commodity,
478  static_cast<gpointer>(com0)));
479 
480  if (subaccounts)
481  ledger = gnc_ledger_display_subaccounts (account, com1 != NULL);
482  else
483  ledger = gnc_ledger_display_simple (account);
484 
485  plugin_page = gnc_plugin_page_register_new_common (ledger);
486  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (plugin_page);
487  priv->key = *xaccAccountGetGUID (account);
488 
489  LEAVE ("%p", plugin_page);
490  return plugin_page;
491 }
The instance data structure for a content plugin.
gpointer gnc_account_foreach_descendant_until(const Account *acc, AccountCb2 thunk, gpointer user_data)
This method will traverse all children of this accounts and their descendants, calling &#39;func&#39; on each...
Definition: Account.cpp:3225
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
GNCLedgerDisplay * gnc_ledger_display_subaccounts(Account *account, gboolean mismatched_commodities)
opens up a register window to display the parent account and all of its children. ...
#define xaccAccountGetGUID(X)
Definition: Account.h:252
gnc_commodity * gnc_account_get_currency_or_parent(const Account *account)
Returns a gnc_commodity that is a currency, suitable for being a Transaction&#39;s currency.
Definition: Account.cpp:3396
GNCLedgerDisplay * gnc_ledger_display_simple(Account *account)
opens up a register window to display a single account
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_plugin_page_register_new_gl()

GncPluginPage * gnc_plugin_page_register_new_gl ( void  )

Create a new "register" plugin page containing a general journal.

Returns
The newly created plugin page.

Definition at line 494 of file gnc-plugin-page-register.cpp.

495 {
496  GNCLedgerDisplay* ledger;
497 
498  ledger = gnc_ledger_display_gl();
499  return gnc_plugin_page_register_new_common (ledger);
500 }
GNCLedgerDisplay * gnc_ledger_display_gl(void)
opens up a general ledger window

◆ gnc_plugin_page_register_new_ledger()

GncPluginPage * gnc_plugin_page_register_new_ledger ( GNCLedgerDisplay *  ledger)

Create a new "register" plugin page, given a pointer to an already created ledger.

This function should be used when the ledger already exists. (E.G. From the "find transaction" code, or from the scheduled transaction code.)

Parameters
ledgerThe pointer to the ledger to embed into the register.
Returns
The newly created plugin page.

Definition at line 503 of file gnc-plugin-page-register.cpp.

504 {
505  return gnc_plugin_page_register_new_common (ledger);
506 }

◆ gnc_plugin_page_register_query_update()

void gnc_plugin_page_register_query_update ( GncPluginPageRegister page,
Query query 
)

This updates the query after the filters have been applied.

Parameters
plugin_pageA pointer to the GncPluginPageRegister.
queryThe updated query

Definition at line 1866 of file gnc-plugin-page-register.cpp.

1867 {
1869 
1870  ENTER(" ");
1871  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
1872 
1873  // clear previous filter query and save current
1874  qof_query_destroy (priv->filter_query);
1875  priv->filter_query = qof_query_copy (query);
1876 
1877  if (priv->enable_refresh)
1878  gnc_ledger_display_refresh (priv->ledger);
1879  LEAVE(" ");
1880 }
void gnc_ledger_display_refresh(GNCLedgerDisplay *ld)
redisplay/redraw only the indicated window.
QofQuery * qof_query_copy(QofQuery *q)
Make a copy of the indicated query.
Definition: qofquery.cpp:1018
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
void qof_query_destroy(QofQuery *query)
Frees the resources associate with a Query object.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_plugin_page_register_set_options()

void gnc_plugin_page_register_set_options ( GncPluginPage plugin_page,
gint  lines_default,
gboolean  read_only 
)

Set various register options on a newly created "register" plugin page.

Parameters
plugin_pageThe "register" page to modify.
lines_defaultUsed to calculate the minimum preferred height of the plugin page.
read_onlyTrue if the register should be read-only.

Definition at line 3750 of file gnc-plugin-page-register.cpp.

3753 {
3754  GncPluginPageRegister* page;
3756 
3757  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));
3758 
3759  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
3760  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
3761  priv->lines_default = lines_default;
3762  priv->read_only = read_only;
3763 }

◆ gnc_plugin_page_register_update_for_search_query()

void gnc_plugin_page_register_update_for_search_query ( GncPluginPageRegister page)

This checks if the register is a search register and if so saves the query.

Parameters
plugin_pageA pointer to the GncPluginPageRegister.

Definition at line 1883 of file gnc-plugin-page-register.cpp.

1884 {
1886  SplitRegister* reg;
1887 
1888  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
1889  reg = gnc_ledger_display_get_split_register (priv->ledger);
1890 
1891  if (reg->type == SEARCH_LEDGER)
1892  {
1893  Query* query_tmp = gnc_ledger_display_get_query (priv->ledger);
1894 
1895  // if filter_query is NULL, then the dialogue find has been run
1896  // before coming here. if query_tmp does not equal filter_query
1897  // then the dialogue find has been run again before coming here
1898  if ((priv->filter_query == NULL) ||
1899  (!qof_query_equal (query_tmp, priv->filter_query)))
1900  {
1901  qof_query_destroy (priv->search_query);
1902  priv->search_query = qof_query_copy (query_tmp);
1903  }
1904  gnc_ledger_display_set_query (priv->ledger, priv->search_query);
1905  }
1906 }
QofQuery * qof_query_copy(QofQuery *q)
Make a copy of the indicated query.
Definition: qofquery.cpp:1018
gboolean qof_query_equal(const QofQuery *q1, const QofQuery *q2)
Compare two queries for equality.
Definition: qofquery.cpp:1472
void gnc_ledger_display_set_query(GNCLedgerDisplay *ledger_display, Query *q)
Set the query used for a register.
Query * gnc_ledger_display_get_query(GNCLedgerDisplay *ld)
return the query associated with a ledger
void qof_query_destroy(QofQuery *query)
Frees the resources associate with a Query object.
SplitRegister * gnc_ledger_display_get_split_register(GNCLedgerDisplay *ld)
return the split register associated with a ledger display
A Query.
Definition: qofquery.cpp:74

◆ gnc_plugin_register_set_enable_refresh()

void gnc_plugin_register_set_enable_refresh ( GncPluginPageRegister page,
gboolean  enable_refresh 
)

This allows controlling when refreshes happen, used to reduce refreshes when different aspects of the register filter change, namely date and status.

Parameters
plugin_pageA pointer to the GncPluginPageRegister.
enable_refreshUsed to controll wehn refresh is required

Definition at line 1909 of file gnc-plugin-page-register.cpp.

1911 {
1913 
1914  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(page));
1915 
1916  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE(page);
1917 
1918  priv->enable_refresh = enable_refresh;
1919 }

◆ gnc_ppr_filter_by()

void gnc_ppr_filter_by ( GncPluginPage plugin_page,
Query query,
FilterData fd,
bool  show_save_button 
)

This function is called for the filter dialog.

Parameters
plugin_pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.
queryA pointer to the current register query.
fdA pointer to the filter data structure for remembering state.
show_save_buttonSet to True to show save button.

Definition at line 1657 of file gnc-plugin-page-register-filter.cpp.

1659 {
1660  RegisterFilterDialog *rfd;
1661 
1662  ENTER(" ");
1663 
1664  rfd = g_new0 (RegisterFilterDialog, 1);
1665 
1666  rfd->plugin_page = plugin_page;
1667  rfd->show_save_button = show_save_button;
1668 
1669  ppr_filter_dialog_create (rfd, fd, query);
1670 
1671  LEAVE(" ");
1672 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_filter_clear_current_filter()

void gnc_ppr_filter_clear_current_filter ( GncPluginPage plugin_page)

This function is used to clear the current filter so that a specific split can be shown in the register.

Parameters
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.

Definition at line 728 of file gnc-plugin-page-register-filter.cpp.

729 {
730  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
731 
732  auto fd = gnc_plugin_page_register_get_filter_data (plugin_page);
733 
734  set_filterdata_to_defaults (fd, false);
735 
736  ppr_filter_update_date_query (plugin_page);
737 }
FilterData * gnc_plugin_page_register_get_filter_data(GncPluginPage *plugin_page)
Get the FilterData data structure associated with this register page.

◆ gnc_ppr_filter_days_changed_cb()

void gnc_ppr_filter_days_changed_cb ( GtkSpinButton *  button,
RegisterFilterDialog rfd 
)

This function is called when the "number of days" spin button is changed which is then saved and updates the time limitation on the register query.

This is handled by a helper function as potentially all widgets will need to be examined.

Parameters
buttonA pointer to the "number of days" spin button.
rfdA pointer to the filter dialog structure.

Definition at line 1054 of file gnc-plugin-page-register-filter.cpp.

1056 {
1057  g_return_if_fail (GTK_IS_SPIN_BUTTON(button));
1058  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1059 
1060  ENTER("(button %p, page %p)", button, rfd->plugin_page);
1061 
1062  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
1063 
1064  fd->days = gtk_spin_button_get_value (GTK_SPIN_BUTTON(button));
1065  ppr_filter_update_date_query (rfd->plugin_page);
1066 
1067  LEAVE(" ");
1068 }
FilterData * gnc_plugin_page_register_get_filter_data(GncPluginPage *plugin_page)
Get the FilterData data structure associated with this register page.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_filter_end_cb()

void gnc_ppr_filter_end_cb ( GtkWidget *  radio,
RegisterFilterDialog rfd 
)

This function is called when one of the end date radio buttons is selected.

It updates the sensitivity of the date entry widget, then calls a common routine to determine the start/end times and update the register query.

*Note: This function is actually called twice for each new radio button selection. The first time call is to uncheck the old button, and the second time to check the new button. This does make a kind of sense, as radio buttons are nothing more than linked toggle buttons where only one can be active.

Parameters
radioThe button whose state is changing. This will be the previously selected button the first of the pair of calls to this function, and will be the newly selected button the second time.
rfdA pointer to the filter dialog structure.

Definition at line 1147 of file gnc-plugin-page-register-filter.cpp.

1149 {
1150  g_return_if_fail (GTK_IS_RADIO_BUTTON(radio));
1151  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1152 
1153  ENTER("(radio %s(%p), page %p)",
1154  gtk_buildable_get_name (GTK_BUILDABLE(radio)), radio, rfd->plugin_page);
1155 
1156  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(radio)))
1157  {
1158  LEAVE("1st callback of pair. Defer to 2nd callback.");
1159  return;
1160  }
1161 
1162  auto name = gtk_buildable_get_name (GTK_BUILDABLE(radio));
1163  gboolean active = !g_strcmp0 (name, "end_date_choose");
1164  gtk_widget_set_sensitive (rfd->end_date, active);
1165  get_filter_times (rfd);
1166  ppr_filter_update_date_query (rfd->plugin_page);
1167 
1168  LEAVE(" ");
1169 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_filter_end_toggle_cb()

void gnc_ppr_filter_end_toggle_cb ( GtkToggleButton *  button,
RegisterFilterDialog rfd 
)

This function is called when one of the check buttons for end relative or end date is changed.

It activates the associated widget and deactivates the other.

Parameters
buttonA pointer to a GtkToggleButton widget.
rfdA pointer to the filter dialog structure.

Definition at line 1287 of file gnc-plugin-page-register-filter.cpp.

1289 {
1290  g_return_if_fail (GTK_IS_CHECK_BUTTON(button));
1291  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1292 
1293  ENTER("End toggle button (%p), plugin_page %p", button, rfd->plugin_page);
1294 
1295  auto name = gtk_buildable_get_name (GTK_BUILDABLE(button));
1296 
1297  gboolean active = gtk_toggle_button_get_active (button);
1298 
1299  gtk_widget_set_sensitive (rfd->end_latest, !active);
1300 
1301  if (g_strcmp0 (name, "end_date_check") == 0)
1302  {
1303  set_sensitive_end_widget (rfd, rfd->end_date, active);
1304 
1305  set_checkbutton_with_blocking (rfd->end_relative_check,
1306  rfd->end_days_check,
1308  rfd, FALSE);
1309  }
1310  if (g_strcmp0 (name, "end_relative_check") == 0)
1311  {
1312  set_sensitive_end_widget (rfd, rfd->end_relative, active);
1313 
1314  set_checkbutton_with_blocking (rfd->end_date_check,
1315  rfd->end_days_check,
1317  rfd, FALSE);
1318  }
1319  if (g_strcmp0 (name, "end_days_check") == 0)
1320  {
1321  set_sensitive_end_widget (rfd, rfd->end_days, active);
1322 
1323  set_checkbutton_with_blocking (rfd->end_date_check,
1324  rfd->end_relative_check,
1326  rfd, FALSE);
1327  }
1328  get_filter_times (rfd);
1329  ppr_filter_update_date_query (rfd->plugin_page);
1330 
1331  LEAVE(" ");
1332 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
void gnc_ppr_filter_end_toggle_cb(GtkToggleButton *button, RegisterFilterDialog *rfd)
This function is called when one of the check buttons for end relative or end date is changed...

◆ gnc_ppr_filter_response_cb()

void gnc_ppr_filter_response_cb ( GtkDialog *  dialog,
gint  response,
RegisterFilterDialog rfd 
)

This function is called when the "Filter By…" dialog is closed.

If the dialog was closed by any method other than clicking the OK button, the original sorting order will be restored.

Parameters
dialogA pointer to the dialog box.
responseA numerical value indicating why the dialog box was closed.
rfdA pointer to the filter dialog structure.

Definition at line 1372 of file gnc-plugin-page-register-filter.cpp.

1375 {
1376  g_return_if_fail (GTK_IS_DIALOG(dialog));
1377  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1378 
1379  ENTER(" ");
1380 
1381  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
1382  auto gsr = gnc_plugin_page_register_get_gsr (rfd->plugin_page);
1383 
1384  if ((fd->start_time > 0 && fd->end_time > 0) && (fd->start_time > fd->end_time))
1385  {
1386  auto response = gnc_ok_cancel_dialog (GTK_WINDOW(rfd->dialog),
1387  GTK_RESPONSE_CANCEL,
1388  _("The Start date is after the End date.\n"
1389  "Select Cancel to change dates.\n"));
1390  if (response == GTK_RESPONSE_CANCEL)
1391  return;
1392  }
1393 
1394  if (response != GTK_RESPONSE_OK)
1395  {
1396  /* Remove the old status match */
1397  fd->cleared_match = rfd->original_cleared_match;
1398  gnc_plugin_register_set_enable_refresh (GNC_PLUGIN_PAGE_REGISTER(rfd->plugin_page), FALSE);
1399  ppr_filter_update_status_query (rfd->plugin_page);
1400  gnc_plugin_register_set_enable_refresh (GNC_PLUGIN_PAGE_REGISTER(rfd->plugin_page), TRUE);
1401 
1402  fd->start_ap = rfd->original_start_ap;
1403  fd->start_time = rfd->original_start_time;
1404  fd->start_days = rfd->original_start_days;
1405  fd->end_ap = rfd->original_end_ap;
1406  fd->end_time = rfd->original_end_time;
1407  fd->end_days = rfd->original_end_days;
1408 
1409  fd->days = rfd->original_days;
1410  fd->save_filter = rfd->original_save_filter;
1411  ppr_filter_update_date_query (rfd->plugin_page);
1412  }
1413  else
1414  {
1415  // clear the filter when unticking the save option
1416  if (!fd->save_filter && rfd->original_save_filter)
1417  ppr_filter_save_filter (gsr, "");
1418 
1419  rfd->original_save_filter = fd->save_filter;
1420 
1421  if (fd->save_filter)
1422  ppr_filter_save_filter_parts (gsr, fd);
1423  }
1424  rfd->dialog = nullptr;
1425  fd->dialog = nullptr;
1426  g_free (rfd);
1427  gtk_widget_destroy (GTK_WIDGET(dialog));
1428  LEAVE(" ");
1429 }
void gnc_plugin_register_set_enable_refresh(GncPluginPageRegister *page, gboolean enable_refresh)
This allows controlling when refreshes happen, used to reduce refreshes when different aspects of the...
FilterData * gnc_plugin_page_register_get_filter_data(GncPluginPage *plugin_page)
Get the FilterData data structure associated with this register page.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
GNCSplitReg * gnc_plugin_page_register_get_gsr(GncPluginPage *plugin_page)
Get the GNCSplitReg data structure associated with this register page.

◆ gnc_ppr_filter_save_cb()

void gnc_ppr_filter_save_cb ( GtkToggleButton *  button,
RegisterFilterDialog rfd 
)

This function is called whenever the save status is checked or unchecked.

It will allow saving of the filter if required.

Parameters
buttonThe toggle button that was changed.
rfdA pointer to the filter dialog structure.

Definition at line 1342 of file gnc-plugin-page-register-filter.cpp.

1344 {
1345  g_return_if_fail (GTK_IS_CHECK_BUTTON(button));
1346  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1347 
1348  ENTER("Save toggle button (%p), plugin_page %p", button, rfd->plugin_page);
1349 
1350  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
1351 
1352  /* Compute the new save filter status */
1353  if (gtk_toggle_button_get_active (button))
1354  fd->save_filter = true;
1355  else
1356  fd->save_filter = false;
1357 
1358  LEAVE(" ");
1359 }
FilterData * gnc_plugin_page_register_get_filter_data(GncPluginPage *plugin_page)
Get the FilterData data structure associated with this register page.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_filter_select_range_cb()

void gnc_ppr_filter_select_range_cb ( GtkRadioButton *  button,
RegisterFilterDialog rfd 
)

This function is called when the radio buttons changes state.

This function is responsible for setting the sensitivity of the widgets controlled by each radio button choice and updating the time limitation on the register query. This is handled by a helper function as potentially all widgets will need to be examined.

Parameters
buttonA pointer to the "select range" radio button.
rfdA pointer to the filter dialog structure.

Definition at line 1009 of file gnc-plugin-page-register-filter.cpp.

1011 {
1012  g_return_if_fail (GTK_IS_RADIO_BUTTON(button));
1013  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1014 
1015  ENTER("(button %p, page %p)", button, rfd->plugin_page);
1016 
1017  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
1018 
1019  auto name = gtk_buildable_get_name (GTK_BUILDABLE(button));
1020  gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button));
1021 
1022  if (active && g_strcmp0 (name, "filter_show_range") == 0)
1023  {
1024  gtk_widget_set_sensitive (rfd->table, active);
1025  gtk_widget_set_sensitive (rfd->num_days, !active);
1026  get_filter_times (rfd);
1027  }
1028  else if (active && g_strcmp0 (name, "filter_show_days") == 0)
1029  {
1030  gtk_widget_set_sensitive (rfd->table, !active);
1031  gtk_widget_set_sensitive (rfd->num_days, active);
1032  fd->days = gtk_spin_button_get_value (GTK_SPIN_BUTTON(rfd->num_days));
1033  }
1034  else
1035  {
1036  gtk_widget_set_sensitive (rfd->table, FALSE);
1037  gtk_widget_set_sensitive (rfd->num_days, FALSE);
1038  set_filterdata_to_defaults (fd, true);
1039  }
1040  ppr_filter_update_date_query (rfd->plugin_page);
1041  LEAVE(" ");
1042 }
FilterData * gnc_plugin_page_register_get_filter_data(GncPluginPage *plugin_page)
Get the FilterData data structure associated with this register page.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_filter_set_tooltip()

void gnc_ppr_filter_set_tooltip ( GncPluginPage plugin_page,
FilterData fd 
)

This function is used to update the tooltip shown in the register which shows a summary of the current filter.

Parameters
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.
fdA pointer to the filter data used for filter state.

Definition at line 531 of file gnc-plugin-page-register-filter.cpp.

532 {
533  GList *t_list = nullptr;
534 
535  ENTER(" ");
536 
537  auto gsr = gnc_plugin_page_register_get_gsr (plugin_page);
538 
539  // filtered start time
540  if (fd->start_time != 0)
541  {
542  auto sdate = qof_print_date (fd->start_time);
543  t_list = g_list_prepend
544  (t_list, g_strdup_printf ("%s %s", _("Start Date:"), sdate));
545  g_free (sdate);
546  }
547 
548  // filtered number of days
549  if (fd->days > 0)
550  {
551  t_list = g_list_prepend
552  (t_list, g_strdup_printf ("%s %d", _("Show previous number of days:"),
553  fd->days));
554  }
555  // filtered end time
556  if (fd->end_time != 0)
557  {
558  auto edate = qof_print_date (fd->end_time);
559  t_list = g_list_prepend
560  (t_list, g_strdup_printf ("%s %s", _("End Date:"), edate));
561  g_free (edate);
562  }
563 
564  // filtered match items
565  if (fd->cleared_match != CLEARED_ALL)
566  {
567  GList *show = nullptr;
568  GList *hide = nullptr;
569 
570  update_match_filter_text (fd->cleared_match, 0x01, _("Unreconciled"),
571  &show, &hide);
572  update_match_filter_text (fd->cleared_match, 0x02, _("Cleared"),
573  &show, &hide);
574  update_match_filter_text (fd->cleared_match, 0x04, _("Reconciled"),
575  &show, &hide);
576  update_match_filter_text (fd->cleared_match, 0x08, _("Frozen"),
577  &show, &hide);
578  update_match_filter_text (fd->cleared_match, 0x10, _("Voided"),
579  &show, &hide);
580 
581  show = g_list_reverse (show);
582  hide = g_list_reverse (hide);
583 
584  if (show)
585  {
586  auto str = gnc_list_formatter (show);
587  t_list = g_list_prepend
588  (t_list, g_strdup_printf ("%s %s", _("Show:"), str));
589  g_free (str);
590  }
591 
592  if (hide)
593  {
594  auto str = gnc_list_formatter (hide);
595  t_list = g_list_prepend
596  (t_list, g_strdup_printf ("%s %s", _("Hide:"), str));
597  g_free (str);
598  }
599 
600  g_list_free_full (show, g_free);
601  g_list_free_full (hide, g_free);
602  }
603 
604  t_list = g_list_reverse (t_list);
605 
606  if (t_list)
607  t_list = g_list_prepend (t_list, g_strdup (_("Filter By:")));
608 
609  // free the existing text if present
610  if (gsr->filter_text)
611  g_free (gsr->filter_text);
612 
613  // set the tooltip text variable in the gsr
614  gsr->filter_text = gnc_g_list_stringjoin (t_list, "\n");
615 
616  g_list_free_full (t_list, g_free);
617 
618  LEAVE(" ");
619 }
gchar * gnc_g_list_stringjoin(GList *list_of_strings, const gchar *sep)
Return a string joining a GList whose elements are gchar* strings.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
char * qof_print_date(time64 secs)
Convenience; calls through to qof_print_date_dmy_buff().
Definition: gnc-date.cpp:610
gchar * gnc_list_formatter(GList *strings)
This function takes a GList of char*, and uses locale-sensitive list formatter.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
GNCSplitReg * gnc_plugin_page_register_get_gsr(GncPluginPage *plugin_page)
Get the GNCSplitReg data structure associated with this register page.

◆ gnc_ppr_filter_start_cb()

void gnc_ppr_filter_start_cb ( GtkWidget *  radio,
RegisterFilterDialog rfd 
)

This function is called when one of the start date radio buttons is selected.

It updates the sensitivity of the date entry widget, then calls a common routine to determine the start/end times and update the register query.

*Note: This function is actually called twice for each new radio button selection. The first time call is to uncheck the old button, and the second time to check the new button. This does make a kind of sense, as radio buttons are nothing more than linked toggle buttons where only one can be active.

Parameters
radioThe button whose state is changing. This will be the previously selected button the first of the pair of calls to this function, and will be the newly selected button the second time.
rfdA pointer to the filter dialog structure.

Definition at line 1104 of file gnc-plugin-page-register-filter.cpp.

1106 {
1107  g_return_if_fail (GTK_IS_RADIO_BUTTON(radio));
1108  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1109 
1110  ENTER("(radio %s(%p), page %p)",
1111  gtk_buildable_get_name (GTK_BUILDABLE(radio)), radio, rfd->plugin_page);
1112 
1113  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(radio)))
1114  {
1115  LEAVE("1st callback of pair. Defer to 2nd callback.");
1116  return;
1117  }
1118 
1119  auto name = gtk_buildable_get_name (GTK_BUILDABLE(radio));
1120  gboolean active = !g_strcmp0 (name, "start_date_choose");
1121  gtk_widget_set_sensitive (rfd->start_date, active);
1122  get_filter_times (rfd);
1123  ppr_filter_update_date_query (rfd->plugin_page);
1124 
1125  LEAVE(" ");
1126 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_filter_start_end_days_changed_cb()

void gnc_ppr_filter_start_end_days_changed_cb ( GtkSpinButton *  button,
RegisterFilterDialog rfd 
)

This function is called when the "days ago" spin button is changed which is then saved and updates the time limitation on the register query.

This is handled by a helper function as potentially all widgets will need to be examined.

Parameters
buttonA pointer to the "days ago" spin button.
rfdA pointer to the filter dialog structure.

Definition at line 1198 of file gnc-plugin-page-register-filter.cpp.

1200 {
1201  g_return_if_fail (GTK_IS_SPIN_BUTTON(button));
1202  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1203 
1204  ENTER("(button %p, page %p)", button, rfd->plugin_page);
1205 
1206  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
1207 
1208  auto name = gtk_buildable_get_name (GTK_BUILDABLE(button));
1209 
1210  if (g_strcmp0 (name, "start_days_spin") == 0)
1211  fd->start_days = gtk_spin_button_get_value (GTK_SPIN_BUTTON(button));
1212 
1213  if (g_strcmp0 (name, "end_days_spin") == 0)
1214  fd->end_days = gtk_spin_button_get_value (GTK_SPIN_BUTTON(button));
1215 
1216  get_filter_times (rfd);
1217  ppr_filter_update_date_query (rfd->plugin_page);
1218 
1219  LEAVE(" ");
1220 }
FilterData * gnc_plugin_page_register_get_filter_data(GncPluginPage *plugin_page)
Get the FilterData data structure associated with this register page.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_filter_start_toggle_cb()

void gnc_ppr_filter_start_toggle_cb ( GtkToggleButton *  button,
RegisterFilterDialog rfd 
)

This function is called when one of the check buttons for start relative or start date is changed.

It activates the associated widget and deactivates the other.

Parameters
buttonA pointer to a GtkToggleButton widget.
rfdA pointer to the filter dialog structure.

Definition at line 1231 of file gnc-plugin-page-register-filter.cpp.

1233 {
1234  g_return_if_fail (GTK_IS_CHECK_BUTTON(button));
1235  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1236 
1237  ENTER("Start toggle button (%p), plugin_page %p", button, rfd->plugin_page);
1238 
1239  auto name = gtk_buildable_get_name (GTK_BUILDABLE(button));
1240 
1241  gboolean active = gtk_toggle_button_get_active (button);
1242 
1243  gtk_widget_set_sensitive (rfd->start_earliest, !active);
1244 
1245  if (g_strcmp0 (name, "start_date_check") == 0)
1246  {
1247  set_sensitive_start_widget (rfd, rfd->start_date, active);
1248 
1249  set_checkbutton_with_blocking (rfd->start_relative_check,
1250  rfd->start_days_check,
1252  rfd, FALSE);
1253  }
1254  if (g_strcmp0 (name, "start_relative_check") == 0)
1255  {
1256  set_sensitive_start_widget (rfd, rfd->start_relative, active);
1257 
1258  set_checkbutton_with_blocking (rfd->start_date_check,
1259  rfd->start_days_check,
1261  rfd, FALSE);
1262  }
1263  if (g_strcmp0 (name, "start_days_check") == 0)
1264  {
1265  set_sensitive_start_widget (rfd, rfd->start_days, active);
1266 
1267  set_checkbutton_with_blocking (rfd->start_date_check,
1268  rfd->start_relative_check,
1270  rfd, FALSE);
1271  }
1272  get_filter_times (rfd);
1273  ppr_filter_update_date_query (rfd->plugin_page);
1274 
1275  LEAVE(" ");
1276 }
void gnc_ppr_filter_start_toggle_cb(GtkToggleButton *button, RegisterFilterDialog *rfd)
This function is called when one of the check buttons for start relative or start date is changed...
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_filter_status_clear_all_cb()

void gnc_ppr_filter_status_clear_all_cb ( GtkButton *  button,
RegisterFilterDialog rfd 
)

This function is called whenever the "clear all" status button is clicked.

It updates all of the checkbox widgets, then updates the query on the register.

Parameters
buttonThe button that was clicked.
rfdA pointer to the filter dialog structure.

Definition at line 906 of file gnc-plugin-page-register-filter.cpp.

908 {
909  g_return_if_fail (GTK_IS_BUTTON(button));
910  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
911 
912  ENTER("(button %p, page %p)", button, rfd->plugin_page);
913 
914  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
915 
916  /* Turn off all the check menu items */
917  for (const auto& action : status_actions)
918  {
919  set_checkbutton_with_blocking (action.widget, nullptr,
921  rfd, FALSE);
922  }
923 
924  /* Set the requested status */
925  fd->cleared_match = CLEARED_NONE;
926  ppr_filter_update_status_query (rfd->plugin_page);
927  LEAVE(" ");
928 }
FilterData * gnc_plugin_page_register_get_filter_data(GncPluginPage *plugin_page)
Get the FilterData data structure associated with this register page.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
void gnc_ppr_filter_status_one_cb(GtkToggleButton *button, RegisterFilterDialog *rfd)
This function is called whenever one of the status entries is checked or unchecked.

◆ gnc_ppr_filter_status_one_cb()

void gnc_ppr_filter_status_one_cb ( GtkToggleButton *  button,
RegisterFilterDialog rfd 
)

This function is called whenever one of the status entries is checked or unchecked.

It updates the status value maintained for the filter dialog, and calls another function to do the work of applying the change to the register itself.

Parameters
buttonThe toggle button that was changed.
rfdA pointer to the filter dialog structure.

Definition at line 784 of file gnc-plugin-page-register-filter.cpp.

786 {
787  g_return_if_fail (GTK_IS_CHECK_BUTTON(button));
788  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
789 
790  auto name = gtk_buildable_get_name (GTK_BUILDABLE(button));
791 
792  ENTER("toggle button %s (%p), plugin_page %p", name, button, rfd->plugin_page);
793 
794  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
795 
796  /* Determine what status bit to change */
797  int value = CLEARED_NONE;
798  for (const auto& action : status_actions)
799  {
800  if (action.action_name.compare (name) == 0)
801  {
802  value = action.value;
803  break;
804  }
805  }
806 
807  /* Compute the new match status */
808  if (gtk_toggle_button_get_active (button))
809  fd->cleared_match = (cleared_match_t)(fd->cleared_match | value);
810  else
811  fd->cleared_match = (cleared_match_t)(fd->cleared_match & ~value);
812 
813  ppr_filter_update_status_query (rfd->plugin_page);
814 
815  LEAVE(" ");
816 }
FilterData * gnc_plugin_page_register_get_filter_data(GncPluginPage *plugin_page)
Get the FilterData data structure associated with this register page.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_filter_status_select_all_cb()

void gnc_ppr_filter_status_select_all_cb ( GtkButton *  button,
RegisterFilterDialog rfd 
)

This function is called whenever the "select all" status button is clicked.

It updates all of the checkbox widgets, then updates the query on the register.

Parameters
buttonThe button that was clicked.
rfdA pointer to the filter dialog structure.

Definition at line 873 of file gnc-plugin-page-register-filter.cpp.

875 {
876  g_return_if_fail (GTK_IS_BUTTON(button));
877  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
878 
879  ENTER("(button %p, page %p)", button, rfd->plugin_page);
880 
881  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
882 
883  /* Turn on all the check menu items */
884  for (const auto& action : status_actions)
885  {
886  set_checkbutton_with_blocking (action.widget, nullptr,
888  rfd, TRUE);
889  }
890 
891  /* Set the requested status */
892  fd->cleared_match = CLEARED_ALL;
893  ppr_filter_update_status_query (rfd->plugin_page);
894  LEAVE(" ");
895 }
FilterData * gnc_plugin_page_register_get_filter_data(GncPluginPage *plugin_page)
Get the FilterData data structure associated with this register page.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
void gnc_ppr_filter_status_one_cb(GtkToggleButton *button, RegisterFilterDialog *rfd)
This function is called whenever one of the status entries is checked or unchecked.

◆ gnc_ppr_filter_update_register()

void gnc_ppr_filter_update_register ( GncPluginPage plugin_page)

This function is called to update the register.

Parameters
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.

Definition at line 745 of file gnc-plugin-page-register-filter.cpp.

746 {
747  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
748 
749  auto gsr = gnc_plugin_page_register_get_gsr (plugin_page);
750 
751  if (!gsr)
752  return;
753 
754  auto fd = gnc_plugin_page_register_get_filter_data (plugin_page);
755  GNCLedgerDisplayType ledger_type = gnc_ledger_display_type (gsr->ledger);
756 
757  /* Set the filter for the split register and status of save filter button */
758  fd->save_filter = false;
759 
760  ppr_filter_load_filter_parts (gsr, ledger_type, fd);
761 
762  if (ledger_type == LD_GL)
763  {
764  SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
765 
766  if (reg->type != GENERAL_JOURNAL) // search ledger and the like
767  set_filterdata_to_defaults (fd, false);
768  }
769  /* Update Query with Filter Status and Dates */
770  ppr_filter_update_status_query (plugin_page);
771  ppr_filter_update_date_query (plugin_page);
772 }
FilterData * gnc_plugin_page_register_get_filter_data(GncPluginPage *plugin_page)
Get the FilterData data structure associated with this register page.
SplitRegister * gnc_ledger_display_get_split_register(GNCLedgerDisplay *ld)
return the split register associated with a ledger display
GNCSplitReg * gnc_plugin_page_register_get_gsr(GncPluginPage *plugin_page)
Get the GNCSplitReg data structure associated with this register page.

◆ gnc_ppr_sort_button_cb()

void gnc_ppr_sort_button_cb ( GtkToggleButton *  button,
RegisterSortDialog rsd 
)

This function is called when a radio button in the "Sort By…" dialog is clicked.

Parameters
buttonThe button that was toggled.
rsdA pointer to the sort dialog structure.

Definition at line 372 of file gnc-plugin-page-register-sort.cpp.

374 {
375  g_return_if_fail (GTK_IS_TOGGLE_BUTTON(button));
376  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rsd->plugin_page));
377 
378  auto name = gtk_buildable_get_name (GTK_BUILDABLE(button));
379 
380  ENTER("button %s(%p), page %p", name, button, rsd->plugin_page);
381 
382  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button)))
383  {
384  LEAVE("1st callback of pair. Defer to 2nd callback.");
385  return;
386  }
387 
388  auto gsr = gnc_plugin_page_register_get_gsr (rsd->plugin_page);
389 
390  SortType type = SortTypefromString (name);
391  gnc_split_reg_sort (gsr, type, no_force, refresh);
392  LEAVE (" ");
393 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
GNCSplitReg * gnc_plugin_page_register_get_gsr(GncPluginPage *plugin_page)
Get the GNCSplitReg data structure associated with this register page.

◆ gnc_ppr_sort_dialog()

void gnc_ppr_sort_dialog ( GncPluginPage plugin_page,
SplitRegister *  reg,
SortData sd,
bool  show_save_button 
)

This function is called for the sort dialog.

Parameters
plugin_pageA pointer to the GncPluginPageRegister that is associated with this sort dialog.
regA pointer to the SplitRegister of the current register.
fdA pointer to the sort data structure for remembering state.
show_save_buttonSet to True to show save button.

Definition at line 530 of file gnc-plugin-page-register-sort.cpp.

532 {
533  RegisterSortDialog *rsd;
534 
535  ENTER(" ");
536 
537  rsd = g_new0 (RegisterSortDialog, 1);
538 
539  rsd->plugin_page = plugin_page;
540  rsd->reg = reg;
541  rsd->show_save_button = show_save_button;
542 
543  gnc_ppr_sort_dialog_create (rsd, sd);
544 
545  LEAVE(" ");
546 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_sort_order_reverse_cb()

void gnc_ppr_sort_order_reverse_cb ( GtkToggleButton *  button,
RegisterSortDialog rsd 
)

This function is called whenever the reverse sort order is checked or unchecked which allows reversing of the sort order.

Parameters
buttonThe toggle button that was changed.
rsdA pointer to the sort dialog structure.

Definition at line 429 of file gnc-plugin-page-register-sort.cpp.

431 {
432  g_return_if_fail (GTK_IS_CHECK_BUTTON(button));
433  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rsd->plugin_page));
434 
435  ENTER("Reverse toggle button (%p), page %p", button, rsd->plugin_page);
436 
437  /* Compute the new save sort order */
438  auto sd = gnc_plugin_page_register_get_sort_data (rsd->plugin_page);
439  auto gsr = gnc_plugin_page_register_get_gsr (rsd->plugin_page);
440 
441  sd->reverse_order = gtk_toggle_button_get_active (button);
442  gnc_split_reg_set_sort_reversed (gsr, sd->reverse_order, refresh);
443  LEAVE (" ");
444 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
SortData * gnc_plugin_page_register_get_sort_data(GncPluginPage *plugin_page)
Get the SortData data structure associated with this register page.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
GNCSplitReg * gnc_plugin_page_register_get_gsr(GncPluginPage *plugin_page)
Get the GNCSplitReg data structure associated with this register page.

◆ gnc_ppr_sort_order_save_cb()

void gnc_ppr_sort_order_save_cb ( GtkToggleButton *  button,
RegisterSortDialog rsd 
)

This function is called whenever the save sort order is checked or unchecked which allows saving of the sort order.

Parameters
buttonThe toggle button that was changed.
rsdA pointer to the sort dialog structure.

Definition at line 403 of file gnc-plugin-page-register-sort.cpp.

405 {
406  g_return_if_fail (GTK_IS_CHECK_BUTTON(button));
407  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rsd->plugin_page));
408 
409  ENTER("Save toggle button (%p), page %p", button, rsd->plugin_page);
410 
411  /* Compute the new save sort order */
412  auto sd = gnc_plugin_page_register_get_sort_data (rsd->plugin_page);
413 
414  if (gtk_toggle_button_get_active (button))
415  sd->save_order = true;
416  else
417  sd->save_order = false;
418  LEAVE (" ");
419 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
SortData * gnc_plugin_page_register_get_sort_data(GncPluginPage *plugin_page)
Get the SortData data structure associated with this register page.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ppr_sort_response_cb()

void gnc_ppr_sort_response_cb ( GtkDialog *  dialog,
gint  response,
RegisterSortDialog rsd 
)

This function is called when the "Sort By…" dialog is closed.

If the dialog was closed by any method other than clicking the OK button, the original sorting order will be restored.

Parameters
dialogA pointer to the dialog box.
responseA numerical value indicating why the dialog box was closed.
rsdA pointer to the sort dialog structure.

Definition at line 309 of file gnc-plugin-page-register-sort.cpp.

312 {
313  g_return_if_fail (GTK_IS_DIALOG(dialog));
314  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rsd->plugin_page));
315 
316  ENTER(" ");
317 
318  auto sd = gnc_plugin_page_register_get_sort_data (rsd->plugin_page);
319  auto gsr = gnc_plugin_page_register_get_gsr (rsd->plugin_page);
320 
321  if (response != GTK_RESPONSE_OK)
322  {
323  // Restore the original sort order
324  gnc_split_reg_set_sort_reversed (gsr, rsd->original_reverse_order, no_refresh);
325  sd->reverse_order = rsd->original_reverse_order;
326  // use force as sort_type may still be the same if only reverse_order changed
327  gnc_split_reg_sort (gsr, rsd->original_sort_type, force, refresh);
328  sd->sort_type = rsd->original_sort_type;
329  sd->save_order = rsd->original_save_order;
330  }
331  else
332  {
333  // clear the sort when unticking the save option
334  if ((!sd->save_order) && ((rsd->original_sort_type) ||
335  (rsd->original_reverse_order)))
336  {
337  gnc_ppr_sort_set_order (gsr, DEFAULT_SORT_ORDER);
338  gnc_ppr_sort_set_reversed (gsr, false);
339  }
340  rsd->original_sort_type = sd->sort_type;
341  rsd->original_reverse_order = sd->reverse_order;
342 
343  if (sd->save_order)
344  {
345  SortType type = gnc_split_reg_get_sort_type (gsr);
346  std::string sort_type = (SortTypeasString (type));
347 
348  gnc_ppr_sort_set_order (gsr, sort_type);
349  gnc_ppr_sort_set_reversed (gsr, sd->reverse_order);
350  }
351  }
352  gnc_book_option_remove_cb (OPTION_NAME_NUM_FIELD_SOURCE,
353  gnc_ppr_sort_book_option_changed,
354  (gpointer)rsd);
355  rsd->dialog = nullptr;
356  rsd->num_radio = nullptr;
357  rsd->act_radio = nullptr;
358  sd->dialog = nullptr;
359  g_free (rsd);
360  gtk_widget_destroy (GTK_WIDGET(dialog));
361  LEAVE (" ");
362 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
SortData * gnc_plugin_page_register_get_sort_data(GncPluginPage *plugin_page)
Get the SortData data structure associated with this register page.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
GNCSplitReg * gnc_plugin_page_register_get_gsr(GncPluginPage *plugin_page)
Get the GNCSplitReg data structure associated with this register page.

◆ gnc_ppr_sort_update_register()

void gnc_ppr_sort_update_register ( GncPluginPage plugin_page)

This function is called to update the register.

Parameters
pageA pointer to the GncPluginPageRegister that is associated with this sort order dialog.

Definition at line 220 of file gnc-plugin-page-register-sort.cpp.

221 {
222  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page));
223 
224  auto sd = gnc_plugin_page_register_get_sort_data (plugin_page);
225  auto gsr = gnc_plugin_page_register_get_gsr (plugin_page);
226  GNCLedgerDisplayType ledger_type = gnc_ledger_display_type (gsr->ledger);
227 
228  sd->save_order = false;
229 
230  // Set the sort direction for the split register and status of save order button
231  sd->reverse_order = gnc_ppr_sort_get_reversed (gsr);
232 
233  PINFO("Loaded Sort reversed order is %s", sd->reverse_order ? "true" : "false");
234 
235  gnc_split_reg_set_sort_reversed (gsr, sd->reverse_order, no_refresh);
236  if (sd->reverse_order)
237  sd->save_order = true;
238 
239  // Set the sort order for the split register and status of save order button
240  std::string sort_type = gnc_ppr_sort_get_order (gsr);
241 
242  PINFO("Loaded Sort type is %s", sort_type.c_str());
243 
244  SortType type = SortTypefromString (sort_type.c_str());
245 
246  gnc_split_reg_sort (gsr, type, no_force, no_refresh);
247 
248  if (sort_type.compare (DEFAULT_SORT_ORDER) != 0)
249  sd->save_order = true;
250 
251  if (ledger_type == LD_GL)
252  {
253  auto reg = gnc_ledger_display_get_split_register (gsr->ledger);
254 
255  if (reg->type != GENERAL_JOURNAL) // search ledger and the like
256  {
257  gnc_split_reg_sort (gsr, SortTypefromString (DEFAULT_SORT_ORDER.c_str()), no_force, no_refresh);
258  sd->reverse_order = false;
259  sd->save_order = false;
260  }
261  }
262 }
#define PINFO(format, args...)
Print an informational note.
Definition: qoflog.h:256
SortData * gnc_plugin_page_register_get_sort_data(GncPluginPage *plugin_page)
Get the SortData data structure associated with this register page.
SplitRegister * gnc_ledger_display_get_split_register(GNCLedgerDisplay *ld)
return the split register associated with a ledger display
GNCSplitReg * gnc_plugin_page_register_get_gsr(GncPluginPage *plugin_page)
Get the GNCSplitReg data structure associated with this register page.