diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp
index 450f28433..f12bcc1d8 100644
--- a/mix/ClientModel.cpp
+++ b/mix/ClientModel.cpp
@@ -355,9 +355,7 @@ void ClientModel::showDebuggerForTransaction(ExecutionResult const& _t)
//register new local variable initialization
auto localIter = contract->locals().find(LocationPair(instruction.getLocation().start, instruction.getLocation().end));
if (localIter != contract->locals().end())
- {
solLocals[s.stack.size()] = new QVariableDeclaration(debugData, localIter.value().name.toStdString(), localIter.value().type);
- }
}
if (instruction.type() == dev::eth::Tag)
diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp
index 8af9e465c..f033c3405 100644
--- a/mix/CodeModel.cpp
+++ b/mix/CodeModel.cpp
@@ -371,7 +371,6 @@ SolidityType CodeModel::nodeType(solidity::Type const* _type)
case Type::Category::Void:
default:
break;
- //BOOST_THROW_EXCEPTION(dev::Exception() << errinfo_comment("Unsupported solidityType: " + _type->toString()));
}
return r;
}
diff --git a/mix/QVariableDeclaration.cpp b/mix/QVariableDeclaration.cpp
index 7a08da116..391d26c04 100644
--- a/mix/QVariableDeclaration.cpp
+++ b/mix/QVariableDeclaration.cpp
@@ -14,8 +14,9 @@
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see .
*/
-/** @file QVariableDeclaration.h
+/** @file QVariableDeclaration.app
* @author Yann yann@ethdev.com
+ * @author Arkadiy Paronyan arkadiy@ethdev.com
* @date 2015
*/
diff --git a/mix/QVariableDeclaration.h b/mix/QVariableDeclaration.h
index 3fcc00dcc..cf9345061 100644
--- a/mix/QVariableDeclaration.h
+++ b/mix/QVariableDeclaration.h
@@ -37,6 +37,7 @@ namespace dev
namespace mix
{
+/// UI wrapper around solidity type
class QSolidityType: public QObject
{
Q_OBJECT
@@ -49,7 +50,7 @@ public:
QSolidityType() {}
QSolidityType(QObject* _parent, SolidityType const& _type);
using Type = SolidityType::Type;
- enum QmlType //TODO: arrays and structs
+ enum QmlType //TODO: Q_ENUMS does not support enum forwarding. Keep in sync with SolidityType::Type
{
SignedInteger,
UnsignedInteger,
@@ -72,6 +73,7 @@ private:
SolidityType m_type;
};
+/// UI wrapper around declaration (name + type)
class QVariableDeclaration: public QBasicNodeDefinition
{
Q_OBJECT
diff --git a/mix/SolidityType.h b/mix/SolidityType.h
index c35f4285d..9990e2e7f 100644
--- a/mix/SolidityType.h
+++ b/mix/SolidityType.h
@@ -33,13 +33,14 @@ namespace mix
struct SolidityDeclaration;
+//Type info extracted from solidity AST
struct SolidityType
{
- enum Type //TODO: arrays and structs
+ enum Type //keep in sync with QSolidity::Type
{
SignedInteger,
UnsignedInteger,
- Hash,
+ Hash, //TODO: remove
Bool,
Address,
Bytes,
@@ -47,12 +48,12 @@ struct SolidityType
Struct
};
Type type;
- unsigned size; //bytes,
+ unsigned size; //in bytes,
bool array;
bool dynamicSize;
QString name;
- std::vector members;
- std::vector enumNames;
+ std::vector members; //for struct
+ std::vector enumNames; //for enum
};
struct SolidityDeclaration
diff --git a/mix/qml/StructView.qml b/mix/qml/StructView.qml
index cbd457947..021365ac8 100644
--- a/mix/qml/StructView.qml
+++ b/mix/qml/StructView.qml
@@ -8,7 +8,6 @@ Column
id: root
property alias members: repeater.model //js array
property var value : { x: "333" }
- property int level: 0
Layout.fillWidth: true
Repeater
@@ -65,7 +64,6 @@ Column
var pname = members[index].name;
var vals = value;
if (ptype.category === QSolidityType.Struct && !item.members) {
- item.level = level + 1;
item.value = getValue();
item.members = ptype.members;
}
diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml
index 64d62de69..5d98d3dbd 100644
--- a/mix/qml/TransactionDialog.qml
+++ b/mix/qml/TransactionDialog.qml
@@ -11,7 +11,7 @@ Window {
id: modalTransactionDialog
modality: Qt.ApplicationModal
width: 520
- height: 500;//(paramsModel.count > 0 ? 500 : 300)
+ height: 500;
visible: false
color: StateDialogStyle.generic.backgroundColor
title: qsTr("Edit Transaction")
@@ -25,7 +25,6 @@ Window {
property var paramsModel: [];
property bool useTransactionDefaultValue: false
property alias stateAccounts: senderComboBox.model
-
signal accepted;
function open(index, item) {
@@ -87,6 +86,9 @@ Window {
visible = true;
valueField.focus = true;
+ modalTransactionDialog.height = (paramsModel.length > 0 ? 500 : 300);
+ paramLabel.visible = paramsModel.length > 0;
+ paramScroll.visible = paramsModel.length > 0;
}
function loadFunctions(contractId)
@@ -326,16 +328,15 @@ Window {
id: paramLabel
text: qsTr("Parameters:")
Layout.preferredWidth: 75
- visible: true;//paramsModel.length > 0
}
ScrollView
{
+ id: paramScroll
anchors.top: paramLabel.bottom
anchors.topMargin: 10
Layout.fillWidth: true
Layout.fillHeight: true
- visible: true;//paramsModel.length > 0
StructView
{
id: typeLoader
diff --git a/mix/qml/VariablesView.qml b/mix/qml/VariablesView.qml
index 36105da9e..191ec52af 100644
--- a/mix/qml/VariablesView.qml
+++ b/mix/qml/VariablesView.qml
@@ -32,7 +32,7 @@ DebugInfoList
function setData(members, values) {
storage.item.value = {};
storage.item.members = [];
- storage.item.value = values;
+ storage.item.value = values; //TODO: use a signal for this?
storage.item.members = members;
}
}