Browse Source

Merge branch 'mix' of https://github.com/arkpar/cpp-ethereum into mix_pf

Conflicts:
	mix/TransactionListModel.cpp
cl-refactor
arkpar 10 years ago
parent
commit
9aafafec0e
  1. 10
      mix/TransactionListModel.cpp
  2. 4
      mix/TransactionListModel.h

10
mix/TransactionListModel.cpp

@ -24,7 +24,7 @@
#include <QQmlEngine> #include <QQmlEngine>
#include <QTextDocument> #include <QTextDocument>
#include <QAbstractListModel> #include <QAbstractListModel>
#include "libdevcore/CommonJS.h" #include <libdevcore/CommonJS.h>
#include "TransactionListModel.h" #include "TransactionListModel.h"
#include "QContractDefinition.h" #include "QContractDefinition.h"
#include "QFunctionDefinition.h" #include "QFunctionDefinition.h"
@ -58,7 +58,9 @@ TransactionListItem::TransactionListItem(int _index, TransactionSettings const&
TransactionListModel::TransactionListModel(QObject* _parent, AppContext* _appContext): TransactionListModel::TransactionListModel(QObject* _parent, AppContext* _appContext):
QAbstractListModel(_parent), m_appContext(_appContext) QAbstractListModel(_parent), m_appContext(_appContext)
{} {
qRegisterMetaType<TransactionListItem*>("TransactionListItem*");
}
QHash<int, QByteArray> TransactionListModel::roleNames() const QHash<int, QByteArray> TransactionListModel::roleNames() const
{ {
@ -143,7 +145,7 @@ QVariantList TransactionListModel::getParameters(int _index, QString const& _fun
return vl; return vl;
} }
QObject* TransactionListModel::getItem(int _index) TransactionListItem* TransactionListModel::getItem(int _index)
{ {
TransactionSettings const& transaction = (_index >= 0 && _index < (int)m_transactions.size()) ? m_transactions[_index] : TransactionSettings(); TransactionSettings const& transaction = (_index >= 0 && _index < (int)m_transactions.size()) ? m_transactions[_index] : TransactionSettings();
TransactionListItem* item = new TransactionListItem(_index, transaction, nullptr); TransactionListItem* item = new TransactionListItem(_index, transaction, nullptr);
@ -198,5 +200,7 @@ void TransactionListModel::runTransaction(int _index)
emit transactionStarted(tr); emit transactionStarted(tr);
} }
} }
} }

4
mix/TransactionListModel.h

@ -143,7 +143,7 @@ public:
/// @todo Change that to transaction item /// @todo Change that to transaction item
Q_INVOKABLE void edit(QObject* _data); Q_INVOKABLE void edit(QObject* _data);
/// @returns transaction item for a give index /// @returns transaction item for a give index
Q_INVOKABLE QObject* getItem(int _index); Q_INVOKABLE TransactionListItem* getItem(int _index);
/// @returns a list of functions for current contract /// @returns a list of functions for current contract
Q_INVOKABLE QList<QString> getFunctions(); Q_INVOKABLE QList<QString> getFunctions();
/// @returns function parameters along with parameter values if set. @see TransactionParameterItem /// @returns function parameters along with parameter values if set. @see TransactionParameterItem
@ -154,7 +154,7 @@ public:
signals: signals:
/// Transaction count has changed /// Transaction count has changed
void countChanged(); void countChanged();
/// Transaction has be launched /// Transaction has been launched
void transactionStarted(dev::mix::TransactionSettings); void transactionStarted(dev::mix::TransactionSettings);
private: private:

Loading…
Cancel
Save