mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
* table-model.h -- add a flag for "READ_ONLY" cells, to all you to
specify a cell as readonly. * table-allgui.c -- allow the cursor to enter a READ_ONLY cell. Make sure "editable" is FALSE for READ_ONLY cells. * split-register-model.c -- If the TxnType != NONE, set all cells as READ_ONLY. * fixes bugs 96024 and 96028 by making posted invoices and payments read-only. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7338 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
ab3a983020
commit
f7a23755d0
@ -32,6 +32,15 @@
|
|||||||
|
|
||||||
* gnc-ledger-display.c -- honor user defaults for A/R and A/P windows
|
* gnc-ledger-display.c -- honor user defaults for A/R and A/P windows
|
||||||
|
|
||||||
|
* table-model.h -- add a flag for "READ_ONLY" cells, to all you to
|
||||||
|
specify a cell as readonly.
|
||||||
|
* table-allgui.c -- allow the cursor to enter a READ_ONLY cell. Make
|
||||||
|
sure "editable" is FALSE for READ_ONLY cells.
|
||||||
|
* split-register-model.c -- If the TxnType != NONE, set all cells as
|
||||||
|
READ_ONLY.
|
||||||
|
* fixes bugs 96024 and 96028 by making posted invoices and payments
|
||||||
|
read-only.
|
||||||
|
|
||||||
2002-10-16 Joshua Sled <jsled@asynchronous.org>
|
2002-10-16 Joshua Sled <jsled@asynchronous.org>
|
||||||
|
|
||||||
* src/app-utils/gnc-exp-parser.c (gnc_exp_parser_parse): This
|
* src/app-utils/gnc-exp-parser.c (gnc_exp_parser_parse): This
|
||||||
|
@ -1330,10 +1330,32 @@ gnc_split_register_get_debcred_entry (VirtualLocation virt_loc,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
gnc_split_register_cursor_is_readonly (VirtualLocation virt_loc,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
SplitRegister *reg = user_data;
|
||||||
|
Split *split;
|
||||||
|
Transaction *txn;
|
||||||
|
char type;
|
||||||
|
|
||||||
|
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||||
|
if (!split) return FALSE;
|
||||||
|
|
||||||
|
txn = xaccSplitGetParent (split);
|
||||||
|
if (!txn) return FALSE;
|
||||||
|
|
||||||
|
type = xaccTransGetTxnType (txn);
|
||||||
|
return (type != TXN_TYPE_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
static CellIOFlags
|
static CellIOFlags
|
||||||
gnc_split_register_get_inactive_io_flags (VirtualLocation virt_loc,
|
gnc_split_register_get_inactive_io_flags (VirtualLocation virt_loc,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
if (gnc_split_register_cursor_is_readonly (virt_loc, user_data))
|
||||||
|
return XACC_CELL_ALLOW_READ_ONLY;
|
||||||
|
|
||||||
return XACC_CELL_ALLOW_NONE;
|
return XACC_CELL_ALLOW_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1341,6 +1363,9 @@ static CellIOFlags
|
|||||||
gnc_split_register_get_standard_io_flags (VirtualLocation virt_loc,
|
gnc_split_register_get_standard_io_flags (VirtualLocation virt_loc,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
if (gnc_split_register_cursor_is_readonly (virt_loc, user_data))
|
||||||
|
return XACC_CELL_ALLOW_READ_ONLY;
|
||||||
|
|
||||||
return XACC_CELL_ALLOW_ALL;
|
return XACC_CELL_ALLOW_ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1348,6 +1373,9 @@ static CellIOFlags
|
|||||||
gnc_split_register_get_recn_io_flags (VirtualLocation virt_loc,
|
gnc_split_register_get_recn_io_flags (VirtualLocation virt_loc,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
if (gnc_split_register_cursor_is_readonly (virt_loc, user_data))
|
||||||
|
return XACC_CELL_ALLOW_READ_ONLY;
|
||||||
|
|
||||||
return XACC_CELL_ALLOW_ALL | XACC_CELL_ALLOW_EXACT_ONLY;
|
return XACC_CELL_ALLOW_ALL | XACC_CELL_ALLOW_EXACT_ONLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1365,7 +1393,7 @@ gnc_split_register_get_ddue_io_flags (VirtualLocation virt_loc,
|
|||||||
return XACC_CELL_ALLOW_NONE;
|
return XACC_CELL_ALLOW_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return XACC_CELL_ALLOW_ALL;
|
return XACC_CELL_ALLOW_READ_ONLY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CellIOFlags
|
static CellIOFlags
|
||||||
@ -1375,6 +1403,9 @@ gnc_split_register_get_debcred_io_flags (VirtualLocation virt_loc,
|
|||||||
SplitRegister *reg = user_data;
|
SplitRegister *reg = user_data;
|
||||||
Split *split;
|
Split *split;
|
||||||
|
|
||||||
|
if (gnc_split_register_cursor_is_readonly (virt_loc, user_data))
|
||||||
|
return XACC_CELL_ALLOW_READ_ONLY;
|
||||||
|
|
||||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||||
|
|
||||||
if (safe_strcmp ("stock-split", xaccSplitGetType (split)) == 0)
|
if (safe_strcmp ("stock-split", xaccSplitGetType (split)) == 0)
|
||||||
@ -1389,6 +1420,9 @@ gnc_split_register_get_security_io_flags (VirtualLocation virt_loc,
|
|||||||
{
|
{
|
||||||
SplitRegister *reg = user_data;
|
SplitRegister *reg = user_data;
|
||||||
|
|
||||||
|
if (gnc_split_register_cursor_is_readonly (virt_loc, user_data))
|
||||||
|
return XACC_CELL_ALLOW_READ_ONLY;
|
||||||
|
|
||||||
if (gnc_split_register_use_security_cells (reg, virt_loc))
|
if (gnc_split_register_use_security_cells (reg, virt_loc))
|
||||||
return XACC_CELL_ALLOW_ALL;
|
return XACC_CELL_ALLOW_ALL;
|
||||||
|
|
||||||
|
@ -1022,6 +1022,10 @@ gnc_table_virtual_loc_valid(Table *table,
|
|||||||
if (gnc_table_model_read_only (table->model)) return TRUE;
|
if (gnc_table_model_read_only (table->model)) return TRUE;
|
||||||
|
|
||||||
io_flags = gnc_table_get_io_flags (table, virt_loc);
|
io_flags = gnc_table_get_io_flags (table, virt_loc);
|
||||||
|
|
||||||
|
/* if the cell allows ENTER, then it is ok */
|
||||||
|
if (io_flags & XACC_CELL_ALLOW_ENTER) return TRUE;
|
||||||
|
|
||||||
/* if cell is marked as output-only, you can't enter */
|
/* if cell is marked as output-only, you can't enter */
|
||||||
if (0 == (XACC_CELL_ALLOW_INPUT & io_flags)) return FALSE;
|
if (0 == (XACC_CELL_ALLOW_INPUT & io_flags)) return FALSE;
|
||||||
|
|
||||||
@ -1047,6 +1051,7 @@ gnc_table_enter_update (Table *table,
|
|||||||
CellBlock *cb;
|
CellBlock *cb;
|
||||||
int cell_row;
|
int cell_row;
|
||||||
int cell_col;
|
int cell_col;
|
||||||
|
CellIOFlags io_flags;
|
||||||
|
|
||||||
if (table == NULL)
|
if (table == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1066,6 +1071,10 @@ gnc_table_enter_update (Table *table,
|
|||||||
if (!cell)
|
if (!cell)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
io_flags = gnc_table_get_io_flags (table, virt_loc);
|
||||||
|
if (io_flags == XACC_CELL_ALLOW_READ_ONLY)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
enter = cell->enter_cell;
|
enter = cell->enter_cell;
|
||||||
|
|
||||||
if (enter)
|
if (enter)
|
||||||
|
@ -36,7 +36,9 @@ typedef enum
|
|||||||
XACC_CELL_ALLOW_INPUT = 1 << 0,
|
XACC_CELL_ALLOW_INPUT = 1 << 0,
|
||||||
XACC_CELL_ALLOW_SHADOW = 1 << 1,
|
XACC_CELL_ALLOW_SHADOW = 1 << 1,
|
||||||
XACC_CELL_ALLOW_ALL = XACC_CELL_ALLOW_INPUT | XACC_CELL_ALLOW_SHADOW,
|
XACC_CELL_ALLOW_ALL = XACC_CELL_ALLOW_INPUT | XACC_CELL_ALLOW_SHADOW,
|
||||||
XACC_CELL_ALLOW_EXACT_ONLY = 1 << 2
|
XACC_CELL_ALLOW_EXACT_ONLY = 1 << 2,
|
||||||
|
XACC_CELL_ALLOW_ENTER = 1 << 3,
|
||||||
|
XACC_CELL_ALLOW_READ_ONLY = XACC_CELL_ALLOW_SHADOW | XACC_CELL_ALLOW_ENTER
|
||||||
} CellIOFlags;
|
} CellIOFlags;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
Loading…
Reference in New Issue
Block a user