Skip to content

Commit

Permalink
Rename Transaction and Invoice Associations to Document Links.
Browse files Browse the repository at this point in the history
More clearly describes the actions and is more consistent with other
software (e.g. Libre Office).

This commit primarily changes the translatable strings, though it also
removes the Remove menu item because that can be done in the Manage
dialog box.
  • Loading branch information
jralls committed Sep 7, 2020
1 parent de0422d commit 8dce845
Show file tree
Hide file tree
Showing 17 changed files with 105 additions and 115 deletions.
27 changes: 18 additions & 9 deletions gnucash/gnome/dialog-assoc.c
Expand Up @@ -202,7 +202,7 @@ setup_file_dialog (GtkBuilder *builder, GtkFileChooserButton *fcb,
GtkWidget *existing_hbox = GTK_WIDGET(gtk_builder_get_object (builder, "existing_hbox"));
GtkWidget *image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_SMALL_TOOLBAR);
gchar *use_uri = gnc_assoc_get_use_uri (path_head, uri, scheme);
gchar *uri_label = g_strdup_printf ("%s '%s'", _("Existing Association is"), display_uri);
gchar *uri_label = g_strdup_printf ("%s '%s'", _("Existing Document Link is"), display_uri);

label = gtk_label_new (uri_label);

Expand Down Expand Up @@ -537,7 +537,9 @@ row_selected_bus_cb (GtkTreeView *view, GtkTreePath *path,
return;
}

ret_uri = gnc_assoc_get_uri_dialog (GTK_WINDOW(assoc_dialog->window), _("Change a Business Association"), uri);
/* Translators: This is the title of a dialog box for linking an external
file or URI with the current bill, invoice, transaction, or voucher. */
ret_uri = gnc_assoc_get_uri_dialog (GTK_WINDOW(assoc_dialog->window), _("Manage Document Link"), uri);

if (ret_uri && g_strcmp0 (uri, ret_uri) != 0)
{
Expand Down Expand Up @@ -585,7 +587,7 @@ row_selected_trans_cb (GtkTreeView *view, GtkTreePath *path,

gtk_tree_model_get (assoc_dialog->model, &iter, URI, &uri, ITEM_POINTER, &split, -1);

// Open associated link, subtract 1 to allow for date_int64
// Open linked document, subtract 1 to allow for date_int64
if (gtk_tree_view_get_column (GTK_TREE_VIEW(assoc_dialog->view), DISPLAY_URI - 1) == col)
gnc_assoc_open_uri (GTK_WINDOW(assoc_dialog->window), uri);

Expand Down Expand Up @@ -628,7 +630,7 @@ row_selected_trans_cb (GtkTreeView *view, GtkTreePath *path,
g_free (uri);
return;
}
ret_uri = gnc_assoc_get_uri_dialog (GTK_WINDOW(assoc_dialog->window), _("Change a Transaction Association"), uri);
ret_uri = gnc_assoc_get_uri_dialog (GTK_WINDOW(assoc_dialog->window), _("Manage Document Link"), uri);

if (ret_uri && g_strcmp0 (uri, ret_uri) != 0)
{
Expand Down Expand Up @@ -912,7 +914,9 @@ gnc_assoc_dialog_create (GtkWindow *parent, AssocDialog *assoc_dialog)
GObject *desc_item_tree_column = G_OBJECT(gtk_builder_get_object (builder, "desc_item"));
GObject *desc_id_tree_column = G_OBJECT(gtk_builder_get_object (builder, "desc_id"));

gtk_window_set_title (GTK_WINDOW(window), _("Transaction Associations"));
/* Translators: This is the label of a dialog box that lists all of the
transaction that have files or URIs linked with them. */
gtk_window_set_title (GTK_WINDOW(window), _("Transaction Document Links"));

gtk_tree_view_column_set_visible (GTK_TREE_VIEW_COLUMN(desc_id_tree_column), FALSE);
gtk_tree_view_column_set_title (GTK_TREE_VIEW_COLUMN(desc_item_tree_column), _("Description"));
Expand All @@ -926,10 +930,15 @@ gnc_assoc_dialog_create (GtkWindow *parent, AssocDialog *assoc_dialog)
{
GtkWidget *help_label = GTK_WIDGET(gtk_builder_get_object (builder, "help_label"));
const gchar *item_string = N_(
" To jump to the Business Item, double click on the entry in the id\n"
" column, Association column to open the Association or Available to update");

gtk_window_set_title (GTK_WINDOW(assoc_dialog->window), _("Business Associations"));
"\t\tDouble click on the entry in the Id column to jump to the"
"Business Item.\n\t\tDouble click on the entry in the Link column"
"to open the Linked Document.\n\t\tDouble click on the entry in"
"the Available? column to modify the document link.");

/* Translators: This is the label of a dialog box that lists all of the
invoices, bills, and vouchers that have files or URIs linked with
them. */
gtk_window_set_title (GTK_WINDOW(assoc_dialog->window), _("Business Document Links"));
gtk_label_set_text (GTK_LABEL(help_label), gettext (item_string));

g_signal_connect (assoc_dialog->view, "row-activated",
Expand Down
3 changes: 1 addition & 2 deletions gnucash/gnome/dialog-invoice.c
Expand Up @@ -2467,7 +2467,7 @@ gnc_invoice_create_page (InvoiceWindow *iw, gpointer page)
if (assoc_uri)
{
gchar *display_uri = gnc_assoc_get_unescaped_just_uri (assoc_uri);
gtk_button_set_label (GTK_BUTTON(iw->assoc_link_button), _("Open Association:"));
gtk_button_set_label (GTK_BUTTON(iw->assoc_link_button), _("Open Linked Document:"));
gtk_link_button_set_uri (GTK_LINK_BUTTON(iw->assoc_link_button), display_uri);
gtk_widget_show (GTK_WIDGET (iw->assoc_link_button));
g_free (display_uri);
Expand Down Expand Up @@ -2680,7 +2680,6 @@ gnc_invoice_update_assoc_for_window (GncInvoice *invoice, const gchar *uri)
// update the menu actions
uri_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(iw->page), "BusinessAssociationOpenAction");
gtk_action_set_sensitive (uri_action, FALSE);
uri_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(iw->page), "BusinessAssociationRemoveAction");
gtk_action_set_sensitive (uri_action, FALSE);

gtk_widget_hide (assoc_link_button);
Expand Down
56 changes: 21 additions & 35 deletions gnucash/gnome/gnc-plugin-page-invoice.c
Expand Up @@ -218,20 +218,15 @@ static GtkActionEntry gnc_plugin_page_invoice_actions [] =
G_CALLBACK (gnc_plugin_page_invoice_cmd_new_invoice)
},
{
"BusinessAssociationAction", NULL, "_Update Association for Invoice", NULL,
"Update Association for current Invoice",
"BusinessAssociationAction", NULL, "_Manage Document Link...", NULL,
"Manage link of an external document to this item.",
G_CALLBACK (gnc_plugin_page_invoice_cmd_associate)
},
{
"BusinessAssociationOpenAction", NULL, "_Open Association for Invoice", NULL,
"Open Association for current Invoice",
"BusinessAssociationOpenAction", NULL, "_Open Linked Document", NULL,
"Open the linked document",
G_CALLBACK (gnc_plugin_page_invoice_cmd_associate_open)
},
{
"BusinessAssociationRemoveAction", NULL, "_Remove Association from Invoice", NULL,
"Remove Association from Invoice",
G_CALLBACK (gnc_plugin_page_invoice_cmd_associate_remove)
},
{
"ToolsProcessPaymentAction", GNC_ICON_INVOICE_PAY, "_Pay Invoice", NULL,
"Enter a payment for the owner of this invoice",
Expand Down Expand Up @@ -306,9 +301,8 @@ static action_toolbar_labels invoice_action_labels[] =
{"EditUnpostInvoiceAction", N_("_Unpost Invoice")},
{"BusinessNewInvoiceAction", N_("New _Invoice")},
{"ToolsProcessPaymentAction", N_("_Pay Invoice")},
{"BusinessAssociationAction", N_("_Update Association for Invoice")},
{"BusinessAssociationOpenAction", N_("_Open Association for Invoice")},
{"BusinessAssociationRemoveAction", N_("_Remove Association from Invoice")},
{"BusinessAssociationAction", N_("_Manage Document Link")},
{"BusinessAssociationOpenAction", N_("_Open Linked Document")},
{NULL, NULL},
};

Expand All @@ -328,9 +322,8 @@ static action_toolbar_labels bill_action_labels[] =
{"EditUnpostInvoiceAction", N_("_Unpost Bill")},
{"BusinessNewInvoiceAction", N_("New _Bill")},
{"ToolsProcessPaymentAction", N_("_Pay Bill")},
{"BusinessAssociationAction", N_("_Update Association for Bill")},
{"BusinessAssociationOpenAction", N_("_Open Association for Bill")},
{"BusinessAssociationRemoveAction", N_("_Remove Association from Bill")},
{"BusinessAssociationAction", N_("_Manage Document Link")},
{"BusinessAssociationOpenAction", N_("_Open Linked Document")},
{NULL, NULL},
};

Expand All @@ -350,9 +343,8 @@ static action_toolbar_labels voucher_action_labels[] =
{"EditUnpostInvoiceAction", N_("_Unpost Voucher")},
{"BusinessNewInvoiceAction", N_("New _Voucher")},
{"ToolsProcessPaymentAction", N_("_Pay Voucher")},
{"BusinessAssociationAction", N_("_Update Association for Voucher")},
{"BusinessAssociationOpenAction", N_("_Open Association for Voucher")},
{"BusinessAssociationRemoveAction", N_("_Remove Association from Voucher")},
{"BusinessAssociationAction", N_("_Manage Document Link")},
{"BusinessAssociationOpenAction", N_("_Open Linked Document")},
{NULL, NULL},
};

Expand All @@ -372,9 +364,8 @@ static action_toolbar_labels creditnote_action_labels[] =
{"EditUnpostInvoiceAction", N_("_Unpost Credit Note")},
{"BusinessNewInvoiceAction", N_("New _Credit Note")},
{"ToolsProcessPaymentAction", N_("_Pay Credit Note")},
{"BusinessAssociationAction", N_("_Update Association for Credit Note")},
{"BusinessAssociationOpenAction", N_("_Open Association for Credit Note")},
{"BusinessAssociationRemoveAction", N_("_Remove Association from Credit Note")},
{"BusinessAssociationAction", N_("_Manage Document Link")},
{"BusinessAssociationOpenAction", N_("_Open Linked Document")},
{NULL, NULL},
};

Expand All @@ -389,9 +380,8 @@ static action_toolbar_labels invoice_action_tooltips[] = {
{"BlankEntryAction", N_("Move to the blank entry at the bottom of the invoice")},
{"ToolsProcessPaymentAction", N_("Enter a payment for the owner of this invoice") },
{"ReportsCompanyReportAction", N_("Open a company report window for the owner of this invoice") },
{"BusinessAssociationAction", N_("Update Association for current invoice")},
{"BusinessAssociationOpenAction", N_("Open Association for current invoice")},
{"BusinessAssociationRemoveAction", N_("Remove Association from invoice")},
{"BusinessAssociationAction", N_("Manage Document Link")},
{"BusinessAssociationOpenAction", N_("Open Linked Document")},
{NULL, NULL},
};

Expand All @@ -411,9 +401,8 @@ static action_toolbar_labels bill_action_tooltips[] = {
{"BlankEntryAction", N_("Move to the blank entry at the bottom of the bill")},
{"ToolsProcessPaymentAction", N_("Enter a payment for the owner of this bill") },
{"ReportsCompanyReportAction", N_("Open a company report window for the owner of this bill") },
{"BusinessAssociationAction", N_("Update Association for current bill")},
{"BusinessAssociationOpenAction", N_("Open Association for current bill")},
{"BusinessAssociationRemoveAction", N_("Remove Association from bill")},
{"BusinessAssociationAction", N_("Manage Document Link")},
{"BusinessAssociationOpenAction", N_("Open Linked Document")},
{NULL, NULL},
};

Expand All @@ -433,9 +422,8 @@ static action_toolbar_labels voucher_action_tooltips[] = {
{"BlankEntryAction", N_("Move to the blank entry at the bottom of the voucher")},
{"ToolsProcessPaymentAction", N_("Enter a payment for the owner of this voucher") },
{"ReportsCompanyReportAction", N_("Open a company report window for the owner of this voucher") },
{"BusinessAssociationAction", N_("Update Association for current voucher")},
{"BusinessAssociationOpenAction", N_("Open Association for current voucher")},
{"BusinessAssociationRemoveAction", N_("Remove Association from voucher")},
{"BusinessAssociationAction", N_("Manage Document Link")},
{"BusinessAssociationOpenAction", N_("Open Linked Document")},
{NULL, NULL},
};

Expand All @@ -455,9 +443,8 @@ static action_toolbar_labels creditnote_action_tooltips[] = {
{"BlankEntryAction", N_("Move to the blank entry at the bottom of the credit note")},
{"ToolsProcessPaymentAction", N_("Enter a payment for the owner of this credit note") },
{"ReportsCompanyReportAction", N_("Open a company report window for the owner of this credit note") },
{"BusinessAssociationAction", N_("Update Association for credit note")},
{"BusinessAssociationOpenAction", N_("Open Association for credit note")},
{"BusinessAssociationRemoveAction", N_("Remove Association from credit note")},
{"BusinessAssociationAction", N_("_Manage Document Link")},
{"BusinessAssociationOpenAction", N_("Open Linked Document")},
{NULL, NULL},
};

Expand Down Expand Up @@ -622,7 +609,6 @@ update_assoc_actions (GncPluginPage *plugin_page, gboolean has_uri)

uri_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(plugin_page), "BusinessAssociationOpenAction");
gtk_action_set_sensitive (uri_action, has_uri);
uri_action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE(plugin_page), "BusinessAssociationRemoveAction");
gtk_action_set_sensitive (uri_action, has_uri);
}

Expand Down Expand Up @@ -1374,7 +1360,7 @@ gnc_plugin_page_invoice_cmd_associate (GtkAction *action,
invoice = gnc_invoice_window_get_invoice (priv->iw);
uri = gncInvoiceGetAssociation (invoice);

ret_uri = gnc_assoc_get_uri_dialog (parent, _("Change a Business Association"), uri);
ret_uri = gnc_assoc_get_uri_dialog (parent, _("Manage Document Link"), uri);

if (ret_uri && g_strcmp0 (uri, ret_uri) != 0)
{
Expand Down
51 changes: 24 additions & 27 deletions gnucash/gnome/gnc-plugin-page-register.c
Expand Up @@ -292,10 +292,17 @@ static GList* invoices_from_transaction (Transaction* trans);
#define PASTE_TRANSACTION_LABEL N_("_Paste Transaction")
#define DUPLICATE_TRANSACTION_LABEL N_("Dup_licate Transaction")
#define DELETE_TRANSACTION_LABEL N_("_Delete Transaction")
#define ASSOCIATE_TRANSACTION_LABEL N_("Update _Association for Transaction")
#define ASSOCIATE_TRANSACTION_OPEN_LABEL N_("_Open Association for Transaction")
#define ASSOCIATE_TRANSACTION_REMOVE_LABEL N_("Re_move Association from Transaction")
#define JUMP_ASSOCIATED_INVOICE_LABEL N_("Open Associated Invoice")
/* Translators: This is a menu item that opens a dialog for linking an
external file or URL with the bill, invoice, transaction, or voucher or
removing such an link. */
#define ASSOCIATE_TRANSACTION_LABEL N_("_Manage Document Link...")
/* Translators: This is a menu item that opens an external file or URI that may
be linked to the current bill, invoice, transaction, or voucher using
the operating system's default application for the file or URI mime type. */
#define ASSOCIATE_TRANSACTION_OPEN_LABEL N_("_Open Linked Document")
/* Translators: This is a menu item that will open the bill, invoice, or voucher
that is posted to the current transaction if there is one. */
#define JUMP_ASSOCIATED_INVOICE_LABEL N_("Jump to Invoice")
#define CUT_SPLIT_LABEL N_("Cu_t Split")
#define COPY_SPLIT_LABEL N_("_Copy Split")
#define PASTE_SPLIT_LABEL N_("_Paste Split")
Expand All @@ -306,10 +313,9 @@ static GList* invoices_from_transaction (Transaction* trans);
#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 ASSOCIATE_TRANSACTION_TIP N_("Update Association for the current transaction")
#define ASSOCIATE_TRANSACTION_OPEN_TIP N_("Open Association for the current transaction")
#define ASSOCIATE_TRANSACTION_REMOVE_TIP N_("Remove the association from the current transaction")
#define JUMP_ASSOCIATED_INVOICE_TIP N_("Open the associated invoice")
#define ASSOCIATE_TRANSACTION_TIP N_("Add, change, or unlink the document linked with the current transaction")
#define ASSOCIATE_TRANSACTION_OPEN_TIP N_("Open the linked document for the current transaction")
#define JUMP_ASSOCIATED_INVOICE_TIP N_("Jump to the linked bill, invoice, or voucher")
#define CUT_SPLIT_TIP N_("Cut the selected split into clipboard")
#define COPY_SPLIT_TIP N_("Copy the selected split into clipboard")
#define PASTE_SPLIT_TIP N_("Paste the split from the clipboard")
Expand Down Expand Up @@ -422,11 +428,6 @@ static GtkActionEntry gnc_plugin_page_register_actions [] =
ASSOCIATE_TRANSACTION_OPEN_TIP,
G_CALLBACK (gnc_plugin_page_register_cmd_associate_transaction_open)
},
{
"AssociateTransactionRemoveAction", NULL, ASSOCIATE_TRANSACTION_REMOVE_LABEL, NULL,
ASSOCIATE_TRANSACTION_REMOVE_TIP,
G_CALLBACK (gnc_plugin_page_register_cmd_associate_transaction_remove)
},
{
"JumpAssociatedInvoiceAction", NULL, JUMP_ASSOCIATED_INVOICE_LABEL, NULL,
JUMP_ASSOCIATED_INVOICE_TIP,
Expand Down Expand Up @@ -492,8 +493,11 @@ static GtkActionEntry gnc_plugin_page_register_actions [] =
G_CALLBACK (gnc_plugin_page_register_cmd_exchange_rate)
},
{
"JumpTransactionAction", GNC_ICON_JUMP_TO, N_ ("_Jump"), NULL,
N_ ("Jump to the corresponding transaction in the other account"),
/* Translators: This is a menu item that will open a register tab for the
account of the first other account in the current transaction's split list
with focus on the current transaction's entry in that register. */
"JumpTransactionAction", GNC_ICON_JUMP_TO, N_ ("_Jump to the other account"), NULL,
N_ ("Open a new register tab for the other account with focus on this transaction."),
G_CALLBACK (gnc_plugin_page_register_cmd_jump)
},
{
Expand Down Expand Up @@ -533,7 +537,7 @@ static GtkToggleActionEntry toggle_entries[] =
{
{
"ViewStyleDoubleLineAction", NULL, N_ ("_Double Line"), NULL,
N_ ("Show a second line with \"Action\", \"Notes\", and \"File Association\" for each transaction."),
N_ ("Show a second line with \"Action\", \"Notes\", and \"Linked Document\" for each transaction."),
G_CALLBACK (gnc_plugin_page_register_cmd_style_double_line), FALSE
},

Expand Down Expand Up @@ -605,14 +609,14 @@ static action_toolbar_labels toolbar_labels[] =
{ "DeleteTransactionAction", N_ ("Delete") },
{ "DuplicateTransactionAction", N_ ("Duplicate") },
{ "SplitTransactionAction", N_ ("Split") },
{ "JumpTransactionAction", N_ ("Jump") },
{ "ScheduleTransactionAction", N_ ("Schedule") },
{ "BlankTransactionAction", N_ ("Blank") },
{ "ActionsReconcileAction", N_ ("Reconcile") },
{ "ActionsAutoClearAction", N_ ("Auto-clear") },
{ "AssociateTransactionAction", N_ ("Update Association") },
{ "AssociateTransactionOpenAction", N_ ("Open Association") },
{ "AssociateTransactionRemoveAction", N_ ("Remove Association") },
{ "JumpAssociatedInvoiceAction", N_ ("Open Invoice") },
{ "AssociateTransactionAction", N_ ("Manage Document Link") },
{ "AssociateTransactionOpenAction", N_ ("Open Linked Document") },
{ "JumpAssociatedInvoiceAction", N_ ("Invoice") },
{ NULL, NULL },
};

Expand Down Expand Up @@ -996,7 +1000,6 @@ static const char* readonly_inactive_actions[] =
"ScrubAllAction",
"ScrubCurrentAction",
"AssociateTransactionAction",
"AssociateTransactionRemoveAction",
NULL
};

Expand All @@ -1022,7 +1025,6 @@ static const char* tran_action_labels[] =
DELETE_TRANSACTION_LABEL,
ASSOCIATE_TRANSACTION_LABEL,
ASSOCIATE_TRANSACTION_OPEN_LABEL,
ASSOCIATE_TRANSACTION_REMOVE_LABEL,
JUMP_ASSOCIATED_INVOICE_LABEL,
NULL
};
Expand All @@ -1037,7 +1039,6 @@ static const char* tran_action_tips[] =
DELETE_TRANSACTION_TIP,
ASSOCIATE_TRANSACTION_TIP,
ASSOCIATE_TRANSACTION_OPEN_TIP,
ASSOCIATE_TRANSACTION_REMOVE_TIP,
JUMP_ASSOCIATED_INVOICE_TIP,
NULL
};
Expand Down Expand Up @@ -1147,10 +1148,6 @@ gnc_plugin_page_register_ui_update (gpointer various,
"AssociateTransactionOpenAction");
gtk_action_set_sensitive (GTK_ACTION(action), (uri ? TRUE:FALSE));

action = gnc_plugin_page_get_action (GNC_PLUGIN_PAGE (page),
"AssociateTransactionRemoveAction");
gtk_action_set_sensitive (GTK_ACTION(action), (uri ? TRUE:FALSE));

/* Set 'ExecAssociatedInvoice'
We can determine an invoice from a txn if either
- it is an invoice transaction
Expand Down

0 comments on commit 8dce845

Please sign in to comment.