Skip to content

Commit

Permalink
Complete the change from using associate in the source files
Browse files Browse the repository at this point in the history
This commit changes some further use of associate and derivates in the
source files to doclink to make it more consistent.
  • Loading branch information
Bob-IT committed Sep 13, 2020
1 parent 7c10267 commit d2af5d7
Show file tree
Hide file tree
Showing 21 changed files with 132 additions and 130 deletions.
9 changes: 3 additions & 6 deletions gnucash/gnome-utils/dialog-doclink-utils.c
Expand Up @@ -166,12 +166,9 @@ static gchar *
doclink_get_path_head_and_set (gboolean *path_head_set)
{
gchar *ret_path = NULL;
gchar *path_head = gnc_prefs_get_string (GNC_PREFS_GROUP_GENERAL, "assoc-head");
gchar *path_head = gnc_prefs_get_string (GNC_PREFS_GROUP_GENERAL, GNC_DOC_LINK_PATH_HEAD);
*path_head_set = FALSE;

/* Note, assoc-head is the old name for the document link head which has been
kept for compatability */

if (path_head && *path_head) // not default entry
{
*path_head_set = TRUE;
Expand All @@ -196,9 +193,9 @@ doclink_get_path_head_and_set (gboolean *path_head_set)

if (*path_head_set) // prior to 3.5, assoc-head could be with or without a trailing '/'
{
if (!gnc_prefs_set_string (GNC_PREFS_GROUP_GENERAL, "assoc-head", ret_path))
if (!gnc_prefs_set_string (GNC_PREFS_GROUP_GENERAL, GNC_DOC_LINK_PATH_HEAD, ret_path))
PINFO ("Failed to save preference at %s, %s with %s",
GNC_PREFS_GROUP_GENERAL, "assoc-head", ret_path);
GNC_PREFS_GROUP_GENERAL, GNC_DOC_LINK_PATH_HEAD, ret_path);
}
}
g_free (path_head);
Expand Down
5 changes: 5 additions & 0 deletions gnucash/gnome-utils/dialog-doclink-utils.h
Expand Up @@ -23,6 +23,11 @@
#ifndef DIALOG_DOCLINK_UTILS_H
#define DIALOG_DOCLINK_UTILS_H

#define GNC_DOC_LINK_PATH_HEAD "assoc-head"
/* Note, assoc-head is the old name for the document link head which has been
kept for compatability */


/** Return the current documentation-link file path head uri.
*
* This function will get the current documentation-link path head from prefs.
Expand Down
38 changes: 19 additions & 19 deletions gnucash/gnome-utils/dialog-dup-trans.h
Expand Up @@ -31,29 +31,29 @@
#include <gnc-date.h>


/********************************************************************\
* gnc_dup_trans_dialog *
* opens up a window to do an automatic transfer between accounts *
* *
* Args: parent - the parent of the window to be created *
* title - the text of the title label, otherwise *
* defaults to "New Transaction Information" *
* show_date - TRUE to display date label and edit widgets *
* date - the initial date to use, and the output *
* parameter for the new date *
* num - input num field *
* out_num - output num field, g_newed string *
* tnum - input tnum field, if used, else NULL *
* out_tnum - output tnum field, g_newed string *
* tassoc - input association field, if used, else NULL *
* out_tnum - output association field, g_newed string *
* Return: TRUE if user closes dialog with 'OK' *
\********************************************************************/
/***********************************************************************\
* gnc_dup_trans_dialog *
* opens up a window to do an automatic transfer between accounts *
* *
* Args: parent - the parent of the window to be created *
* title - the text of the title label, otherwise *
* defaults to "New Transaction Information" *
* show_date - TRUE to display date label and edit widgets *
* date - the initial date to use, and the output *
* parameter for the new date *
* num - input num field *
* out_num - output num field, g_newed string *
* tnum - input tnum field, if used, else NULL *
* out_tnum - output tnum field, g_newed string *
* tdoclink - input document link field, if used, else NULL*
* out_tdoclink - output document link field, g_newed string *
* Return: TRUE if user closes dialog with 'OK' *
\***********************************************************************/
gboolean
gnc_dup_trans_dialog (GtkWidget * parent, const char* title, gboolean show_date,
time64 *date_p, const char *num, char **out_num,
const char *tnum, char **out_tnum,
const char *tassoc, char **out_tassoc);
const char *tdoclink, char **out_tdoclink);

gboolean
gnc_dup_trans_dialog_gdate (GtkWidget * parent, GDate *gdate_p,
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gnome-utils/dialog-preferences.c
Expand Up @@ -1367,7 +1367,7 @@ gnc_preferences_dialog_create(GtkWindow *parent)
gtk_box_pack_start(GTK_BOX (box), currency, TRUE, TRUE, 0);

box = GTK_WIDGET(gtk_builder_get_object (builder,
"pref/" GNC_PREFS_GROUP_GENERAL "/assoc-head"));
"pref/" GNC_PREFS_GROUP_GENERAL "/" GNC_DOC_LINK_PATH_HEAD));
fcb = gtk_file_chooser_button_new (_("Select a folder"),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
gtk_box_pack_start (GTK_BOX (box), fcb, TRUE, TRUE, 0);
Expand Down
6 changes: 3 additions & 3 deletions gnucash/gnome/gnc-plugin-basic-commands.c
Expand Up @@ -91,7 +91,7 @@ static void gnc_main_window_cmd_tools_close_book (GtkAction *action, GncMainWind
static void gnc_main_window_cmd_tools_find_transactions (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_price_editor (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_imap_editor (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_trans_assoc (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_trans_doclink (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_tools_commodity_editor (GtkAction *action, GncMainWindowActionData *data);
static void gnc_main_window_cmd_help_totd (GtkAction *action, GncMainWindowActionData *data);

Expand Down Expand Up @@ -215,7 +215,7 @@ static GtkActionEntry gnc_plugin_actions [] =
{
"ToolsTransLinkedDocsAction", NULL, N_("_Transaction Linked Documents"), NULL,
N_("View all Transaction Linked Documents"),
G_CALLBACK (gnc_main_window_cmd_tools_trans_assoc)
G_CALLBACK (gnc_main_window_cmd_tools_trans_doclink)
},

/* Help menu */
Expand Down Expand Up @@ -603,7 +603,7 @@ gnc_main_window_cmd_tools_imap_editor (GtkAction *action, GncMainWindowActionDat
}

static void
gnc_main_window_cmd_tools_trans_assoc (GtkAction *action, GncMainWindowActionData *data)
gnc_main_window_cmd_tools_trans_doclink (GtkAction *action, GncMainWindowActionData *data)
{
gnc_set_busy_cursor (NULL, TRUE);
gnc_doclink_trans_dialog (GTK_WINDOW (data->window));
Expand Down
8 changes: 4 additions & 4 deletions gnucash/gnome/gnc-plugin-business.c
Expand Up @@ -114,7 +114,7 @@ static void gnc_plugin_business_cmd_employee_find_expense_voucher (GtkAction *ac
static void gnc_plugin_business_cmd_employee_process_payment (GtkAction *action,
GncMainWindowActionData *data);

static void gnc_plugin_business_cmd_assoc (GtkAction *action,
static void gnc_plugin_business_cmd_doclink (GtkAction *action,
GncMainWindowActionData *data);
static void gnc_plugin_business_cmd_tax_tables (GtkAction *action,
GncMainWindowActionData *data);
Expand Down Expand Up @@ -277,7 +277,7 @@ static GtkActionEntry gnc_plugin_actions [] =
{
"BusinessLinkOpenAction", NULL, N_("Business Links"), NULL,
N_("View all Linked Business Documents"),
G_CALLBACK (gnc_plugin_business_cmd_assoc)
G_CALLBACK (gnc_plugin_business_cmd_doclink)
},
{
"TaxTablesOpenAction", NULL, N_("Sales _Tax Table"), NULL,
Expand Down Expand Up @@ -753,8 +753,8 @@ gnc_plugin_business_cmd_employee_process_payment (GtkAction *action,
}

static void
gnc_plugin_business_cmd_assoc (GtkAction *action,
GncMainWindowActionData *mw)
gnc_plugin_business_cmd_doclink (GtkAction *action,
GncMainWindowActionData *mw)
{
g_return_if_fail (mw != NULL);
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
Expand Down
8 changes: 4 additions & 4 deletions gnucash/gnome/gnc-plugin-page-invoice.c
Expand Up @@ -602,7 +602,7 @@ gnc_plugin_page_invoice_finalize (GObject *object)
}

static void
update_assoc_actions (GncPluginPage *plugin_page, gboolean has_uri)
update_doclink_actions (GncPluginPage *plugin_page, gboolean has_uri)
{
GtkAction *uri_action;

Expand Down Expand Up @@ -746,7 +746,7 @@ gnc_plugin_page_invoice_update_menus (GncPluginPage *page, gboolean is_posted, g
if (gncInvoiceGetDocLink (invoice))
has_uri = TRUE;

update_assoc_actions (page, has_uri);
update_doclink_actions (page, has_uri);
}


Expand Down Expand Up @@ -1384,7 +1384,7 @@ gnc_plugin_page_invoice_cmd_link (GtkAction *action,
}

// update the menu actions
update_assoc_actions (GNC_PLUGIN_PAGE(plugin_page), has_uri);
update_doclink_actions (GNC_PLUGIN_PAGE(plugin_page), has_uri);

g_free (ret_uri);
LEAVE(" ");
Expand Down Expand Up @@ -1414,7 +1414,7 @@ gnc_plugin_page_invoice_cmd_link_remove (GtkAction *action,
gtk_widget_hide (GTK_WIDGET(doclink_button));

// update the menu actions
update_assoc_actions (GNC_PLUGIN_PAGE(plugin_page), FALSE);
update_doclink_actions (GNC_PLUGIN_PAGE(plugin_page), FALSE);

LEAVE(" ");
}
Expand Down
6 changes: 3 additions & 3 deletions gnucash/gnome/gnc-plugin-page-register.c
Expand Up @@ -4557,7 +4557,7 @@ gnc_plugin_page_register_cmd_linked_transaction (GtkAction *action,
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));

priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (plugin_page);
gsr_default_associate_handler (priv->gsr);
gsr_default_doclink_handler (priv->gsr);
gnc_plugin_page_register_ui_update (NULL, plugin_page);
LEAVE (" ");
}
Expand All @@ -4573,7 +4573,7 @@ gnc_plugin_page_register_cmd_linked_transaction_open (GtkAction *action,
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));

priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (plugin_page);
gsr_default_associate_open_handler (priv->gsr);
gsr_default_doclink_open_handler (priv->gsr);
LEAVE (" ");
}

Expand All @@ -4588,7 +4588,7 @@ gnc_plugin_page_register_cmd_linked_transaction_remove (GtkAction *action,
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (plugin_page));

priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (plugin_page);
gsr_default_associate_remove_handler (priv->gsr);
gsr_default_doclink_remove_handler (priv->gsr);
gnc_plugin_page_register_ui_update (NULL, plugin_page);
LEAVE (" ");

Expand Down
28 changes: 14 additions & 14 deletions gnucash/gnome/gnc-split-reg.c
Expand Up @@ -116,10 +116,10 @@ void gsr_default_paste_txn_handler( GNCSplitReg *w, gpointer ud );
void gsr_default_void_txn_handler ( GNCSplitReg *w, gpointer ud );
void gsr_default_unvoid_txn_handler ( GNCSplitReg *w, gpointer ud );
void gsr_default_reverse_txn_handler ( GNCSplitReg *w, gpointer ud );
void gsr_default_associate_handler ( GNCSplitReg *w );
void gsr_default_associate_open_handler ( GNCSplitReg *w );
void gsr_default_associate_remove_handler ( GNCSplitReg *w );
static void gsr_default_associate_from_sheet_handler ( GNCSplitReg *w );
void gsr_default_doclink_handler ( GNCSplitReg *w );
void gsr_default_doclink_open_handler ( GNCSplitReg *w );
void gsr_default_doclink_remove_handler ( GNCSplitReg *w );
static void gsr_default_doclink_from_sheet_handler ( GNCSplitReg *w );

static void gsr_emit_simple_signal ( GNCSplitReg *gsr, const char *sigName );
static void gsr_emit_help_changed ( GnucashRegister *reg, gpointer user_data );
Expand Down Expand Up @@ -488,9 +488,9 @@ gsr_create_table( GNCSplitReg *gsr )
gtk_box_pack_start (GTK_BOX (gsr), GTK_WIDGET(gsr->reg), TRUE, TRUE, 0);
gnucash_sheet_set_window (gnucash_register_get_sheet (gsr->reg), gsr->window);

// setup the callback for when the associate cell clicked on
gnucash_register_set_open_assoc_cb (gsr->reg,
(GFunc)gsr_default_associate_from_sheet_handler, gsr);
// setup the callback for when the doclink cell clicked on
gnucash_register_set_open_doclink_cb (gsr->reg,
(GFunc)gsr_default_doclink_from_sheet_handler, gsr);

gtk_widget_show ( GTK_WIDGET(gsr->reg) );
g_signal_connect (gsr->reg, "activate_cursor",
Expand Down Expand Up @@ -1264,9 +1264,9 @@ gnc_split_reg_reinitialize_trans_cb(GtkWidget *widget, gpointer data)
gsr_emit_simple_signal( gsr, "reinit_ent" );
}

/* Edit the associated link for the current transaction. */
/* Edit the document link for the current transaction. */
void
gsr_default_associate_handler (GNCSplitReg *gsr)
gsr_default_doclink_handler (GNCSplitReg *gsr)
{
SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
Split *split = gnc_split_register_get_current_split (reg);
Expand Down Expand Up @@ -1306,9 +1306,9 @@ gsr_default_associate_handler (GNCSplitReg *gsr)
g_free (uri);
}

/* Opens the associated link for the current transaction. */
/* Opens the document link for the current transaction. */
void
gsr_default_associate_open_handler (GNCSplitReg *gsr)
gsr_default_doclink_open_handler (GNCSplitReg *gsr)
{
CursorClass cursor_class;
SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
Expand Down Expand Up @@ -1336,9 +1336,9 @@ gsr_default_associate_open_handler (GNCSplitReg *gsr)
g_free (uri);
}

/* Removes the associated link for the current transaction. */
/* Removes the document link for the current transaction. */
void
gsr_default_associate_remove_handler (GNCSplitReg *gsr)
gsr_default_doclink_remove_handler (GNCSplitReg *gsr)
{
CursorClass cursor_class;
SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
Expand All @@ -1365,7 +1365,7 @@ gsr_default_associate_remove_handler (GNCSplitReg *gsr)
}

static void
gsr_default_associate_from_sheet_handler (GNCSplitReg *gsr)
gsr_default_doclink_from_sheet_handler (GNCSplitReg *gsr)
{
CursorClass cursor_class;
SplitRegister *reg = gnc_ledger_display_get_split_register (gsr->ledger);
Expand Down
12 changes: 6 additions & 6 deletions gnucash/gnome/gnc-split-reg.h
Expand Up @@ -274,23 +274,23 @@ void gnc_split_reg_set_sheet_focus (GNCSplitReg *gsr, gboolean has_focus);
void gnc_split_reg_balancing_entry (GNCSplitReg *gsr, Account *account,
time64 statement_date, gnc_numeric balancing_amount);

/** Default transaction association edit handler
/** Default transaction document link edit handler
*
* @param gsr A pointer to GNCSplitReg
**/
void gsr_default_associate_handler (GNCSplitReg *gsr);
void gsr_default_doclink_handler (GNCSplitReg *gsr);

/** Default transaction association open handler
/** Default transaction document link open handler
*
* @param gsr A pointer to GNCSplitReg
**/
void gsr_default_associate_open_handler (GNCSplitReg *gsr);
void gsr_default_doclink_open_handler (GNCSplitReg *gsr);

/** Default transaction association delete handler
/** Default transaction document link delete handler
*
* @param gsr A pointer to GNCSplitReg
**/
void gsr_default_associate_remove_handler (GNCSplitReg *gsr);
void gsr_default_doclink_remove_handler (GNCSplitReg *gsr);

void gnc_split_reg_enter( GNCSplitReg *gsr, gboolean next_transaction );
void gsr_default_delete_handler( GNCSplitReg *gsr, gpointer data );
Expand Down

0 comments on commit d2af5d7

Please sign in to comment.