GnuCash c935c2f+
Loading...
Searching...
No Matches
Public Member Functions
PageCapGain Class Reference

Public Member Functions

 PageCapGain (GtkBuilder *builder, Account *account)
 
void connect (StockTransactionEntry *entry)
 
void prepare (StockTransactionEntry *entry)
 
const char * get_memo ()
 

Detailed Description

Definition at line 2233 of file assistant-stock-transaction.cpp.

Constructor & Destructor Documentation

◆ PageCapGain()

PageCapGain::PageCapGain ( GtkBuilder *  builder,
Account account 
)

Definition at line 2247 of file assistant-stock-transaction.cpp.

2247 :
2248 m_page (get_widget (builder, "capgains_details_page")),
2249 m_account (builder, { ACCT_TYPE_INCOME }, gnc_account_get_currency_or_parent(account),
2250 xaccAccountGetAssociatedAccount (account, CAPGAINS_KVP_TAG)),
2251 m_memo (get_widget (builder, "capgains_memo_entry")),
2252 m_value (builder, gnc_account_get_currency_or_parent(account))
2253{
2254 m_account.attach(builder, "capgains_table", "capgains_account_label", 0);
2255 m_value.attach(builder, "capgains_table", "capgains_label", 1);
2256}
gnc_commodity * gnc_account_get_currency_or_parent(const Account *account)
Returns a gnc_commodity that is a currency, suitable for being a Transaction's currency.
Definition Account.cpp:3415
Account * xaccAccountGetAssociatedAccount(const Account *acc, const char *tag)
Get the account's associated account e.g.
Definition Account.cpp:3387
@ ACCT_TYPE_INCOME
Income accounts are used to denote income.
Definition Account.h:140

Member Function Documentation

◆ connect()

void PageCapGain::connect ( StockTransactionEntry entry)

Definition at line 2266 of file assistant-stock-transaction.cpp.

2267{
2268 m_account.connect(entry);
2269 g_signal_connect(m_memo, "changed", G_CALLBACK(text_entry_changed_cb), entry);
2270 m_value.connect(G_CALLBACK(value_changed_cb), entry);
2271}

◆ get_memo()

const char * PageCapGain::get_memo ( )

Definition at line 2259 of file assistant-stock-transaction.cpp.

2260{
2261 return gtk_entry_get_text(GTK_ENTRY (m_memo));
2262}

◆ prepare()

void PageCapGain::prepare ( StockTransactionEntry entry)

Definition at line 2274 of file assistant-stock-transaction.cpp.

2275{
2276 entry->set_memo(get_memo());
2277 if (gnc_numeric_check(m_value.get()))
2278 entry->set_value(m_value.get());
2279 entry->set_account(m_account.get());
2280 g_signal_connect(m_page, "focus", G_CALLBACK(assistant_page_set_focus), m_value.widget());
2281}
GNCNumericErrorCode gnc_numeric_check(gnc_numeric in)
Check for error signal in value.

The documentation for this class was generated from the following file: