GnuCash 7574033+
Loading...
Searching...
No Matches
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 2184 of file assistant-stock-transaction.cpp.

Constructor & Destructor Documentation

◆ PageDividend()

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

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

2199 : m_page(get_widget(builder, "dividend_details_page")),
2200 m_account(builder, {ACCT_TYPE_INCOME}, gnc_account_get_currency_or_parent(account),
2201 xaccAccountGetAssociatedAccount (account, DIVIDEND_KVP_TAG)),
2202 m_memo(get_widget(builder, "dividend_memo_entry")),
2203 m_value(builder, gnc_account_get_currency_or_parent(account))
2204{
2205 m_account.attach(builder, "dividend_table", "dividend_account_label", 0);
2206 m_value.attach(builder, "dividend_table", "dividend_label", 1);
2207}
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:3396
Account * xaccAccountGetAssociatedAccount(const Account *acc, const char *tag)
Get the account's associated account e.g.
Definition Account.cpp:3368
@ 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 2211 of file assistant-stock-transaction.cpp.

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

◆ get_memo()

const char * PageDividend::get_memo ( )

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

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

◆ prepare()

void PageDividend::prepare ( StockTransactionEntry * entry)

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

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

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