mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remember power save mode between restarts
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.ide;
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.util.messages.MessageBus;
|
||||
import com.intellij.util.messages.Topic;
|
||||
@@ -23,7 +24,8 @@ import com.intellij.util.messages.Topic;
|
||||
* @author yole
|
||||
*/
|
||||
public class PowerSaveMode {
|
||||
private boolean myEnabled = false;
|
||||
private static final String POWER_SAVE_MODE = "power.save.mode";
|
||||
private boolean myEnabled = PropertiesComponent.getInstance().getBoolean(POWER_SAVE_MODE, false);
|
||||
private final MessageBus myBus;
|
||||
|
||||
public PowerSaveMode(MessageBus bus) {
|
||||
@@ -39,6 +41,7 @@ public class PowerSaveMode {
|
||||
if (instance.myEnabled != value) {
|
||||
instance.myEnabled = value;
|
||||
instance.myBus.syncPublisher(TOPIC).powerSaveStateChanged();
|
||||
PropertiesComponent.getInstance().setValue(POWER_SAVE_MODE, String.valueOf(value));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user