Skip to content

Commit

Permalink
Make a distinction between file/link Association
Browse files Browse the repository at this point in the history
Show a 'f' in the register for a file association and a 'w' for a link
  • Loading branch information
Bob-IT authored and jralls committed Aug 20, 2016
1 parent 5bb53c0 commit 57666b4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/register/ledger-core/split-register-layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ gnc_split_register_layout_add_cells (SplitRegister *reg,
ASSOC_CELL,
RECN_CELL_TYPE_NAME,
N_("Associate:A") + 10,
CELL_ALIGN_LEFT,
CELL_ALIGN_CENTER,
FALSE,
FALSE);

Expand Down
4 changes: 2 additions & 2 deletions src/register/ledger-core/split-register-load.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ gnc_split_register_load_associate_cells (SplitRegister *reg)
if (!cell) return;

/* FIXME: These should get moved to an i18n function */
gnc_recn_cell_set_valid_flags (cell, "@ ", ' ');
gnc_recn_cell_set_flag_order (cell, "@ ");
gnc_recn_cell_set_valid_flags (cell, "fw ", ' ');
gnc_recn_cell_set_flag_order (cell, "fw ");
}

static void
Expand Down
22 changes: 13 additions & 9 deletions src/register/ledger-core/split-register-model.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,13 @@ gnc_split_register_get_action_label (VirtualLocation virt_loc,
return _("Action");
}

static const char *
gnc_split_register_get_associate_label (VirtualLocation virt_loc,
gpointer user_data)
{
return _("Associate:A") + 10;
}

static const char *
gnc_split_register_get_xfrm_label (VirtualLocation virt_loc,
gpointer user_data)
Expand All @@ -339,13 +346,6 @@ gnc_split_register_get_memo_label (VirtualLocation virt_loc,
return _("Memo");
}

static const char *
gnc_split_register_get_associate_label (VirtualLocation virt_loc,
gpointer user_data)
{
return _("Associate:A");
}

static const char *
gnc_split_register_get_type_label (VirtualLocation virt_loc,
gpointer user_data)
Expand Down Expand Up @@ -786,7 +786,12 @@ gnc_split_register_get_associate_entry (VirtualLocation virt_loc,

// Check for uri is empty or NULL
if (g_strcmp0 (uri, "") != 0 && g_strcmp0 (uri, NULL) != 0)
associate = '@';
{
if (g_str_has_prefix (uri, "file:"))
associate = 'f';
else
associate = 'w';
}
else
associate = ' ';

Expand All @@ -809,7 +814,6 @@ gnc_split_register_get_associate_value (SplitRegister *reg,
return gnc_recn_cell_get_flag (cell);
}


static const char *
gnc_split_register_get_type_entry (VirtualLocation virt_loc,
gboolean translate,
Expand Down

0 comments on commit 57666b4

Please sign in to comment.