GnuCashew ~ GnuCash Enabled Web
GCW
AccountSuggestionPopup.cpp
Go to the documentation of this file.
1 #line 2 "src/Gui/AccountSuggestionPopup.cpp"
2 
3 #include "../App.h"
5 
8 : Wt::WSuggestionPopup
9  (
10  Wt::WSuggestionPopup::Options
11  {
12  "<b>", // highlightBeginTag
13  "</b>", // highlightEndTag
14  ',', // listSeparator ()
15  " \n", // whitespace
16  "()[]{}-., \"@\n;:", // wordSeparators ()
17  "" // appendReplacedText ()
18  }
19  )
20 {
21  setAttributeValue( "style", "height:250px;overflow:scroll" );
22 
23  std::set< std::string > items;
24  Wt::Dbo::Transaction t( GCW::app()-> gnucashew_session() );
25  for( auto accountItem : GCW::Dbo::Accounts::activeAccounts() )
26  items.insert( GCW::Dbo::Accounts::fullName( accountItem-> guid() ) );
27 
28  for( auto item : items )
29  addSuggestion( item );
30 
31 } // endAccountSuggestionPopup()
32 
33 
34 
const Wt::WFormModel::Field guid
Definition: Accounts.cpp:46
auto activeAccounts() -> Item::Vector
Load accounts as; if( !hidden() && !placeHolder() )
Definition: Accounts.cpp:247
auto fullName(const std::string &_guid) -> std::string
Account Fullname via GUID.
Definition: Accounts.cpp:292
App * app()
Definition: App.cpp:67
Definition: GncLock.h:6