/* 
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Peter Hofer <ph@desktopbsd.net>
 *         (C) 2004, 2005
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#include "batterysettings.h"

#include <dbsdsettings.h>

bool BatterySettings::isLowWarningEnabled() {
	return readBoolEntry("/battery/lowWarningEnabled", true);
}

bool BatterySettings::isCriticalWarningEnabled() {
	return readBoolEntry("/battery/criticalWarningEnabled", true);
}

bool BatterySettings::setLowWarningEnabled(bool value) {
	return writeEntry("/battery/lowWarningEnabled", value);
}

bool BatterySettings::setCriticalWarningEnabled(bool value) {
	return writeEntry("/battery/criticalWarningEnabled", value);
}

int BatterySettings::getLowWarningAt() {
	return readNumEntry("/battery/lowWarningAt", 10);
}

int BatterySettings::getCriticalWarningAt() {
	return readNumEntry("/battery/criticalWarningAt", 5);
}

bool BatterySettings::setLowWarningAt(int value) {
	return writeEntry("/battery/lowWarningAt", value);
}

bool BatterySettings::setCriticalWarningAt(int value) {
	return writeEntry("/battery/criticalWarningAt", value);
}
