Merge branch 'maint'

This commit is contained in:
Christopher Lam 2020-05-10 17:04:39 +08:00
commit 8d64c011c5
6 changed files with 49 additions and 50 deletions

View File

@ -65,6 +65,13 @@ static int gnome_is_initialized = FALSE;
#define ACCEL_MAP_NAME "accelerator-map"
const gchar *msg_no_help_found =
N_("GnuCash could not find the files of the help documentation.");
const gchar *msg_no_help_reason =
N_("This is likely because the \"gnucash-docs\" package is not properly installed.");
/* Translators: URI of missing help files */
const gchar *msg_no_help_location = N_("Expected location");
static void gnc_book_options_help_cb (GNCOptionWin *win, gpointer dat);
void
@ -262,10 +269,9 @@ gnc_gnome_help (const char *dir, const char *detail)
componentsJoinedByString: @"-"];
if (![[NSFileManager defaultManager] fileExistsAtPath: docs_dir])
{
const gchar *message =
_("GnuCash could not find the files for the help documentation. "
"This is likely because the 'gnucash-docs' package is not installed");
gnc_error_dialog(NULL, "%s at %s", message, [docs_dir UTF8String]);
gnc_error_dialog(NULL, "%s\n%s\n%s: %s", _(msg_no_help_found),
_(msg_no_help_reason),
_(msg_no_help_location), [docs_dir UTF8String]);
[pool release];
return;
}
@ -355,10 +361,7 @@ gnc_gnome_help (const char *dir, const char *detail)
[[NSWorkspace sharedWorkspace] openURL: url];
else
{
const gchar *message =
_("GnuCash could not find the files for the help documentation. "
"This is likely because the 'gnucash-docs' package is not installed.");
gnc_error_dialog(NULL, "%s", message);
gnc_error_dialog(NULL, "%s\n%s", _(msg_no_help_found), _(msg_no_help_reason));
}
[pool release];
}
@ -386,9 +389,7 @@ gnc_gnome_help (const char *file_name, const char *anchor)
if (!found)
{
const gchar *message =
_("GnuCash could not find the files for the help documentation.");
gnc_error_dialog (NULL, message);
gnc_error_dialog (NULL, "%s\n%s", _(msg_no_help_found), _(msg_no_help_reason));
}
else
{
@ -419,10 +420,7 @@ gnc_gnome_help (const char *file_name, const char *anchor)
g_assert(error != NULL);
{
const gchar *message =
_("GnuCash could not find the files for the help documentation. "
"This is likely because the 'gnucash-docs' package is not installed.");
gnc_error_dialog(NULL, "%s", message);
gnc_error_dialog(NULL, "%s\n%s", _(msg_no_help_found), _(msg_no_help_reason));
}
PERR ("%s", error->message);
g_error_free(error);
@ -485,7 +483,7 @@ gnc_launch_assoc (GtkWindow *parent, const char *uri)
NULL, NULL, SW_SHOWNORMAL) <= 32)
{
const gchar *message =
_("GnuCash could not find the associated file");
_("GnuCash could not find the associated file.");
gnc_error_dialog(parent, "%s:\n%s", message, filename);
}
g_free (wincmd);

View File

@ -496,13 +496,13 @@ gbv_create_widget (GncBudgetView *budget_view)
// Create totals tree view
totals_tree_model = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING);
gtk_list_store_append (totals_tree_model, &iter);
gtk_list_store_set (totals_tree_model, &iter, 0, _("Inflow from Income"),
gtk_list_store_set (totals_tree_model, &iter, 0, _("Income"),
1, TOTALS_TYPE_INCOME, 2, " ", 3, " ", -1);
gtk_list_store_append (totals_tree_model, &iter);
gtk_list_store_set (totals_tree_model, &iter, 0, _("Outflow to Expenses"),
gtk_list_store_set (totals_tree_model, &iter, 0, _("Expenses"),
1, TOTALS_TYPE_EXPENSES, 2, " ", 3, " ", -1);
gtk_list_store_append (totals_tree_model, &iter);
gtk_list_store_set (totals_tree_model, &iter, 0, _("Outflow to Asset/Equity/Liability"),
gtk_list_store_set (totals_tree_model, &iter, 0, _("Transfer"),
1, TOTALS_TYPE_ASSET_LIAB_EQ, 2, " ", 3, " ", -1);
gtk_list_store_append (totals_tree_model, &iter);
gtk_list_store_set (totals_tree_model, &iter, 0, _("Remaining to Budget"),
@ -1329,11 +1329,11 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
switch (row_type)
{
case TOTALS_TYPE_ASSET_LIAB_EQ:
if ((acctype == ACCT_TYPE_LIABILITY) ||
(acctype == ACCT_TYPE_EQUITY))
neg = !neg;
else if (acctype != ACCT_TYPE_ASSET)
if ((acctype != ACCT_TYPE_ASSET) &&
(acctype != ACCT_TYPE_LIABILITY) &&
(acctype != ACCT_TYPE_EQUITY))
continue;
neg = !neg;
break;
case TOTALS_TYPE_EXPENSES:
if (acctype != ACCT_TYPE_EXPENSE)
@ -1345,10 +1345,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
neg = !neg;
break;
case TOTALS_TYPE_REMAINDER:
if ((acctype == ACCT_TYPE_ASSET) ||
(acctype == ACCT_TYPE_INCOME) ||
(acctype == ACCT_TYPE_EXPENSE))
neg = !neg;
neg = !neg;
break;
default:
continue; /* don't count if unexpected total row type is passed in... */
@ -1366,6 +1363,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
(acctype != ACCT_TYPE_LIABILITY) &&
(acctype != ACCT_TYPE_EQUITY))
continue;
neg = (acctype == ACCT_TYPE_ASSET);
break;
case TOTALS_TYPE_EXPENSES:
if (acctype != ACCT_TYPE_EXPENSE)
@ -1376,7 +1374,8 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
continue;
break;
case TOTALS_TYPE_REMAINDER:
neg = (acctype != ACCT_TYPE_INCOME);
neg = ((acctype == ACCT_TYPE_ASSET) ||
(acctype == ACCT_TYPE_EXPENSE));
break;
default:
continue; /* don't count if unexpected total row type is passed in... */

View File

@ -60,25 +60,25 @@ static void gnc_plugin_budget_cmd_delete_budget (GtkAction *action,
static GtkActionEntry gnc_plugin_actions [] =
{
{
"NewBudgetAction", NULL, N_("New Budget"), NULL,
N_("Create a new Budget"),
"NewBudgetAction", NULL, N_("_New Budget"), NULL,
N_("Create a new Budget."),
G_CALLBACK(gnc_plugin_budget_cmd_new_budget)
},
{
"OpenBudgetAction", NULL, N_("Open Budget"), NULL,
N_("Open an existing Budget"),
"OpenBudgetAction", NULL, N_("_Open Budget"), NULL,
N_("Open an existing Budget in a new tab. If none exists a new budget will be created."),
G_CALLBACK(gnc_plugin_budget_cmd_open_budget)
},
{
"CopyBudgetAction", NULL, N_("Copy Budget"), NULL,
N_("Copy an existing Budget"),
"CopyBudgetAction", NULL, N_("_Copy Budget"), NULL,
N_("Copy an existing Budget."),
G_CALLBACK(gnc_plugin_budget_cmd_copy_budget)
},
{
"DeleteBudgetAction", NULL, N_("Delete Budget"), NULL,
N_("Deletes an existing Budget"),
"DeleteBudgetAction", NULL, N_("_Delete Budget"), NULL,
N_("Delete an existing Budget."),
G_CALLBACK(gnc_plugin_budget_cmd_delete_budget)
},

View File

@ -138,37 +138,37 @@ static GtkActionEntry gnc_plugin_page_budget_actions [] =
/* File menu */
{
"OpenAccountAction", GNC_ICON_OPEN_ACCOUNT, N_("Open _Account"), NULL,
N_("Open the selected account"),
N_("Open the selected account."),
G_CALLBACK(gnc_plugin_page_budget_cmd_open_account)
},
{
"OpenSubaccountsAction", GNC_ICON_OPEN_ACCOUNT,
N_("Open _Subaccounts"), NULL,
N_("Open the selected account and all its subaccounts"),
N_("Open the selected account and all its subaccounts."),
G_CALLBACK(gnc_plugin_page_budget_cmd_open_subaccounts)
},
/* Edit menu */
{
"DeleteBudgetAction", GNC_ICON_DELETE_BUDGET, N_("_Delete Budget"),
NULL, N_("Delete this budget"),
NULL, N_("Delete this budget."),
G_CALLBACK(gnc_plugin_page_budget_cmd_delete_budget)
},
{
"OptionsBudgetAction", "document-properties", N_("Budget Options"),
NULL, N_("Edit this budget's options"),
"OptionsBudgetAction", "document-properties", N_("Budget _Options..."),
NULL, N_("Edit this budget's options."),
G_CALLBACK(gnc_plugin_page_budget_cmd_view_options)
},
{
"EstimateBudgetAction", "system-run", N_("Estimate Budget"),
"EstimateBudgetAction", "system-run", N_("Esti_mate Budget..."),
NULL,
N_("Estimate a budget value for the selected accounts from past transactions"),
N_("Estimate a budget value for the selected accounts from past transactions."),
G_CALLBACK(gnc_plugin_page_budget_cmd_estimate_budget)
},
{
"AllPeriodsBudgetAction", "system-run", N_("All Periods"),
"AllPeriodsBudgetAction", "system-run", N_("_All Periods..."),
NULL,
N_("Edit budget for all periods for the selected accounts"),
N_("Edit budget for all periods for the selected accounts."),
G_CALLBACK(gnc_plugin_page_budget_cmd_allperiods_budget)
},
{
@ -184,7 +184,7 @@ static GtkActionEntry gnc_plugin_page_budget_actions [] =
},
{
"ViewRefreshAction", "view-refresh", N_("_Refresh"), "<primary>r",
N_("Refresh this window"),
N_("Refresh this window."),
G_CALLBACK(gnc_plugin_page_budget_cmd_refresh)
},

View File

@ -370,17 +370,15 @@ gnc_start_recn_date_changed (GtkWidget *widget, startRecnWindowData *data)
if (days_after_today > 0)
{
/* Translators: This is a ngettext(3) message, %d is the
number of days in the future */
gchar *str = g_strdup_printf
/* Translators: %d is the number of days in the future */
(ngettext ("Statement Date is %d day after today.",
"Statement Date is %d days after today.",
days_after_today),
days_after_today);
/* Translators: This is a ngettext(3) message, %d is the
number of days in the future */
gchar *tip_start = g_strdup_printf
/* Translators: %d is the number of days in the future */
(ngettext ("The statement date you have chosen is %d day in the future.",
"The statement date you have chosen is %d days in the future.",
days_after_today),

View File

@ -627,6 +627,10 @@ static void split_find_match (GNCImportTransInfo * trans_info,
Transaction *new_trans = gnc_import_TransInfo_get_trans (trans_info);
Split *new_trans_fsplit = gnc_import_TransInfo_get_fsplit (trans_info);
// Do not consider transactions that have been previously matched.
if (gnc_import_split_has_online_id (split))
return;
/* Matching heuristics */
/* Amount heuristics */