Added Suspend session policy

This commit is contained in:
Valentin Sokolov 2023-08-10 17:22:48 +04:00
parent 5a542e1fc3
commit 8c98343166
3 changed files with 237 additions and 48 deletions

View File

@ -783,96 +783,96 @@
<supportedOn ref="system:SUPPORTED_AltP10" />
<elements>
<enum id="kde-dimdisplay-ac_setter" valueName="powermanagementprofilesrc.DisplayAC" required="true">
<item displayName="$(string.kde-dimmer-1)">
<item displayName="$(string.kde-timer-1)">
<value>
<string>{"AC][DimDisplay":{"idleTime":"60000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-2)">
<item displayName="$(string.kde-timer-2)">
<value>
<string>{"AC][DimDisplay":{"idleTime":"120000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-5)">
<item displayName="$(string.kde-timer-5)">
<value>
<string>{"AC][DimDisplay":{"idleTime":"300000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-10)">
<item displayName="$(string.kde-timer-10)">
<value>
<string>{"AC][DimDisplay":{"idleTime":"600000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-30)">
<item displayName="$(string.kde-timer-30)">
<value>
<string>{"AC][DimDisplay":{"idleTime":"1800000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-60)">
<item displayName="$(string.kde-timer-60)">
<value>
<string>{"AC][DimDisplay":{"idleTime":"3600000"}}</string>
</value>
</item>
</enum>
<enum id="kde-dimdisplay-battery_setter" valueName="powermanagementprofilesrc.DisplayBattery" required="true">
<item displayName="$(string.kde-dimmer-1)">
<item displayName="$(string.kde-timer-1)">
<value>
<string>{"Battery][DimDisplay":{"idleTime":"60000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-2)">
<item displayName="$(string.kde-timer-2)">
<value>
<string>{"Battery][DimDisplay":{"idleTime":"120000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-5)">
<item displayName="$(string.kde-timer-5)">
<value>
<string>{"Battery][DimDisplay":{"idleTime":"300000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-10)">
<item displayName="$(string.kde-timer-10)">
<value>
<string>{"Battery][DimDisplay":{"idleTime":"600000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-30)">
<item displayName="$(string.kde-timer-30)">
<value>
<string>{"Battery][DimDisplay":{"idleTime":"1800000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-60)">
<item displayName="$(string.kde-timer-60)">
<value>
<string>{"Battery][DimDisplay":{"idleTime":"3600000"}}</string>
</value>
</item>
</enum>
<enum id="kde-dimdisplay-lowbattery_setter" valueName="powermanagementprofilesrc.DisplayLowBattery" required="true">
<item displayName="$(string.kde-dimmer-1)">
<item displayName="$(string.kde-timer-1)">
<value>
<string>{"LowBattery][DimDisplay":{"idleTime":"60000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-2)">
<item displayName="$(string.kde-timer-2)">
<value>
<string>{"LowBattery][DimDisplay":{"idleTime":"120000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-5)">
<item displayName="$(string.kde-timer-5)">
<value>
<string>{"LowBattery][DimDisplay":{"idleTime":"300000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-10)">
<item displayName="$(string.kde-timer-10)">
<value>
<string>{"LowBattery][DimDisplay":{"idleTime":"600000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-30)">
<item displayName="$(string.kde-timer-30)">
<value>
<string>{"LowBattery][DimDisplay":{"idleTime":"1800000"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-60)">
<item displayName="$(string.kde-timer-60)">
<value>
<string>{"LowBattery][DimDisplay":{"idleTime":"3600000"}}</string>
</value>
@ -912,96 +912,96 @@
<supportedOn ref="system:SUPPORTED_AltP10" />
<elements>
<enum id="kde-dimmonitor-ac_setter" valueName="powermanagementprofilesrc.MonitorAC" required="true">
<item displayName="$(string.kde-dimmer-1)">
<item displayName="$(string.kde-timer-1)">
<value>
<string>{"AC][DPMSControl":{"idleTime":"60"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-2)">
<item displayName="$(string.kde-timer-2)">
<value>
<string>{"AC][DPMSControl":{"idleTime":"120"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-5)">
<item displayName="$(string.kde-timer-5)">
<value>
<string>{"AC][DPMSControl":{"idleTime":"300"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-10)">
<item displayName="$(string.kde-timer-10)">
<value>
<string>{"AC][DPMSControl":{"idleTime":"600"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-30)">
<item displayName="$(string.kde-timer-30)">
<value>
<string>{"AC][DPMSControl":{"idleTime":"1800"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-60)">
<item displayName="$(string.kde-timer-60)">
<value>
<string>{"AC][DPMSControl":{"idleTime":"3600"}}</string>
</value>
</item>
</enum>
<enum id="kde-dimmonitor-battery_setter" valueName="powermanagementprofilesrc.MonitorBattery" required="true">
<item displayName="$(string.kde-dimmer-1)">
<item displayName="$(string.kde-timer-1)">
<value>
<string>{"Battery][DPMSControl":{"idleTime":"60"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-2)">
<item displayName="$(string.kde-timer-2)">
<value>
<string>{"Battery][DPMSControl":{"idleTime":"120"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-5)">
<item displayName="$(string.kde-timer-5)">
<value>
<string>{"Battery][DPMSControl":{"idleTime":"300"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-10)">
<item displayName="$(string.kde-timer-10)">
<value>
<string>{"Battery][DPMSControl":{"idleTime":"600"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-30)">
<item displayName="$(string.kde-timer-30)">
<value>
<string>{"Battery][DPMSControl":{"idleTime":"1800"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-60)">
<item displayName="$(string.kde-timer-60)">
<value>
<string>{"Battery][DPMSControl":{"idleTime":"3600"}}</string>
</value>
</item>
</enum>
<enum id="kde-dimmonitor-lowbattery_setter" valueName="powermanagementprofilesrc.MonitorLowBattery" required="true">
<item displayName="$(string.kde-dimmer-1)">
<item displayName="$(string.kde-timer-1)">
<value>
<string>{"LowBattery][DPMSControl":{"idleTime":"60"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-2)">
<item displayName="$(string.kde-timer-2)">
<value>
<string>{"LowBattery][DPMSControl":{"idleTime":"120"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-5)">
<item displayName="$(string.kde-timer-5)">
<value>
<string>{"LowBattery][DPMSControl":{"idleTime":"300"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-10)">
<item displayName="$(string.kde-timer-10)">
<value>
<string>{"LowBattery][DPMSControl":{"idleTime":"600"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-30)">
<item displayName="$(string.kde-timer-30)">
<value>
<string>{"LowBattery][DPMSControl":{"idleTime":"1800"}}</string>
</value>
</item>
<item displayName="$(string.kde-dimmer-60)">
<item displayName="$(string.kde-timer-60)">
<value>
<string>{"LowBattery][DPMSControl":{"idleTime":"3600"}}</string>
</value>
@ -1033,6 +1033,135 @@
</boolean>
</elements>
</policy>
<policy name="kde-stopsessiontime" class="User" displayName="$(string.kde-stopsessiontime)"
explainText="$(string.kde-stopsessiontime_help)"
key="Software\BaseALT\Policies\KDE"
presentation="$(presentation.kde-stopsessiontime-user-pr)">
<parentCategory ref="system:ALT_PowerManagement_KDE" />
<supportedOn ref="system:SUPPORTED_AltP10" />
<elements>
<enum id="kde-stopsessiontime-ac_setter" valueName="powermanagementprofilesrc.StopSessionTimeAC" required="true">
<item displayName="$(string.kde-timer-1)">
<value>
<string>{"AC][SuspendSession":{"idleTime":"60000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-2)">
<value>
<string>{"AC][SuspendSession":{"idleTime":"120000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-5)">
<value>
<string>{"AC][SuspendSession":{"idleTime":"300000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-10)">
<value>
<string>{"AC][SuspendSession":{"idleTime":"600000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-30)">
<value>
<string>{"AC][SuspendSession":{"idleTime":"1800000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-60)">
<value>
<string>{"AC][SuspendSession":{"idleTime":"3600000"}}</string>
</value>
</item>
</enum>
<enum id="kde-stopsessiontime-battery_setter" valueName="powermanagementprofilesrc.StopSessionTimeBattery" required="true">
<item displayName="$(string.kde-timer-1)">
<value>
<string>{"Battery][SuspendSession":{"idleTime":"60000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-2)">
<value>
<string>{"Battery][SuspendSession":{"idleTime":"120000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-5)">
<value>
<string>{"Battery][SuspendSession":{"idleTime":"300000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-10)">
<value>
<string>{"Battery][SuspendSession":{"idleTime":"600000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-30)">
<value>
<string>{"Battery][SuspendSession":{"idleTime":"1800000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-60)">
<value>
<string>{"Battery][SuspendSession":{"idleTime":"3600000"}}</string>
</value>
</item>
</enum>
<enum id="kde-stopsessiontime-lowbattery_setter" valueName="powermanagementprofilesrc.StopSessionTimeLowBattery" required="true">
<item displayName="$(string.kde-timer-1)">
<value>
<string>{"LowBattery][SuspendSession":{"idleTime":"60000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-2)">
<value>
<string>{"LowBattery][SuspendSession":{"idleTime":"120000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-5)">
<value>
<string>{"LowBattery][SuspendSession":{"idleTime":"300000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-10)">
<value>
<string>{"LowBattery][SuspendSession":{"idleTime":"600000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-30)">
<value>
<string>{"LowBattery][SuspendSession":{"idleTime":"1800000"}}</string>
</value>
</item>
<item displayName="$(string.kde-timer-60)">
<value>
<string>{"LowBattery][SuspendSession":{"idleTime":"3600000"}}</string>
</value>
</item>
</enum>
<boolean id="kde-stopsessiontime-ac_blocker" key="Software\BaseALT\Policies\KDELocks" valueName="powermanagementprofilesrc.StopSessionTimeAC">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
<boolean id="kde-stopsessiontime-battery_blocker" key="Software\BaseALT\Policies\KDELocks" valueName="powermanagementprofilesrc.StopSessionTimeBattery">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
<boolean id="kde-stopsessiontime-lowbattery_blocker" key="Software\BaseALT\Policies\KDELocks" valueName="powermanagementprofilesrc.StopSessionTimeLowBattery">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
</elements>
</policy>
<policy name="kde-wallpaper" class="User" displayName="$(string.kde-wallpaper)"
explainText="$(string.kde-wallpaper_help)"
presentation="$(presentation.kde-wallpaper-user-pr)"

View File

@ -185,6 +185,25 @@ The time to turn off the monitor in AC mode, on battery mode, and when the batte
- 30 minutes;
- 60 minutes.
</string>
<string id="kde-stopsessiontime">Suspending a session</string>
<string id="kde-stopsessiontime_help">This policy allows you to configure the time before the session is suspended under different power modes: on battery power, on mains power, and on low battery.
The time to pause session on plugged in, on battery, and low battery has the following possible values:
- 1 minute;
- 2 minutes;
- 5 minutes;
- 10 minutes;
- 30 minutes;
- 60 minutes.
</string>
@ -361,12 +380,12 @@ If the policy is disabled, clicking on the file or folder will highlight it.
<string id="kde-britness-80">80</string>
<string id="kde-britness-100">100</string>
<string id="kde-dimmer-1">1 минута</string>
<string id="kde-dimmer-2">2 минуты</string>
<string id="kde-dimmer-5">5 минут</string>
<string id="kde-dimmer-10">10 минут</string>
<string id="kde-dimmer-30">30 минут</string>
<string id="kde-dimmer-60">60 минут</string>
<string id="kde-timer-1">1 минута</string>
<string id="kde-timer-2">2 минуты</string>
<string id="kde-timer-5">5 минут</string>
<string id="kde-timer-10">10 минут</string>
<string id="kde-timer-30">30 минут</string>
<string id="kde-timer-60">60 минут</string>
</stringTable>
<presentationTable>
@ -502,6 +521,17 @@ If the policy is disabled, clicking on the file or folder will highlight it.
<checkBox refId="kde-dimmonitor-lowbattery_blocker">Block</checkBox>
<text>Blocking changes to this setting by the user. After restarting the device, the user's changes to the settings are not saved.</text>
</presentation>
<presentation id="kde-stopsessiontime-user-pr">
<dropdownList noSort="true" defaultItem="0" refId="kde-stopsessiontime-ac_setter">Time to suspend session on mains power:</dropdownList>
<checkBox refId="kde-stopsessiontime-ac_blocker">Block</checkBox>
<text>Blocking changes to this setting by the user. After restarting the device, the user's changes to the settings are not saved.</text>
<dropdownList noSort="true" defaultItem="0" refId="kde-stopsessiontime-battery_setter">Time to suspend session on battery power:</dropdownList>
<checkBox refId="kde-stopsessiontime-battery_blocker">Block</checkBox>
<text>Blocking changes to this setting by the user. After restarting the device, the user's changes to the settings are not saved.</text>
<dropdownList noSort="true" defaultItem="0" refId="kde-stopsessiontime-lowbattery_setter">Time to suspend session when battery is low:</dropdownList>
<checkBox refId="kde-stopsessiontime-lowbattery_blocker">Block</checkBox>
<text>Blocking changes to this setting by the user. After restarting the device, the user's changes to the settings are not saved.</text>
</presentation>
</presentationTable>
</resources>
</policyDefinitionResources>

View File

@ -185,6 +185,25 @@
- 30 минут;
- 60 минут.
</string>
<string id="kde-stopsessiontime">Приостановка сеанса</string>
<string id="kde-stopsessiontime_help">Данная политика позволяет настраивать время до приостановки сеанса при разных режимах электропитания: при питании от батареи, от сети, при низком уровне заряда.
Время до приостановка сеанса в режиме электропитания от сети, от батареи и при низком заряде батареи имеет следующие возможные значения:
- 1 минута;
- 2 минуты;
- 5 минут;
- 10 минут;
- 30 минут;
- 60 минут.
</string>
@ -361,12 +380,12 @@
<string id="kde-britness-80">80</string>
<string id="kde-britness-100">100</string>
<string id="kde-dimmer-1">1 минута</string>
<string id="kde-dimmer-2">2 минуты</string>
<string id="kde-dimmer-5">5 минут</string>
<string id="kde-dimmer-10">10 минут</string>
<string id="kde-dimmer-30">30 минут</string>
<string id="kde-dimmer-60">60 минут</string>
<string id="kde-timer-1">1 минута</string>
<string id="kde-timer-2">2 минуты</string>
<string id="kde-timer-5">5 минут</string>
<string id="kde-timer-10">10 минут</string>
<string id="kde-timer-30">30 минут</string>
<string id="kde-timer-60">60 минут</string>
</stringTable>
<presentationTable>
@ -502,6 +521,17 @@
<checkBox refId="kde-dimmonitor-lowbattery_blocker">Блокировать</checkBox>
<text>Блокировка изменений данной настройки пользователем. После перезагрузки устройства внесённые пользователем изменения настройки не сохраняются.</text>
</presentation>
<presentation id="kde-stopsessiontime-user-pr">
<dropdownList noSort="true" defaultItem="0" refId="kde-stopsessiontime-ac_setter">Время до приостановки сеанса при питании от сети:</dropdownList>
<checkBox refId="kde-stopsessiontime-ac_blocker">Блокировать</checkBox>
<text>Блокировка изменений данной настройки пользователем. После перезагрузки устройства внесённые пользователем изменения настройки не сохраняются.</text>
<dropdownList noSort="true" defaultItem="0" refId="kde-stopsessiontime-battery_setter">Время до приостановки сеанса при питании от батареи:</dropdownList>
<checkBox refId="kde-stopsessiontime-battery_blocker">Блокировать</checkBox>
<text>Блокировка изменений данной настройки пользователем. После перезагрузки устройства внесённые пользователем изменения настройки не сохраняются.</text>
<dropdownList noSort="true" defaultItem="0" refId="kde-stopsessiontime-lowbattery_setter">Время до приостановки сеанса при низком заряде батареи:</dropdownList>
<checkBox refId="kde-stopsessiontime-lowbattery_blocker">Блокировать</checkBox>
<text>Блокировка изменений данной настройки пользователем. После перезагрузки устройства внесённые пользователем изменения настройки не сохраняются.</text>
</presentation>
</presentationTable>
</resources>
</policyDefinitionResources>