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() ) );
201 auto tabName =
TR8(
"gcw.cw.tabName.Customer" ) +
": " + customerItem-> name();
207 if( tabIndex( tabName ) == -1 )
218 ( tabWidget()-> currentIndex() + 1,
219 std::make_unique< GCW::Gui::CustomerReportWidget >( _customerGuid ),
223 tab-> setCloseable(
true );
231 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
239 auto tabName =
TR8(
"gcw.cw.tabName.Customers" );
244 if( tabIndex( tabName ) == -1 )
249 auto widget = std::make_unique< GCW::Gui::Customer::MainWidget >();
250 auto w = widget.get();
257 doubleClicked().connect( [=](
const std::string & _customerGuid )
259 open_CustomerReportWidget( _customerGuid );
270 tab-> setCloseable(
true );
277 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
285 auto tabName =
TR8(
"gcw.cw.tabName.Employees" );
290 if( tabIndex( tabName ) == -1 )
295 auto widget = std::make_unique< GCW::Gui::EmployeesWidget >();
296 auto w = widget.get();
303 doubleClicked().connect( [=](
const std::string & _customerGuid )
305 open_EmployeesWidget();
316 tab-> setCloseable(
true );
323 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
332 auto tabName =
TR8(
"gcw.cw.tabName.BillPay" );
337 if( tabIndex( tabName ) == -1 )
342 auto widget = std::make_unique< GCW::Gui::BillPay::MainWidget >();
343 auto w = widget.get();
353 tab-> setCloseable(
true );
360 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
369 auto tabName =
"General Journal";
374 if( tabIndex( tabName ) == -1 )
376 auto u_ = std::make_unique< GCW::Gui::AccountRegister::Widget >();
377 auto accountRegister = u_.get();
387 tab-> setCloseable(
true );
394 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
402 auto tabName =
"RawTables";
407 if( tabIndex( tabName ) == -1 )
409 auto widget = std::make_unique< Wt::WTabWidget >();
411 auto tw = widget.get();
421 tab-> setCloseable(
true );
464 tabWidget()-> setCurrentIndex( tabIndex( tabName ) );
474 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.