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

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

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

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

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

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

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

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

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

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

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

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

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

703 {
705  SplitRegister* reg;
706 
707  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
708  reg = gnc_ledger_display_get_split_register (priv->ledger);
710 }
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 5431 of file gnc-plugin-page-register.cpp.

5432 {
5433  GncPluginPageRegister* page;
5435 
5436  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), NULL);
5437 
5438  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
5439  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
5440 
5441  return priv->gsr;
5442 }

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

2312 {
2313  GncPluginPageRegister* page;
2315 
2316  g_return_val_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page), NULL);
2317 
2318  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
2319  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
2320  return gnc_ledger_display_get_query (priv->ledger);
2321 }
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 570 of file gnc-plugin-page-register.cpp.

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

601 {
602  GNCLedgerDisplay* ledger;
603 
604  ledger = gnc_ledger_display_gl();
605  return gnc_plugin_page_register_new_common (ledger);
606 }
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 609 of file gnc-plugin-page-register.cpp.

610 {
611  return gnc_plugin_page_register_new_common (ledger);
612 }

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

5418 {
5419  GncPluginPageRegister* page;
5421 
5422  g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));
5423 
5424  page = GNC_PLUGIN_PAGE_REGISTER (plugin_page);
5425  priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
5426  priv->lines_default = lines_default;
5427  priv->read_only = read_only;
5428 }

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

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

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

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

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