GnuCash
5.6-150-g038405b370+
|
Page classes generate the several pages of the assistant. More...
Public Member Functions | |
PageTransType (GtkBuilder *builder) | |
void | prepare (StockAssistantModel *model) |
int | get_transaction_type_index () |
void | set_transaction_types (const TxnTypeVec &txn_types) |
void | set_txn_type_explanation (const gchar *txt) |
Sets the explanation text for the selected transaction type, allowing the user to make sure that the selected transaction matches what they want to do. More... | |
void | connect (StockAssistantModel *model) |
void | change_txn_type (StockAssistantModel *model) |
Page classes generate the several pages of the assistant.
In general they have two functions, prepare and connect, plus a callback for each widget on the page and helper functions.
Pages are displayed only if the split is enabled in the transaction info. For most pages that means that the info is set to ENABLED_CREDIT or ENABLED_DEBIT, but for the stock amount page the info must be set to AMOUNT_CREDIT or AMOUNT_DEBIT. DISABLED is a placeholder as 0 is not testable.
Empty entries in amount edits are treated as 0 if the TxnTypeInfo for the split has ALLOW_ZERO set. Negative numbers are permitted only if ALLOW_NEGATIVE is set; that's used for amounts where the sign cannot be determined from the transaction type (like capital gains) or where it makes sense for consistency (like the new balance for a stock split in a short position.)
Prepare is called before a page is displayed and performs specializtion for the transaction type and populates widgets with already-known values; the latter may be available if the user has visited the page before for this transaction.
Connect connects the page's widgets signals with the handlers that transfer data to the model. The Transaction Type page.
This page collects the transaction type that's used to select the TxnTypeInfo that drives the rest of the process.
Definition at line 1741 of file assistant-stock-transaction.cpp.
void PageTransType::set_txn_type_explanation | ( | const gchar * | txt | ) |
Sets the explanation text for the selected transaction type, allowing the user to make sure that the selected transaction matches what they want to do.
transaction | explanation from the tranaction type's txntypeinfo. |
Definition at line 1808 of file assistant-stock-transaction.cpp.