diff --git a/KelvinDashboardGUI/DapScreenHistoryModel.h b/KelvinDashboardGUI/DapScreenHistoryModel.h index c94d046847a2f45d868584ad95dc4bac2813c30c..4f90d5ab2112c7527a29828a754b10ef93ba8fd6 100644 --- a/KelvinDashboardGUI/DapScreenHistoryModel.h +++ b/KelvinDashboardGUI/DapScreenHistoryModel.h @@ -15,24 +15,7 @@ class DapScreenHistoryModel : public QAbstractListModel Q_OBJECT public: -// enum DapTransactionStatus { -// Pending, -// Sent, -// Received, -// Error -// }; -// Q_ENUM(DapTransactionStatus) - -// struct DapTransactionItem { -// QDateTime Date; -// QImage TokenPic; -// DapTransactionStatus Status; -// QString TokenName; -// QString WalletNumber; -// QString Cryptocurrency; -// QString Currency; -// }; - + //!< Role enumeration enum { DisplayDateRole = Qt::UserRole, DateRole, @@ -46,21 +29,27 @@ public: }; private: - QList<DapTransactionItem> m_elementList; + QList<DapTransactionItem> m_elementList; // Tx history list QTimer* m_timeout; public: explicit DapScreenHistoryModel(QObject *parent = nullptr); static DapScreenHistoryModel &getInstance(); + //!< override model's methods int rowCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QHash<int, QByteArray> roleNames() const override; public slots: + //!< Receive new tx history void receiveNewData(const QVariant& aData); signals: + //!< Signal for requset current state of tx history + //! By defalt this signal emits when the client has just started while + //! the tx model will not get at least one tx history. + //! The signal stop emitting after getting the request result void sendRequestHistory(); }; diff --git a/KelvinDashboardService/DapChainHistoryHandler.cpp b/KelvinDashboardService/DapChainHistoryHandler.cpp index 6864587a3ac93365db0ace0fcbfaa953a7af7365..e0459064dd0d96450852c91e9f69281ebb819391 100644 --- a/KelvinDashboardService/DapChainHistoryHandler.cpp +++ b/KelvinDashboardService/DapChainHistoryHandler.cpp @@ -10,8 +10,6 @@ DapChainHistoryHandler::DapChainHistoryHandler(QObject *parent) : QVariant DapChainHistoryHandler::getHistory() const { -// qDebug() << "get story" << m_history; - return m_history; } diff --git a/KelvinDashboardService/DapChainHistoryHandler.h b/KelvinDashboardService/DapChainHistoryHandler.h index 748546110f063b1e602909f4622df81b0e682661..7eb29ec8e712879028aeff261d1b48cb39e738d0 100644 --- a/KelvinDashboardService/DapChainHistoryHandler.h +++ b/KelvinDashboardService/DapChainHistoryHandler.h @@ -22,13 +22,18 @@ private: public: explicit DapChainHistoryHandler(QObject *parent = nullptr); + //!< Get current state of history QVariant getHistory() const; public slots: + //!< Request new tx history + //! \param wallet list void onRequestNewHistory(const QMap<QString, QVariant>& aWallets); signals: + //!< Signal for request wallets list void requsetWallets(); + //!< Signal about getting new transatcion history void changeHistory(QVariant); }; diff --git a/KelvinDashboardService/KelvinDashboardService.pro b/KelvinDashboardService/KelvinDashboardService.pro index bce4996d1cb0c4318565821c810a200806d86666..22ae350c2f8024dc0b0dd324f09de5c72cbf9f01 100755 --- a/KelvinDashboardService/KelvinDashboardService.pro +++ b/KelvinDashboardService/KelvinDashboardService.pro @@ -21,7 +21,8 @@ ICON = icon.ico win32 { VERSION = $${VER_MAJ}.$${VER_MIN}.$$VER_PAT DEFINES += CLI_PATH=\\\"./kelvin-node-cli.exe\\\" - DEFINES += LOG_FILE=\\\"./opt/kelvin-node/bin/kelvin-node_logs.txt\\\" +# DEFINES += LOG_FILE=\\\"./opt/kelvin-node/bin/kelvin-node_logs.txt\\\" + DEFINES += LOG_FILE=\\\"./kelvin-node_logs.txt\\\" } else { VERSION = $$VER_MAJ\.$$VER_MIN\-$$VER_PAT