From 369268c0cedf0e0e4a7dfb8175ed35cd2989b235 Mon Sep 17 00:00:00 2001 From: yann300 Date: Sat, 29 Nov 2014 01:02:12 +0100 Subject: [PATCH] tab indentation --- mix/ApplicationCtx.cpp | 28 ++++----- mix/ApplicationCtx.h | 40 ++++++------- mix/CodeEditorExtensionManager.cpp | 94 +++++++++++++++--------------- mix/CodeEditorExtensionManager.h | 48 +++++++-------- mix/ConstantCompilationCtrl.cpp | 92 ++++++++++++++--------------- mix/ConstantCompilationCtrl.h | 44 +++++++------- mix/ConstantCompilationModel.cpp | 72 +++++++++++------------ mix/ConstantCompilationModel.h | 34 +++++------ mix/Extension.cpp | 44 +++++++------- mix/Extension.h | 36 ++++++------ mix/MixApplication.cpp | 50 ++++++++-------- mix/MixApplication.h | 30 +++++----- mix/main.cpp | 36 ++++++------ mix/qml/BasicContent.qml | 3 +- 14 files changed, 326 insertions(+), 325 deletions(-) diff --git a/mix/ApplicationCtx.cpp b/mix/ApplicationCtx.cpp index 5b8c34aaf..f97478f3c 100644 --- a/mix/ApplicationCtx.cpp +++ b/mix/ApplicationCtx.cpp @@ -1,15 +1,15 @@ /* - 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 . + 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 ApplicationCtx.cpp * @author Yann yann@ethdev.com @@ -26,11 +26,11 @@ ApplicationCtx* ApplicationCtx::Instance = nullptr; QQmlApplicationEngine* ApplicationCtx::appEngine() { - return m_applicationEngine; + return m_applicationEngine; } void ApplicationCtx::setApplicationContext(QQmlApplicationEngine* _engine) { - if (Instance == nullptr) - Instance = new ApplicationCtx(_engine); + if (Instance == nullptr) + Instance = new ApplicationCtx(_engine); } diff --git a/mix/ApplicationCtx.h b/mix/ApplicationCtx.h index 3938c7bf5..37166ea05 100644 --- a/mix/ApplicationCtx.h +++ b/mix/ApplicationCtx.h @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ /** @file ApplicationCtx.h * @author Yann yann@ethdev.com @@ -33,21 +33,21 @@ namespace mix class ApplicationCtx: public QObject { - Q_OBJECT + Q_OBJECT public: - ApplicationCtx(QQmlApplicationEngine* _engine) { m_applicationEngine = _engine; } - ~ApplicationCtx() { delete m_applicationEngine; } - static ApplicationCtx* getInstance() { return Instance; } - static void setApplicationContext(QQmlApplicationEngine* _engine); - QQmlApplicationEngine* appEngine(); + ApplicationCtx(QQmlApplicationEngine* _engine) { m_applicationEngine = _engine; } + ~ApplicationCtx() { delete m_applicationEngine; } + static ApplicationCtx* getInstance() { return Instance; } + static void setApplicationContext(QQmlApplicationEngine* _engine); + QQmlApplicationEngine* appEngine(); private: - static ApplicationCtx* Instance; - QQmlApplicationEngine* m_applicationEngine; + static ApplicationCtx* Instance; + QQmlApplicationEngine* m_applicationEngine; public slots: - void quitApplication() { delete Instance; } + void quitApplication() { delete Instance; } }; } diff --git a/mix/CodeEditorExtensionManager.cpp b/mix/CodeEditorExtensionManager.cpp index 92400cd63..4a46c60d4 100644 --- a/mix/CodeEditorExtensionManager.cpp +++ b/mix/CodeEditorExtensionManager.cpp @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ /** @file CodeEditorExtensionMan.cpp * @author Yann yann@ethdev.com @@ -36,56 +36,56 @@ using namespace dev::mix; CodeEditorExtensionManager::~CodeEditorExtensionManager() { - m_features.clear(); + m_features.clear(); } void CodeEditorExtensionManager::loadEditor(QQuickItem* _editor) { - if (!_editor) - return; - try - { - QVariant doc = _editor->property("textDocument"); - if (doc.canConvert()) - { - QQuickTextDocument* qqdoc = doc.value(); - if (qqdoc) - m_doc = qqdoc->textDocument(); - } - } - catch (...) - { - qDebug() << "unable to load editor: "; - } + if (!_editor) + return; + try + { + QVariant doc = _editor->property("textDocument"); + if (doc.canConvert()) + { + QQuickTextDocument* qqdoc = doc.value(); + if (qqdoc) + m_doc = qqdoc->textDocument(); + } + } + catch (...) + { + qDebug() << "unable to load editor: "; + } } void CodeEditorExtensionManager::initExtensions() { - //only one for now - std::shared_ptr constantCompilation = std::make_shared(m_doc); - if (constantCompilation.get()->contentUrl() != "") - { - try - { - constantCompilation.get()->addContentOn(m_tabView); - } - catch (...) - { - qDebug() << "Exception when adding content into view."; - return; - } - } - constantCompilation.get()->start(); - m_features.append(constantCompilation); + //only one for now + std::shared_ptr constantCompilation = std::make_shared(m_doc); + if (constantCompilation.get()->contentUrl() != "") + { + try + { + constantCompilation.get()->addContentOn(m_tabView); + } + catch (...) + { + qDebug() << "Exception when adding content into view."; + return; + } + } + constantCompilation.get()->start(); + m_features.append(constantCompilation); } void CodeEditorExtensionManager::setEditor(QQuickItem* _editor) { - this->loadEditor(_editor); - this->initExtensions(); + this->loadEditor(_editor); + this->initExtensions(); } void CodeEditorExtensionManager::setTabView(QQuickItem* _tabView) { - m_tabView = _tabView; + m_tabView = _tabView; } diff --git a/mix/CodeEditorExtensionManager.h b/mix/CodeEditorExtensionManager.h index 1d8fb1ec5..2b8402bf2 100644 --- a/mix/CodeEditorExtensionManager.h +++ b/mix/CodeEditorExtensionManager.h @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ /** @file CodeEditorExtensionMan.h * @author Yann yann@ethdev.com @@ -36,24 +36,24 @@ namespace mix class CodeEditorExtensionManager: public QObject { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(QQuickItem* editor MEMBER m_editor WRITE setEditor) - Q_PROPERTY(QQuickItem* tabView MEMBER m_tabView WRITE setTabView) + Q_PROPERTY(QQuickItem* editor MEMBER m_editor WRITE setEditor) + Q_PROPERTY(QQuickItem* tabView MEMBER m_tabView WRITE setTabView) public: - CodeEditorExtensionManager() {} - ~CodeEditorExtensionManager(); - void initExtensions(); - void setEditor(QQuickItem*); - void setTabView(QQuickItem*); + CodeEditorExtensionManager() {} + ~CodeEditorExtensionManager(); + void initExtensions(); + void setEditor(QQuickItem*); + void setTabView(QQuickItem*); private: - QQuickItem* m_editor; - QVector> m_features; - QQuickItem* m_tabView; - QTextDocument* m_doc; - void loadEditor(QQuickItem*); + QQuickItem* m_editor; + QVector> m_features; + QQuickItem* m_tabView; + QTextDocument* m_doc; + void loadEditor(QQuickItem*); }; } diff --git a/mix/ConstantCompilationCtrl.cpp b/mix/ConstantCompilationCtrl.cpp index 2c42a28dd..06b9c0284 100644 --- a/mix/ConstantCompilationCtrl.cpp +++ b/mix/ConstantCompilationCtrl.cpp @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ /** @file ConstantCompilation.cpp * @author Yann yann@ethdev.com @@ -32,66 +32,66 @@ using namespace dev::mix; ConstantCompilationCtrl::ConstantCompilationCtrl(QTextDocument* _doc) { - m_editor = _doc; - m_compilationModel = new ConstantCompilationModel(); + m_editor = _doc; + m_compilationModel = new ConstantCompilationModel(); } ConstantCompilationCtrl::~ConstantCompilationCtrl() { - delete m_compilationModel; + delete m_compilationModel; } QString ConstantCompilationCtrl::contentUrl() const { - return QStringLiteral("qrc:/qml/BasicContent.qml"); + return QStringLiteral("qrc:/qml/BasicContent.qml"); } QString ConstantCompilationCtrl::title() const { - return "compiler"; + return "compiler"; } void ConstantCompilationCtrl::start() const { - connect(m_editor, SIGNAL(contentsChange(int,int,int)), this, SLOT(compile())); + connect(m_editor, SIGNAL(contentsChange(int,int,int)), this, SLOT(compile())); } void ConstantCompilationCtrl::compile() { - QString codeContent = m_editor->toPlainText().replace("\n", ""); - if (codeContent == "") - { - resetOutPut(); - return; - } - CompilerResult res = m_compilationModel->compile(m_editor->toPlainText()); - writeOutPut(res); + QString codeContent = m_editor->toPlainText().replace("\n", ""); + if (codeContent.isEmpty()) + { + resetOutPut(); + return; + } + CompilerResult res = m_compilationModel->compile(m_editor->toPlainText()); + writeOutPut(res); } void ConstantCompilationCtrl::resetOutPut() { - QObject* status = m_view->findChild("status", Qt::FindChildrenRecursively); - QObject* content = m_view->findChild("content", Qt::FindChildrenRecursively); - status->setProperty("text", ""); - content->setProperty("text", ""); + QObject* status = m_view->findChild("status", Qt::FindChildrenRecursively); + QObject* content = m_view->findChild("content", Qt::FindChildrenRecursively); + status->setProperty("text", ""); + content->setProperty("text", ""); } -void ConstantCompilationCtrl::writeOutPut(const CompilerResult& _res) +void ConstantCompilationCtrl::writeOutPut(CompilerResult const& _res) { - QObject* status = m_view->findChild("status", Qt::FindChildrenRecursively); - QObject* content = m_view->findChild("content", Qt::FindChildrenRecursively); - if (_res.success) - { - status->setProperty("text", "succeeded"); - status->setProperty("color", "green"); - content->setProperty("text", _res.hexCode); - qDebug() << QString("compile succeeded " + _res.hexCode); - } - else - { - status->setProperty("text", "failure"); - status->setProperty("color", "red"); - content->setProperty("text", _res.comment); - qDebug() << QString("compile failed " + _res.comment); - } + QObject* status = m_view->findChild("status", Qt::FindChildrenRecursively); + QObject* content = m_view->findChild("content", Qt::FindChildrenRecursively); + if (_res.success) + { + status->setProperty("text", "succeeded"); + status->setProperty("color", "green"); + content->setProperty("text", _res.hexCode); + qDebug() << QString("compile succeeded " + _res.hexCode); + } + else + { + status->setProperty("text", "failure"); + status->setProperty("color", "red"); + content->setProperty("text", _res.comment); + qDebug() << QString("compile failed " + _res.comment); + } } diff --git a/mix/ConstantCompilationCtrl.h b/mix/ConstantCompilationCtrl.h index af7c97951..e4661c800 100644 --- a/mix/ConstantCompilationCtrl.h +++ b/mix/ConstantCompilationCtrl.h @@ -1,15 +1,15 @@ /* - 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 . + 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 ConstantCompilation.h * @author Yann yann@ethdev.com @@ -31,23 +31,23 @@ namespace mix class ConstantCompilationCtrl: public Extension { - Q_OBJECT + Q_OBJECT public: - ConstantCompilationCtrl(QTextDocument*); - ~ConstantCompilationCtrl(); - void start() const override; - QString title() const override; - QString contentUrl() const override; + ConstantCompilationCtrl(QTextDocument*); + ~ConstantCompilationCtrl(); + void start() const override; + QString title() const override; + QString contentUrl() const override; private: - QTextDocument* m_editor; - ConstantCompilationModel* m_compilationModel; - void writeOutPut(const CompilerResult&); - void resetOutPut(); + QTextDocument* m_editor; + ConstantCompilationModel* m_compilationModel; + void writeOutPut(CompilerResult const&); + void resetOutPut(); public Q_SLOTS: - void compile(); + void compile(); }; } diff --git a/mix/ConstantCompilationModel.cpp b/mix/ConstantCompilationModel.cpp index 533523a4e..e06734f59 100644 --- a/mix/ConstantCompilationModel.cpp +++ b/mix/ConstantCompilationModel.cpp @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ /** @file ApplicationCtx.h * @author Yann yann@ethdev.com @@ -33,29 +33,29 @@ using namespace dev::mix; CompilerResult ConstantCompilationModel::compile(QString _code) { - dev::solidity::CompilerStack compiler; - dev::bytes m_data; - CompilerResult res; - try - { - m_data = compiler.compile(_code.toStdString(), true); - res.success = true; - res.comment = "ok"; - res.hexCode = QString::fromStdString(dev::eth::disassemble(m_data)); - } - catch (dev::Exception const& _exception) - { - ostringstream error; - solidity::SourceReferenceFormatter::printExceptionInformation(error, _exception, "Error", compiler.getScanner()); - res.success = false; - res.comment = QString::fromStdString(error.str()).toHtmlEscaped(); - res.hexCode = ""; - } - catch (...) - { - res.success = false; - res.comment = "Uncaught exception."; - res.hexCode = ""; - } - return res; + dev::solidity::CompilerStack compiler; + dev::bytes m_data; + CompilerResult res; + try + { + m_data = compiler.compile(_code.toStdString(), true); + res.success = true; + res.comment = "ok"; + res.hexCode = QString::fromStdString(dev::eth::disassemble(m_data)); + } + catch (dev::Exception const& _exception) + { + ostringstream error; + solidity::SourceReferenceFormatter::printExceptionInformation(error, _exception, "Error", compiler.getScanner()); + res.success = false; + res.comment = QString::fromStdString(error.str()).toHtmlEscaped(); + res.hexCode = ""; + } + catch (...) + { + res.success = false; + res.comment = "Uncaught exception."; + res.hexCode = ""; + } + return res; } diff --git a/mix/ConstantCompilationModel.h b/mix/ConstantCompilationModel.h index 4c84bc0eb..faeb853e0 100644 --- a/mix/ConstantCompilationModel.h +++ b/mix/ConstantCompilationModel.h @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ /** @file ApplicationCtx.h * @author Yann yann@ethdev.com @@ -32,18 +32,18 @@ namespace mix struct CompilerResult { - QString hexCode; - QString comment; - bool success; + QString hexCode; + QString comment; + bool success; }; class ConstantCompilationModel { public: - ConstantCompilationModel() { } - ~ConstantCompilationModel() { } - CompilerResult compile(QString code); + ConstantCompilationModel() { } + ~ConstantCompilationModel() { } + CompilerResult compile(QString code); }; } diff --git a/mix/Extension.cpp b/mix/Extension.cpp index b1ae31ecc..5aeb0cc17 100644 --- a/mix/Extension.cpp +++ b/mix/Extension.cpp @@ -1,15 +1,15 @@ /* - 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 . + 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 Feature.cpp * @author Yann yann@ethdev.com @@ -27,18 +27,18 @@ using namespace dev::mix; void Extension::addContentOn(QObject* _tabView) { - if (contentUrl() == "") - return; + if (contentUrl() == "") + return; - QVariant returnValue; - QQmlComponent* component = new QQmlComponent( - ApplicationCtx::getInstance()->appEngine(), - QUrl(this->contentUrl()), _tabView); + QVariant returnValue; + QQmlComponent* component = new QQmlComponent( + ApplicationCtx::getInstance()->appEngine(), + QUrl(this->contentUrl()), _tabView); - QMetaObject::invokeMethod(_tabView, "addTab", - Q_RETURN_ARG(QVariant, returnValue), - Q_ARG(QVariant, this->title()), - Q_ARG(QVariant, QVariant::fromValue(component))); + QMetaObject::invokeMethod(_tabView, "addTab", + Q_RETURN_ARG(QVariant, returnValue), + Q_ARG(QVariant, this->title()), + Q_ARG(QVariant, QVariant::fromValue(component))); - m_view = qvariant_cast(returnValue); + m_view = qvariant_cast(returnValue); } diff --git a/mix/Extension.h b/mix/Extension.h index 0678fdd5b..f8fef0aa6 100644 --- a/mix/Extension.h +++ b/mix/Extension.h @@ -1,15 +1,15 @@ /* - 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 . + 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 Feature.h * @author Yann yann@ethdev.com @@ -30,17 +30,17 @@ namespace mix class Extension: public QObject { - Q_OBJECT + Q_OBJECT public: - Extension() {} - virtual QString contentUrl() const { return ""; } - virtual QString title() const { return ""; } - virtual void start() const {} - void addContentOn(QObject* tabView); + Extension() {} + virtual QString contentUrl() const { return ""; } + virtual QString title() const { return ""; } + virtual void start() const {} + void addContentOn(QObject* tabView); protected: - QObject* m_view; + QObject* m_view; }; } diff --git a/mix/MixApplication.cpp b/mix/MixApplication.cpp index 634b3142a..c63349409 100644 --- a/mix/MixApplication.cpp +++ b/mix/MixApplication.cpp @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ /** @file main.cpp * @author Yann yann@ethdev.com @@ -24,23 +24,23 @@ using namespace dev::mix; MixApplication::MixApplication(int _argc, char *_argv[]) - : QApplication(_argc, _argv) + : QApplication(_argc, _argv) { } bool MixApplication::notify(QObject* _receiver, QEvent* _event) { - try - { - return MixApplication::notify(_receiver, _event); - } - catch (std::exception& _ex) - { - qDebug() << "std::exception was caught " << _ex.what(); - } - catch (...) - { - qDebug() << "uncaught exception "; - } - return false; + try + { + return MixApplication::notify(_receiver, _event); + } + catch (std::exception& _ex) + { + qDebug() << "std::exception was caught " << _ex.what(); + } + catch (...) + { + qDebug() << "uncaught exception "; + } + return false; } diff --git a/mix/MixApplication.h b/mix/MixApplication.h index ba344fcdc..fdc506268 100644 --- a/mix/MixApplication.h +++ b/mix/MixApplication.h @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ /** @file main.cpp * @author Yann yann@ethdev.com @@ -33,12 +33,12 @@ namespace mix class MixApplication: public QApplication { - Q_OBJECT + Q_OBJECT public: - MixApplication(int _argc, char* _argv[]); - virtual ~MixApplication() { } - virtual bool notify(QObject* _receiver, QEvent* _event); + MixApplication(int _argc, char* _argv[]); + virtual ~MixApplication() {} + virtual bool notify(QObject* _receiver, QEvent* _event); }; } diff --git a/mix/main.cpp b/mix/main.cpp index c0fc76bdd..537941290 100644 --- a/mix/main.cpp +++ b/mix/main.cpp @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + 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 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. + 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 . + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ /** @file main.cpp * @author Yann yann@ethdev.com @@ -30,11 +30,11 @@ using namespace dev::mix; int main(int _argc, char *_argv[]) { - QApplication app(_argc, _argv); - qmlRegisterType("CodeEditorExtensionManager", 1, 0, "CodeEditorExtensionManager"); - QQmlApplicationEngine* engine = new QQmlApplicationEngine(); - ApplicationCtx::setApplicationContext(engine); - QObject::connect(&app, SIGNAL(lastWindowClosed()), ApplicationCtx::getInstance(), SLOT(quitApplication())); //use to kill ApplicationContext and other stuff - engine->load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); - return app.exec(); + QApplication app(_argc, _argv); + qmlRegisterType("CodeEditorExtensionManager", 1, 0, "CodeEditorExtensionManager"); + QQmlApplicationEngine* engine = new QQmlApplicationEngine(); + ApplicationCtx::setApplicationContext(engine); + QObject::connect(&app, SIGNAL(lastWindowClosed()), ApplicationCtx::getInstance(), SLOT(quitApplication())); //use to kill ApplicationContext and other stuff + engine->load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); + return app.exec(); } diff --git a/mix/qml/BasicContent.qml b/mix/qml/BasicContent.qml index 8e450dabf..6d5020d3d 100644 --- a/mix/qml/BasicContent.qml +++ b/mix/qml/BasicContent.qml @@ -2,6 +2,7 @@ import QtQuick 2.3 import QtQuick.Controls 1.2 Rectangle { + anchors.fill: parent width: parent.width height: parent.height @@ -19,7 +20,7 @@ Rectangle { id: status } - TextArea{ + TextArea { readOnly: true anchors.left: parent.left anchors.leftMargin: 10