1#line 2 "src/Gui/AccountEditor.cpp"
4#include <Wt/WTextArea.h>
5#include <Wt/WVBoxLayout.h>
6#include <Wt/WFitLayout.h>
7#include <Wt/WGridLayout.h>
8#include <Wt/WPushButton.h>
9#include <Wt/WComboBox.h>
10#include <Wt/WCheckBox.h>
16class AccountParentCombo
40#ifdef MOVE_ALL_THIS_TO_A_SETVALUETEXT_FUNCTION
47 addItem(
Wt::WString::tr(
Wt::WString(
"gcw.AccountsType.{1}").arg( def.backendName ).toUTF8() ) );
57 if( def.backendName == _initialValue )
79class SmallestFractionCombo
84 SmallestFractionCombo()
86 addItem(
TR(
"gcw.AccountEditor.usecommodity" ) );
106 auto lw =
setLayout( std::make_unique< Wt::WVBoxLayout >() );
107 auto t1 =
lw->
addWidget( std::make_unique< Wt::WTemplate >(
TR(
"gcw_gui.accounteditor.form.tab1" ) ) );
109 t1-> bindString(
"name-label" ,
TR(
"gcw.AccountEditor.name" ) );
110 t1-> bindString(
"code-label" ,
TR(
"gcw.AccountEditor.code" ) );
111 t1-> bindString(
"desc-label" ,
TR(
"gcw.AccountEditor.desc" ) );
112 t1-> bindString(
"parent-label" ,
TR(
"gcw.AccountEditor.parent" ) );
113 t1-> bindString(
"accountType-label" ,
TR(
"gcw.AccountEditor.accountType" ) );
114 t1-> bindString(
"security-label" ,
TR(
"gcw.AccountEditor.security" ) );
115 t1-> bindString(
"fraction-label" ,
TR(
"gcw.AccountEditor.fraction" ) );
116 t1-> bindString(
"color-label" ,
TR(
"gcw.AccountEditor.color" ) );
117 t1-> bindString(
"notes-label" ,
TR(
"gcw.AccountEditor.notes" ) );
158 auto lw =
setLayout( std::make_unique< Wt::WFitLayout >() );
159 auto t2 =
lw->
addWidget( std::make_unique< Wt::WTemplate >(
TR(
"gcw_gui.accounteditor.form.tab2" ) ) );
181 auto lw =
setLayout( std::make_unique< Wt::WVBoxLayout >() );
186 auto at1 = std::make_unique< Tab1 >();
189 auto at2 = std::make_unique< Tab2 >();
193 auto twt1 =
tabWidget()-> addTab( std::move(
at1 ),
TR(
"gcw_gui.accounteditor.form.tab1") );
194 auto twt2 =
tabWidget()-> addTab( std::move(
at2 ),
TR(
"gcw_gui.accounteditor.form.tab2") );
196 auto footer =
lw->
addWidget( std::make_unique< Wt::WTemplate >(
TR(
"gcw_gui.accounteditor.form.footer" ) ) );
214 wApp->
doJavaScript(
"window.open( '/dox/html/AccountEditor.html', '_blank' )" );
287:
Wt::WDialog(
"Edit Account" )
294 contents()-> addNew< GCW::Gui::AccountEditor >()-> loadData( _accountGuid );
AccountEditorDialog(const std::string &_accountGuid)
Wt::WComboBox * m_fraction
auto loadData(const std::string &_accountGuid) -> void
Wt::WCheckBox * m_autoTransfer
Wt::WComboBox * m_accountType
Wt::WCheckBox * m_taxRelated
Wt::WCheckBox * m_placeholder
Wt::WCheckBox * m_openingBalance
Wt::WComboBox * m_security
Wt::WPushButton * m_color
auto saveData(const std::string &_accountGuid) -> void
auto loadData(const std::string &_accountGuid) -> void
auto saveData(const std::string &_accountGuid) -> void
auto save() -> Wt::Signal<> &
std::string m_accountGuid
Wt::WText * m_accountName
Wt::WTabWidget * m_tabWidget
auto isDirty() const -> bool
auto saveData(const std::string &_accountGuid) -> void
Wt::WTabWidget * tabWidget()
auto loadData(const std::string &_accountGuid) -> void
auto cancel() -> Wt::Signal<> &
void setCurrentIndex(int index)
void addItem(const WString &text)
void setResizable(bool resizable)
virtual void setMinimumSize(const WLength &width, const WLength &height) override
WContainerWidget * contents() const
void rejectWhenEscapePressed(bool enable=true)
void setClosable(bool closable)
auto load(const std::string &_guid) -> Item::Ptr
Load Account by GUID.
const std::vector< AccountDef_t > s_accountDefs