GnuCash 038f90a+
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 2236 of file assistant-stock-transaction.cpp.

Constructor & Destructor Documentation

◆ PageCapGain()

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

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

2250 :
2251 m_page (get_widget (builder, "capgains_details_page")),
2252 m_account (builder, { ACCT_TYPE_INCOME }, gnc_account_get_currency_or_parent(account),
2253 xaccAccountGetAssociatedAccount (account, CAPGAINS_KVP_TAG)),
2254 m_memo (get_widget (builder, "capgains_memo_entry")),
2255 m_value (builder, gnc_account_get_currency_or_parent(account))
2256{
2257 m_account.attach(builder, "capgains_table", "capgains_account_label", 0);
2258 m_value.attach(builder, "capgains_table", "capgains_label", 1);
2259}
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 2269 of file assistant-stock-transaction.cpp.

2270{
2271 m_account.connect(entry);
2272 g_signal_connect(m_memo, "changed", G_CALLBACK(text_entry_changed_cb), entry);
2273 m_value.connect(G_CALLBACK(value_changed_cb), entry);
2274}

◆ get_memo()

const char * PageCapGain::get_memo ( )

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

2263{
2264 return gtk_entry_get_text(GTK_ENTRY (m_memo));
2265}

◆ prepare()

void PageCapGain::prepare ( StockTransactionEntry entry)

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

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

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