mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-08 12:13:31 -04:00
feat(ipc): add powerprofile status & shared profile helpers
- Follow-up to PR #2515
This commit is contained in:
@@ -21,14 +21,13 @@ DankPopout {
|
||||
}
|
||||
|
||||
function setProfile(profile) {
|
||||
if (typeof PowerProfiles === "undefined") {
|
||||
ToastService.showError(I18n.tr("power-profiles-daemon not available"));
|
||||
if (PowerProfileWatcher.applyProfile(profile))
|
||||
return;
|
||||
}
|
||||
PowerProfiles.profile = profile;
|
||||
if (PowerProfiles.profile !== profile) {
|
||||
|
||||
if (!PowerProfileWatcher.available)
|
||||
ToastService.showError(I18n.tr("power-profiles-daemon not available"));
|
||||
else
|
||||
ToastService.showError(I18n.tr("Failed to set power profile"));
|
||||
}
|
||||
}
|
||||
|
||||
popupWidth: 400
|
||||
@@ -555,7 +554,7 @@ DankPopout {
|
||||
DankButtonGroup {
|
||||
id: profileButtonGroup
|
||||
|
||||
property var profileModel: (typeof PowerProfiles !== "undefined") ? [PowerProfile.PowerSaver, PowerProfile.Balanced].concat(PowerProfiles.hasPerformanceProfile ? [PowerProfile.Performance] : []) : [PowerProfile.PowerSaver, PowerProfile.Balanced, PowerProfile.Performance]
|
||||
property var profileModel: PowerProfileWatcher.availableProfiles
|
||||
property int currentProfileIndex: {
|
||||
if (typeof PowerProfiles === "undefined")
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user