GnuCash c935c2f+
Loading...
Searching...
No Matches
Public Member Functions
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)
 
Accountstock_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 2086 of file assistant-stock-transaction.cpp.

Constructor & Destructor Documentation

◆ PageFees()

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

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

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

Member Function Documentation

◆ connect()

void PageFees::connect ( StockTransactionEntry entry)

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

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

◆ get_capitalize_fees()

bool PageFees::get_capitalize_fees ( )

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

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

◆ get_memo()

const char * PageFees::get_memo ( )

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

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

◆ prepare()

void PageFees::prepare ( StockTransactionEntry entry)

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

2172{
2173 set_capitalize_fees (entry->do_capitalize());
2174 entry->set_memo(get_memo());
2175 if (!gnc_numeric_check(m_value.get()))
2176 entry->set_value (m_value.get());
2177 entry->set_account(m_account.get());
2178 g_signal_connect(m_page, "focus", G_CALLBACK(assistant_page_set_focus), m_value.widget());
2179}
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 2101 of file assistant-stock-transaction.cpp.

2101{ m_account.set(acct); }

◆ set_capitalize_fees()

void PageFees::set_capitalize_fees ( bool  state)

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

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

◆ stock_account()

Account * PageFees::stock_account ( )
inline

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

2102{ return m_stock_account; }

◆ update_fees_acct_sensitive()

void PageFees::update_fees_acct_sensitive ( bool  sensitive)

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

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

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