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

Constructor & Destructor Documentation

◆ PageFees()

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

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

2111 : m_page(get_widget(builder, "fees_details_page")),
2112 m_capitalize(
2113 get_widget(builder, "capitalize_fees_checkbutton")),
2114 m_account(builder, {ACCT_TYPE_EXPENSE}, gnc_account_get_currency_or_parent(account),
2115 xaccAccountGetAssociatedAccount (account, FEES_KVP_TAG)),
2116 m_memo(get_widget(builder, "fees_memo_entry")),
2117 m_value(builder, gnc_account_get_currency_or_parent(account)),
2118 m_stock_account(account)
2119{
2120 m_account.attach (builder, "fees_table", "fees_account_label", 1);
2121 m_value.attach(builder, "fees_table", "fees_label", 2);
2122}
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 2164 of file assistant-stock-transaction.cpp.

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

◆ get_capitalize_fees()

bool PageFees::get_capitalize_fees ( )

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

2126{
2127 return gtk_toggle_button_get_active(
2128 GTK_TOGGLE_BUTTON(m_capitalize));
2129}

◆ get_memo()

const char * PageFees::get_memo ( )

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

2133{
2134 return gtk_entry_get_text(GTK_ENTRY (m_memo));
2135}

◆ prepare()

void PageFees::prepare ( StockTransactionEntry entry)

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

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

2104{ m_account.set(acct); }

◆ set_capitalize_fees()

void PageFees::set_capitalize_fees ( bool  state)

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

2139{
2140 gtk_toggle_button_set_active(
2141 GTK_TOGGLE_BUTTON(m_capitalize), state);
2142}

◆ stock_account()

Account * PageFees::stock_account ( )
inline

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

2105{ return m_stock_account; }

◆ update_fees_acct_sensitive()

void PageFees::update_fees_acct_sensitive ( bool  sensitive)

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

2146{
2147 m_account.set_sensitive(sensitive);
2148}

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