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:3218
#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:3382
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 1655 of file gnc-plugin-page-register-filter.cpp.

1657 {
1658  RegisterFilterDialog *rfd;
1659 
1660  ENTER(" ");
1661 
1662  rfd = g_new0 (RegisterFilterDialog, 1);
1663 
1664  rfd->plugin_page = plugin_page;
1665  rfd->show_save_button = show_save_button;
1666 
1667  ppr_filter_dialog_create (rfd, fd, query);
1668 
1669  LEAVE(" ");
1670 }
#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 1052 of file gnc-plugin-page-register-filter.cpp.

1054 {
1055  g_return_if_fail (GTK_IS_SPIN_BUTTON(button));
1056  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1057 
1058  ENTER("(button %p, page %p)", button, rfd->plugin_page);
1059 
1060  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
1061 
1062  fd->days = gtk_spin_button_get_value (GTK_SPIN_BUTTON(button));
1063  ppr_filter_update_date_query (rfd->plugin_page);
1064 
1065  LEAVE(" ");
1066 }
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 1145 of file gnc-plugin-page-register-filter.cpp.

1147 {
1148  g_return_if_fail (GTK_IS_RADIO_BUTTON(radio));
1149  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1150 
1151  ENTER("(radio %s(%p), page %p)",
1152  gtk_buildable_get_name (GTK_BUILDABLE(radio)), radio, rfd->plugin_page);
1153 
1154  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(radio)))
1155  {
1156  LEAVE("1st callback of pair. Defer to 2nd callback.");
1157  return;
1158  }
1159 
1160  auto name = gtk_buildable_get_name (GTK_BUILDABLE(radio));
1161  gboolean active = !g_strcmp0 (name, "end_date_choose");
1162  gtk_widget_set_sensitive (rfd->end_date, active);
1163  get_filter_times (rfd);
1164  ppr_filter_update_date_query (rfd->plugin_page);
1165 
1166  LEAVE(" ");
1167 }
#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 1285 of file gnc-plugin-page-register-filter.cpp.

1287 {
1288  g_return_if_fail (GTK_IS_CHECK_BUTTON(button));
1289  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1290 
1291  ENTER("End toggle button (%p), plugin_page %p", button, rfd->plugin_page);
1292 
1293  auto name = gtk_buildable_get_name (GTK_BUILDABLE(button));
1294 
1295  gboolean active = gtk_toggle_button_get_active (button);
1296 
1297  gtk_widget_set_sensitive (rfd->end_latest, !active);
1298 
1299  if (g_strcmp0 (name, "end_date_check") == 0)
1300  {
1301  set_sensitive_end_widget (rfd, rfd->end_date, active);
1302 
1303  set_checkbutton_with_blocking (rfd->end_relative_check,
1304  rfd->end_days_check,
1306  rfd, FALSE);
1307  }
1308  if (g_strcmp0 (name, "end_relative_check") == 0)
1309  {
1310  set_sensitive_end_widget (rfd, rfd->end_relative, active);
1311 
1312  set_checkbutton_with_blocking (rfd->end_date_check,
1313  rfd->end_days_check,
1315  rfd, FALSE);
1316  }
1317  if (g_strcmp0 (name, "end_days_check") == 0)
1318  {
1319  set_sensitive_end_widget (rfd, rfd->end_days, active);
1320 
1321  set_checkbutton_with_blocking (rfd->end_date_check,
1322  rfd->end_relative_check,
1324  rfd, FALSE);
1325  }
1326  get_filter_times (rfd);
1327  ppr_filter_update_date_query (rfd->plugin_page);
1328 
1329  LEAVE(" ");
1330 }
#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 1370 of file gnc-plugin-page-register-filter.cpp.

1373 {
1374  g_return_if_fail (GTK_IS_DIALOG(dialog));
1375  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1376 
1377  ENTER(" ");
1378 
1379  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
1380  auto gsr = gnc_plugin_page_register_get_gsr (rfd->plugin_page);
1381 
1382  if ((fd->start_time > 0 && fd->end_time > 0) && (fd->start_time > fd->end_time))
1383  {
1384  auto response = gnc_ok_cancel_dialog (GTK_WINDOW(rfd->dialog),
1385  GTK_RESPONSE_CANCEL,
1386  _("The Start date is after the End date.\n"
1387  "Select Cancel to change dates.\n"));
1388  if (response == GTK_RESPONSE_CANCEL)
1389  return;
1390  }
1391 
1392  if (response != GTK_RESPONSE_OK)
1393  {
1394  /* Remove the old status match */
1395  fd->cleared_match = rfd->original_cleared_match;
1396  gnc_plugin_register_set_enable_refresh (GNC_PLUGIN_PAGE_REGISTER(rfd->plugin_page), FALSE);
1397  ppr_filter_update_status_query (rfd->plugin_page);
1398  gnc_plugin_register_set_enable_refresh (GNC_PLUGIN_PAGE_REGISTER(rfd->plugin_page), TRUE);
1399 
1400  fd->start_ap = rfd->original_start_ap;
1401  fd->start_time = rfd->original_start_time;
1402  fd->start_days = rfd->original_start_days;
1403  fd->end_ap = rfd->original_end_ap;
1404  fd->end_time = rfd->original_end_time;
1405  fd->end_days = rfd->original_end_days;
1406 
1407  fd->days = rfd->original_days;
1408  fd->save_filter = rfd->original_save_filter;
1409  ppr_filter_update_date_query (rfd->plugin_page);
1410  }
1411  else
1412  {
1413  // clear the filter when unticking the save option
1414  if (!fd->save_filter && rfd->original_save_filter)
1415  ppr_filter_save_filter (gsr, "");
1416 
1417  rfd->original_save_filter = fd->save_filter;
1418 
1419  if (fd->save_filter)
1420  ppr_filter_save_filter_parts (gsr, fd);
1421  }
1422  rfd->dialog = nullptr;
1423  fd->dialog = nullptr;
1424  g_free (rfd);
1425  gtk_widget_destroy (GTK_WIDGET(dialog));
1426  LEAVE(" ");
1427 }
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 1340 of file gnc-plugin-page-register-filter.cpp.

1342 {
1343  g_return_if_fail (GTK_IS_CHECK_BUTTON(button));
1344  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1345 
1346  ENTER("Save toggle button (%p), plugin_page %p", button, rfd->plugin_page);
1347 
1348  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
1349 
1350  /* Compute the new save filter status */
1351  if (gtk_toggle_button_get_active (button))
1352  fd->save_filter = true;
1353  else
1354  fd->save_filter = false;
1355 
1356  LEAVE(" ");
1357 }
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 1007 of file gnc-plugin-page-register-filter.cpp.

1009 {
1010  g_return_if_fail (GTK_IS_RADIO_BUTTON(button));
1011  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1012 
1013  ENTER("(button %p, page %p)", button, rfd->plugin_page);
1014 
1015  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
1016 
1017  auto name = gtk_buildable_get_name (GTK_BUILDABLE(button));
1018  gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button));
1019 
1020  if (active && g_strcmp0 (name, "filter_show_range") == 0)
1021  {
1022  gtk_widget_set_sensitive (rfd->table, active);
1023  gtk_widget_set_sensitive (rfd->num_days, !active);
1024  get_filter_times (rfd);
1025  }
1026  else if (active && g_strcmp0 (name, "filter_show_days") == 0)
1027  {
1028  gtk_widget_set_sensitive (rfd->table, !active);
1029  gtk_widget_set_sensitive (rfd->num_days, active);
1030  gtk_spin_button_set_value (GTK_SPIN_BUTTON(rfd->num_days), fd->days);
1031  }
1032  else
1033  {
1034  gtk_widget_set_sensitive (rfd->table, FALSE);
1035  gtk_widget_set_sensitive (rfd->num_days, FALSE);
1036  set_filterdata_to_defaults (fd, true);
1037  }
1038  ppr_filter_update_date_query (rfd->plugin_page);
1039  LEAVE(" ");
1040 }
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 1102 of file gnc-plugin-page-register-filter.cpp.

1104 {
1105  g_return_if_fail (GTK_IS_RADIO_BUTTON(radio));
1106  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1107 
1108  ENTER("(radio %s(%p), page %p)",
1109  gtk_buildable_get_name (GTK_BUILDABLE(radio)), radio, rfd->plugin_page);
1110 
1111  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(radio)))
1112  {
1113  LEAVE("1st callback of pair. Defer to 2nd callback.");
1114  return;
1115  }
1116 
1117  auto name = gtk_buildable_get_name (GTK_BUILDABLE(radio));
1118  gboolean active = !g_strcmp0 (name, "start_date_choose");
1119  gtk_widget_set_sensitive (rfd->start_date, active);
1120  get_filter_times (rfd);
1121  ppr_filter_update_date_query (rfd->plugin_page);
1122 
1123  LEAVE(" ");
1124 }
#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 1196 of file gnc-plugin-page-register-filter.cpp.

1198 {
1199  g_return_if_fail (GTK_IS_SPIN_BUTTON(button));
1200  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1201 
1202  ENTER("(button %p, page %p)", button, rfd->plugin_page);
1203 
1204  auto fd = gnc_plugin_page_register_get_filter_data (rfd->plugin_page);
1205 
1206  auto name = gtk_buildable_get_name (GTK_BUILDABLE(button));
1207 
1208  if (g_strcmp0 (name, "start_days_spin") == 0)
1209  fd->start_days = gtk_spin_button_get_value (GTK_SPIN_BUTTON(button));
1210 
1211  if (g_strcmp0 (name, "end_days_spin") == 0)
1212  fd->end_days = gtk_spin_button_get_value (GTK_SPIN_BUTTON(button));
1213 
1214  get_filter_times (rfd);
1215  ppr_filter_update_date_query (rfd->plugin_page);
1216 
1217  LEAVE(" ");
1218 }
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 1229 of file gnc-plugin-page-register-filter.cpp.

1231 {
1232  g_return_if_fail (GTK_IS_CHECK_BUTTON(button));
1233  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER(rfd->plugin_page));
1234 
1235  ENTER("Start toggle button (%p), plugin_page %p", button, rfd->plugin_page);
1236 
1237  auto name = gtk_buildable_get_name (GTK_BUILDABLE(button));
1238 
1239  gboolean active = gtk_toggle_button_get_active (button);
1240 
1241  gtk_widget_set_sensitive (rfd->start_earliest, !active);
1242 
1243  if (g_strcmp0 (name, "start_date_check") == 0)
1244  {
1245  set_sensitive_start_widget (rfd, rfd->start_date, active);
1246 
1247  set_checkbutton_with_blocking (rfd->start_relative_check,
1248  rfd->start_days_check,
1250  rfd, FALSE);
1251  }
1252  if (g_strcmp0 (name, "start_relative_check") == 0)
1253  {
1254  set_sensitive_start_widget (rfd, rfd->start_relative, active);
1255 
1256  set_checkbutton_with_blocking (rfd->start_date_check,
1257  rfd->start_days_check,
1259  rfd, FALSE);
1260  }
1261  if (g_strcmp0 (name, "start_days_check") == 0)
1262  {
1263  set_sensitive_start_widget (rfd, rfd->start_days, active);
1264 
1265  set_checkbutton_with_blocking (rfd->start_date_check,
1266  rfd->start_relative_check,
1268  rfd, FALSE);
1269  }
1270  get_filter_times (rfd);
1271  ppr_filter_update_date_query (rfd->plugin_page);
1272 
1273  LEAVE(" ");
1274 }
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.