GnuCash  5.6-150-g038405b370+
Files | Data Structures | Macros | Enumerations | Functions

Files

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

Data Structures

struct  status_action
 
struct  GncPluginPageRegisterPrivate
 
struct  GncPluginPageRegister
 
struct  GncPluginPageRegisterClass
 

Macros

#define DEFAULT_LINES_AMOUNT   50
 
#define DEFAULT_FILTER_NUM_DAYS_GL   "30"
 
#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 Invoice")
 
#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 bill, invoice, or voucher")
 
#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 CLEARED_VALUE   "cleared_value"
 
#define DEFAULT_FILTER   "0x001f"
 
#define DEFAULT_SORT_ORDER   "BY_STANDARD"
 
#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_plugin_page_register_sort_button_cb (GtkToggleButton *button, GncPluginPageRegister *page)
 This function is called when a radio button in the "Sort By…" dialog is clicked. More...
 
void gnc_plugin_page_register_sort_response_cb (GtkDialog *dialog, gint response, GncPluginPageRegister *page)
 This function is called when the "Sort By…" dialog is closed. More...
 
void gnc_plugin_page_register_sort_order_save_cb (GtkToggleButton *button, GncPluginPageRegister *page)
 This function is called whenever the save sort order is checked or unchecked which allows saving of the sort order. More...
 
void gnc_plugin_page_register_sort_order_reverse_cb (GtkToggleButton *button, GncPluginPageRegister *page)
 This function is called whenever the reverse sort order is checked or unchecked which allows reversing of the sort order. More...
 
void gnc_plugin_page_register_set_sort_order (GncPluginPage *plugin_page, const gchar *sort_order)
 
void gnc_plugin_page_register_set_sort_reversed (GncPluginPage *plugin_page, gboolean reverse_order)
 
void gnc_plugin_page_register_filter_select_range_cb (GtkRadioButton *button, GncPluginPageRegister *page)
 This function is called when the radio buttons changes state. More...
 
void gnc_plugin_page_register_filter_start_cb (GtkWidget *radio, GncPluginPageRegister *page)
 This function is called when one of the start date radio buttons is selected. More...
 
void gnc_plugin_page_register_filter_end_cb (GtkWidget *radio, GncPluginPageRegister *page)
 This function is called when one of the end date radio buttons is selected. More...
 
void gnc_plugin_page_register_filter_response_cb (GtkDialog *dialog, gint response, GncPluginPageRegister *page)
 This function is called when the "Filter By…" dialog is closed. More...
 
void gnc_plugin_page_register_filter_status_select_all_cb (GtkButton *button, GncPluginPageRegister *page)
 This function is called whenever the "select all" status button is clicked. More...
 
void gnc_plugin_page_register_filter_status_clear_all_cb (GtkButton *button, GncPluginPageRegister *page)
 This function is called whenever the "clear all" status button is clicked. More...
 
void gnc_plugin_page_register_filter_status_one_cb (GtkToggleButton *button, GncPluginPageRegister *page)
 This function is called whenever one of the status entries is checked or unchecked. More...
 
void gnc_plugin_page_register_filter_save_cb (GtkToggleButton *button, GncPluginPageRegister *page)
 This function is called whenever the save status is checked or unchecked. More...
 
void gnc_plugin_page_register_filter_days_changed_cb (GtkSpinButton *button, GncPluginPageRegister *page)
 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_plugin_page_register_set_filter (GncPluginPage *plugin_page, const gchar *filter)
 
 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_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...
 
GType gnc_plugin_page_register_get_type (void)
 Retrieve the type number for the plugin page. More...
 

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 2968 of file gnc-plugin-page-register.cpp.

2969 {
2971 
2972  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));
2973 
2974  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (plugin_page);
2975 
2976  priv->fd.days = 0;
2977  priv->fd.start_time = 0;
2978  priv->fd.end_time = 0;
2979  priv->fd.cleared_match = (cleared_match_t)g_ascii_strtoll (DEFAULT_FILTER, NULL, 16);
2980 
2981  gnc_ppr_update_date_query (GNC_PLUGIN_PAGE_REGISTER(plugin_page));
2982 }

◆ gnc_plugin_page_register_filter_days_changed_cb()

void gnc_plugin_page_register_filter_days_changed_cb ( GtkSpinButton *  button,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.

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

2997 {
2999 
3000  g_return_if_fail (GTK_IS_SPIN_BUTTON (button));
3001  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
3002 
3003  ENTER ("(button %p, page %p)", button, page);
3004  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
3005 
3006  priv->fd.days = gtk_spin_button_get_value (GTK_SPIN_BUTTON (button));
3007  gnc_ppr_update_date_query (page);
3008  LEAVE (" ");
3009 }
#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_plugin_page_register_filter_end_cb()

void gnc_plugin_page_register_filter_end_cb ( GtkWidget *  radio,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.

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

3106 {
3108  const gchar* name;
3109  gboolean active;
3110 
3111  g_return_if_fail (GTK_IS_RADIO_BUTTON (radio));
3112  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
3113 
3114  ENTER ("(radio %s(%p), page %p)",
3115  gtk_buildable_get_name (GTK_BUILDABLE (radio)), radio, page);
3116  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
3117  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio)))
3118  {
3119  LEAVE ("1st callback of pair. Defer to 2nd callback.");
3120  return;
3121  }
3122 
3123  name = gtk_buildable_get_name (GTK_BUILDABLE (radio));
3124  active = !g_strcmp0 (name, "end_date_choose");
3125  gtk_widget_set_sensitive (priv->fd.end_date, active);
3126  get_filter_times (page);
3127  gnc_ppr_update_date_query (page);
3128  LEAVE (" ");
3129 }
#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_plugin_page_register_filter_response_cb()

void gnc_plugin_page_register_filter_response_cb ( GtkDialog *  dialog,
gint  response,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister associated with this dialog box.

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

3176 {
3178  GncPluginPage* plugin_page;
3179 
3180  g_return_if_fail (GTK_IS_DIALOG (dialog));
3181  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
3182 
3183  ENTER (" ");
3184  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
3185  plugin_page = GNC_PLUGIN_PAGE (page);
3186 
3187  if (response != GTK_RESPONSE_OK)
3188  {
3189  /* Remove the old status match */
3190  priv->fd.cleared_match = priv->fd.original_cleared_match;
3191  priv->enable_refresh = FALSE;
3192  gnc_ppr_update_status_query (page);
3193  priv->enable_refresh = TRUE;
3194  priv->fd.start_time = priv->fd.original_start_time;
3195  priv->fd.end_time = priv->fd.original_end_time;
3196  priv->fd.days = priv->fd.original_days;
3197  priv->fd.save_filter = priv->fd.original_save_filter;
3198  gnc_ppr_update_date_query (page);
3199  }
3200  else
3201  {
3202  // clear the filter when unticking the save option
3203  if ((priv->fd.save_filter == FALSE) && (priv->fd.original_save_filter == TRUE))
3204  gnc_plugin_page_register_set_filter (plugin_page, NULL);
3205 
3206  priv->fd.original_save_filter = priv->fd.save_filter;
3207 
3208  if (priv->fd.save_filter)
3209  {
3210  gchar *filter;
3211  GList *flist = NULL;
3212 
3213  // cleared match
3214  flist = g_list_prepend
3215  (flist, g_strdup_printf ("0x%04x", priv->fd.cleared_match));
3216 
3217  // start time
3218  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->fd.start_date_choose)) && priv->fd.start_time != 0)
3219  flist = g_list_prepend (flist, gnc_plugin_page_register_filter_time2dmy (priv->fd.start_time));
3220  else
3221  flist = g_list_prepend (flist, g_strdup ("0"));
3222 
3223  // end time
3224  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->fd.end_date_choose))
3225  && priv->fd.end_time != 0)
3226  flist = g_list_prepend (flist, gnc_plugin_page_register_filter_time2dmy (priv->fd.end_time));
3227  else
3228  flist = g_list_prepend (flist, g_strdup ("0"));
3229 
3230  // number of days
3231  if (priv->fd.days > 0)
3232  flist = g_list_prepend (flist, g_strdup_printf ("%d", priv->fd.days));
3233  else
3234  flist = g_list_prepend (flist, g_strdup ("0"));
3235 
3236  flist = g_list_reverse (flist);
3237  filter = gnc_g_list_stringjoin (flist, ",");
3238  PINFO ("The filter to save is %s", filter);
3239  gnc_plugin_page_register_set_filter (plugin_page, filter);
3240  g_free (filter);
3241  g_list_free_full (flist, g_free);
3242  }
3243  }
3244  priv->fd.dialog = NULL;
3245  gtk_widget_destroy (GTK_WIDGET (dialog));
3246  LEAVE (" ");
3247 }
The instance data structure for a content plugin.
gchar * gnc_g_list_stringjoin(GList *list_of_strings, const gchar *sep)
Return a string joining a GList whose elements are gchar* strings.
#define PINFO(format, args...)
Print an informational note.
Definition: qoflog.h:256
#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_plugin_page_register_filter_save_cb()

void gnc_plugin_page_register_filter_save_cb ( GtkToggleButton *  button,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.

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

3143 {
3145 
3146  g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
3147  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
3148 
3149  ENTER ("Save toggle button (%p), plugin_page %p", button, page);
3150 
3151  /* Compute the new save filter status */
3152  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
3153  if (gtk_toggle_button_get_active (button))
3154  priv->fd.save_filter = TRUE;
3155  else
3156  priv->fd.save_filter = FALSE;
3157  LEAVE (" ");
3158 }
#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_plugin_page_register_filter_select_range_cb()

void gnc_plugin_page_register_filter_select_range_cb ( GtkRadioButton *  button,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.

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

2930 {
2932  gboolean active;
2933  const gchar* name;
2934 
2935  g_return_if_fail (GTK_IS_RADIO_BUTTON (button));
2936  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2937 
2938  ENTER ("(button %p, page %p)", button, page);
2939  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2940  name = gtk_buildable_get_name (GTK_BUILDABLE (button));
2941  active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
2942 
2943  if (active && g_strcmp0 (name, "filter_show_range") == 0)
2944  {
2945  gtk_widget_set_sensitive (priv->fd.table, active);
2946  gtk_widget_set_sensitive (priv->fd.num_days, !active);
2947  get_filter_times (page);
2948  }
2949  else if (active && g_strcmp0 (name, "filter_show_days") == 0)
2950  {
2951  gtk_widget_set_sensitive (priv->fd.table, !active);
2952  gtk_widget_set_sensitive (priv->fd.num_days, active);
2953  gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->fd.num_days), priv->fd.days);
2954  }
2955  else
2956  {
2957  gtk_widget_set_sensitive (priv->fd.table, FALSE);
2958  gtk_widget_set_sensitive (priv->fd.num_days, FALSE);
2959  priv->fd.days = 0;
2960  priv->fd.start_time = 0;
2961  priv->fd.end_time = 0;
2962  }
2963  gnc_ppr_update_date_query (page);
2964  LEAVE (" ");
2965 }
#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_plugin_page_register_filter_start_cb()

void gnc_plugin_page_register_filter_start_cb ( GtkWidget *  radio,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.

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

3058 {
3060  const gchar* name;
3061  gboolean active;
3062 
3063  g_return_if_fail (GTK_IS_RADIO_BUTTON (radio));
3064  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
3065 
3066  ENTER ("(radio %s(%p), page %p)",
3067  gtk_buildable_get_name (GTK_BUILDABLE (radio)), radio, page);
3068  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
3069  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio)))
3070  {
3071  LEAVE ("1st callback of pair. Defer to 2nd callback.");
3072  return;
3073  }
3074 
3075  name = gtk_buildable_get_name (GTK_BUILDABLE (radio));
3076  active = !g_strcmp0 (name, "start_date_choose");
3077  gtk_widget_set_sensitive (priv->fd.start_date, active);
3078  get_filter_times (page);
3079  gnc_ppr_update_date_query (page);
3080  LEAVE (" ");
3081 }
#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_plugin_page_register_filter_status_clear_all_cb()

void gnc_plugin_page_register_filter_status_clear_all_cb ( GtkButton *  button,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.

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

2827 {
2829  GtkWidget* widget;
2830  gint i;
2831 
2832  g_return_if_fail (GTK_IS_BUTTON (button));
2833  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2834 
2835  ENTER ("(button %p, page %p)", button, page);
2836 
2837  /* Turn off all the check menu items */
2838  for (i = 0; status_actions[i].action_name; i++)
2839  {
2840  widget = status_actions[i].widget;
2841  g_signal_handlers_block_by_func (widget,
2843  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
2844  g_signal_handlers_unblock_by_func (widget,
2846  }
2847 
2848  /* Set the requested status */
2849  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2850  priv->fd.cleared_match = CLEARED_NONE;
2851  gnc_ppr_update_status_query (page);
2852  LEAVE (" ");
2853 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
void gnc_plugin_page_register_filter_status_one_cb(GtkToggleButton *button, GncPluginPageRegister *page)
This function is called whenever one of the status entries is checked or unchecked.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_plugin_page_register_filter_status_one_cb()

void gnc_plugin_page_register_filter_status_one_cb ( GtkToggleButton *  button,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.

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

2740 {
2742  const gchar* name;
2743  gint i, value;
2744 
2745  g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
2746  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2747 
2748  name = gtk_buildable_get_name (GTK_BUILDABLE (button));
2749  ENTER ("toggle button %s (%p), plugin_page %p", name, button, page);
2750 
2751  /* Determine what status bit to change */
2752  value = CLEARED_NONE;
2753  for (i = 0; status_actions[i].action_name; i++)
2754  {
2755  if (g_strcmp0 (name, status_actions[i].action_name) == 0)
2756  {
2757  value = status_actions[i].value;
2758  break;
2759  }
2760  }
2761 
2762  /* Compute the new match status */
2763  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2764  if (gtk_toggle_button_get_active (button))
2765  priv->fd.cleared_match = (cleared_match_t)(priv->fd.cleared_match | value);
2766  else
2767  priv->fd.cleared_match = (cleared_match_t)(priv->fd.cleared_match & ~value);
2768  gnc_ppr_update_status_query (page);
2769  LEAVE (" ");
2770 }
#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_plugin_page_register_filter_status_select_all_cb()

void gnc_plugin_page_register_filter_status_select_all_cb ( GtkButton *  button,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister that is associated with this filter dialog.

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

2785 {
2787  GtkWidget* widget;
2788  gint i;
2789 
2790  g_return_if_fail (GTK_IS_BUTTON (button));
2791  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2792 
2793  ENTER ("(button %p, page %p)", button, page);
2794 
2795  /* Turn on all the check menu items */
2796  for (i = 0; status_actions[i].action_name; i++)
2797  {
2798  widget = status_actions[i].widget;
2799  g_signal_handlers_block_by_func (widget,
2801  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
2802  g_signal_handlers_unblock_by_func (widget,
2804  }
2805 
2806  /* Set the requested status */
2807  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2808  priv->fd.cleared_match = CLEARED_ALL;
2809  gnc_ppr_update_status_query (page);
2810  LEAVE (" ");
2811 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
void gnc_plugin_page_register_filter_status_one_cb(GtkToggleButton *button, GncPluginPageRegister *page)
This function is called whenever one of the status entries is checked or unchecked.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ 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 690 of file gnc-plugin-page-register.cpp.

691 {
693  GNCLedgerDisplayType ledger_type;
694  Account* leader;
695 
696  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
697  ledger_type = gnc_ledger_display_type (priv->ledger);
698  leader = gnc_ledger_display_leader (priv->ledger);
699 
700  if ((ledger_type == LD_SINGLE) || (ledger_type == LD_SUBACCOUNT))
701  return leader;
702  return NULL;
703 }
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 706 of file gnc-plugin-page-register.cpp.

707 {
709  SplitRegister* reg;
710 
711  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
712  reg = gnc_ledger_display_get_split_register (priv->ledger);
714 }
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_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 5421 of file gnc-plugin-page-register.cpp.

5422 {
5423  GncPluginPageRegister* page;
5425 
5426  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), NULL);
5427 
5428  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
5429  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
5430 
5431  return priv->gsr;
5432 }

◆ 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 2313 of file gnc-plugin-page-register.cpp.

2314 {
2315  GncPluginPageRegister* page;
2317 
2318  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), NULL);
2319 
2320  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
2321  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2322  return gnc_ledger_display_get_query (priv->ledger);
2323 }
Query * gnc_ledger_display_get_query(GNCLedgerDisplay *ld)
return the query associated with a ledger

◆ 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 574 of file gnc-plugin-page-register.cpp.

575 {
576  GNCLedgerDisplay* ledger;
577  GncPluginPage* page;
579  gnc_commodity* com0;
580  gnc_commodity* com1;
581 
582  ENTER ("account=%p, subaccounts=%s", account,
583  subaccounts ? "TRUE" : "FALSE");
584 
585  com0 = gnc_account_get_currency_or_parent (account);
586  com1 = GNC_COMMODITY(gnc_account_foreach_descendant_until (account,
587  gnc_plug_page_register_check_commodity,
588  static_cast<gpointer>(com0)));
589 
590  if (subaccounts)
591  ledger = gnc_ledger_display_subaccounts (account, com1 != NULL);
592  else
593  ledger = gnc_ledger_display_simple (account);
594 
595  page = gnc_plugin_page_register_new_common (ledger);
596  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
597  priv->key = *xaccAccountGetGUID (account);
598 
599  LEAVE ("%p", page);
600  return page;
601 }
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:3210
#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:3374
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 604 of file gnc-plugin-page-register.cpp.

605 {
606  GNCLedgerDisplay* ledger;
607 
608  ledger = gnc_ledger_display_gl();
609  return gnc_plugin_page_register_new_common (ledger);
610 }
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 613 of file gnc-plugin-page-register.cpp.

614 {
615  return gnc_plugin_page_register_new_common (ledger);
616 }

◆ 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 5405 of file gnc-plugin-page-register.cpp.

5408 {
5409  GncPluginPageRegister* page;
5411 
5412  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));
5413 
5414  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
5415  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
5416  priv->lines_default = lines_default;
5417  priv->read_only = read_only;
5418 }

◆ gnc_plugin_page_register_sort_button_cb()

void gnc_plugin_page_register_sort_button_cb ( GtkToggleButton *  button,
GncPluginPageRegister page 
)

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

Parameters
buttonThe button that was toggled.
pageA pointer to the GncPluginPageRegister associated with this dialog box.

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

2442 {
2444  const gchar* name;
2445  SortType type;
2446 
2447  g_return_if_fail (GTK_IS_TOGGLE_BUTTON (button));
2448  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2449 
2450  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2451  name = gtk_buildable_get_name (GTK_BUILDABLE (button));
2452  ENTER ("button %s(%p), page %p", name, button, page);
2453  type = SortTypefromString (name);
2454  gnc_split_reg_set_sort_type (priv->gsr, type);
2455  LEAVE (" ");
2456 }
#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_plugin_page_register_sort_order_reverse_cb()

void gnc_plugin_page_register_sort_order_reverse_cb ( GtkToggleButton *  button,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister that is associated with this sort order dialog.

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

2500 {
2502 
2503  g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
2504  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2505 
2506  ENTER ("Reverse toggle button (%p), plugin_page %p", button, page);
2507 
2508  /* Compute the new save sort order */
2509  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2510 
2511  priv->sd.reverse_order = gtk_toggle_button_get_active (button);
2512  gnc_split_reg_set_sort_reversed (priv->gsr, priv->sd.reverse_order, TRUE);
2513  LEAVE (" ");
2514 }
#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_plugin_page_register_sort_order_save_cb()

void gnc_plugin_page_register_sort_order_save_cb ( GtkToggleButton *  button,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister that is associated with this sort order dialog.

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

2470 {
2472 
2473  g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
2474  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2475 
2476  ENTER ("Save toggle button (%p), plugin_page %p", button, page);
2477 
2478  /* Compute the new save sort order */
2479  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2480 
2481  if (gtk_toggle_button_get_active (button))
2482  priv->sd.save_order = TRUE;
2483  else
2484  priv->sd.save_order = FALSE;
2485  LEAVE (" ");
2486 }
#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_plugin_page_register_sort_response_cb()

void gnc_plugin_page_register_sort_response_cb ( GtkDialog *  dialog,
gint  response,
GncPluginPageRegister page 
)

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.
pageA pointer to the GncPluginPageRegister associated with this dialog box.

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

2379 {
2381  GncPluginPage* plugin_page;
2382  SortType type;
2383  const gchar* order;
2384 
2385  g_return_if_fail (GTK_IS_DIALOG (dialog));
2386  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2387 
2388  ENTER (" ");
2389  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2390  plugin_page = GNC_PLUGIN_PAGE (page);
2391 
2392  if (response != GTK_RESPONSE_OK)
2393  {
2394  /* Restore the original sort order */
2395  gnc_split_reg_set_sort_reversed (priv->gsr, priv->sd.original_reverse_order,
2396  TRUE);
2397  priv->sd.reverse_order = priv->sd.original_reverse_order;
2398  gnc_split_reg_set_sort_type (priv->gsr, priv->sd.original_sort_type);
2399  priv->sd.save_order = priv->sd.original_save_order;
2400  }
2401  else
2402  {
2403  // clear the sort when unticking the save option
2404  if ((!priv->sd.save_order) && ((priv->sd.original_save_order) || (priv->sd.original_reverse_order)))
2405  {
2406  gnc_plugin_page_register_set_sort_order (plugin_page, DEFAULT_SORT_ORDER);
2407  gnc_plugin_page_register_set_sort_reversed (plugin_page, FALSE);
2408  }
2409  priv->sd.original_save_order = priv->sd.save_order;
2410 
2411  if (priv->sd.save_order)
2412  {
2413  type = gnc_split_reg_get_sort_type (priv->gsr);
2414  order = SortTypeasString (type);
2415  gnc_plugin_page_register_set_sort_order (plugin_page, order);
2416  gnc_plugin_page_register_set_sort_reversed (plugin_page,
2417  priv->sd.reverse_order);
2418  }
2419  }
2420  gnc_book_option_remove_cb (OPTION_NAME_NUM_FIELD_SOURCE,
2421  gnc_plugin_page_register_sort_book_option_changed,
2422  page);
2423  priv->sd.dialog = NULL;
2424  priv->sd.num_radio = NULL;
2425  priv->sd.act_radio = NULL;
2426  gtk_widget_destroy (GTK_WIDGET (dialog));
2427  LEAVE (" ");
2428 }
The instance data structure for a content plugin.
#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