diff --git a/qml.qrc b/qml.qrc index fe67712..d1f4794 100644 --- a/qml.qrc +++ b/qml.qrc @@ -85,5 +85,8 @@ qml/js/ScientificNumber.js qml/NewFolderDialog.qml qml/TooltipArea.qml + qml/WelcomeView.qml + qml/DefaultCompleteButton.qml + qml/WelcomeViewStyle.qml diff --git a/qml/AlertMessageDialog.qml b/qml/AlertMessageDialog.qml index 1d48f54..b0bf64d 100644 --- a/qml/AlertMessageDialog.qml +++ b/qml/AlertMessageDialog.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file AlertMessageDialog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Window 2.0 diff --git a/qml/Application.qml b/qml/Application.qml index a348bed..a17a464 100644 --- a/qml/Application.qml +++ b/qml/Application.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Application.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 @@ -31,6 +51,7 @@ ApplicationWindow { property alias appService: appService; property alias mainSettings: appSettings property bool trackLastProject: true; + WelcomeViewStyle { id: welcomeViewStyleId } ApplicationService { id: appService @@ -289,6 +310,7 @@ ApplicationWindow { text: qsTr("Show Web View") shortcut: "F2" checkable: true + enabled: !projectModel.isEmpty checked: mainContent.webViewVisible onTriggered: mainContent.toggleWebPreview(); } @@ -298,6 +320,7 @@ ApplicationWindow { text: qsTr("Show Project Navigator") shortcut: "Alt+0" checkable: true + enabled: !projectModel.isEmpty checked: mainContent.projectViewVisible onTriggered: mainContent.toggleProjectView(); } @@ -307,6 +330,7 @@ ApplicationWindow { text: qsTr("Horizontal Web View") shortcut: "Alt+W" checkable: true + enabled: !projectModel.isEmpty checked: mainContent.webViewHorizontal onTriggered: mainContent.toggleWebPreviewOrientation(); } @@ -325,6 +349,7 @@ ApplicationWindow { text: qsTr("Show Right View") shortcut: "F7" checkable: true + enabled: !projectModel.isEmpty checked: mainContent.rightViewVisible onTriggered: mainContent.toggleRightView(); } @@ -333,7 +358,7 @@ ApplicationWindow { id: createProjectAction text: qsTr("&New Project") shortcut: "Ctrl+N" - enabled: true; + enabled: true onTriggered: projectModel.createProject(); } diff --git a/qml/BasicMessage.qml b/qml/BasicMessage.qml index bcd5b2e..d7b6352 100644 --- a/qml/BasicMessage.qml +++ b/qml/BasicMessage.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file BasicMessage.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/BigIntValue.qml b/qml/BigIntValue.qml index 5e32625..96861f9 100644 --- a/qml/BigIntValue.qml +++ b/qml/BigIntValue.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file BigIntValue.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + /* * Used to instanciate a QEther obj using Qt.createComponent function. */ diff --git a/qml/Block.qml b/qml/Block.qml index e439154..e9f9236 100644 --- a/qml/Block.qml +++ b/qml/Block.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Block.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/BlockChain.qml b/qml/BlockChain.qml index 5dbc786..cfa6f35 100644 --- a/qml/BlockChain.qml +++ b/qml/BlockChain.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file BlockChain.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 @@ -134,6 +154,7 @@ ColumnLayout { { model.blocks[_block].transactions.splice(_txIndex, 1) blockModel.removeTransaction(_block, _txIndex) + rebuildRequired() } function getAccountNickname(address) @@ -274,7 +295,7 @@ ColumnLayout { anchors.leftMargin: 5 anchors.top: parent.top anchors.topMargin: -4 - spacing: 1 + spacing: 10 id: rowBtns Settings { @@ -315,6 +336,7 @@ ColumnLayout { rebuildEnable = true; } } + ScenarioButton { id: rebuild text: qsTr("Rebuild Scenario") @@ -470,11 +492,19 @@ ColumnLayout { sourceImg: "qrc:/qml/img/recycleicon@2x.png" } - ScenarioButton { - id: addTransaction - text: qsTr("Add Transaction...") - enabled: scenarioIndex !== -1 - onClicked: + DropdownButton + { + id: actionsButtons + width: btnWidth + height: 30 + Component.onCompleted: + { + actions.push({ label: qsTr("Add Transaction...") , action: addTransaction }) + actions.push({ label: qsTr("Mine Block") , action: mineBlock }) + init() + } + + function addTransaction() { if (model && model.blocks) { @@ -493,29 +523,8 @@ ColumnLayout { transactionDialog.open(model.blocks[model.blocks.length - 1].transactions.length, model.blocks.length - 1, item) } } - width: btnWidth - Layout.minimumHeight: 30 - buttonShortcut: "" - sourceImg: "qrc:/qml/img/sendtransactionicon@2x.png" - roundLeft: false - roundRight: false - } - - Timer - { - id: ensureNotFuturetime - interval: 1000 - repeat: false - running: false - } - ScenarioButton { - id: addBlockBtn - text: qsTr("Add Block") - enabled: scenarioIndex !== -1 - roundLeft: false - roundRight: false - onClicked: + function mineBlock() { if (ensureNotFuturetime.running) return @@ -542,11 +551,14 @@ ColumnLayout { model.blocks.push(block) blockModel.appendBlock(block) } - width: btnWidth - Layout.minimumHeight: 30 + } - buttonShortcut: "" - sourceImg: "qrc:/qml/img/newblock@2x.png" + Timer + { + id: ensureNotFuturetime + interval: 1000 + repeat: false + running: false } Connections @@ -563,7 +575,7 @@ ColumnLayout { var lastB = blockModel.get(model.blocks.length - 1) lastB.status = "mined" lastB.number = model.blocks.length - addBlockBtn.addNewBlock() + actionsButtons.addNewBlock() } } onStateCleared: @@ -664,33 +676,6 @@ ColumnLayout { { } } - - ScenarioButton { - id: newAccount - enabled: scenarioIndex !== -1 - text: qsTr("New Account...") - onClicked: { - newAddressWin.accounts = model.accounts - newAddressWin.open() - } - width: btnWidth - Layout.minimumHeight: 30 - buttonShortcut: "" - sourceImg: "qrc:/qml/img/newaccounticon@2x.png" - roundLeft: false - roundRight: true - } - - NewAccount - { - id: newAddressWin - onAccepted: - { - model.accounts.push(ac) - clientModel.addAccount(ac.secret); - projectModel.saveProject() - } - } } Rectangle @@ -835,6 +820,7 @@ ColumnLayout { else return [] } + transactionModel: { if (index >= 0) diff --git a/qml/CallStack.qml b/qml/CallStack.qml index b7a7989..af61b6e 100644 --- a/qml/CallStack.qml +++ b/qml/CallStack.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file CallStack.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/CodeEditor.qml b/qml/CodeEditor.qml index 6a0a428..4321845 100644 --- a/qml/CodeEditor.qml +++ b/qml/CodeEditor.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file CodeEditor.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Window 2.0 import QtQuick.Layouts 1.0 diff --git a/qml/CodeEditorView.qml b/qml/CodeEditorView.qml index 78da2d8..131ebea 100644 --- a/qml/CodeEditorView.qml +++ b/qml/CodeEditorView.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file CodeEditorView.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Window 2.0 import QtQuick.Layouts 1.0 diff --git a/qml/CommonSeparator.qml b/qml/CommonSeparator.qml index 6644802..35630fe 100644 --- a/qml/CommonSeparator.qml +++ b/qml/CommonSeparator.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file CommonSeparator.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import "." diff --git a/qml/CopyButton.qml b/qml/CopyButton.qml index f2e0aae..9d1afb0 100644 --- a/qml/CopyButton.qml +++ b/qml/CopyButton.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file CopyButton.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.1 diff --git a/qml/DebugBasicInfo.qml b/qml/DebugBasicInfo.qml index fd1d087..bdd8bbd 100644 --- a/qml/DebugBasicInfo.qml +++ b/qml/DebugBasicInfo.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DebugBasicInfo.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.0 diff --git a/qml/DebugInfoList.qml b/qml/DebugInfoList.qml index 7177a0f..bdf93dc 100644 --- a/qml/DebugInfoList.qml +++ b/qml/DebugInfoList.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DebugInfoList.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.0 diff --git a/qml/Debugger.qml b/qml/Debugger.qml index d2091df..6fc5acc 100644 --- a/qml/Debugger.qml +++ b/qml/Debugger.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Debugger.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/DefaultButton.qml b/qml/DefaultButton.qml index dd15b2b..0186870 100644 --- a/qml/DefaultButton.qml +++ b/qml/DefaultButton.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DefaultButton.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 @@ -5,6 +25,7 @@ import QtQuick.Controls.Styles 1.1 Button { id: root property string text + style: ButtonStyle { label: DefaultText { diff --git a/qml/DefaultCombobox.qml b/qml/DefaultCombobox.qml index b560291..68c930d 100644 --- a/qml/DefaultCombobox.qml +++ b/qml/DefaultCombobox.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DefaultCombobox.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.3 diff --git a/qml/DefaultCompleteButton.qml b/qml/DefaultCompleteButton.qml new file mode 100644 index 0000000..f829578 --- /dev/null +++ b/qml/DefaultCompleteButton.qml @@ -0,0 +1,53 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** + * @file DefaultCompleteButton.qml + * @author Liana liana@ethdev.com + * @date 2016 + * Mix: Ethereum IDE client. + */ + +import QtQuick 2.0 +import QtQuick.Controls 1.1 +import QtQuick.Controls.Styles 1.1 +import QtQuick.Layouts 1.0 + +DefaultImgButton { + id: completeButton + property var imageSource + property var labelText + style: ButtonStyle { + background: Rectangle { + color: welcomeViewStyleId.bgColor + implicitWidth: 48 + implicitHeight: 48 + } + label: RowLayout { + Image { + source: imageSource + width: 48 + height: 48 + id: openProjectImg + anchors.top: parent.top + } + DefaultLabel + { + text: labelText + font.pixelSize: 22 + font.italic: true + color: welcomeViewStyleId.fontColor + } + } + } +} diff --git a/qml/DefaultImgButton.qml b/qml/DefaultImgButton.qml index f9fef86..a24d6a5 100644 --- a/qml/DefaultImgButton.qml +++ b/qml/DefaultImgButton.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DefaultImgButton.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/DefaultLabel.qml b/qml/DefaultLabel.qml index 65c1df4..b32bea5 100644 --- a/qml/DefaultLabel.qml +++ b/qml/DefaultLabel.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DefaultLabel.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.1 diff --git a/qml/DefaultRadioButton.qml b/qml/DefaultRadioButton.qml index b87247a..2cf2b39 100644 --- a/qml/DefaultRadioButton.qml +++ b/qml/DefaultRadioButton.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DefaultRadioButton.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.3 import QtQuick.Controls.Styles 1.3 diff --git a/qml/DefaultText.qml b/qml/DefaultText.qml index e5499cf..eac7334 100644 --- a/qml/DefaultText.qml +++ b/qml/DefaultText.qml @@ -1,6 +1,27 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DefaultText.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 Text { font.pointSize: appSettings.getFormattedPointSize() } + diff --git a/qml/DefaultTextArea.qml b/qml/DefaultTextArea.qml index 7b5edfc..5da4dbf 100644 --- a/qml/DefaultTextArea.qml +++ b/qml/DefaultTextArea.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DefaultTextArea.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.1 diff --git a/qml/DefaultTextField.qml b/qml/DefaultTextField.qml index 9451c2c..4873373 100644 --- a/qml/DefaultTextField.qml +++ b/qml/DefaultTextField.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DefaultTextField.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.1 diff --git a/qml/DeployContractStep.qml b/qml/DeployContractStep.qml index e15122a..2994205 100644 --- a/qml/DeployContractStep.qml +++ b/qml/DeployContractStep.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DeployContractStep.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.1 diff --git a/qml/DeploymentDialog.qml b/qml/DeploymentDialog.qml index b4dae35..a0b344a 100644 --- a/qml/DeploymentDialog.qml +++ b/qml/DeploymentDialog.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DeploymentDialog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 diff --git a/qml/DeploymentDialogSteps.qml b/qml/DeploymentDialogSteps.qml index 00ed230..216cebc 100644 --- a/qml/DeploymentDialogSteps.qml +++ b/qml/DeploymentDialogSteps.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DeploymentDialogSteps.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.1 diff --git a/qml/DeploymentOptions.qml b/qml/DeploymentOptions.qml index 2753c82..7a4da8c 100644 --- a/qml/DeploymentOptions.qml +++ b/qml/DeploymentOptions.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DeploymentOptions.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.1 @@ -447,7 +467,7 @@ Rectangle projectModel.deployBlockNumber = nb projectModel.saveProject() root.updateVerification(nb, trLost) - root.deployed() + root.deployStep.deployed() }) projectModel.deploymentAddresses = addresses projectModel.saveProject() diff --git a/qml/DeploymentWorker.qml b/qml/DeploymentWorker.qml index 93d9177..d0c01c3 100644 --- a/qml/DeploymentWorker.qml +++ b/qml/DeploymentWorker.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DeploymentWorker.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 @@ -42,7 +62,7 @@ Item nodeReachable() var ids = JSON.parse(arg2)[0].result; requests = []; - accounts = [] + accounts = [] for (var k in ids) { requests.push({ @@ -57,7 +77,7 @@ Item TransactionHelper.rpcCall(requests, function (request, response){ var balanceRet = JSON.parse(response); - balances = {} + balances = {} for (var k in balanceRet) { var ether = QEtherHelper.createEther(balanceRet[k].result, QEther.Wei); @@ -171,12 +191,17 @@ Item function estimateGas(scenario) { - for (var si = 0; si < projectModel.listModel.count; si++) + var docs = {} + for (var c in codeModel.contracts) { - var document = projectModel.listModel.get(si); - if (document.isContract) - codeModelGasEstimation.registerCodeChange(document.documentId, fileIo.readFile(document.path)); + var docId = codeModel.contracts[c].documentId + if (!docs[docId]) + { + codeModelGasEstimation.registerCodeChange(docId, fileIo.readFile(docId)); + docs[docId] = "" + } } + var sce = projectModel.stateListModel.copyScenario(scenario) for (var k = 0; k < sce.blocks.length; k++) { @@ -187,7 +212,7 @@ Item } } clientModelGasEstimation.setupScenario(sce) - } + } CodeModel { id: codeModelGasEstimation diff --git a/qml/DisableInput.qml b/qml/DisableInput.qml index a604ba3..37a156a 100644 --- a/qml/DisableInput.qml +++ b/qml/DisableInput.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file DisableInput.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.1 diff --git a/qml/DropdownButton.qml b/qml/DropdownButton.qml new file mode 100644 index 0000000..2be2247 --- /dev/null +++ b/qml/DropdownButton.qml @@ -0,0 +1,153 @@ +import QtQuick 2.2 +import QtQuick.Controls 1.1 +import QtQuick.Controls.Styles 1.1 +import QtQuick.Dialogs 1.1 +import QtQuick.Layouts 1.1 +import org.ethereum.qml.InverseMouseArea 1.0 + +Item +{ + property var actions: [] + id: root + function init() + { + actionsModel.clear() + actionLabels.height = 0 + for (var k in actions) + actionsModel.append({ index: k, label: actions[k].label }) + } + + InverseMouseArea + { + id: inverseMouse + anchors.fill: parent + active: false + onClickedOutside: { + for (var k = 0; k < actionsModel.count; k++) + { + if (actionsRepeater.itemAt(k).containsMouse()) + return + } + actionLabels.visible = false + inverseMouse.active = false + } + } + + ScenarioButton + { + id: labelButton + roundLeft: true + roundRight: true + width: 40 + height: 30 + sourceImg: "qrc:/qml/img/plus.png" + text: qsTr("Add Transaction/Block") + onClicked: + { + btnClicked() + } + + function btnClicked() + { + if (actionLabels.visible) + actionLabels.visible = false + else + { + parent.init() + var top = labelButton; + while (top.parent) + top = top.parent + actionLabels.parent = top + var globalCoord = labelButton.mapToItem(null, 0, 0); + actionLabels.x = globalCoord.x + labelButton.width + actionLabels.y = globalCoord.y + actionLabels.z = 50 + actionLabels.visible = true + inverseMouse.active = true + } + } + } + + Rectangle + { + id: actionLabels + visible: false + width: (5 * appSettings.systemPointSize) + minWidth + property int minHeight: 35 + property int minWidth: 150 + Connections + { + target: appSettings + onSystemPointSizeChanged: + { + updateSize() + } + + Component.onCompleted: + { + updateSize() + } + + function updateSize() + { + if (actionLabels.visible) + { + actionLabels.visible = falses + labelButton.btnClicked() + } + } + } + + ColumnLayout + { + id: actionsCol + spacing: 5 + ListModel + { + id: actionsModel + } + + Repeater + { + id: actionsRepeater + model: actionsModel + Rectangle + { + function containsMouse() + { + return mouseAreaAction.containsMouse + } + color: mouseAreaAction.containsMouse ? "#cccccc" : "transparent" + width: actionLabels.width + height: labelAction.height + 10 + + Component.onCompleted: + { + actionLabels.height += height + actionsCol.spacing + } + + DefaultLabel + { + text: actions[index].label + elide: Text.ElideRight + id: labelAction + anchors.left: parent.left + anchors.leftMargin: 10 + anchors.verticalCenter: parent.verticalCenter + MouseArea + { + id: mouseAreaAction + anchors.fill: parent + hoverEnabled: true + onClicked: + { + actions[index].action() + actionLabels.visible = false + } + } + } + } + } + } + } +} diff --git a/qml/Ether.qml b/qml/Ether.qml index 11a5ef1..458b7e9 100644 --- a/qml/Ether.qml +++ b/qml/Ether.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Ether.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + /* * Display a row containing : * - The amount of Ether. diff --git a/qml/EtherValue.qml b/qml/EtherValue.qml index 1217aad..8ecef80 100644 --- a/qml/EtherValue.qml +++ b/qml/EtherValue.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file EtherValue.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + /* * Used to instanciate a QEther obj using Qt.createComponent function. */ diff --git a/qml/Folder.qml b/qml/Folder.qml index 54312da..5ffef29 100644 --- a/qml/Folder.qml +++ b/qml/Folder.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Folder.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Window 2.0 import QtQuick.Layouts 1.0 @@ -403,7 +423,7 @@ ColumnLayout { MessageDialog { id: deleteConfirmation - text: qsTr("Are you sure to delete this file ?") + text: qsTr("Are you sure you want to delete this file?") standardButtons: StandardIcon.Ok | StandardIcon.Cancel onAccepted: { diff --git a/qml/GasPrice.qml b/qml/GasPrice.qml index bd0b9b0..896ab70 100644 --- a/qml/GasPrice.qml +++ b/qml/GasPrice.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file GasPrice.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.1 diff --git a/qml/ItemDelegateDataDump.qml b/qml/ItemDelegateDataDump.qml index 0b2d00f..32d6b03 100644 --- a/qml/ItemDelegateDataDump.qml +++ b/qml/ItemDelegateDataDump.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file ItemDelegateDataDump.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.0 diff --git a/qml/KeyValuePanel.qml b/qml/KeyValuePanel.qml index 984313f..1f17da4 100644 --- a/qml/KeyValuePanel.qml +++ b/qml/KeyValuePanel.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file KeyValuePanel.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/LogsPane.qml b/qml/LogsPane.qml index a136ccb..68f81e7 100644 --- a/qml/LogsPane.qml +++ b/qml/LogsPane.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file LogsPane.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.1 diff --git a/qml/LogsPaneStyle.qml b/qml/LogsPaneStyle.qml index 8126e86..9b66155 100644 --- a/qml/LogsPaneStyle.qml +++ b/qml/LogsPaneStyle.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file LogsPaneStyle.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 QtObject { diff --git a/qml/MacFileDialog.qml b/qml/MacFileDialog.qml index 6bf9104..d0c4804 100644 --- a/qml/MacFileDialog.qml +++ b/qml/MacFileDialog.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file MacFileDialog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.2 import QtQuick.Controls.Private 1.0 as ControlsPrivate diff --git a/qml/MainContent.qml b/qml/MainContent.qml index 8600988..dbddf5c 100644 --- a/qml/MainContent.qml +++ b/qml/MainContent.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file MainContent.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.0 @@ -101,11 +121,11 @@ Rectangle { property alias codeWebOrientation: codeWebSplitter.orientation property alias webWidth: webPreview.width property alias webHeight: webPreview.height - property alias showProjectView: projectList.visible property bool runOnProjectLoad: true property int scenarioMinWidth: scenarioMinWidth } + ColumnLayout { id: mainColumn @@ -117,6 +137,7 @@ Rectangle { Layout.row: 0 Layout.fillWidth: true Layout.minimumHeight: 40 + Connections { target: appSettings @@ -171,10 +192,20 @@ Rectangle { property alias rightViewWidth: scenarioExe.width } + WelcomeView + { + id: welcomeView + anchors.fill: parent + Layout.fillHeight: true + Layout.fillWidth: true + visible: projectModel.isEmpty + } + Splitter { anchors.fill: parent orientation: Qt.Horizontal + id: mainPanels ProjectList { @@ -275,6 +306,32 @@ Rectangle { debugPanel.close() scenarioExe.clear() } + Component.onCompleted: resetPanels() + onIsEmptyChanged: + { + resetPanels(); + } + function resetPanels() + { + if (projectModel.isEmpty) + { + scenarioExe.visible = false; + webPreview.visible = false; + projectList.visible = false; + codeEditor.visible = false; + mainPanels.visible = false; + welcomeView.visible = true; + } + else + { + scenarioExe.visible = true; + webPreview.visible = true; + projectList.visible = true; + codeEditor.visible = true; + mainPanels.visible = true; + welcomeView.visible = false; + } + } } ScenarioExecution diff --git a/qml/ModalDialog.qml b/qml/ModalDialog.qml index d5b7f3d..cfa42d8 100644 --- a/qml/ModalDialog.qml +++ b/qml/ModalDialog.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file ModalDialog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Window 2.0 diff --git a/qml/NewAccount.qml b/qml/NewAccount.qml index 55b37f3..69e1d1b 100644 --- a/qml/NewAccount.qml +++ b/qml/NewAccount.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file NewAccount.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Dialogs 1.2 @@ -148,6 +168,7 @@ Dialog { DefaultButton { id: okButton; + activeFocusOnPress : true text: qsTr("OK"); enabled: newAddressWin.secret !== "" onClicked: { diff --git a/qml/NewFolderDialog.qml b/qml/NewFolderDialog.qml index 04ba871..a37d1f4 100644 --- a/qml/NewFolderDialog.qml +++ b/qml/NewFolderDialog.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file NewFolderDialog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 diff --git a/qml/NewProjectDialog.qml b/qml/NewProjectDialog.qml index 8655439..e7690f1 100644 --- a/qml/NewProjectDialog.qml +++ b/qml/NewProjectDialog.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file NewProjectDialog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 diff --git a/qml/PackagingStep.qml b/qml/PackagingStep.qml index e4916a2..cb52cc0 100644 --- a/qml/PackagingStep.qml +++ b/qml/PackagingStep.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file PackagingStep.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.1 diff --git a/qml/ProjectFilesStyle.qml b/qml/ProjectFilesStyle.qml index 21f4c82..e38703b 100644 --- a/qml/ProjectFilesStyle.qml +++ b/qml/ProjectFilesStyle.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file ProjectFilesStyle.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 QtObject { diff --git a/qml/ProjectList.qml b/qml/ProjectList.qml index 6257a67..2f9ea31 100644 --- a/qml/ProjectList.qml +++ b/qml/ProjectList.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file ProjectList.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Window 2.0 import QtQuick.Layouts 1.0 @@ -352,7 +372,7 @@ ScrollView MessageDialog { id: deleteConfirmation - text: qsTr("Are you sure to delete this file ?") + text: qsTr("Are you sure you want to delete this file?") standardButtons: StandardIcon.Ok | StandardIcon.Cancel property bool regenerateCompilationResult: false onAccepted: @@ -563,12 +583,15 @@ ScrollView } } - Button + DefaultImgButton { id: fileCloseBtn + height: 20 + width: 20 anchors.left: parent.left anchors.leftMargin: 10 - text: qsTr("Close") + iconSource: "qrc:/qml/img/delete_sign.png" + tooltip: qsTr("Close") anchors.verticalCenter: parent.verticalCenter onClicked: { diff --git a/qml/ProjectModel.qml b/qml/ProjectModel.qml index 40f2e21..ef7d179 100644 --- a/qml/ProjectModel.qml +++ b/qml/ProjectModel.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file ProjectModel.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Window 2.0 import QtQuick.Layouts 1.0 diff --git a/qml/QAddressView.qml b/qml/QAddressView.qml index 59c0f7f..d96454e 100644 --- a/qml/QAddressView.qml +++ b/qml/QAddressView.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file QAddressView.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.3 import QtQuick.Controls.Styles 1.3 diff --git a/qml/QBoolTypeView.qml b/qml/QBoolTypeView.qml index dfe6f05..9589b61 100644 --- a/qml/QBoolTypeView.qml +++ b/qml/QBoolTypeView.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file QBoolTypeView.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.3 import "js/InputValidator.js" as InputValidator diff --git a/qml/QFileDialog.qml b/qml/QFileDialog.qml index 5ce2ad4..19bfc45 100644 --- a/qml/QFileDialog.qml +++ b/qml/QFileDialog.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file QFileDialog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.2 import QtQuick.Dialogs 1.2 diff --git a/qml/QHashTypeView.qml b/qml/QHashTypeView.qml index bcb966c..b53650a 100644 --- a/qml/QHashTypeView.qml +++ b/qml/QHashTypeView.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file QHashTypeView.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 Item diff --git a/qml/QIntTypeView.qml b/qml/QIntTypeView.qml index df67a40..8b26332 100644 --- a/qml/QIntTypeView.qml +++ b/qml/QIntTypeView.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file QIntTypeView.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.1 import "js/ScientificNumber.js" as ScientificNumber diff --git a/qml/QRealTypeView.qml b/qml/QRealTypeView.qml index 070e214..bcc6c5c 100644 --- a/qml/QRealTypeView.qml +++ b/qml/QRealTypeView.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file QRealTypeView.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 Component diff --git a/qml/QStringTypeView.qml b/qml/QStringTypeView.qml index af53be9..1a41a4f 100644 --- a/qml/QStringTypeView.qml +++ b/qml/QStringTypeView.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file QStringTypeView.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.1 diff --git a/qml/QVariableDeclaration.qml b/qml/QVariableDeclaration.qml index dc21d40..d94bef0 100644 --- a/qml/QVariableDeclaration.qml +++ b/qml/QVariableDeclaration.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file QVariableDeclaration.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import org.ethereum.qml.QVariableDeclaration 1.0 diff --git a/qml/RegisteringStep.qml b/qml/RegisteringStep.qml index 1109bc2..6d2ef66 100644 --- a/qml/RegisteringStep.qml +++ b/qml/RegisteringStep.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file RegisteringStep.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.1 diff --git a/qml/ScenarioButton.qml b/qml/ScenarioButton.qml index 683565c..ab8b0c3 100644 --- a/qml/ScenarioButton.qml +++ b/qml/ScenarioButton.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file ScenarioButton.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.0 diff --git a/qml/ScenarioExecution.qml b/qml/ScenarioExecution.qml index da330e8..26043f6 100644 --- a/qml/ScenarioExecution.qml +++ b/qml/ScenarioExecution.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file ScenarioExecution.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 @@ -78,8 +98,6 @@ Rectangle { width: 10 Layout.minimumHeight: 10 Layout.preferredHeight: 12 - text: qsTr("Manage Scenario") - sourceImg: qsTr("Manage Scenario") roundRight: true roundLeft: true @@ -103,7 +121,7 @@ Rectangle { Layout.minimumHeight: 40 Layout.preferredWidth: parent.width width: parent.width - visible: false + visible: true id: loader anchors.left: parent.left anchors.leftMargin: 5 diff --git a/qml/ScenarioLoader.qml b/qml/ScenarioLoader.qml index 97e8a18..6af6a70 100644 --- a/qml/ScenarioLoader.qml +++ b/qml/ScenarioLoader.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file ScenarioLoader.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 @@ -56,23 +76,17 @@ ColumnLayout function updatebtnWidth(w) { - editScenario.width = w - deleteScenario.width = w - duplicateScenario.width = w - addScenario.width = w - restoreScenario.width = w - saveScenario.width = w rowBtn.width = 6 * w } function createScenario(defaultScenario) { - addScenario.createScenario(defaultScenario) + dropBtns.createScenario(defaultScenario) } RowLayout { - spacing: 0 + spacing: 15 anchors.top: parent.top anchors.topMargin: 7 id: btnRowContainer @@ -118,7 +132,7 @@ ColumnLayout onCurrentIndexChanged: { - restoreScenario.restore() + dropBtns.restore() } function init() @@ -247,8 +261,8 @@ ColumnLayout for (var k = 0; k < projectModel.stateListModel.count; ++k) { - if (projectModel.stateListModel.get(k).title === scenarioNameEdit.text) - return //title already exists + if (projectModel.stateListModel.get(k).title === scenarioNameEdit.text) + return //title already exists } projectModel.stateListModel.getState(scenarioList.currentIndex).title = scenarioNameEdit.text @@ -287,73 +301,50 @@ ColumnLayout Layout.preferredWidth: btnWidth * 6 Layout.minimumHeight: 30 id: rowBtn - ScenarioButton { - id: editScenario + + DropdownButton + { width: btnWidth height: parent.height - sourceImg: "qrc:/qml/img/edittransaction.png" - onClicked: { - scenarioNameEdit.toggleEdit() + id: dropBtns + Component.onCompleted: + { + actions.push({ label: qsTr("Edit Title") , action: editTitle }) + actions.push({ label: qsTr("Delete Scenario") , action: deleteSce }) + actions.push({ label: qsTr("New Scenario") , action: newSce }) + actions.push({ label: qsTr("Duplicate Scenario") , action: duplicate }) + actions.push({ label: qsTr("Create Scenario") , action: addSce }) + init() } - text: qsTr("Edit Title") - roundRight: false - roundLeft: true - enabled: panelLoaded - } - Rectangle - { - width: 1 - height: parent.height - color: "#ededed" - } + function editTitle() + { + scenarioNameEdit.toggleEdit() + } - ScenarioButton { - id: deleteScenario - enabled: panelLoaded - width: btnWidth - height: parent.height - sourceImg: "qrc:/qml/img/delete-block-icon@2x.png" - onClicked: { + function deleteSce() + { if (projectModel.stateListModel.count > 1) deleteWarning.open() } - text: qsTr("Delete") - roundRight: true - roundLeft: false - } - MessageDialog - { - id: deleteWarning - text: qsTr("Are you sure to delete this scenario ?") - onYes: + function newSce() { - projectModel.stateListModel.deleteState(scenarioList.currentIndex) - scenarioList.init() + createScenario(false) } - standardButtons: StandardButton.Yes | StandardButton.No - } - Rectangle - { - width: 1 - height: parent.height - color: "#ededed" - } + function duplicate() + { + projectModel.stateListModel.duplicateState(scenarioList.currentIndex) + duplicated(state) + scenarioList.currentIndex = projectModel.stateListModel.count - 1 + scenarioNameEdit.toggleEdit() + } - ScenarioButton { - id: addScenario - enabled: panelLoaded - width: btnWidth - height: parent.height - sourceImg: "qrc:/qml/img/newIcon@2x.png" - onClicked: { - addScenario.createScenario(false) + function addSce() + { + createScenario(false) } - text: qsTr("New") - roundRight: false - roundLeft: false function createScenario(defaultScenario) { @@ -373,26 +364,7 @@ ColumnLayout else scenarioNameEdit.toggleEdit() } - } - Rectangle - { - width: 1 - height: parent.height - color: "#ededed" - } - - ScenarioButton { - id: restoreScenario - enabled: panelLoaded - width: btnWidth - height: parent.height - buttonShortcut: "" - sourceImg: "qrc:/qml/img/restoreicon@2x.png" - onClicked: { - restore() - } - text: qsTr("Reset") function restore() { var state = projectModel.stateListModel.reloadStateFromProject(scenarioList.currentIndex) @@ -402,68 +374,18 @@ ColumnLayout loaded(state) } } - roundRight: false - roundLeft: false } - Rectangle + MessageDialog { - width: 1 - height: parent.height - color: "#ededed" - } - - ScenarioButton { - id: saveScenario - enabled: panelLoaded - text: qsTr("Save") - onClicked: save() - width: btnWidth - height: parent.height - buttonShortcut: "" - sourceImg: "qrc:/qml/img/saveicon@2x.png" - roundRight: false - roundLeft: false - - function save() + id: deleteWarning + text: qsTr("Are you sure you want to delete this scenario?") + onYes: { - projectModel.saveProjectFile() - saved(state) - } - } - - Connections - { - target: clientModel - onSetupFinished: { - saveScenario.save() - } - } - - Rectangle - { - width: 1 - height: parent.height - color: "#ededed" - } - - ScenarioButton - { - id: duplicateScenario - enabled: panelLoaded - text: qsTr("Duplicate") - onClicked: { - projectModel.stateListModel.duplicateState(scenarioList.currentIndex) - duplicated(state) - scenarioList.currentIndex = projectModel.stateListModel.count - 1 - scenarioNameEdit.toggleEdit() + projectModel.stateListModel.deleteState(scenarioList.currentIndex) + scenarioList.init() } - width: btnWidth - height: parent.height - buttonShortcut: "" - sourceImg: "qrc:/qml/img/duplicateicon@2x.png" - roundRight: true - roundLeft: false + standardButtons: StandardButton.Yes | StandardButton.No } } } diff --git a/qml/SourceSansProBold.qml b/qml/SourceSansProBold.qml index 39c99cc..c2e36ee 100644 --- a/qml/SourceSansProBold.qml +++ b/qml/SourceSansProBold.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file SourceSansProBold.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 FontLoader diff --git a/qml/SourceSansProLight.qml b/qml/SourceSansProLight.qml index f46abed..50003fc 100644 --- a/qml/SourceSansProLight.qml +++ b/qml/SourceSansProLight.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file SourceSansProLight.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 FontLoader diff --git a/qml/SourceSansProRegular.qml b/qml/SourceSansProRegular.qml index d9ce908..0de9c8a 100644 --- a/qml/SourceSansProRegular.qml +++ b/qml/SourceSansProRegular.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file SourceSansProRegular.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 FontLoader diff --git a/qml/Splitter.qml b/qml/Splitter.qml index 2e00383..bb110d3 100644 --- a/qml/Splitter.qml +++ b/qml/Splitter.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Splitter.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.3 diff --git a/qml/StateDialog.qml b/qml/StateDialog.qml index 5fae8ec..90e452f 100644 --- a/qml/StateDialog.qml +++ b/qml/StateDialog.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file StateDialog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Dialogs 1.2 @@ -319,7 +339,7 @@ Dialog { MessageDialog { id: deleteAccountMsg - text: qsTr("Are you sure to delete this account?") + text: qsTr("Are you sure you want to delete this account?") onYes: { stateAccounts.splice(styleData.row, 1) diff --git a/qml/StateDialogStyle.qml b/qml/StateDialogStyle.qml index 993e6a1..8729ab1 100644 --- a/qml/StateDialogStyle.qml +++ b/qml/StateDialogStyle.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file StateDialog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 QtObject { diff --git a/qml/StateList.qml b/qml/StateList.qml index 45564c0..d4e1022 100644 --- a/qml/StateList.qml +++ b/qml/StateList.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file StateList.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 @@ -117,10 +137,11 @@ Dialog { id: deleteScenario onYes: list.model.deleteState(styleData.row); standardButtons: StandardButton.Yes | StandardButton.No - text: qsTr("Are you sure to delete this scenario?") + text: qsTr("Are you sure you want to delete this scenario?") } } } } } + diff --git a/qml/StateListModel.qml b/qml/StateListModel.qml index ab9a3f2..9421797 100644 --- a/qml/StateListModel.qml +++ b/qml/StateListModel.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file StateListModel.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/StatusPane.qml b/qml/StatusPane.qml index ff8d7e7..6fe0e25 100644 --- a/qml/StatusPane.qml +++ b/qml/StatusPane.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file StatusPane.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 @@ -201,6 +221,22 @@ Rectangle { height: 25 color: "#fcfbfc" + Connections + { + target: projectModel + onIsEmptyChanged: + if (projectModel.isEmpty) + { + debugImg.visible = false + visible = false + } + else + { + debugImg.visible = true; + visible = true + } + } + Connections { target: appSettings diff --git a/qml/StatusPaneStyle.qml b/qml/StatusPaneStyle.qml index 1eb11b4..a26b026 100644 --- a/qml/StatusPaneStyle.qml +++ b/qml/StatusPaneStyle.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file StatusPaneStyle.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 QtObject { diff --git a/qml/StepActionImage.qml b/qml/StepActionImage.qml index 6627501..42d7466 100644 --- a/qml/StepActionImage.qml +++ b/qml/StepActionImage.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file StepActionImage.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.0 diff --git a/qml/StorageView.qml b/qml/StorageView.qml index 3b24cd0..a5de441 100644 --- a/qml/StorageView.qml +++ b/qml/StorageView.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file StorageView.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/StructView.qml b/qml/StructView.qml index 414f567..89164ef 100644 --- a/qml/StructView.qml +++ b/qml/StructView.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file StructView.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 diff --git a/qml/Style.qml b/qml/Style.qml index 422831c..47cf1dd 100644 --- a/qml/Style.qml +++ b/qml/Style.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Style.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 QtObject { diff --git a/qml/TabStyle.qml b/qml/TabStyle.qml index 6ab1787..4c4295d 100644 --- a/qml/TabStyle.qml +++ b/qml/TabStyle.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file TabStyle.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/TooltipArea.qml b/qml/TooltipArea.qml index 1996f45..7252197 100644 --- a/qml/TooltipArea.qml +++ b/qml/TooltipArea.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file TooltipArea.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.4 import QtQuick.Controls.Private 1.0 diff --git a/qml/Transaction.qml b/qml/Transaction.qml index d090c10..86ebda4 100644 --- a/qml/Transaction.qml +++ b/qml/Transaction.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Transaction.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 @@ -27,8 +47,7 @@ ColumnLayout { if (!isCall && blockChain) { - blockChain.deleteTransaction(blockIndex, txIndex) - blockChain.rebuildRequired() + deleteConfirmation.open(); } } @@ -88,6 +107,40 @@ ColumnLayout func.color = labelColor } + Menu + { + id: contextMenu + visible: false + MenuItem { + text: qsTr("Delete") + onTriggered: { + deleteConfirmation.open(); + } + } + } + + MouseArea + { + anchors.fill: parent + acceptedButtons: Qt.RightButton + onClicked: + { + contextMenu.popup() + } + } + + MessageDialog + { + id: deleteConfirmation + text: qsTr("Are you sure you want to delete this transaction?\n\nTo mark multiple transactions to delete on reload, click on 'Mark to delete' icon at the left") + + standardButtons: StandardIcon.Ok | StandardIcon.Cancel + onAccepted: + { + deleteTransaction(blockIndex, txIndex) + contextMenu.visible = false + } + } MouseArea { anchors.fill: parent @@ -119,6 +172,10 @@ ColumnLayout width: statusWidth height: rowTransactionItem.height < trHeight ? trHeight : rowTransactionItem.height color: "transparent" + TooltipArea { + text: qsTr("Mark to delete") + anchors.fill: parent + } property bool saveStatus Image { anchors.verticalCenter: parent.verticalCenter diff --git a/qml/TransactionDialog.qml b/qml/TransactionDialog.qml index 0e406ae..27d5bf7 100644 --- a/qml/TransactionDialog.qml +++ b/qml/TransactionDialog.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file transactionDialog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 @@ -816,7 +836,7 @@ Dialog { DefaultButton { anchors.verticalCenter: parent.verticalCenter - text: editMode ? qsTr("Update") : qsTr("Ok") + text: editMode ? qsTr("Update") : qsTr("OK") onClicked: { var invalid = InputValidator.validate(paramsModel, paramValues); if (invalid.length === 0) diff --git a/qml/TransactionLog.qml b/qml/TransactionLog.qml index 9438616..fb68ed1 100644 --- a/qml/TransactionLog.qml +++ b/qml/TransactionLog.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file TransactionLog.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/UploadPackage.qml b/qml/UploadPackage.qml index 1b8405d..3f1bcee 100644 --- a/qml/UploadPackage.qml +++ b/qml/UploadPackage.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file UploadPackage.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.1 diff --git a/qml/VariablesView.qml b/qml/VariablesView.qml index d45610c..3ed883a 100644 --- a/qml/VariablesView.qml +++ b/qml/VariablesView.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file VariablesView.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/Watchers.qml b/qml/Watchers.qml index 6270985..5b0d595 100644 --- a/qml/Watchers.qml +++ b/qml/Watchers.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Watchers.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 diff --git a/qml/WebCodeEditor.qml b/qml/WebCodeEditor.qml index b865545..c424fd2 100644 --- a/qml/WebCodeEditor.qml +++ b/qml/WebCodeEditor.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file WebCodeEditor.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.0 diff --git a/qml/WebPreview.qml b/qml/WebPreview.qml index b83312a..900ee5a 100644 --- a/qml/WebPreview.qml +++ b/qml/WebPreview.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file webPreview.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Window 2.0 import QtQuick.Layouts 1.0 diff --git a/qml/WebPreviewStub.qml b/qml/WebPreviewStub.qml index 53c6fcb..27c4122 100644 --- a/qml/WebPreviewStub.qml +++ b/qml/WebPreviewStub.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file WebPreviewStub.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 import QtQuick.Window 2.0 import QtQuick.Layouts 1.0 diff --git a/qml/WebPreviewStyle.qml b/qml/WebPreviewStyle.qml index 1fc0c8b..1d5123c 100644 --- a/qml/WebPreviewStyle.qml +++ b/qml/WebPreviewStyle.qml @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file WebPreviewStyle.qml + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + import QtQuick 2.0 QtObject { @@ -8,7 +28,7 @@ QtObject { } property QtObject general: QtObject { - property string headerBackgroundColor: "#f0f0f0" + property string headerBackgroundColor: "#ededed" property string separatorColor: "#808080" property string fontName: "sans serif" } diff --git a/qml/WelcomeView.qml b/qml/WelcomeView.qml new file mode 100644 index 0000000..0d32449 --- /dev/null +++ b/qml/WelcomeView.qml @@ -0,0 +1,109 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** + * @file WelcomeView.qml + * @author Liana liana@ethdev.com + * @date 2016 + * Mix: Ethereum IDE client. + */ + +import QtQuick 2.0 +import QtQuick.Window 2.0 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 1.0 +import QtQuick.Controls.Styles 1.1 +import QtQuick.Layouts 1.0 +import QtWebEngine 1.0 +import QtWebEngine.experimental 1.0 +import Qt.labs.settings 1.0 +import HttpServer 1.0 +import "js/TransactionHelper.js" as TransactionHelper +import "js/QEtherHelper.js" as QEtherHelper +import "." + +Item { + id: welcomeView + + visible: false + + + Rectangle + { + color: welcomeViewStyleId.bgColor + anchors.fill: parent + ColumnLayout + { + anchors.fill: parent + anchors.top: parent.top + anchors.verticalCenter: parent.verticalCenter + anchors.topMargin: 50 + anchors.leftMargin: 50 + spacing: 50 + + RowLayout + { + Image { + source: "qrc:/res/Mix-1024.png" + sourceSize.height: 300 + anchors.left: parent.left + } + anchors.left: parent.left + ColumnLayout + { + Layout.fillHeight: true + Layout.fillWidth: true + anchors.top: parent.top + anchors.topMargin: 80 + spacing: 50 + DefaultCompleteButton + { + imageSource: "qrc:/qml/img/openedfolder.png" + labelText: "Open Project" + onClicked: + { + openProjectFileDialog.open(); + } + } + DefaultCompleteButton + { + imageSource: "qrc:/qml/img/createfolder.png" + labelText: "New Project" + onClicked: + { + openProjectFileDialog.open() + } + } + } + } + + DefaultLabel + { + text: "To get started" + font.pixelSize: 32 + color: welcomeViewStyleId.headerColor + } + DefaultText { + text: 'Mix: The DApp IDE' + onLinkActivated: Qt.openUrlExternally(link) + } + DefaultText { + text: 'Solidity Documentation' + onLinkActivated: Qt.openUrlExternally(link) + } + Splitter { anchors.fill: parent } + } + } +} + + diff --git a/qml/WelcomeViewStyle.qml b/qml/WelcomeViewStyle.qml new file mode 100644 index 0000000..64f6611 --- /dev/null +++ b/qml/WelcomeViewStyle.qml @@ -0,0 +1,27 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** + * @file WelcomeViewStyle.qml + * @author Liana liana@ethdev.com + * @date 2016 + * Mix: Ethereum IDE client. + */ + +import QtQuick 2.0 + +QtObject { + property string bgColor: "dimgray" + property string fontColor: "silver" + property string headerColor: "silver" +} diff --git a/qml/html/WebContainer.html b/qml/html/WebContainer.html index 67e6488..783fa4c 100644 --- a/qml/html/WebContainer.html +++ b/qml/html/WebContainer.html @@ -1,3 +1,22 @@ + + diff --git a/qml/html/cm/errorannotation.js b/qml/html/cm/errorannotation.js index 33837ed..ec90d6a 100644 --- a/qml/html/cm/errorannotation.js +++ b/qml/html/cm/errorannotation.js @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file errorannotation.js + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + function ErrorAnnotation(editor, location, content) { this.location = location; diff --git a/qml/html/cm/solidityToken.js b/qml/html/cm/solidityToken.js index e4473ac..3b1a51a 100644 --- a/qml/html/cm/solidityToken.js +++ b/qml/html/cm/solidityToken.js @@ -5,7 +5,7 @@ function solCurrency() function solKeywords() { - return { "memory": true, "storage": true, "throw": true, "break": true, "case": true, "constant": true, "continue": true, "contract": true, "default": true, "delete": true, "do": true, "else": true, "event": true, "external": true, "is": true, "indexed": true, "for": true, "function": true, "if": true, "import": true, "mapping": true, "modifier": true, "new": true, "public": true, "private": true, "internal": true, "return": true, "returns": true, "struct": true, "switch": true, "var": true, "while": true, "enum": true }; + return { "library": true, "memory": true, "storage": true, "throw": true, "break": true, "case": true, "constant": true, "continue": true, "contract": true, "default": true, "delete": true, "do": true, "else": true, "event": true, "external": true, "is": true, "indexed": true, "for": true, "function": true, "if": true, "import": true, "mapping": true, "modifier": true, "new": true, "public": true, "private": true, "internal": true, "return": true, "returns": true, "struct": true, "switch": true, "var": true, "while": true, "enum": true }; } function solStdContract() diff --git a/qml/html/codeeditor.html b/qml/html/codeeditor.html index f368404..89ea19f 100644 --- a/qml/html/codeeditor.html +++ b/qml/html/codeeditor.html @@ -1,3 +1,23 @@ + + + diff --git a/qml/img/createfolder.png b/qml/img/createfolder.png new file mode 100644 index 0000000..3122530 Binary files /dev/null and b/qml/img/createfolder.png differ diff --git a/qml/js/Debugger.js b/qml/js/Debugger.js index 8b61bb7..c40c194 100644 --- a/qml/js/Debugger.js +++ b/qml/js/Debugger.js @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Debugger.js + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + Qt.include("Printer.js") Qt.include("ansi2html.js") //debugData => contain all debug states. diff --git a/qml/js/ErrorLocationFormater.js b/qml/js/ErrorLocationFormater.js index cb92f29..a3ce0b2 100644 --- a/qml/js/ErrorLocationFormater.js +++ b/qml/js/ErrorLocationFormater.js @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file ErrorLocationFormatter.js + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + function formatLocation(raw, shortMessage) { var splitted = raw.split(':'); diff --git a/qml/js/InputValidator.js b/qml/js/InputValidator.js index 38551dc..637edce 100644 --- a/qml/js/InputValidator.js +++ b/qml/js/InputValidator.js @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file InputValidator.js + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + Qt.include("QEtherHelper.js") var nbRegEx; diff --git a/qml/js/NetworkDeployment.js b/qml/js/NetworkDeployment.js index 0f04dab..0dfdecd 100644 --- a/qml/js/NetworkDeployment.js +++ b/qml/js/NetworkDeployment.js @@ -35,6 +35,7 @@ function deployProject(force) { function deployContracts(gas, gasPrice, callback) { deployedLibraries = {} + trRealIndex = -1 deploymentGas = gas; deploymentGasPrice = gasPrice deploymentStarted(); diff --git a/qml/js/Printer.js b/qml/js/Printer.js index 2c53fe5..fa50dd3 100644 --- a/qml/js/Printer.js +++ b/qml/js/Printer.js @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Printer.js + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + var prettyPrint = (function () { function pp(object, indent) { try { diff --git a/qml/js/QEtherHelper.js b/qml/js/QEtherHelper.js index 7563941..051b997 100644 --- a/qml/js/QEtherHelper.js +++ b/qml/js/QEtherHelper.js @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file QEtherHelper.js + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + function createEther(_value, _unit, _parent) { var etherComponent = Qt.createComponent("qrc:/qml/EtherValue.qml"); diff --git a/qml/js/ScientificNumber.js b/qml/js/ScientificNumber.js index f8640c8..c83acf2 100644 --- a/qml/js/ScientificNumber.js +++ b/qml/js/ScientificNumber.js @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file SciantificNumber.js + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + function isScientificNumber(_value) { var nbRegEx = new RegExp('^[0-9]+$'); diff --git a/qml/js/TransactionHelper.js b/qml/js/TransactionHelper.js index 3fac86b..432ad75 100644 --- a/qml/js/TransactionHelper.js +++ b/qml/js/TransactionHelper.js @@ -1,3 +1,23 @@ +/* + This file is part of cpp-ethereum. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file TransactionHelper.js + * @author Yann yann@ethdev.com + * @author Arkadiy Paronyan arkadiy@ethdev.com + * @date 2015 + * Ethereum IDE client. + */ + Qt.include("QEtherHelper.js") function defaultTransaction() diff --git a/res.qrc b/res.qrc index fbede93..4411290 100644 --- a/res.qrc +++ b/res.qrc @@ -117,5 +117,7 @@ res/Mix-1024.png qml/img/folder-icon-64x64.png qml/img/unknown.png + qml/DropdownButton.qml + qml/img/createfolder.png diff --git a/src/ClientModel.cpp b/src/ClientModel.cpp index c224ebb..e3a0941 100644 --- a/src/ClientModel.cpp +++ b/src/ClientModel.cpp @@ -180,6 +180,7 @@ void ClientModel::mine() m_mining = false; cerr << boost::current_exception_diagnostic_information(); emit runFailed(QString::fromStdString(boost::current_exception_diagnostic_information())); + return; } emit miningStateChanged(); }); @@ -553,7 +554,7 @@ void ClientModel::executeSequence(vector const& _sequence) if (!f) { emit runFailed("Function '" + transaction.functionId + tr("' not found. Please check transactions or the contract code.")); - break; + return; } if (!transaction.functionId.isEmpty()) encoder.encode(f); @@ -591,8 +592,9 @@ void ClientModel::executeSequence(vector const& _sequence) if (transaction.functionId.isEmpty() || transaction.functionId == ctrInstance.first) { bytes param = encoder.encodedData(); - bytes contractCode = m_codeModel->linkLibraries(ctrInstance.first, m_deployedLibrary); + m_codeModel->linkLibraries(ctrInstance.first, m_deployedLibraries); eth::LinkerObject object = m_codeModel->contract(ctrInstance.first)->linkerObject(); + bytes contractCode = object.bytecode; if (!object.linkReferences.empty()) { for (auto const& ref: object.linkReferences) @@ -602,12 +604,14 @@ void ClientModel::executeSequence(vector const& _sequence) contractCode.insert(contractCode.end(), param.begin(), param.end()); Address newAddress = deployContract(contractCode, transaction); if (compilerRes->contract()->isLibrary()) - m_deployedLibrary[ctrInstance.first] = QString::fromStdString(newAddress.hex()); - std::pair contractToken = retrieveToken(transaction.contractId); - m_contractAddresses[contractToken] = newAddress; - m_contractNames[newAddress] = contractToken.first; - contractAddressesChanged(); - gasCostsChanged(); + m_deployedLibraries[ctrInstance.first] = QString::fromStdString(newAddress.hex()); + else + { + std::pair contractToken = retrieveToken(transaction.contractId); + m_contractAddresses[contractToken] = newAddress; + m_contractNames[newAddress] = contractToken.first; + contractAddressesChanged(); + } } else { @@ -615,19 +619,17 @@ void ClientModel::executeSequence(vector const& _sequence) if (contractAddressIter == m_contractAddresses.end()) { emit runFailed("Contract '" + transaction.contractId + tr(" not deployed.") + "' " + tr(" Cannot call ") + transaction.functionId); - Address fakeAddress = Address::random(); - std::pair contractToken = resolvePair(transaction.contractId); - m_contractNames[fakeAddress] = contractToken.first; - callAddress(fakeAddress, encoder.encodedData(), transaction); //Transact to a random fake address to that transaction is added to the list anyway + return; } else callAddress(contractAddressIter->second, encoder.encodedData(), transaction); } m_gasCosts.append(m_client->lastExecution().gasUsed); + gasCostsChanged(); onNewTransaction(RecordLogEntry::TxSource::MixGui); TransactionException exception = m_client->lastExecution().excepted; if (exception != TransactionException::None) - break; + return; } emit runComplete(); } @@ -635,16 +637,19 @@ void ClientModel::executeSequence(vector const& _sequence) { cerr << boost::current_exception_diagnostic_information(); emit runFailed(QString::fromStdString(boost::current_exception_diagnostic_information())); + return; } catch(std::exception const& e) { cerr << boost::current_exception_diagnostic_information(); emit runFailed(e.what()); + return; } catch(...) { cerr << boost::current_exception_diagnostic_information(); emit runFailed("Unknown Error"); + return; } emit runStateChanged(); }); @@ -1013,7 +1018,7 @@ void ClientModel::onStateReset() m_stdContractNames.clear(); m_queueTransactions.clear(); m_gasCosts.clear(); - m_deployedLibrary.clear(); + m_deployedLibraries.clear(); m_mining = false; m_running = false; emit stateCleared(); @@ -1039,7 +1044,7 @@ void ClientModel::onNewTransaction(RecordLogEntry::TxSource _source) { exception = RecordLogEntry::TransactionException::NotEnoughCash; emit runFailed("Insufficient balance"); - break; + return; } case TransactionException::OutOfGasIntrinsic: case TransactionException::OutOfGasBase: @@ -1047,32 +1052,32 @@ void ClientModel::onNewTransaction(RecordLogEntry::TxSource _source) { exception = RecordLogEntry::TransactionException::OutOfGas; emit runFailed("Not enough gas"); - break; + return; } case TransactionException::BlockGasLimitReached: { exception = RecordLogEntry::TransactionException::BlockGasLimitReached; emit runFailed("Block gas limit reached"); - break; + return; } case TransactionException::BadJumpDestination: { exception = RecordLogEntry::TransactionException::BadJumpDestination; emit runFailed("Solidity exception (bad jump)"); - break; + return; } case TransactionException::OutOfStack: { exception = RecordLogEntry::TransactionException::OutOfStack; emit runFailed("Out of stack"); - break; + return; } case TransactionException::StackUnderflow: { exception = RecordLogEntry::TransactionException::StackUnderflow; emit runFailed("Stack underflow"); - break; + return; } //these should not happen in mix case TransactionException::Unknown: @@ -1084,7 +1089,7 @@ void ClientModel::onNewTransaction(RecordLogEntry::TxSource _source) { exception = RecordLogEntry::TransactionException::Unknown; emit runFailed("Internal execution error"); - break; + return; } } diff --git a/src/ClientModel.h b/src/ClientModel.h index 04c57cd..da75153 100644 --- a/src/ClientModel.h +++ b/src/ClientModel.h @@ -364,7 +364,7 @@ private slots: QString m_dbpath; ExecutionCtx m_executionCtx; QString m_lastTransactionIndex; - QVariantMap m_deployedLibrary; + QVariantMap m_deployedLibraries; }; } diff --git a/src/CodeModel.cpp b/src/CodeModel.cpp index cffd869..473a703 100644 --- a/src/CodeModel.cpp +++ b/src/CodeModel.cpp @@ -155,7 +155,6 @@ CompiledContract::CompiledContract(const dev::solidity::CompilerStack& _compiler QQmlEngine::setObjectOwnership(m_contract.get(), QQmlEngine::CppOwnership); m_contract->moveToThread(QApplication::instance()->thread()); m_linkerObject = _compiler.object(_contractName.toStdString()); - m_bytes = m_linkerObject.bytecode; // use linkLibraries() to link object dev::solidity::InterfaceHandler interfaceHandler; m_contractInterface = QString::fromStdString(interfaceHandler.abiInterface(contractDefinition)); @@ -172,7 +171,7 @@ CompiledContract::CompiledContract(const dev::solidity::CompilerStack& _compiler m_constructorAssemblyItems = *_compiler.assemblyItems(name); } -bytes CompiledContract::linkLibraries(QVariantMap const& _deployedLibraries, QVariantMap _compiledItems) +void CompiledContract::linkLibraries(QVariantMap const& _deployedLibraries, QVariantMap _compiledItems) { std::map toLink; for (auto const& linkRef: m_linkerObject.linkReferences) @@ -185,13 +184,11 @@ bytes CompiledContract::linkLibraries(QVariantMap const& _deployedLibraries, QVa } } m_linkerObject.link(toLink); - m_bytes = m_linkerObject.bytecode; - return m_linkerObject.bytecode; } QString CompiledContract::codeHex() const { - return QString::fromStdString(toJS(m_bytes)); + return QString::fromStdString(toJS(m_linkerObject.bytecode)); } CodeModel::CodeModel(): @@ -340,14 +337,13 @@ CompiledContract* CodeModel::contractByDocumentId(QString const& _documentId) co } } -bytes CodeModel::linkLibraries(QString const& _contractName, QVariantMap const& _deployedLibraries) +void CodeModel::linkLibraries(QString const& _contractName, QVariantMap const& _deployedLibraries) { auto contract = m_contractMap.value(_contractName); - bytes code = contract->linkLibraries(_deployedLibraries, contracts()); - return code; + contract->linkLibraries(_deployedLibraries, contracts()); } -CompiledContract const* CodeModel::contract(QString const& _name) const +CompiledContract* CodeModel::contract(QString const& _name) { CompiledContract* res = nullptr; try diff --git a/src/CodeModel.h b/src/CodeModel.h index 39e7ed0..00218ff 100644 --- a/src/CodeModel.h +++ b/src/CodeModel.h @@ -90,7 +90,7 @@ class CompiledContract: public QObject /// @returns contract definition std::shared_ptr sharedContract() const { return m_contract; } /// @returns contract bytecode - dev::bytes const& bytes() const { return m_bytes; } + dev::bytes const& bytes() const { return m_linkerObject.bytecode; } /// @returns contract bytecode as hex string QString codeHex() const; /// @returns contract definition in JSON format @@ -105,15 +105,14 @@ class CompiledContract: public QObject QHash const& storage() const { return m_storage; } /// link @arg _contract to referenced libraries - dev::bytes linkLibraries(QVariantMap const& _deployedLibraries, QVariantMap _compiledItems); + void linkLibraries(QVariantMap const& _deployedLibraries, QVariantMap _compiledItems); /// linker object - eth::LinkerObject linkerObject() const { return m_linkerObject; } + eth::LinkerObject& linkerObject() { return m_linkerObject; } private: uint m_sourceHash; std::shared_ptr m_contract; QString m_compilerMessage; ///< @todo: use some structure here - dev::bytes m_bytes; QString m_contractInterface; QString m_documentId; eth::AssemblyItems m_assemblyItems; @@ -229,7 +228,7 @@ class CodeModel: public QObject bool hasContract() const; /// Get contract by name /// Throws if not found - CompiledContract const* contract(QString const& _name) const; + CompiledContract* contract(QString const& _name); /// Find a contract by document id /// @returns CompiledContract object or null if not found Q_INVOKABLE CompiledContract* contractByDocumentId(QString const& _documentId) const; @@ -259,7 +258,7 @@ class CodeModel: public QObject /// Return the location of the given contract Q_INVOKABLE QVariantMap locationOf(QString _contract); /// link libraries referenced in @arg _contractName - bytes linkLibraries(QString const& _contractName, QVariantMap const& _deployedLibraries); + void linkLibraries(QString const& _contractName, QVariantMap const& _deployedLibraries); signals: /// Emited on internal error