GnuCashew ~ GnuCash Enabled Web
GCW
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
GCW::Gui::AccountRegister Class Reference

AccountRegister. More...

#include <AccountRegister.h>

Inherits Wt::WContainerWidget.

Classes

class  StatusBar
 

Public Types

using BaseModel = GCW::Eng::AccountRegisterModel
 Model. More...
 
using SortFilterModel = Wt::WSortFilterProxyModel
 
using BatchEditModel = Wt::WBatchEditProxyModel
 

Public Member Functions

 AccountRegister (const std::string &_accountGuid="")
 Constructor. More...
 
auto setAccountGuid (const std::string &_accountGuid) -> void
 
auto tableView () -> GCW::Gui::TableView *
 Table View. More...
 
auto baseModel () -> std::shared_ptr< BaseModel >
 
auto sortFilterModel () -> std::shared_ptr< SortFilterModel >
 
auto batchEditModel () -> std::shared_ptr< BatchEditModel >
 
auto statusBar () -> StatusBar *
 
auto test () -> void
 
auto toJson () const -> Wt::Json::Object
 Create View Properties JSON Object. More...
 
auto fromJson (const Wt::Json::Object &_jobj) -> bool
 Set View Properties from JSON Object. More...
 

Private Member Functions

auto loadData () -> void
 
auto editRow (int _row) -> void
 
auto deleteRow (int _row) -> void
 
auto lastIndex () -> Wt::WModelIndex
 
auto on_showPopup_triggered (const Wt::WModelIndex &_index, const Wt::WMouseEvent &_event) -> void
 
auto on_sortBy_triggered () -> void
 
auto on_filterBy_triggered () -> void
 
auto on_renamePage_triggered () -> void
 
auto on_duplicate_triggered () -> void
 
auto on_delete_triggered () -> void
 Delete a Row. More...
 
auto on_removeSplits_triggered () -> void
 
auto on_enter_triggered () -> void
 
auto on_cancel_triggered () -> void
 
auto on_manageDocument_triggered () -> void
 
auto on_openDocument_triggered () -> void
 
auto on_blankTransaction_triggered () -> void
 
auto on_goDate_triggered () -> void
 
auto on_splitTransaction_triggered () -> void
 
auto on_editExchangeRate_triggered () -> void
 
auto on_schedule_triggered () -> void
 
auto on_jump_triggered () -> void
 
auto on_assignPayment_triggered () -> void
 

Private Attributes

Wt::WPopupMenu m_popupMenu
 
std::string m_accountGuid
 
std::shared_ptr< BaseModelm_baseModel
 
std::shared_ptr< Wt::WSortFilterProxyModel > m_sortFilterModel
 
std::shared_ptr< Wt::WBatchEditProxyModel > m_batchEditModel
 
GCW::Gui::TableViewm_tableView = nullptr
 
StatusBarm_statusBar = nullptr
 
int m_clickedRow = -1
 
int m_clickedCol = -1
 
int m_rightClickRow = -1
 
int m_rightClickCol = -1
 

Detailed Description

AccountRegister.

The AccountRegister is a widget that displays transactions from a single account within the system. It displays the account transactions in a spreadsheet-table-like format with multiple columns representing other field values such as; date, check-number, description... and so on.

Account Register

The goal here is to make this widget behave just as closely as possible to the GnuCash interface, because theirs is very slick and makes navigating the register a no-mouse-necessary affair. One of the problems with web-based interfaces, however, is trapping keys completely, such as the ~tab~ key. So... we'll see how this goes!

The register view also grants the user editing abilities. When the user clicks on fields that are ~not~ reconciled, and appropriate 'editor' will open. The editor depends on the column selected, and is generated by the column Delegates.

Definition at line 49 of file AccountRegister.h.

Member Typedef Documentation

◆ BaseModel

Model.

An alias for the Model in case this interface changes.

Definition at line 91 of file AccountRegister.h.

◆ BatchEditModel

using GCW::Gui::AccountRegister::BatchEditModel = Wt::WBatchEditProxyModel

Definition at line 93 of file AccountRegister.h.

◆ SortFilterModel

using GCW::Gui::AccountRegister::SortFilterModel = Wt::WSortFilterProxyModel

Definition at line 92 of file AccountRegister.h.

Constructor & Destructor Documentation

◆ AccountRegister()

GCW::Gui::AccountRegister::AccountRegister ( const std::string &  _accountGuid = "")

Constructor.

A register must be opened to a specific AccountGuid. If the AccountGuid is blank or cannot be found (why would that be?) then the register simply opens, allows registry entries, but has no place to save them (dangerous?).

Definition at line 585 of file AccountRegister.cpp.

References baseModel(), m_clickedCol, m_clickedRow, m_statusBar, m_tableView, on_showPopup_triggered(), and tableView().

Member Function Documentation

◆ baseModel()

auto GCW::Gui::AccountRegister::baseModel ( ) -> std::shared_ptr< BaseModel >
inline

◆ batchEditModel()

auto GCW::Gui::AccountRegister::batchEditModel ( ) -> std::shared_ptr< BatchEditModel >
inline

Definition at line 115 of file AccountRegister.h.

References m_batchEditModel.

◆ deleteRow()

auto GCW::Gui::AccountRegister::deleteRow ( int  _row) -> void
private

Definition at line 864 of file AccountRegister.cpp.

References baseModel().

Referenced by on_delete_triggered().

◆ editRow()

auto GCW::Gui::AccountRegister::editRow ( int  _row) -> void
private

Definition at line 1259 of file AccountRegister.cpp.

References baseModel(), and tableView().

Referenced by on_showPopup_triggered(), and setAccountGuid().

◆ fromJson()

auto GCW::Gui::AccountRegister::fromJson ( const Wt::Json::Object &  _jobj) -> bool

Set View Properties from JSON Object.

This accepts a JSON object containing all of the view properties and applys them to the view, essentially restoring it to its previous layout.

Definition at line 1301 of file AccountRegister.cpp.

◆ lastIndex()

auto GCW::Gui::AccountRegister::lastIndex ( ) -> Wt::WModelIndex
private

Definition at line 1187 of file AccountRegister.cpp.

References baseModel().

Referenced by setAccountGuid().

◆ loadData()

auto GCW::Gui::AccountRegister::loadData ( ) -> void
private

Definition at line 1195 of file AccountRegister.cpp.

References baseModel(), m_baseModel, statusBar(), and tableView().

Referenced by setAccountGuid().

◆ on_assignPayment_triggered()

auto GCW::Gui::AccountRegister::on_assignPayment_triggered ( ) -> void
private

Definition at line 1083 of file AccountRegister.cpp.

◆ on_blankTransaction_triggered()

auto GCW::Gui::AccountRegister::on_blankTransaction_triggered ( ) -> void
private

Definition at line 1035 of file AccountRegister.cpp.

◆ on_cancel_triggered()

auto GCW::Gui::AccountRegister::on_cancel_triggered ( ) -> void
private

Definition at line 1010 of file AccountRegister.cpp.

◆ on_delete_triggered()

auto GCW::Gui::AccountRegister::on_delete_triggered ( ) -> void
private

Delete a Row.

This will delete a row from the register

by default, the user will be asked to delete an item from the register, unless they have chosen to never be asked.

Bug:
the logic here is not correct

Definition at line 909 of file AccountRegister.cpp.

References baseModel(), deleteRow(), GCW_DATE_FORMAT_DISPLAY, GCW::Dbo::Prefrences::get(), m_rightClickRow, and TR.

Referenced by on_showPopup_triggered().

◆ on_duplicate_triggered()

auto GCW::Gui::AccountRegister::on_duplicate_triggered ( ) -> void
private

Definition at line 901 of file AccountRegister.cpp.

◆ on_editExchangeRate_triggered()

auto GCW::Gui::AccountRegister::on_editExchangeRate_triggered ( ) -> void
private

Definition at line 1059 of file AccountRegister.cpp.

◆ on_enter_triggered()

auto GCW::Gui::AccountRegister::on_enter_triggered ( ) -> void
private

Definition at line 1002 of file AccountRegister.cpp.

◆ on_filterBy_triggered()

auto GCW::Gui::AccountRegister::on_filterBy_triggered ( ) -> void
private

Definition at line 885 of file AccountRegister.cpp.

◆ on_goDate_triggered()

auto GCW::Gui::AccountRegister::on_goDate_triggered ( ) -> void
private

Definition at line 1043 of file AccountRegister.cpp.

◆ on_jump_triggered()

auto GCW::Gui::AccountRegister::on_jump_triggered ( ) -> void
private

Definition at line 1075 of file AccountRegister.cpp.

◆ on_manageDocument_triggered()

auto GCW::Gui::AccountRegister::on_manageDocument_triggered ( ) -> void
private

Definition at line 1018 of file AccountRegister.cpp.

◆ on_openDocument_triggered()

auto GCW::Gui::AccountRegister::on_openDocument_triggered ( ) -> void
private

Definition at line 1027 of file AccountRegister.cpp.

◆ on_removeSplits_triggered()

auto GCW::Gui::AccountRegister::on_removeSplits_triggered ( ) -> void
private

Definition at line 994 of file AccountRegister.cpp.

◆ on_renamePage_triggered()

auto GCW::Gui::AccountRegister::on_renamePage_triggered ( ) -> void
private

Definition at line 893 of file AccountRegister.cpp.

◆ on_schedule_triggered()

auto GCW::Gui::AccountRegister::on_schedule_triggered ( ) -> void
private

Definition at line 1067 of file AccountRegister.cpp.

◆ on_showPopup_triggered()

auto GCW::Gui::AccountRegister::on_showPopup_triggered ( const Wt::WModelIndex &  _index,
const Wt::WMouseEvent &  _event 
) -> void
private

◆ on_sortBy_triggered()

auto GCW::Gui::AccountRegister::on_sortBy_triggered ( ) -> void
private

Definition at line 877 of file AccountRegister.cpp.

◆ on_splitTransaction_triggered()

auto GCW::Gui::AccountRegister::on_splitTransaction_triggered ( ) -> void
private

Definition at line 1051 of file AccountRegister.cpp.

◆ setAccountGuid()

auto GCW::Gui::AccountRegister::setAccountGuid ( const std::string &  _accountGuid) -> void

Definition at line 1169 of file AccountRegister.cpp.

References baseModel(), editRow(), lastIndex(), loadData(), and m_accountGuid.

◆ sortFilterModel()

auto GCW::Gui::AccountRegister::sortFilterModel ( ) -> std::shared_ptr< SortFilterModel >
inline

Definition at line 114 of file AccountRegister.h.

References m_sortFilterModel.

◆ statusBar()

auto GCW::Gui::AccountRegister::statusBar ( ) -> StatusBar *
inline

Definition at line 117 of file AccountRegister.h.

References m_statusBar.

Referenced by loadData().

◆ tableView()

auto GCW::Gui::AccountRegister::tableView ( ) -> GCW::Gui::TableView *
inline

Table View.

Definition at line 111 of file AccountRegister.h.

References m_tableView.

Referenced by AccountRegister(), editRow(), loadData(), on_showPopup_triggered(), and test().

◆ test()

void GCW::Gui::AccountRegister::test ( ) -> void

Definition at line 1310 of file AccountRegister.cpp.

References tableView().

◆ toJson()

auto GCW::Gui::AccountRegister::toJson ( ) const -> Wt::Json::Object

Create View Properties JSON Object.

This will pack all of the Widget display variables in to a JSON object for restoration later.

See also
fromJson()

Definition at line 1292 of file AccountRegister.cpp.

Member Data Documentation

◆ m_accountGuid

std::string GCW::Gui::AccountRegister::m_accountGuid
private

Definition at line 178 of file AccountRegister.h.

Referenced by setAccountGuid().

◆ m_baseModel

std::shared_ptr< BaseModel > GCW::Gui::AccountRegister::m_baseModel
private

Definition at line 179 of file AccountRegister.h.

Referenced by baseModel(), and loadData().

◆ m_batchEditModel

std::shared_ptr< Wt::WBatchEditProxyModel > GCW::Gui::AccountRegister::m_batchEditModel
private

Definition at line 181 of file AccountRegister.h.

Referenced by batchEditModel().

◆ m_clickedCol

int GCW::Gui::AccountRegister::m_clickedCol = -1
private

Definition at line 185 of file AccountRegister.h.

Referenced by AccountRegister().

◆ m_clickedRow

int GCW::Gui::AccountRegister::m_clickedRow = -1
private

Definition at line 184 of file AccountRegister.h.

Referenced by AccountRegister().

◆ m_popupMenu

Wt::WPopupMenu GCW::Gui::AccountRegister::m_popupMenu
private

Definition at line 177 of file AccountRegister.h.

Referenced by on_showPopup_triggered().

◆ m_rightClickCol

int GCW::Gui::AccountRegister::m_rightClickCol = -1
private

Definition at line 187 of file AccountRegister.h.

Referenced by on_showPopup_triggered().

◆ m_rightClickRow

int GCW::Gui::AccountRegister::m_rightClickRow = -1
private

Definition at line 186 of file AccountRegister.h.

Referenced by on_delete_triggered(), and on_showPopup_triggered().

◆ m_sortFilterModel

std::shared_ptr< Wt::WSortFilterProxyModel > GCW::Gui::AccountRegister::m_sortFilterModel
private

Definition at line 180 of file AccountRegister.h.

Referenced by sortFilterModel().

◆ m_statusBar

StatusBar* GCW::Gui::AccountRegister::m_statusBar = nullptr
private

Definition at line 183 of file AccountRegister.h.

Referenced by AccountRegister(), and statusBar().

◆ m_tableView

GCW::Gui::TableView* GCW::Gui::AccountRegister::m_tableView = nullptr
private

Definition at line 182 of file AccountRegister.h.

Referenced by AccountRegister(), and tableView().


The documentation for this class was generated from the following files: