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.

144 lines
3.0 KiB

10 years ago
import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
10 years ago
import "js/ErrorLocationFormater.js" as ErrorLocationFormater
import "."
10 years ago
Rectangle {
10 years ago
id: statusHeader
objectName: "statusPane"
10 years ago
function updateStatus()
10 years ago
{
if (statusPane.result.successful)
10 years ago
{
status.state = "";
status.text = qsTr("Compile without errors.");
logslink.visible = false;
debugImg.state = "active";
10 years ago
}
else
{
status.state = "error";
var errorInfo = ErrorLocationFormater.extractErrorInfo(statusPane.result.compilerMessage, true);
10 years ago
status.text = errorInfo.errorLocation + " " + errorInfo.errorDetail;
logslink.visible = true;
debugImg.state = "";
10 years ago
}
debugRunActionIcon.enabled = statusPane.result.successful;
10 years ago
}
10 years ago
10 years ago
function infoMessage(text)
{
status.state = "";
status.text = text
logslink.visible = false;
}
Connections {
target:clientModel
onRunStarted: infoMessage(qsTr("Running transactions.."));
onRunFailed: infoMessage(qsTr("Error running transactions"));
onRunComplete: infoMessage(qsTr("Run complete"));
onNewBlock: infoMessage(qsTr("New block created"));
}
color: "transparent"
10 years ago
anchors.fill: parent
10 years ago
Rectangle {
id: statusContainer
10 years ago
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
radius: 3
width: 500
height: 30
color: "#fcfbfc"
RowLayout {
10 years ago
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
spacing: 5
Text {
font.pointSize: StatusPaneStyle.general.statusFontSize
10 years ago
height: 9
font.family: "sans serif"
objectName: "status"
id: status
states:[
State {
name: "error"
PropertyChanges {
target: status
color: "red"
}
PropertyChanges {
target: statusContainer
color: "#fffcd5"
}
10 years ago
}
]
}
Text {
visible: false
font.pointSize: StatusPaneStyle.general.logLinkFontSize
10 years ago
height: 9
text: qsTr("See Log.")
10 years ago
font.family: "Monospace"
objectName: "status"
id: logslink
color: "#8c8a74"
MouseArea {
anchors.fill: parent
onClicked: {
mainContent.ensureRightView();
}
}
}
}
10 years ago
}
10 years ago
Rectangle
{
color: "transparent"
width: 100
height: parent.height
anchors.top: statusHeader.top
anchors.right: statusHeader.right
RowLayout
{
anchors.fill: parent
Rectangle {
color: "transparent"
anchors.fill: parent
Button
{
anchors.right: parent.right
anchors.rightMargin: 9
10 years ago
anchors.verticalCenter: parent.verticalCenter
id: debugImg
iconSource: "qrc:/qml/img/bugiconinactive.png"
action: debugRunActionIcon
states: [
State{
name: "active"
PropertyChanges { target: debugImg; iconSource: "qrc:/qml/img/bugiconactive.png"}
}
]
10 years ago
}
Action {
id: debugRunActionIcon
onTriggered: {
if (mainContent.rightViewIsVisible())
mainContent.hideRightView()
else
mainContent.startQuickDebugging();
10 years ago
}
enabled: false
}
}
}
}
10 years ago
}