1#line 2 "src/Gui/CentralWidget.cpp"
3#include <Wt/WMenuItem.h>
4#include <Wt/WTabWidget.h>
58 tabClosed().connect( [=](
int tabIndex )
69 auto widget = std::make_unique< GCW::Gui::AccountsTreeView >( 7 );
71 tabWidget()-> addTab( std::move(
widget ),
TR(
"gcw.AccountsTreeView.tabName" ) );
82 auto index = tabIndex(
TR8(
"gcw.AccountsTreeView.tabName" ) );
86 tabWidget()-> setCurrentIndex( index );
93tabIndex(
const std::string & _text )->
int
95 for(
int i=0; i< tabWidget()-> count(); i++ )
96 if( tabWidget()-> tabText( i ) == _text )
133 if( tabIndex( accountItem-> name() ) == -1 )
135 auto u_ = std::make_unique< AccountRegister::Widget >();
136 auto accountRegister = u_.get();
156 tabWidget()-> setTabToolTip( 1, fullName( accountItem ) );
158 tab-> setCloseable(
true );
160 accountRegister-> setAccountGuid( _accountGuid );
167 tabWidget()-> setCurrentIndex( tabIndex( accountItem-> name() ) );
193 open_AccountRegister( splitItem-> account_guid() );
198 currentAccountRegister()-> selectSplit( splitItem-> guid() );
232 auto tabName =
TR8(
"gcw.cw.tabName.Customer" ) +
": " + customerItem-> name();
238 if( tabIndex( tabName ) == -1 )
249 ( tabWidget()-> currentIndex() + 1,
250 std::make_unique< GCW::Gui::CustomerReportWidget >( _customerGuid ),
254 tab-> setCloseable(
true );
262 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
270 auto tabName =
TR8(
"gcw.cw.tabName.Customers" );
275 if( tabIndex( tabName ) == -1 )
280 auto widget = std::make_unique< GCW::Gui::Customer::MainWidget >();
281 auto w = widget.get();
288 doubleClicked().connect( [=](
const std::string & _customerGuid )
290 open_CustomerReportWidget( _customerGuid );
301 tab-> setCloseable(
true );
308 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
316 auto tabName =
TR8(
"gcw.cw.tabName.Employees" );
321 if( tabIndex( tabName ) == -1 )
326 auto widget = std::make_unique< GCW::Gui::EmployeesWidget >();
327 auto w = widget.get();
334 doubleClicked().connect( [=](
const std::string & _customerGuid )
336 open_EmployeesWidget();
347 tab-> setCloseable(
true );
354 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
363 auto tabName =
TR8(
"gcw.cw.tabName.BillPay" );
368 if( tabIndex( tabName ) == -1 )
373 auto widget = std::make_unique< GCW::Gui::BillPay::MainWidget >();
374 auto w = widget.get();
384 tab-> setCloseable(
true );
391 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
400 auto tabName =
"General Journal";
405 if( tabIndex( tabName ) == -1 )
407 auto u_ = std::make_unique< GCW::Gui::AccountRegister::Widget >();
408 auto accountRegister = u_.get();
418 tab-> setCloseable(
true );
425 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
433 auto tabName =
"RawTables";
438 if( tabIndex( tabName ) == -1 )
440 auto widget = std::make_unique< Wt::WTabWidget >();
442 auto tw = widget.get();
452 tab-> setCloseable(
true );
495 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
505 registerWidget-> test();
auto byGuid(const std::string &_guid) -> Item::Ptr
Load Account by GUID.
Item::Ptr byGuid(const std::string &_guid)
Load Customer by Guid.
auto byGuid(const std::string &_splitGuid) -> Item::Ptr
Load a single split.