Browse Source

minor fixes

cl-refactor
arkpar 10 years ago
parent
commit
9e87abc136
  1. 9
      mix/qml/StateListModel.qml
  2. 2
      mix/qml/WebPreview.qml
  3. 2
      mix/qml/main.qml

9
mix/qml/StateListModel.qml

@ -47,6 +47,10 @@ Item {
varComponent = Qt.createComponent("qrc:/qml/QHashType.qml"); varComponent = Qt.createComponent("qrc:/qml/QHashType.qml");
else if (type.indexOf("bool") !== -1) else if (type.indexOf("bool") !== -1)
varComponent = Qt.createComponent("qrc:/qml/QBoolType.qml"); varComponent = Qt.createComponent("qrc:/qml/QBoolType.qml");
else {
console.log("Unknown parameter type: " + type);
continue;
}
var param = varComponent.createObject(stateListModel); var param = varComponent.createObject(stateListModel);
var dec = Qt.createComponent("qrc:/qml/QVariableDeclaration.qml"); var dec = Qt.createComponent("qrc:/qml/QVariableDeclaration.qml");
@ -203,7 +207,7 @@ Item {
} }
function debugDefaultState() { function debugDefaultState() {
if (defaultStateIndex >= 0) if (defaultStateIndex >= 0 && defaultStateIndex < stateList.length)
runState(defaultStateIndex); runState(defaultStateIndex);
} }
@ -221,6 +225,9 @@ Item {
defaultStateIndex = 0; defaultStateIndex = 0;
defaultStateChanged(); defaultStateChanged();
} }
else if (defaultStateIndex > index)
defaultStateIndex--;
save(); save();
} }

2
mix/qml/WebPreview.qml

@ -24,9 +24,11 @@ Item {
} }
function reload() { function reload() {
if (initialized) {
updateContract(); updateContract();
webView.runJavaScript("reloadPage()"); webView.runJavaScript("reloadPage()");
} }
}
function updateContract() { function updateContract() {
var contracts = {}; var contracts = {};

2
mix/qml/main.qml

@ -95,7 +95,7 @@ ApplicationWindow {
text: qsTr("Mine") text: qsTr("Mine")
shortcut: "Ctrl+M" shortcut: "Ctrl+M"
onTriggered: clientModel.mine(); onTriggered: clientModel.mine();
enabled: codeModel.hasContract && !clientModel.running &&!clientModel.mining enabled: codeModel.hasContract && !clientModel.running && !clientModel.mining
} }
StateList { StateList {

Loading…
Cancel
Save