From 49467ed8e286ac4303c8438ca3011f3291160d79 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 12 Jan 2015 14:32:54 +0100 Subject: [PATCH] - rename init() => update() in AssemblyDebuggerControl - rename ConstantCompilationControl.cpp => StatusPane.cpp --- mix/AssemblyDebuggerControl.cpp | 2 +- mix/CodeEditorExtensionManager.cpp | 5 ++--- mix/CodeEditorExtensionManager.h | 2 +- mix/DebuggingStateWrapper.cpp | 2 +- ...tCompilationControl.cpp => StatusPane.cpp} | 22 +++++++++---------- ...stantCompilationControl.h => StatusPane.h} | 6 ++--- mix/qml.qrc | 2 +- mix/qml/Debugger.qml | 6 ++--- .../{CompilationStatus.qml => StatusPane.qml} | 6 ++--- 9 files changed, 26 insertions(+), 27 deletions(-) rename mix/{ConstantCompilationControl.cpp => StatusPane.cpp} (63%) rename mix/{ConstantCompilationControl.h => StatusPane.h} (89%) rename mix/qml/{CompilationStatus.qml => StatusPane.qml} (90%) diff --git a/mix/AssemblyDebuggerControl.cpp b/mix/AssemblyDebuggerControl.cpp index 4c0fdda0c..12dfe533b 100644 --- a/mix/AssemblyDebuggerControl.cpp +++ b/mix/AssemblyDebuggerControl.cpp @@ -208,7 +208,7 @@ void AssemblyDebuggerControl::updateDebugPanel() { QVariant returnValue; QObject* debugPanel = m_view->findChild("debugPanel", Qt::FindChildrenRecursively); - QMetaObject::invokeMethod(debugPanel, "init", Q_RETURN_ARG(QVariant, returnValue)); + QMetaObject::invokeMethod(debugPanel, "update", Q_RETURN_ARG(QVariant, returnValue)); } void AssemblyDebuggerControl::showDebugError(QString const& _error) diff --git a/mix/CodeEditorExtensionManager.cpp b/mix/CodeEditorExtensionManager.cpp index ae6cfec87..6c5b23af7 100644 --- a/mix/CodeEditorExtensionManager.cpp +++ b/mix/CodeEditorExtensionManager.cpp @@ -25,7 +25,7 @@ #include #include #include -#include "ConstantCompilationControl.h" +#include "StatusPane.h" #include "AssemblyDebuggerControl.h" #include "StateListView.h" #include "AppContext.h" @@ -64,11 +64,10 @@ void CodeEditorExtensionManager::loadEditor(QQuickItem* _editor) void CodeEditorExtensionManager::initExtensions() { - std::shared_ptr output = std::make_shared(m_appContext); + std::shared_ptr output = std::make_shared(m_appContext); std::shared_ptr debug = std::make_shared(m_appContext); std::shared_ptr stateList = std::make_shared(m_appContext); QObject::connect(m_doc, &QTextDocument::contentsChange, this, &CodeEditorExtensionManager::onCodeChange); - //QObject::connect(debug.get(), &AssemblyDebuggerControl::runFailed, output.get(), &ConstantCompilationControl::displayError); QObject::connect(m_appContext->codeModel(), &CodeModel::compilationComplete, this, &CodeEditorExtensionManager::applyCodeHighlight); initExtension(output); diff --git a/mix/CodeEditorExtensionManager.h b/mix/CodeEditorExtensionManager.h index b7d0e3074..da7d0486d 100644 --- a/mix/CodeEditorExtensionManager.h +++ b/mix/CodeEditorExtensionManager.h @@ -26,7 +26,7 @@ #include #include #include -#include "ConstantCompilationControl.h" +#include "StatusPane.h" namespace dev { diff --git a/mix/DebuggingStateWrapper.cpp b/mix/DebuggingStateWrapper.cpp index f12a0b9ef..6c5a9b047 100644 --- a/mix/DebuggingStateWrapper.cpp +++ b/mix/DebuggingStateWrapper.cpp @@ -105,7 +105,7 @@ QStringList DebuggingStateWrapper::debugStorage() s << "@" << prettyU256(i.first) << " " << prettyU256(i.second); storage.append(QString::fromStdString(s.str())); } - return fillList(storage, "@- -"); + return fillList(storage, "@ -"); } QStringList DebuggingStateWrapper::debugMemory() diff --git a/mix/ConstantCompilationControl.cpp b/mix/StatusPane.cpp similarity index 63% rename from mix/ConstantCompilationControl.cpp rename to mix/StatusPane.cpp index c4f365238..e1a33f1a9 100644 --- a/mix/ConstantCompilationControl.cpp +++ b/mix/StatusPane.cpp @@ -27,40 +27,40 @@ #include #include #include -#include "ConstantCompilationControl.h" +#include "StatusPane.h" #include "QContractDefinition.h" #include "AppContext.h" #include "CodeModel.h" using namespace dev::mix; -ConstantCompilationControl::ConstantCompilationControl(AppContext* _context): Extension(_context, ExtensionDisplayBehavior::HeaderView) +StatusPane::StatusPane(AppContext* _context): Extension(_context, ExtensionDisplayBehavior::HeaderView) { - connect(_context->codeModel(), &CodeModel::compilationComplete, this, &ConstantCompilationControl::update); - _context->appEngine()->rootContext()->setContextProperty("constantCompilation", this); + connect(_context->codeModel(), &CodeModel::compilationComplete, this, &StatusPane::update); + _context->appEngine()->rootContext()->setContextProperty("statusPane", this); } -QString ConstantCompilationControl::contentUrl() const +QString StatusPane::contentUrl() const { - return QStringLiteral("qrc:/qml/CompilationStatus.qml"); + return QStringLiteral("qrc:/qml/StatusPane.qml"); } -QString ConstantCompilationControl::title() const +QString StatusPane::title() const { return QApplication::tr("compiler"); } -void ConstantCompilationControl::start() const +void StatusPane::start() const { } -CompilationResult* ConstantCompilationControl::result() const +CompilationResult* StatusPane::result() const { return m_ctx->codeModel()->code(); } -void ConstantCompilationControl::update() +void StatusPane::update() { - QObject* ctrl = m_view->findChild("constantCompilationStatus", Qt::FindChildrenRecursively); + QObject* ctrl = m_view->findChild("statusPane", Qt::FindChildrenRecursively); QMetaObject::invokeMethod(ctrl, "update"); } diff --git a/mix/ConstantCompilationControl.h b/mix/StatusPane.h similarity index 89% rename from mix/ConstantCompilationControl.h rename to mix/StatusPane.h index 8acde4f09..c0db286a3 100644 --- a/mix/ConstantCompilationControl.h +++ b/mix/StatusPane.h @@ -30,14 +30,14 @@ namespace mix /** * @brief Extension which display assembly code of the contract being edited. */ -class ConstantCompilationControl: public Extension +class StatusPane: public Extension { Q_OBJECT Q_PROPERTY(CompilationResult* result READ result CONSTANT) public: - ConstantCompilationControl(AppContext* _appContext); - ~ConstantCompilationControl() {} + StatusPane(AppContext* _appContext); + ~StatusPane() {} void start() const override; QString title() const override; QString contentUrl() const override; diff --git a/mix/qml.qrc b/mix/qml.qrc index 0d0314785..29d890417 100644 --- a/mix/qml.qrc +++ b/mix/qml.qrc @@ -12,7 +12,6 @@ qml/AlertMessageDialog.qml qml/StateDialog.qml qml/StateList.qml - qml/CompilationStatus.qml qml/js/main.js qml/img/jumpintoback.png qml/img/jumpintoforward.png @@ -34,5 +33,6 @@ qml/img/bugiconinactive.png qml/DebugInfoList.qml qml/ItemDelegateDataDump.qml + qml/StatusPane.qml diff --git a/mix/qml/Debugger.qml b/mix/qml/Debugger.qml index 41567f997..822c7346a 100644 --- a/mix/qml/Debugger.qml +++ b/mix/qml/Debugger.qml @@ -20,9 +20,9 @@ Rectangle { Debugger.moveSelection(-1); } - function init() + function update() { - if (constantCompilation.result.successfull) + if (statusPane.result.successfull) { Debugger.init(); debugScrollArea.visible = true; @@ -35,7 +35,7 @@ Rectangle { compilationErrorArea.visible = true; machineStates.visible = false; console.log(constantCompilation.result.compilerMessage); - var errorInfo = ErrorLocationFormater.extractErrorInfo(constantCompilation.result.compilerMessage, false); + var errorInfo = ErrorLocationFormater.extractErrorInfo(statusPane.result.compilerMessage, false); errorLocation.text = errorInfo.errorLocation; errorDetail.text = errorInfo.errorDetail; errorLine.text = errorInfo.errorLine; diff --git a/mix/qml/CompilationStatus.qml b/mix/qml/StatusPane.qml similarity index 90% rename from mix/qml/CompilationStatus.qml rename to mix/qml/StatusPane.qml index da77e70cd..0a828a0d0 100644 --- a/mix/qml/CompilationStatus.qml +++ b/mix/qml/StatusPane.qml @@ -5,10 +5,10 @@ import "js/ErrorLocationFormater.js" as ErrorLocationFormater Rectangle { id: constantCompilationStatus - objectName: "constantCompilationStatus" + objectName: "statusPane" function update() { - if (constantCompilation.result.successfull) + if (statusPane.result.successfull) { image.state = ""; status.state = ""; @@ -19,7 +19,7 @@ Rectangle { { image.state = "error"; status.state = "error"; - var errorInfo = ErrorLocationFormater.extractErrorInfo(constantCompilation.result.compilerMessage, true); + var errorInfo = ErrorLocationFormater.extractErrorInfo(statusPane.result.compilerMessage, true); status.text = errorInfo.errorLocation + " " + errorInfo.errorDetail; logslink.visible = true; }