You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.8 KiB

10 years ago
/*
10 years ago
This file is part of cpp-ethereum.
10 years ago
10 years ago
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.
10 years ago
10 years ago
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.
10 years ago
10 years ago
You should have received a copy of the GNU General Public License
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
10 years ago
*/
/** @file ConstantCompilationControl.cpp
10 years ago
* @author Yann yann@ethdev.com
* @date 2014
* Ethereum IDE client.
*/
#include <QQmlContext>
10 years ago
#include <QQuickItem>
#include <QtCore/QFileInfo>
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QtCore/QtCore>
#include <QDebug>
#include "StatusPane.h"
#include "QContractDefinition.h"
#include "AppContext.h"
#include "CodeModel.h"
using namespace dev::mix;
10 years ago
StatusPane::StatusPane(AppContext* _context): Extension(_context, ExtensionDisplayBehavior::HeaderView)
10 years ago
{
connect(_context->codeModel(), &CodeModel::compilationComplete, this, &StatusPane::update);
_context->appEngine()->rootContext()->setContextProperty("statusPane", this);
10 years ago
}
QString StatusPane::contentUrl() const
10 years ago
{
return QStringLiteral("qrc:/qml/StatusPane.qml");
10 years ago
}
QString StatusPane::title() const
10 years ago
{
return QApplication::tr("compiler");
10 years ago
}
void StatusPane::start() const
10 years ago
{
}
CompilationResult* StatusPane::result() const
10 years ago
{
10 years ago
return m_ctx->codeModel()->code();
}
10 years ago
void StatusPane::update()
10 years ago
{
QObject* ctrl = m_view->findChild<QObject*>("statusPane", Qt::FindChildrenRecursively);
10 years ago
QMetaObject::invokeMethod(ctrl, "updateStatus");
10 years ago
}