GnuCash 7574033+
Loading...
Searching...
No Matches
PageFees Class Reference

Fees page. More...

Public Member Functions

 PageFees (GtkBuilder *builder, Account *account)
void connect (StockTransactionEntry *)
bool get_capitalize_fees ()
const char * get_memo ()
void set_capitalize_fees (bool state)
void set_account (Account *acct)
Account * stock_account ()
void update_fees_acct_sensitive (bool sensitive)
void prepare (StockTransactionEntry *)

Detailed Description

Fees page.

Controls for selecting whether to capitalize (i.e. charge them to the stock value), an account selector restricted to EXPENSE accounts if not capitalized, an amount and a memo.

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

Constructor & Destructor Documentation

◆ PageFees()

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

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

2109 : m_page(get_widget(builder, "fees_details_page")),
2110 m_capitalize(
2111 get_widget(builder, "capitalize_fees_checkbutton")),
2112 m_account(builder, {ACCT_TYPE_EXPENSE}, gnc_account_get_currency_or_parent(account),
2113 xaccAccountGetAssociatedAccount (account, FEES_KVP_TAG)),
2114 m_memo(get_widget(builder, "fees_memo_entry")),
2115 m_value(builder, gnc_account_get_currency_or_parent(account)),
2116 m_stock_account(account)
2117{
2118 m_account.attach (builder, "fees_table", "fees_account_label", 1);
2119 m_value.attach(builder, "fees_table", "fees_label", 2);
2120}
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_EXPENSE
Expense accounts are used to denote expenses.
Definition Account.h:143

Member Function Documentation

◆ connect()

void PageFees::connect ( StockTransactionEntry * entry)

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

2163{
2164 m_account.connect(entry);
2165 g_signal_connect(m_memo, "changed", G_CALLBACK(text_entry_changed_cb), entry);
2166 m_value.connect(G_CALLBACK(value_changed_cb), entry);
2167 g_object_set_data(G_OBJECT (m_capitalize), "owner", this);
2168 g_signal_connect (m_capitalize, "toggled", G_CALLBACK (capitalize_fees_toggled_cb), entry);
2169}

◆ get_capitalize_fees()

bool PageFees::get_capitalize_fees ( )

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

2124{
2125 return gtk_toggle_button_get_active(
2126 GTK_TOGGLE_BUTTON(m_capitalize));
2127}

◆ get_memo()

const char * PageFees::get_memo ( )

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

2131{
2132 return gtk_entry_get_text(GTK_ENTRY (m_memo));
2133}

◆ prepare()

void PageFees::prepare ( StockTransactionEntry * entry)

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

2173{
2174 set_capitalize_fees (entry->do_capitalize());
2175 entry->set_memo(get_memo());
2176 if (!gnc_numeric_check(m_value.get()))
2177 entry->set_value (m_value.get());
2178 entry->set_account(m_account.get());
2179 g_signal_connect(m_page, "focus", G_CALLBACK(assistant_page_set_focus), m_value.widget());
2180}
GNCNumericErrorCode gnc_numeric_check(gnc_numeric in)
Check for error signal in value.

◆ set_account()

void PageFees::set_account ( Account * acct)
inline

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

2102{ m_account.set(acct); }

◆ set_capitalize_fees()

void PageFees::set_capitalize_fees ( bool state)

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

2137{
2138 gtk_toggle_button_set_active(
2139 GTK_TOGGLE_BUTTON(m_capitalize), state);
2140}

◆ stock_account()

Account * PageFees::stock_account ( )
inline

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

2103{ return m_stock_account; }

◆ update_fees_acct_sensitive()

void PageFees::update_fees_acct_sensitive ( bool sensitive)

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

2144{
2145 m_account.set_sensitive(sensitive);
2146}

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