GnuCashew ~ GnuCash Enabled Web
GCW
FilePropertiesWidget.cpp
Go to the documentation of this file.
1 #line 2 "src/Gui/FilePropertiesWidget.cpp"
2 
3 #include <Wt/WText.h>
4 #include <Wt/WVBoxLayout.h>
5 #include <Wt/WPushButton.h>
6 
7 #include "../define.h"
8 #include "../GnuCashew.h"
9 #include "FilePropertiesWidget.h"
10 
13 {
14  addStyleClass( "FilePropertiesWidget" );
15 
16  /*
17  ** Apply a layout so everything will fit in the window
18  **
19  */
20  auto lw = setLayout( std::make_unique< Wt::WVBoxLayout >() );
21  lw-> setSpacing( 0 );
22 
23  if( GCW::app()-> gnucashew_session().hasGnuCashewExtensions() )
24  {
25  lw-> addWidget( std::make_unique< Wt::WText >( "has gnucashew extensions" ) );
26  }
27  else
28  {
29  auto pb = lw-> addWidget( std::make_unique< Wt::WPushButton >( "apply gnucashew extensions" ) );
30 
31  pb-> clicked().connect( this, &FilePropertiesWidget::do_applyGnuCashewExtensions );
32  }
33 
34 
35 } // endGCW::Gui::FilePropertisWidget::FilePropertiesWidget()
36 
37 
38 void
41 {
42  GCW::app()-> gnucashew_session().addGnuCashewExtensions();
43 
44 } // enddo_applyGnuCashewExtensions()
45 
App * app()
Definition: App.cpp:67