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

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

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

2993 {
2995 
2996  g_return_if_fail (GTK_IS_SPIN_BUTTON (button));
2997  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2998 
2999  ENTER ("(button %p, page %p)", button, page);
3000  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
3001 
3002  priv->fd.days = gtk_spin_button_get_value (GTK_SPIN_BUTTON (button));
3003  gnc_ppr_update_date_query (page);
3004  LEAVE (" ");
3005 }
#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 3100 of file gnc-plugin-page-register.cpp.

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

3172 {
3174  GncPluginPage* plugin_page;
3175 
3176  g_return_if_fail (GTK_IS_DIALOG (dialog));
3177  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
3178 
3179  ENTER (" ");
3180  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
3181  plugin_page = GNC_PLUGIN_PAGE (page);
3182 
3183  if (response != GTK_RESPONSE_OK)
3184  {
3185  /* Remove the old status match */
3186  priv->fd.cleared_match = priv->fd.original_cleared_match;
3187  priv->enable_refresh = FALSE;
3188  gnc_ppr_update_status_query (page);
3189  priv->enable_refresh = TRUE;
3190  priv->fd.start_time = priv->fd.original_start_time;
3191  priv->fd.end_time = priv->fd.original_end_time;
3192  priv->fd.days = priv->fd.original_days;
3193  priv->fd.save_filter = priv->fd.original_save_filter;
3194  gnc_ppr_update_date_query (page);
3195  }
3196  else
3197  {
3198  // clear the filter when unticking the save option
3199  if ((priv->fd.save_filter == FALSE) && (priv->fd.original_save_filter == TRUE))
3200  gnc_plugin_page_register_set_filter (plugin_page, NULL);
3201 
3202  priv->fd.original_save_filter = priv->fd.save_filter;
3203 
3204  if (priv->fd.save_filter)
3205  {
3206  gchar *filter;
3207  GList *flist = NULL;
3208 
3209  // cleared match
3210  flist = g_list_prepend
3211  (flist, g_strdup_printf ("0x%04x", priv->fd.cleared_match));
3212 
3213  // start time
3214  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->fd.start_date_choose)) && priv->fd.start_time != 0)
3215  flist = g_list_prepend (flist, gnc_plugin_page_register_filter_time2dmy (priv->fd.start_time));
3216  else
3217  flist = g_list_prepend (flist, g_strdup ("0"));
3218 
3219  // end time
3220  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->fd.end_date_choose))
3221  && priv->fd.end_time != 0)
3222  flist = g_list_prepend (flist, gnc_plugin_page_register_filter_time2dmy (priv->fd.end_time));
3223  else
3224  flist = g_list_prepend (flist, g_strdup ("0"));
3225 
3226  // number of days
3227  if (priv->fd.days > 0)
3228  flist = g_list_prepend (flist, g_strdup_printf ("%d", priv->fd.days));
3229  else
3230  flist = g_list_prepend (flist, g_strdup ("0"));
3231 
3232  flist = g_list_reverse (flist);
3233  filter = gnc_g_list_stringjoin (flist, ",");
3234  PINFO ("The filter to save is %s", filter);
3235  gnc_plugin_page_register_set_filter (plugin_page, filter);
3236  g_free (filter);
3237  g_list_free_full (flist, g_free);
3238  }
3239  }
3240  priv->fd.dialog = NULL;
3241  gtk_widget_destroy (GTK_WIDGET (dialog));
3242  LEAVE (" ");
3243 }
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 3137 of file gnc-plugin-page-register.cpp.

3139 {
3141 
3142  g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
3143  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
3144 
3145  ENTER ("Save toggle button (%p), plugin_page %p", button, page);
3146 
3147  /* Compute the new save filter status */
3148  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
3149  if (gtk_toggle_button_get_active (button))
3150  priv->fd.save_filter = TRUE;
3151  else
3152  priv->fd.save_filter = FALSE;
3153  LEAVE (" ");
3154 }
#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 2924 of file gnc-plugin-page-register.cpp.

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

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

2823 {
2825  GtkWidget* widget;
2826  gint i;
2827 
2828  g_return_if_fail (GTK_IS_BUTTON (button));
2829  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2830 
2831  ENTER ("(button %p, page %p)", button, page);
2832 
2833  /* Turn off all the check menu items */
2834  for (i = 0; status_actions[i].action_name; i++)
2835  {
2836  widget = status_actions[i].widget;
2837  g_signal_handlers_block_by_func (widget,
2839  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), FALSE);
2840  g_signal_handlers_unblock_by_func (widget,
2842  }
2843 
2844  /* Set the requested status */
2845  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2846  priv->fd.cleared_match = CLEARED_NONE;
2847  gnc_ppr_update_status_query (page);
2848  LEAVE (" ");
2849 }
#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 2734 of file gnc-plugin-page-register.cpp.

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

2781 {
2783  GtkWidget* widget;
2784  gint i;
2785 
2786  g_return_if_fail (GTK_IS_BUTTON (button));
2787  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2788 
2789  ENTER ("(button %p, page %p)", button, page);
2790 
2791  /* Turn on all the check menu items */
2792  for (i = 0; status_actions[i].action_name; i++)
2793  {
2794  widget = status_actions[i].widget;
2795  g_signal_handlers_block_by_func (widget,
2797  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
2798  g_signal_handlers_unblock_by_func (widget,
2800  }
2801 
2802  /* Set the requested status */
2803  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2804  priv->fd.cleared_match = CLEARED_ALL;
2805  gnc_ppr_update_status_query (page);
2806  LEAVE (" ");
2807 }
#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 5384 of file gnc-plugin-page-register.cpp.

5385 {
5386  GncPluginPageRegister* page;
5388 
5389  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), NULL);
5390 
5391  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
5392  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
5393 
5394  return priv->gsr;
5395 }

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

2310 {
2311  GncPluginPageRegister* page;
2313 
2314  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), NULL);
2315 
2316  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
2317  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2318  return gnc_ledger_display_get_query (priv->ledger);
2319 }
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:3214
#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:3378
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 5368 of file gnc-plugin-page-register.cpp.

5371 {
5372  GncPluginPageRegister* page;
5374 
5375  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));
5376 
5377  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
5378  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
5379  priv->lines_default = lines_default;
5380  priv->read_only = read_only;
5381 }

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

2438 {
2440  const gchar* name;
2441  SortType type;
2442 
2443  g_return_if_fail (GTK_IS_TOGGLE_BUTTON (button));
2444  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2445 
2446  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2447  name = gtk_buildable_get_name (GTK_BUILDABLE (button));
2448  ENTER ("button %s(%p), page %p", name, button, page);
2449  type = SortTypefromString (name);
2450  gnc_split_reg_set_sort_type (priv->gsr, type);
2451  LEAVE (" ");
2452 }
#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 2493 of file gnc-plugin-page-register.cpp.

2496 {
2498 
2499  g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
2500  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2501 
2502  ENTER ("Reverse toggle button (%p), plugin_page %p", button, page);
2503 
2504  /* Compute the new save sort order */
2505  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2506 
2507  priv->sd.reverse_order = gtk_toggle_button_get_active (button);
2508  gnc_split_reg_set_sort_reversed (priv->gsr, priv->sd.reverse_order, TRUE);
2509  LEAVE (" ");
2510 }
#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 2464 of file gnc-plugin-page-register.cpp.

2466 {
2468 
2469  g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
2470  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
2471 
2472  ENTER ("Save toggle button (%p), plugin_page %p", button, page);
2473 
2474  /* Compute the new save sort order */
2475  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2476 
2477  if (gtk_toggle_button_get_active (button))
2478  priv->sd.save_order = TRUE;
2479  else
2480  priv->sd.save_order = FALSE;
2481  LEAVE (" ");
2482 }
#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 2372 of file gnc-plugin-page-register.cpp.

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