Commit 3f07a9e2 authored by rahulde's avatar rahulde

Added zero organs error message in build

parent 3f5088b7
import QtQuick 2.0
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
import QtQuick.Controls 1.2
import JSONReader 1.0
......@@ -86,6 +87,13 @@ RowLayout {
onError: console.log(msg)
}
MessageDialog {
id: errorDialog
title: "Error"
text: "Please drop at least one organ."
visible: false;
}
Rectangle {
width: parent.width / 2
height: parent.height
......@@ -207,6 +215,12 @@ RowLayout {
stack.push(buildSelection);
} else {
var droppedOrgans = _globalDataStore.getKeys().split(' ');
if (droppedOrgans[0] === '') {
errorDialog.visible = true;
return;
}
for (var organ in droppedOrgans) {
var dX = _globalDataStore.getOrgan(droppedOrgans[organ]).split(',')[0],
dY = _globalDataStore.getOrgan(droppedOrgans[organ]).split(',')[1],
......
import QtQuick 2.0
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1
import QtQuick.Controls 1.2
import JSONReader 1.0
......@@ -102,6 +102,13 @@ RowLayout {
onError: console.log(msg)
}
MessageDialog {
id: errorDialog
title: "Error"
text: "Please drop at least one organ."
visible: false;
}
Rectangle {
width: parent.width / 2
height: parent.height
......@@ -227,6 +234,12 @@ RowLayout {
stack.push(buildSelection);
} else {
var droppedOrgans = _globalDataStore.getKeys().split(' ');
if (droppedOrgans[0] === '') {
errorDialog.visible = true;
return;
}
for (var organ in droppedOrgans) {
var dX = _globalDataStore.getOrgan(droppedOrgans[organ]).split(',')[0],
dY = _globalDataStore.getOrgan(droppedOrgans[organ]).split(',')[1],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment