Verified Commit 5e1633a8 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

[applets/batterymonitor] PowerManagement: Shuffle inhibition hints around

Technically it doesn't matter, since they are mutually exclusive anyway.
But for the upcoming refactoring it will be a bit easier to see what's
going on if they'll be close to each other.
parent fbcef6d7
......@@ -61,22 +61,6 @@ ColumnLayout {
text: i18nc("Minimize the length of this string as much as possible", "Your notebook is configured not to sleep when closing the lid while an external monitor is connected.")
}
// UI to display when there is only one inhibition
InhibitionHint {
// Don't need to show the inhibitions when power management
// isn't enabled anyway
visible: inhibitions.length === 1 && !root.disabled
Layout.fillWidth: true
iconSource: (inhibitions.length === 1) ? inhibitions[0].Icon : ""
text: (inhibitions.length === 1) ?
inhibitions[0].Reason ?
i18n("%1 is currently blocking sleep and screen locking (%2)", inhibitions[0].Name, inhibitions[0].Reason)
:
i18n("%1 is currently blocking sleep and screen locking (unknown reason)", inhibitions[0].Name)
:
""
}
// UI to display when there is more than one inhibition
PlasmaComponents3.Label {
id: inhibitionExplanation
......@@ -106,5 +90,21 @@ ColumnLayout {
: i18nc("Application name: reason for preventing sleep and screen locking", "%1: unknown reason", inhibitions[index].Name)
}
}
// UI to display when there is only one inhibition
InhibitionHint {
Layout.fillWidth: true
// Don't need to show the inhibitions when power management
// is manually disabled anyway
visible: inhibitions.length === 1 && !root.disabled
iconSource: (inhibitions.length === 1) ? inhibitions[0].Icon : ""
text: (inhibitions.length === 1) ?
inhibitions[0].Reason ?
i18n("%1 is currently blocking sleep and screen locking (%2)", inhibitions[0].Name, inhibitions[0].Reason)
:
i18n("%1 is currently blocking sleep and screen locking (unknown reason)", inhibitions[0].Name)
:
""
}
}
}
Supports Markdown
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