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

Dividend page, collects an amount, an INCOME account, and a memo. More...

Public Member Functions

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

Detailed Description

Dividend page, collects an amount, an INCOME account, and a memo.

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

Constructor & Destructor Documentation

◆ PageDividend()

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

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

2198 : m_page(get_widget(builder, "dividend_details_page")),
2199 m_account(builder, {ACCT_TYPE_INCOME}, gnc_account_get_currency_or_parent(account),
2200 xaccAccountGetAssociatedAccount (account, DIVIDEND_KVP_TAG)),
2201 m_memo(get_widget(builder, "dividend_memo_entry")),
2202 m_value(builder, gnc_account_get_currency_or_parent(account))
2203{
2204 m_account.attach(builder, "dividend_table", "dividend_account_label", 0);
2205 m_value.attach(builder, "dividend_table", "dividend_label", 1);
2206}
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 PageDividend::connect ( StockTransactionEntry entry)

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

2211{
2212 m_account.connect(entry);
2213 g_signal_connect(m_memo, "changed", G_CALLBACK(text_entry_changed_cb), entry);
2214 m_value.connect(G_CALLBACK(value_changed_cb), entry);
2215}

◆ get_memo()

const char * PageDividend::get_memo ( )

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

2229{
2230 return gtk_entry_get_text(GTK_ENTRY (m_memo));
2231}

◆ prepare()

void PageDividend::prepare ( StockTransactionEntry entry)

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

2219{
2220 entry->set_memo(get_memo());
2221 if (!gnc_numeric_check(m_value.get()))
2222 entry->set_value(m_value.get());
2223 entry->set_account(m_account.get());
2224 g_signal_connect(m_page, "focus", G_CALLBACK(assistant_page_set_focus), m_value.widget());
2225}
GNCNumericErrorCode gnc_numeric_check(gnc_numeric in)
Check for error signal in value.

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