Browse Source

Warn when roasting from a window that already contains prior roasting data.

Neal Wilson 7 years ago
parent
commit
a419dd6c6f
1 changed files with 10 additions and 2 deletions
  1. 10
    2
      config/Windows/newbatch.xml

+ 10
- 2
config/Windows/newbatch.xml View File

393
                 }
393
                 }
394
                 return true;
394
                 return true;
395
             }
395
             }
396
+            var duration = findChildObject(this, 'duration');
397
+            var timefield = findChildObject(this, 'time');
396
             profilebutton.clicked.connect(function() {
398
             profilebutton.clicked.connect(function() {
397
                 var proceed = false;
399
                 var proceed = false;
398
                 if(validateCapacity()) {
400
                 if(validateCapacity()) {
401
                     proceed = displayWarning(TTR("batchWindow", "Suspicious Input"),
403
                     proceed = displayWarning(TTR("batchWindow", "Suspicious Input"),
402
                     TTR("batchWindow", "Entered green coffee weight exceeds maximum batch size. Continue?"));
404
                     TTR("batchWindow", "Entered green coffee weight exceeds maximum batch size. Continue?"));
403
                 }
405
                 }
406
+                if((proceed == true) && (timefield.text.length != 0)) {
407
+                    proceed = displayWarning(TTR("batchWindow", "Batch Already Roasted"),
408
+                    TTR("batchWindow", "Roasting data already exists for this batch. Roasting another batch from this window will overwrite existing data. Are you sure you want to do this?"));
409
+                }
404
                 if(proceed) {
410
                 if(proceed) {
405
                     doLoadProfile();
411
                     doLoadProfile();
406
                 }
412
                 }
484
                     proceed = displayWarning(TTR("batchWindow", "Suspicious Input"),
490
                     proceed = displayWarning(TTR("batchWindow", "Suspicious Input"),
485
                     TTR("batchWindow", "Entered green coffee weight exceeds maximum batch size. Continue?"));
491
                     TTR("batchWindow", "Entered green coffee weight exceeds maximum batch size. Continue?"));
486
                 }
492
                 }
493
+                if((proceed == true) && (timefield.text.length != 0)) {
494
+                    proceed = displayWarning(TTR("batchWindow", "Batch Already Roasted"),
495
+                    TTR("batchWindow", "Roasting data already exists for this batch. Roasting another batch from this window will overwrite existing data. Are you sure you want to do this?"));
496
+                }
487
                 if(proceed) {
497
                 if(proceed) {
488
                     doNoProfile();
498
                     doNoProfile();
489
                 }
499
                 }
495
                 navigationwindow.loggingWindow.activateWindow();
505
                 navigationwindow.loggingWindow.activateWindow();
496
             }
506
             }
497
             var submitbutton = findChildObject(this, 'submit');
507
             var submitbutton = findChildObject(this, 'submit');
498
-            var timefield = findChildObject(this, 'time');
499
             var notes = findChildObject(this, 'annotation');
508
             var notes = findChildObject(this, 'annotation');
500
-            var duration = findChildObject(this, 'duration');
501
             var approval = findChildObject(this, 'approval');
509
             var approval = findChildObject(this, 'approval');
502
             approval.checked = true;
510
             approval.checked = true;
503
             var target = findChildObject(this, 'target');
511
             var target = findChildObject(this, 'target');

Loading…
Cancel
Save