Small clean-up of log warnings

Contributes to CL-1165
This commit is contained in:
Ian Paschal 2019-01-10 16:04:57 +01:00
parent 3377ed0e6e
commit 8d76bd8678
3 changed files with 12 additions and 16 deletions

View file

@ -197,9 +197,7 @@ Popup
}
function recalculateOrientation() {
// Flip direction if there is not enough screen space
var availableSpace
var targetPosition = target.mapToItem(monitorFrame, 0, 0)
// Stupid pop-up logic causes the pop-up to resize, so let's compute what it SHOULD be

View file

@ -21,15 +21,8 @@ Item
{
id: popUp
// If the pop-up won't fit in the window, flip it
direction:
{
var availableSpace = monitorFrame.height
var targetPosition = target.mapToItem(null, 0, 0)
var requiredSpace = targetPosition.y + target.height + contentWrapper.implicitHeight
console.log("available space", availableSpace - targetPosition.y + target.height)
return requiredSpace < availableSpace ? "top" : "bottom"
}
// Which way should the pop-up point? Default is up, but will flip when required
direction: "up"
// Use dark grey for info blurbs and white for context menus
color: "#ffffff" // TODO: Theme!
@ -60,7 +53,7 @@ Item
}
text: catalog.i18nc("@label", "Move to top");
visible: {
if (printJob && printJob.state == "queued" && !assigned) {
if (printJob && printJob.state == "queued" && !isAssigned(printJob)) {
if (OutputDevice && OutputDevice.queuedPrintJobs[0]) {
return OutputDevice.queuedPrintJobs[0].key != printJob.key;
}
@ -180,4 +173,10 @@ Item
function close() {
popUp.close()
}
function isAssigned(job) {
if (!job) {
return false;
}
return job.assignedPrinter ? true : false;
}
}

View file

@ -27,7 +27,7 @@ Item
ExpandableCard
{
enabled: printJob != null
borderColor: printJob.configurationChanges.length !== 0 ? "#f5a623" : "#CCCCCC" // TODO: Theme!
borderColor: printJob && printJob.configurationChanges.length !== 0 ? "#f5a623" : "#CCCCCC" // TODO: Theme!
headerItem: Row
{
height: 48 * screenScaleFactor // TODO: Theme!
@ -177,8 +177,7 @@ Item
id: printerConfiguration
anchors.verticalCenter: parent.verticalCenter
buildplate: "Glass"
configurations:
[
configurations: !base.printJob ? [null, null] : [
base.printJob.configuration.extruderConfigurations[0],
base.printJob.configuration.extruderConfigurations[1]
]
@ -241,7 +240,7 @@ Item
MonitorContextMenu
{
id: contextMenu
printJob: printer ? printer.activePrintJob : null
printJob: base.printJob ? base.printJob : null
target: contextMenuButton
}