Browse Source

small changes

cl-refactor
yann300 10 years ago
parent
commit
e0fa87db76
  1. 50
      mix/qml/LogsPane.qml
  2. 20
      mix/qml/MainContent.qml
  3. 70
      mix/qml/StatusPane.qml
  4. 16
      mix/qml/WebPreview.qml

50
mix/qml/LogsPane.qml

@ -19,6 +19,7 @@ Rectangle
border.color: "#808080"
border.width: 1
ColumnLayout {
z: 2
height: parent.height
width: parent.width
spacing: 0
@ -152,6 +153,31 @@ Rectangle
}
}
ToolButton {
id: compilationButton
checkable: true
height: 30
anchors.verticalCenter: parent.verticalCenter
checked: false
onCheckedChanged: {
proxyModel.toogleFilter("compilation")
}
tooltip: qsTr("Compilation")
style:
ButtonStyle {
label:
Item {
DefaultLabel {
font.family: "sans serif"
font.pointSize: Style.absoluteSize(-3)
color: "#5391d8"
anchors.centerIn: parent
text: qsTr("Compilation")
}
}
}
}
DefaultTextField
{
id: searchBox
@ -160,6 +186,7 @@ Rectangle
width: 200
font.family: "sans serif"
font.pointSize: Style.absoluteSize(-3)
font.italic: true
onTextChanged: {
proxyModel.search(text);
}
@ -168,7 +195,6 @@ Rectangle
ListModel {
id: logsModel
}
TableView {
@ -180,7 +206,8 @@ Rectangle
onDoubleClicked:
{
var log = logsModel.get((logsTable.currentRow));
appContext.toClipboard(log.type + " " + log.level + " " + log.date + " " + log.content);
if (log)
appContext.toClipboard(log.type + "\t" + log.level + "\t" + log.date + "\t" + log.content);
}
model: SortFilterProxyModel {
@ -216,9 +243,9 @@ Rectangle
function regEx(_value)
{
console.log("(?:" + roles.join('|') + ")");
return "(?:" + roles.join('|') + ")";
}
filterType: "(?:javascript|run|state)"
filterContent: ""
filterSyntax: SortFilterProxyModel.RegExp
@ -235,7 +262,7 @@ Rectangle
{
role: "type"
title: qsTr("type")
width: 100
width: 80
delegate: itemDelegate
}
TableViewColumn
@ -245,6 +272,14 @@ Rectangle
width: 700
delegate: itemDelegate
}
rowDelegate: Item {
Rectangle {
width: logsTable.width - 4
height: 17
color: styleData.alternate ? "transparent" : "#f0f0f0"
}
}
}
Component {
@ -253,7 +288,12 @@ Rectangle
text: styleData.value;
font.family: "sans serif"
font.pointSize: Style.absoluteSize(-1)
color: "#808080"
color: {
if (proxyModel.get(styleData.row).level === "error")
return "red"
else
return "#808080"
}
}
}
}

20
mix/qml/MainContent.qml

@ -35,8 +35,8 @@ Rectangle {
onCompilationComplete: {
if (firstCompile) {
firstCompile = false;
if (runOnProjectLoad)
startQuickDebugging();
if (runOnProjectLoad)
startQuickDebugging();
}
}
}
@ -102,7 +102,6 @@ Rectangle {
}
CodeEditorExtensionManager {
//headerView: headerPaneTabs;
}
Settings {
@ -116,6 +115,7 @@ Rectangle {
ColumnLayout
{
id: mainColumn
anchors.fill: parent
spacing: 0
Rectangle {
@ -141,7 +141,7 @@ Rectangle {
}
}
Rectangle{
Rectangle {
Layout.fillWidth: true
height: 1
color: "#8c8c8c"
@ -162,9 +162,9 @@ Rectangle {
{
anchors.fill: parent
handleDelegate: Rectangle {
width: 1
height: 1
color: "#8c8c8c"
width: 1
height: 1
color: "#8c8c8c"
}
orientation: Qt.Horizontal
@ -174,16 +174,18 @@ Rectangle {
Layout.minimumWidth: 250
Layout.fillHeight: true
}
Rectangle {
id: contentView
Layout.fillHeight: true
Layout.fillWidth: true
SplitView {
handleDelegate: Rectangle {
handleDelegate: Rectangle {
width: 1
height: 1
color: "#8c8c8c"
}
}
id: codeWebSplitter
anchors.fill: parent
orientation: Qt.Vertical

70
mix/qml/StatusPane.qml

@ -24,6 +24,7 @@ Rectangle {
var errorInfo = ErrorLocationFormater.extractErrorInfo(message, true);
status.text = errorInfo.errorLocation + " " + errorInfo.errorDetail;
debugImg.state = "";
errorMessage(status.text, "Compilation");
}
debugRunActionIcon.enabled = codeModel.hasContract;
}
@ -51,17 +52,27 @@ Rectangle {
Connections {
target: webPreview
onJavaScriptErrorMessage: errorMessage(_content, "javascript")
onJavaScriptWarningMessage: warningMessage(_content, "javascript")
onJavaScriptInfoMessage: infoMessage(_content, "javascript")
onJavaScriptMessage:
{
if (_level === 0)
infoMessage(_content, "JavaScript")
else
{
var message = _sourceId.substring(_sourceId.lastIndexOf("/") + 1) + " - " + qsTr("line") + " " + _lineNb + " - " + _content;
if (_level === 1)
warningMessage(message, "JavaScript")
else if (_level === 2)
errorMessage(message, "JavaScript")
}
}
}
Connections {
target:clientModel
onRunStarted: infoMessage(qsTr("Running transactions..."), "run");
onRunFailed: errorMessage(format(_message), "run");
onRunComplete: infoMessage(qsTr("Run complete"), "run");
onNewBlock: infoMessage(qsTr("New block created"), "state");
onRunStarted: infoMessage(qsTr("Running transactions..."), "Run");
onRunFailed: errorMessage(format(_message), "Run");
onRunComplete: infoMessage(qsTr("Run complete"), "Run");
onNewBlock: infoMessage(qsTr("New block created"), "State");
function format(_message)
{
@ -72,16 +83,16 @@ Rectangle {
return _message;
var exceptionInfos = _message.match(/(?:tag_)(.+)/g);
for (var k in exceptionInfos)
formatted += " " + exceptionInfos[k].replace("*]", "").replace("tag_", "") + " - ";
formatted += " " + exceptionInfos[k].replace("*]", "").replace("tag_", "").replace("=", "");
return formatted;
}
}
Connections {
target:projectModel
onDeploymentStarted: infoMessage(qsTr("Running deployment..."), "deployment");
onDeploymentError: errorMessage(error, "deployment");
onDeploymentComplete: infoMessage(qsTr("Deployment complete"), "deployment");
onDeploymentStepChanged: infoMessage(message, "deployment");
onDeploymentStarted: infoMessage(qsTr("Running deployment..."), "Deployment");
onDeploymentError: errorMessage(error, "Deployment");
onDeploymentComplete: infoMessage(qsTr("Deployment complete"), "Deployment");
onDeploymentStepChanged: infoMessage(message, "Deployment");
}
Connections {
target: codeModel
@ -95,7 +106,7 @@ Rectangle {
Rectangle {
id: statusContainer
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenterw
anchors.verticalCenter: parent.verticalCenter
radius: 3
width: 500
height: 30
@ -171,6 +182,12 @@ Rectangle {
color: "transparent"
}
}
MouseArea {
anchors.fill: parent
onClicked: {
logsContainer.toggle();
}
}
}
Action {
@ -189,15 +206,17 @@ Rectangle {
}
else
{
statusContainer.state = "logsOpened";
statusContainer.state = "'logsOpened";
logsContainer.state = "opened";
logsContainer.focus = true;
forceActiveFocus();
}
}
id: logsContainer
width: 1000
height: 0
//anchors.topMargin:
anchors.topMargin: 10
anchors.top: statusContainer.bottom
anchors.horizontalCenter: parent.horizontalCenter
visible: false
@ -233,26 +252,6 @@ Rectangle {
}
}
Button
{
id: logslink
anchors.left: statusContainer.right
anchors.leftMargin: 9
anchors.verticalCenter: parent.verticalCenter
action: displayLogAction
iconSource: "qrc:/qml/img/search_filled.png"
}
Action {
id: displayLogAction
tooltip: qsTr("Display Log")
onTriggered: {
logsContainer.toggle();
//if (status.state === "error" && logPane.front().type === "run")
// mainContent.displayCompilationErrorIfAny();
}
}
Rectangle
{
color: "transparent"
@ -267,7 +266,6 @@ Rectangle {
{
color: "transparent"
anchors.fill: parent
Button
{
anchors.right: parent.right

16
mix/qml/WebPreview.qml

@ -12,9 +12,7 @@ Item {
id: webPreview
property string pendingPageUrl: ""
property bool initialized: false
signal javaScriptErrorMessage(string _content)
signal javaScriptWarningMessage(string _content)
signal javaScriptInfoMessage(string _content)
signal javaScriptMessage(var _level, string _sourceId, var _lineNb, string _content)
function setPreviewUrl(url) {
if (!initialized)
@ -201,7 +199,6 @@ Item {
{
setPreviewUrl(text);
}
focus: true
}
@ -219,7 +216,9 @@ Item {
anchors.verticalCenter: parent.verticalCenter
width: 21
height: 21
focus: true
}
CheckBox {
id: autoReloadOnSave
checked: true
@ -230,6 +229,7 @@ Item {
text: qsTr("Auto reload on save")
}
}
focus: true
}
}
}
@ -243,13 +243,7 @@ Item {
id: webView
experimental.settings.localContentCanAccessRemoteUrls: true
onJavaScriptConsoleMessage: {
var info = sourceID + ":" + lineNumber + ":" + message;
if (level === 0)
webPreview.javaScriptInfoMessage(info);
else if (level === 1)
webPreview.javaScriptErrorMessage(info);
else if (level === 2)
webPreview.javaScriptErrorMessage(info);
webPreview.javaScriptMessage(level, sourceID, lineNumber, message);
}
onLoadingChanged: {
if (!loading) {

Loading…
Cancel
Save