Browse Source

ui bug fix

cl-refactor
yann300 10 years ago
parent
commit
b0865ea28f
  1. 10
      mix/qml/QBoolTypeView.qml
  2. 14
      mix/qml/StructView.qml
  3. 4
      mix/qml/TransactionDialog.qml

10
mix/qml/QBoolTypeView.qml

@ -53,12 +53,16 @@ Item
for (var k in JSON.parse(boolArray.text)) for (var k in JSON.parse(boolArray.text))
formattedparam.push(parseInt(format(param[k]))) formattedparam.push(parseInt(format(param[k])))
boolArray.text = JSON.stringify(formattedparam) boolArray.text = JSON.stringify(formattedparam)
value = ""
value = boolArray.text
console.log("gfdg " + value)
} }
} }
function finalize()
{
if (isArray())
value = boolArray.text
}
function format(value) function format(value)
{ {
value = value === true ? "1" : value value = value === true ? "1" : value

14
mix/qml/StructView.qml

@ -91,11 +91,6 @@ Column
var pname = members[index].name; var pname = members[index].name;
var vals = value; var vals = value;
item.onValueChanged.connect(function() {
vals[pname] = item.value;
valueChanged();
});
item.readOnly = context === "variable"; item.readOnly = context === "variable";
if (ptype.category === QSolidityType.Address) if (ptype.category === QSolidityType.Address)
{ {
@ -107,7 +102,6 @@ Column
item.subType = dec[0]; item.subType = dec[0];
item.load(); item.load();
} }
console.log("jj" + pname)
item.init(); item.init();
} }
else if (ptype.category === QSolidityType.Struct && !item.members) else if (ptype.category === QSolidityType.Struct && !item.members)
@ -124,9 +118,17 @@ Column
item.init(); item.init();
} }
item.onValueChanged.connect(function() {
vals[pname] = item.value;
valueChanged();
});
var newWidth = nameLabel.width + typeLabel.width + item.width + 108; var newWidth = nameLabel.width + typeLabel.width + item.width + 108;
if (root.width < newWidth) if (root.width < newWidth)
root.width = newWidth; root.width = newWidth;
if (item.finalize)
item.finalize()
} }
function getValue() function getValue()

4
mix/qml/TransactionDialog.qml

@ -246,7 +246,7 @@ Dialog {
functionRect.show() functionRect.show()
loadFunctions(TransactionHelper.contractFromToken(recipientsAccount.currentValue())) loadFunctions(TransactionHelper.contractFromToken(recipientsAccount.currentValue()))
loadParameters(); loadParameters();
//paramScroll.updateView() paramScroll.updateView()
} }
else else
{ {
@ -492,7 +492,7 @@ Dialog {
StructView StructView
{ {
id: paramScroll id: paramScroll
members: paramsModel; members: paramsModel
accounts: senderComboBox.model accounts: senderComboBox.model
context: "parameter" context: "parameter"
Layout.fillWidth: true Layout.fillWidth: true

Loading…
Cancel
Save