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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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