Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed May 10, 2020
2 parents f9dfdb3 + 0b0e4c7 commit 8d64c01
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 50 deletions.
30 changes: 14 additions & 16 deletions gnucash/gnome-utils/gnc-gnome-utils.c
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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];
}
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
23 changes: 11 additions & 12 deletions gnucash/gnome/gnc-budget-view.c
Expand Up @@ -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"),
Expand Down Expand Up @@ -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)
Expand All @@ -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... */
Expand All @@ -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)
Expand All @@ -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... */
Expand Down
16 changes: 8 additions & 8 deletions gnucash/gnome/gnc-plugin-budget.c
Expand Up @@ -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)
},

Expand Down
20 changes: 10 additions & 10 deletions gnucash/gnome/gnc-plugin-page-budget.c
Expand Up @@ -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)
},
{
Expand All @@ -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)
},

Expand Down
6 changes: 2 additions & 4 deletions gnucash/gnome/window-reconcile.c
Expand Up @@ -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),
Expand Down
4 changes: 4 additions & 0 deletions gnucash/import-export/import-backend.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 8d64c01

Please sign in to comment.