diff options
Diffstat (limited to 'kcontrol/energy')
-rw-r--r-- | kcontrol/energy/Makefile.am | 18 | ||||
-rw-r--r-- | kcontrol/energy/configure.in.in | 1 | ||||
-rw-r--r-- | kcontrol/energy/energy.cpp | 442 | ||||
-rw-r--r-- | kcontrol/energy/energy.desktop | 242 | ||||
-rw-r--r-- | kcontrol/energy/energy.h | 68 | ||||
-rw-r--r-- | kcontrol/energy/pics/Makefile.am | 5 | ||||
-rw-r--r-- | kcontrol/energy/pics/energybig.png | bin | 0 -> 24161 bytes | |||
-rw-r--r-- | kcontrol/energy/pics/lo-energy.png | bin | 0 -> 1977 bytes |
8 files changed, 776 insertions, 0 deletions
diff --git a/kcontrol/energy/Makefile.am b/kcontrol/energy/Makefile.am new file mode 100644 index 000000000..ea6578582 --- /dev/null +++ b/kcontrol/energy/Makefile.am @@ -0,0 +1,18 @@ +SUBDIRS= . pics + +AM_CPPFLAGS = $(all_includes) $(DPMSINC) + +kde_module_LTLIBRARIES = kcm_energy.la + +kcm_energy_la_SOURCES = energy.cpp +kcm_energy_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined +kcm_energy_la_LIBADD = $(DPMSLIB) $(LIB_KDEUI) $(LIB_KIO) +METASOURCES = energy.moc + +noinst_HEADERS = energy.h + +messages: + $(XGETTEXT) *.cpp -o $(podir)/kcmenergy.pot + +energy_data_DATA = energy.desktop +energy_datadir = $(kde_appsdir)/.hidden diff --git a/kcontrol/energy/configure.in.in b/kcontrol/energy/configure.in.in new file mode 100644 index 000000000..7c9f247da --- /dev/null +++ b/kcontrol/energy/configure.in.in @@ -0,0 +1 @@ +AC_HAVE_DPMS() diff --git a/kcontrol/energy/energy.cpp b/kcontrol/energy/energy.cpp new file mode 100644 index 000000000..af3c4965d --- /dev/null +++ b/kcontrol/energy/energy.cpp @@ -0,0 +1,442 @@ +/* vi: ts=8 sts=4 sw=4 + * + * + * + * This file is part of the KDE project, module kcontrol. + * Copyright (C) 1999 Geert Jansen <[email protected]> + * + * You can Freely distribute this program under the GNU General Public + * License. See the file "COPYING" for the exact licensing terms. + * + * Based on kcontrol1 energy.cpp, Copyright (c) 1999 Tom Vijlbrief + */ + + +/* + * KDE Energy setup module. + */ + +#include <config.h> + +#if !defined(QT_CLEAN_NAMESPACE) +#define QT_CLEAN_NAMESPACE +#endif + +#include <qcheckbox.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qwhatsthis.h> + +#include <kconfig.h> +#include <kcursor.h> +#include <kdialog.h> +#include <kiconloader.h> +#include <klocale.h> +#include <knuminput.h> +#include <krun.h> +#include <kstandarddirs.h> +#include <kurllabel.h> + +#include <X11/X.h> +#include <X11/Xlib.h> +#include <X11/Xatom.h> +#include <X11/Xutil.h> +#include <X11/Xos.h> + +#include "energy.h" + + +#ifdef HAVE_DPMS +#include <X11/Xmd.h> +extern "C" { +#include <X11/extensions/dpms.h> +Status DPMSInfo ( Display *, CARD16 *, BOOL * ); +Bool DPMSCapable( Display * ); +int __kde_do_not_unload = 1; + +#ifndef HAVE_DPMSCAPABLE_PROTO +Bool DPMSCapable ( Display * ); +#endif + +#ifndef HAVE_DPMSINFO_PROTO +Status DPMSInfo ( Display *, CARD16 *, BOOL * ); +#endif +} + +#if defined(XIMStringConversionRetrival) || defined (__sun) || defined(__hpux) +extern "C" { +#endif + Bool DPMSQueryExtension(Display *, int *, int *); + Status DPMSEnable(Display *); + Status DPMSDisable(Display *); + Bool DPMSGetTimeouts(Display *, CARD16 *, CARD16 *, CARD16 *); + Bool DPMSSetTimeouts(Display *, CARD16, CARD16, CARD16); +#if defined(XIMStringConversionRetrival) || defined (__sun) || defined(__hpux) +} +#endif +#endif + +static const int DFLT_STANDBY = 0; +static const int DFLT_SUSPEND = 30; +static const int DFLT_OFF = 60; + + +/**** DLL Interface ****/ + +extern "C" { + + KDE_EXPORT KCModule *create_energy(QWidget *parent, char *) { + return new KEnergy(parent, "kcmenergy"); + } + + KDE_EXPORT void init_energy() { +#ifdef HAVE_DPMS + KConfig *cfg = new KConfig("kcmdisplayrc", true /*readonly*/, false /*no globals*/); + cfg->setGroup("DisplayEnergy"); + + Display *dpy = qt_xdisplay(); + CARD16 pre_configured_status; + BOOL pre_configured_enabled; + CARD16 pre_configured_standby; + CARD16 pre_configured_suspend; + CARD16 pre_configured_off; + bool enabled; + CARD16 standby; + CARD16 suspend; + CARD16 off; + int dummy; + /* query the running X server if DPMS is supported */ + if (DPMSQueryExtension(dpy, &dummy, &dummy) && DPMSCapable(dpy)) { + DPMSGetTimeouts(dpy, &pre_configured_standby, &pre_configured_suspend, &pre_configured_off); + DPMSInfo(dpy, &pre_configured_status, &pre_configured_enabled); + /* let the user override the settings */ + enabled = cfg->readBoolEntry("displayEnergySaving", pre_configured_enabled); + standby = cfg->readNumEntry("displayStandby", pre_configured_standby/60); + suspend = cfg->readNumEntry("displaySuspend", pre_configured_suspend/60); + off = cfg->readNumEntry("displayPowerOff", pre_configured_off/60); + } else { + /* provide our defauts */ + enabled = true; + standby = DFLT_STANDBY; + suspend = DFLT_SUSPEND; + off = DFLT_OFF; + } + + delete cfg; + + KEnergy::applySettings(enabled, standby, suspend, off); +#endif + } +} + +/**** KEnergy ****/ + +KEnergy::KEnergy(QWidget *parent, const char *name) + : KCModule(parent, name) +{ + m_bChanged = false; + m_bEnabled = false; + m_Standby = DFLT_STANDBY; + m_Suspend = DFLT_SUSPEND; + m_Off = DFLT_OFF; + m_bDPMS = false; + m_bMaintainSanity = true; + + setQuickHelp( i18n("<h1>Display Power Control</h1> If your display supports" + " power saving features, you can configure them using this module.<p>" + " There are three levels of power saving: standby, suspend, and off." + " The greater the level of power saving, the longer it takes for the" + " display to return to an active state.<p>" + " To wake up the display from a power saving mode, you can make a small" + " movement with the mouse, or press a key that is not likely to cause" + " any unintentional side-effects, for example, the \"Shift\" key.")); + +#ifdef HAVE_DPMS + int dummy; + m_bDPMS = DPMSQueryExtension(qt_xdisplay(), &dummy, &dummy); +#endif + + QVBoxLayout *top = new QVBoxLayout(this, 0, KDialog::spacingHint()); + QHBoxLayout *hbox = new QHBoxLayout(); + top->addLayout(hbox); + + QLabel *lbl; + if (m_bDPMS) { + m_pCBEnable= new QCheckBox(i18n("&Enable display power management" ), this); + connect(m_pCBEnable, SIGNAL(toggled(bool)), SLOT(slotChangeEnable(bool))); + hbox->addWidget(m_pCBEnable); + QWhatsThis::add( m_pCBEnable, i18n("Check this option to enable the" + " power saving features of your display.") ); + } else { + lbl = new QLabel(i18n("Your display does not support power saving."), this); + hbox->addWidget(lbl); + } + + KURLLabel *logo = new KURLLabel(this); + logo->setURL("http://www.energystar.gov"); + logo->setPixmap(QPixmap(locate("data", "kcontrol/pics/energybig.png"))); + logo->setTipText(i18n("Learn more about the Energy Star program")); + logo->setUseTips(true); +connect(logo, SIGNAL(leftClickedURL(const QString&)), SLOT(openURL(const QString &))); + + hbox->addStretch(); + hbox->addWidget(logo); + + // Sliders + m_pStandbySlider = new KIntNumInput(m_Standby, this); + m_pStandbySlider->setLabel(i18n("&Standby after:")); + m_pStandbySlider->setRange(0, 120, 10); + m_pStandbySlider->setSuffix(i18n(" min")); + m_pStandbySlider->setSpecialValueText(i18n("Disabled")); + connect(m_pStandbySlider, SIGNAL(valueChanged(int)), SLOT(slotChangeStandby(int))); + top->addWidget(m_pStandbySlider); + QWhatsThis::add( m_pStandbySlider, i18n("Choose the period of inactivity" + " after which the display should enter \"standby\" mode. This is the" + " first level of power saving.") ); + + m_pSuspendSlider = new KIntNumInput(m_pStandbySlider, m_Suspend, this); + m_pSuspendSlider->setLabel(i18n("S&uspend after:")); + m_pSuspendSlider->setRange(0, 120, 10); + m_pSuspendSlider->setSuffix(i18n(" min")); + m_pSuspendSlider->setSpecialValueText(i18n("Disabled")); + connect(m_pSuspendSlider, SIGNAL(valueChanged(int)), SLOT(slotChangeSuspend(int))); + top->addWidget(m_pSuspendSlider); + QWhatsThis::add( m_pSuspendSlider, i18n("Choose the period of inactivity" + " after which the display should enter \"suspend\" mode. This is the" + " second level of power saving, but may not be different from the first" + " level for some displays.") ); + + m_pOffSlider = new KIntNumInput(m_pSuspendSlider, m_Off, this); + m_pOffSlider->setLabel(i18n("&Power off after:")); + m_pOffSlider->setRange(0, 120, 10); + m_pOffSlider->setSuffix(i18n(" min")); + m_pOffSlider->setSpecialValueText(i18n("Disabled")); + connect(m_pOffSlider, SIGNAL(valueChanged(int)), SLOT(slotChangeOff(int))); + top->addWidget(m_pOffSlider); + QWhatsThis::add( m_pOffSlider, i18n("Choose the period of inactivity" + " after which the display should be powered off. This is the" + " greatest level of power saving that can be achieved while the" + " display is still physically turned on.") ); + + top->addStretch(); + + if (m_bDPMS) + setButtons( KCModule::Help | KCModule::Default | KCModule::Apply ); + else + setButtons( KCModule::Help ); + + m_pConfig = new KConfig("kcmdisplayrc", false /*readwrite*/, false /*no globals*/); + m_pConfig->setGroup("DisplayEnergy"); + + load(); +} + + +KEnergy::~KEnergy() +{ + delete m_pConfig; +} + + +void KEnergy::load() +{ + load( false ); +} + +void KEnergy::load( bool useDefaults ) +{ + m_pConfig->setReadDefaults( useDefaults ); + readSettings(); + showSettings(); + + emit changed( useDefaults ); +} + + +void KEnergy::save() +{ + writeSettings(); + applySettings(m_bEnabled, m_Standby, m_Suspend, m_Off); + + emit changed(false); +} + + +void KEnergy::defaults() +{ + load( true ); +} + + +void KEnergy::readSettings() +{ + m_bEnabled = m_pConfig->readBoolEntry("displayEnergySaving", false); + m_Standby = m_pConfig->readNumEntry("displayStandby", DFLT_STANDBY); + m_Suspend = m_pConfig->readNumEntry("displaySuspend", DFLT_SUSPEND); + m_Off = m_pConfig->readNumEntry("displayPowerOff", DFLT_OFF); + + m_StandbyDesired = m_Standby; + m_SuspendDesired = m_Suspend; + m_OffDesired = m_Off; + + m_bChanged = false; +} + + +void KEnergy::writeSettings() +{ + if (!m_bChanged) + return; + + m_pConfig->writeEntry( "displayEnergySaving", m_bEnabled); + m_pConfig->writeEntry("displayStandby", m_Standby); + m_pConfig->writeEntry("displaySuspend", m_Suspend); + m_pConfig->writeEntry("displayPowerOff", m_Off); + + m_pConfig->sync(); + m_bChanged = false; +} + + +void KEnergy::showSettings() +{ + m_bMaintainSanity = false; + + if (m_bDPMS) + m_pCBEnable->setChecked(m_bEnabled); + + m_pStandbySlider->setEnabled(m_bEnabled); + m_pStandbySlider->setValue(m_Standby); + m_pSuspendSlider->setEnabled(m_bEnabled); + m_pSuspendSlider->setValue(m_Suspend); + m_pOffSlider->setEnabled(m_bEnabled); + m_pOffSlider->setValue(m_Off); + + m_bMaintainSanity = true; +} + + +extern "C" { + int dropError(Display *, XErrorEvent *); + typedef int (*XErrFunc) (Display *, XErrorEvent *); +} + +int dropError(Display *, XErrorEvent *) +{ + return 0; +} + +/* static */ +void KEnergy::applySettings(bool enable, int standby, int suspend, int off) +{ +#ifdef HAVE_DPMS + XErrFunc defaultHandler; + defaultHandler = XSetErrorHandler(dropError); + + Display *dpy = qt_xdisplay(); + + int dummy; + bool hasDPMS = DPMSQueryExtension(dpy, &dummy, &dummy); + if (hasDPMS) { + if (enable) { + DPMSEnable(dpy); + DPMSSetTimeouts(dpy, 60*standby, 60*suspend, 60*off); + } else + DPMSDisable(dpy); + } else + qWarning("Server has no DPMS extension"); + + XFlush(dpy); + XSetErrorHandler(defaultHandler); +#else + /* keep gcc silent */ + if (enable | standby | suspend | off) + /* nothing */ ; +#endif +} + + +void KEnergy::slotChangeEnable(bool ena) +{ + m_bEnabled = ena; + m_bChanged = true; + + m_pStandbySlider->setEnabled(ena); + m_pSuspendSlider->setEnabled(ena); + m_pOffSlider->setEnabled(ena); + + emit changed(true); +} + + +void KEnergy::slotChangeStandby(int value) +{ + m_Standby = value; + + if ( m_bMaintainSanity ) { + m_bMaintainSanity = false; + m_StandbyDesired = value; + if ((m_Suspend > 0 && m_Standby > m_Suspend) || + (m_SuspendDesired && m_Standby >= m_SuspendDesired) ) + m_pSuspendSlider->setValue(m_Standby); + if ((m_Off > 0 && m_Standby > m_Off) || + (m_OffDesired && m_Standby >= m_OffDesired) ) + m_pOffSlider->setValue(m_Standby); + m_bMaintainSanity = true; + } + + m_bChanged = true; + emit changed(true); +} + + +void KEnergy::slotChangeSuspend(int value) +{ + m_Suspend = value; + + if ( m_bMaintainSanity ) { + m_bMaintainSanity = false; + m_SuspendDesired = value; + if (m_Suspend == 0 && m_StandbyDesired > 0) + m_pStandbySlider->setValue( m_StandbyDesired ); + else if (m_Suspend < m_Standby || m_Suspend <= m_StandbyDesired ) + m_pStandbySlider->setValue(m_Suspend); + if ((m_Off > 0 && m_Suspend > m_Off) || + (m_OffDesired && m_Suspend >= m_OffDesired) ) + m_pOffSlider->setValue(m_Suspend); + m_bMaintainSanity = true; + } + + m_bChanged = true; + emit changed(true); +} + + +void KEnergy::slotChangeOff(int value) +{ + m_Off = value; + + if ( m_bMaintainSanity ) { + m_bMaintainSanity = false; + m_OffDesired = value; + if (m_Off == 0 && m_StandbyDesired > 0) + m_pStandbySlider->setValue( m_StandbyDesired ); + else if (m_Off < m_Standby || m_Off <= m_StandbyDesired ) + m_pStandbySlider->setValue(m_Off); + if (m_Off == 0 && m_SuspendDesired > 0) + m_pSuspendSlider->setValue( m_SuspendDesired ); + else if (m_Off < m_Suspend || m_Off <= m_SuspendDesired ) + m_pSuspendSlider->setValue(m_Off); + m_bMaintainSanity = true; + } + + m_bChanged = true; + emit changed(true); +} + +void KEnergy::openURL(const QString &URL) +{ + new KRun(KURL( URL )); +} + +#include "energy.moc" diff --git a/kcontrol/energy/energy.desktop b/kcontrol/energy/energy.desktop new file mode 100644 index 000000000..bf856866a --- /dev/null +++ b/kcontrol/energy/energy.desktop @@ -0,0 +1,242 @@ +[Desktop Entry] +Exec=kcmshell energy +Icon=energy_star +DocPath=kcontrol/energy/index.html +Type=Application +X-KDE-Library=energy +X-KDE-Init=energy +X-KDE-ParentApp=kcontrol +X-KDE-Init-Phase=2 + +Name=Power Control +Name[af]=Krag Beheer +Name[ar]=التحكّم بالطّاقة +Name[az]=Güc İdarəsi +Name[be]=Кіраванне сілкаваннем +Name[bg]=Електрозахранване +Name[bn]=পাওয়ার নিয়ন্ত্রণ +Name[br]=Renadur ar gremm +Name[bs]=Ušteda energije +Name[ca]=Control d'energia +Name[cs]=Správa napájení +Name[csb]=Kòntrola sëłë +Name[cy]=Rheoli Pŵer +Name[da]=Strømstyring +Name[de]=Energiekontrolle +Name[el]=Έλεγχος ισχύος +Name[eo]=Elektrostirilo +Name[es]=Control de energía +Name[et]=Voolutarve +Name[eu]=Energia kontrola +Name[fa]=کنترل توان +Name[fi]=Virranhallinta +Name[fo]=Orkustýring +Name[fr]=Contrôle de l'énergie +Name[fy]=Enerzjybehear +Name[ga]=Rialú Cumhachta +Name[gl]=Control da Enerxéa +Name[he]=צריכת חשמל +Name[hi]=बिज़ली नियंत्रण +Name[hr]=Ušteda energije +Name[hsb]=Milina +Name[hu]=Energiakezelés +Name[id]=Kontrol Power +Name[is]=Orkustilling +Name[it]=Controllo energia +Name[ja]=電源管理 +Name[ka]=კვების კონტროლი +Name[kk]=Қуаттандыруды бақылау +Name[km]=ការត្រួតពិនិត្យថាមពល +Name[ko]=전원 관리 +Name[lo]=ຄວບຄຸມການໃຊ້ພະລັງງານ +Name[lt]=Energijos kontrolė +Name[lv]=Energo Kontrole +Name[mk]=Контрола на енергија +Name[mn]=Энергийн удирдлага +Name[ms]=Kawalan Kuasa +Name[mt]=Kontroll tal-konsum +Name[nb]=Strømkontroll +Name[nds]=Stroomkuntrull +Name[ne]=शक्ति नियन्त्रण +Name[nl]=Energiebeheer +Name[nn]=Straumkontroll +Name[nso]=Taolo ya Matla +Name[oc]=Contròle d'alimentacion +Name[pa]=ਊਰਜਾ ਕੰਟਰੋਲ +Name[pl]=Zasilanie +Name[pt]=Controlo de Energia +Name[pt_BR]=Controle de Energia +Name[ro]=Control energie +Name[ru]=Управление питанием +Name[rw]=Igenzura ry'Umuriro +Name[se]=El-rávdnje stivren +Name[sk]=Ovládanie spotreby +Name[sl]=Nadzor energije +Name[sr]=Контрола енергије +Name[sr@Latn]=Kontrola energije +Name[ss]=Kulawulwa kwemlilo +Name[sv]=Strömsparfunktion +Name[ta]=மின்னோட்ட கட்டுப்பாடு +Name[te]=విద్యుత్ నియంత్రణ +Name[tg]=Идораи қувваи барқ +Name[th]=ควบคุมการใช้พลังงาน +Name[tr]=Güç Denetimi +Name[tt]=Qüät İdäräse +Name[uk]=Керування живленням +Name[uz]=Elektr taʼminotni boshqarish +Name[uz@cyrillic]=Электр таъминотни бошқариш +Name[ven]=Ndanguli ya maanda +Name[vi]=Điều khiển Nguồn điện +Name[wa]=Controle di l' alimintåcion +Name[xh]=Ulawulo Lwamandla +Name[zh_CN]=电源控制 +Name[zh_TW]=電源控制 +Name[zu]=Ukulawulwa kwamandla + +Comment=Settings for display power management +Comment[af]=Instellings vir die vertoon van die krag bestuurder +Comment[ar]=تعيينات إدخار الطاقة للشاشة +Comment[az]=Displey gec idarəsi qurğuları +Comment[be]=Кіраванне сілкаваннем манітора +Comment[bg]=Настройване на електрозахранването +Comment[bn]=ডিসপ্লের বৈদ্যুতিক শক্তি ব্যবহার সংক্রান্ত সেটিংস +Comment[br]=Kefluniadur renadur gremm an diskwell +Comment[bs]=Postavke uštede energije monitora (ekrana) +Comment[ca]=Arranjaments per al control d'energia a la pantalla +Comment[cs]=Nastavení pro správu šetření napájení +Comment[csb]=Nastôw sprôwianiô sëłą +Comment[cy]=Gosodiadau i rheoli pw?r y dangosydd +Comment[da]=Indstilling for visning af strømstyring +Comment[de]=Stromspareinstellungen für Ihren Monitor bzw. Ihr Display +Comment[el]=Ρυθμίσεις για την προβολή της διαχείρισης ενέργειας +Comment[eo]=Agordo por de la elektrouzado de via ekrano +Comment[es]=Preferencias para la pantalla de control de energía +Comment[et]=Ekraani voolutarbe juhtimise seaded +Comment[eu]=Pantailaren energia kudeatzeko ezarpenak +Comment[fa]=تنظیمات برای نمایش مدیریت توان +Comment[fi]=Asetukset näytön virranhallinnalle +Comment[fr]=Paramètres de la gestion d'énergie pour l'affichage +Comment[fy]=Ynstellings foar energybesparring foar byldskerms +Comment[gl]=Configuracións para a xestión de enerxia da pantalla +Comment[he]=שינוי הגדרות ניהול צריכת החשמל של התצוגה +Comment[hi]=बिज़ली नियंत्रण प्रदर्शक के लिए विन्यास +Comment[hr]=Postavke za štednju energije zaslona +Comment[hu]=A képernyő energiatakarékossági beállításai +Comment[is]=Stillingar fyrir orkustýringu skjás +Comment[it]=Impostazioni per la gestione dell'energia dello schermo. +Comment[ja]=ディスプレイの電源管理の設定 +Comment[ka]=დისპლეის კვების მონეჯმენტის კონფიგურაცია +Comment[kk]=Дисплейді қуаттандыруды басқаруын баптау +Comment[km]=ការកំណត់សម្រាប់គ្រប់គ្រងថាមពលការបង្ហាញ +Comment[ko]=디스플레이 전원 관리 설정 +Comment[lo]=ຕັ້ງຄ່າສຳລັບການປະຫຍັດພະລັງງານຂອງລະບົບສະແດງຜົນ +Comment[lt]=Parinktys displėjaus energijos tvarkymui +Comment[lv]=Ekrāna enorgotaupības parametri +Comment[mk]=Поставувања за менаџмент на енергијата за екранот +Comment[mn]=Дэлгэцийн тань энерги-тохируулга +Comment[ms]=Seting untuk pengurusan kuasa paparan +Comment[mt]=Setings għall-kontroll tal-konsum tal-iskrin +Comment[nb]=Innstillinger for strømkontroll av skjerm +Comment[nds]=Stroomspoorinstellen för den Schirm +Comment[ne]=प्रर्दशन शक्ति व्यवस्थापनका लागि सेटिङ +Comment[nl]=Instellingen voor energiebesparing voor monitors/displays +Comment[nn]=Innstillingar for straumkontroll av skjerm +Comment[nso]=Dipeakanyo tsa taolo ya matla a pontsho +Comment[pa]=ਊਰਜਾ ਪਰਬੰਧਨ ਝਲਕ ਲਈ ਸੈਟਿੰਗ +Comment[pl]=Ustawienia zarządzania mocą +Comment[pt]=Configurações para a gestão de energia do ecrã +Comment[pt_BR]= Configurações para o gerenciamento de energia do monitor +Comment[ro]=Setări pentru controlul energiei consumate de monitor +Comment[ru]=Настройка управления питанием дисплея +Comment[rw]=Amagenamiterere yo kwerekana icunga ry'umuriro +Comment[se]=Heivehusat mat stivrejit rávdnji šerbmii +Comment[sk]=Nastavenie šetrenia energiou obrazovky +Comment[sl]=Nastavitve za nadzor energije zaslona +Comment[sr]=Поставке за управаљање енергијом екрана +Comment[sr@Latn]=Postavke za upravaljanje energijom ekrana +Comment[ss]=Kuhleleka kwekubonisa kuphatfwa kwemandla +Comment[sv]=Inställning av skärmens strömsparfunktion +Comment[ta]=மின்சார மேலாண்மைக்கான அமைப்புகள் +Comment[tg]=Танзимоти мудирияти барқии намоишгар +Comment[th]=ตั้งค่าสำหรับการประหยัดพลังงานของระบบแสดงผล +Comment[tr]=Ekran güç yöneticisi ayarları +Comment[tt]=Küräk qüäten idäräläw caylawları +Comment[uk]=Налаштування керування живленням дисплея +Comment[uz]=Displeyning elektr taʼminoti uchun moslamalar +Comment[uz@cyrillic]=Дисплейнинг электр таъминоти учун мосламалар +Comment[ven]=Mavhekanyele au sumbedza ndangulo ya maanda +Comment[vi]=Thiết lập cho quản lý nguồn điện +Comment[wa]=Tchuzes po håyner l' manaedjmint d' enerdjeye +Comment[xh]=Izicwangciso zoboniso lophatho lwamandla +Comment[zh_CN]=显示器电源管理设置 +Comment[zh_TW]=顯示器電源管理的設定值 +Comment[zu]=Izilungiselelo zokuvezwa kokuphathwa kwamandla + +Keywords=energy,saver,apm,acpi,dpms,timeout,blanking,stand by,suspend,power +Keywords[az]=enerji,apm,acpi,zamanaşımı,boşaltma,güç,karartma,ekran +Keywords[be]=энергія,зберагальнік,збераганне,тэрмін чакання,ачышчэнне,выключэнне,сілкаванне,сон,energy,saver,apm,acpi,dpms,timeout,blanking,stand by,suspend,power +Keywords[bg]=ток, захранване, прекъсване, батерия, батерии, контакт, energy, saver, apm, acpi, dpms, timeout, blanking, stand by, suspend, power +Keywords[ca]=energia,salva,apm,acpi,dpms,expiració,en blanc,en espera, suspès,corrent +Keywords[cs]=Energie,Úspora,APM,ACPI,Časový limit,Vypnutí,Napájení,Šetřič,Spořič +Keywords[csb]=sëła, energijô,zachòwëwanié,apm,acpi,dpms,limit czasu,zaczôrnienié,wëłączanié, ùspienié,zasëlanié +Keywords[cy]=ynni,arbedwr,apm,acpi,dpms,goroedi,gwagu,sefyll wrthlaw,seibio, pwer +Keywords[da]=energi,sparer,apm,acpi,dpms,timeout,udløb,gør blank,standby,suspendér,strøm +Keywords[de]=Energie,APM,ACPI,DPMS,Zeitüberlauf,Timeout,Standby,Bereitschaft +Keywords[el]=ενέργεια,εξοικονόμηση,apm,acpi,dpms,χρονικό όριο,blanking,αναμονή,παύση,ισχύς +Keywords[eo]=energio,sekurigo,APM,ACPI,tempolimo,ekrano,kurteno,nigrigo, dormigo,malŝalto +Keywords[es]=energía,ahorro,APM,ACPI,tiempo de expiración,apagar monitor,modo de espera,suspender +Keywords[et]=energia,säästja,apm,acpi,dpms,taimaut,energiasääst,passiivne +Keywords[eu]=energia,babeslea,apm,acpi,dpms,denbora-muga,monitorea itzali, zain,suspenditu,indarra +Keywords[fa]=انرژی، محافظ، apm، acpi، dpms، اتمام وقت، فاصلهگذاری، نیمه روشن، معلق، توان +Keywords[fi]=energia,säästö,apm,acpi,dpms,aikavalvonta,sammutus,valmiustila,teho +Keywords[fr]=énergie,économie,apm,acpi,suspension,suspendre,tension,éteindre,extinction,veille,mise en veille,alimentation +Keywords[fy]=energy,besparring,apm,acpi,tiidslimyt,sliepstân,stand-by,suspend,power,wachtstân,laptop,byldskerm,monitor,display,timeout +Keywords[ga]=cumhacht,sábhálaí,apm,acpi,dpms,teorainn ama,bánú,croch,fuinneamh +Keywords[gl]=enerxia,aforro,apm,acpi,dpms,tempo de espera,espera,suspender,timeout,bloqueo +Keywords[he]=זמן מוקצב,האפלה,המתנה,חשמל,dpms,acpi,apm,אנרגיה,חיסכון, energy,saver,timeout,blanking,stand y,suspend,power +Keywords[hi]=बिज़ली,रक्षक,एपीएम,एसीपीआई,डीपीएमएस,टाइम-आउट,ब्लैंकिंग,स्टैंड-बाय,सस्पैंड,उर्जा +Keywords[hr]=energy,saver,apm,acpi,dpms,timeout,blanking,stand by,suspend,power,štednja energije,energija,štednja,crnilo +Keywords[hu]=energia,kímélő,apm,acpi,dpms,időtúllépés,képernyőkioltás,készenlét,felfüggesztés,tápfeszültség +Keywords[id]=energi,hemat,apm,acpi,timeout,blanking,stand by,suspend,Power +Keywords[is]=orka,sparnaður,svæfing,apm,slökkva,svæfa,kveikja,dpms,tímamörk +Keywords[it]=energia,risparmio,apm,acpi,tempo massimo,schermo nero,stand by,sospensione,corrente +Keywords[ja]=電源,節約,apm,acpi,dpms,タイムアウト,ブランク,スタンバイ,サスペンド,パワー +Keywords[ka]=ენერგია,შემნახველი, apm, acpi, dpms, დროის ამოწურვა, გასუფთავება, მზაობა, გაუქმება, კვება +Keywords[km]=ថាមពល,អ្នកសង្គ្រោះ,apm,acpi,dpms,អស់ពេល,ទទេ,ឈប់មួយភ្លែត,ឈប់បណ្ដោះអាសន្ន +Keywords[lt]=energija,saugojimas,apm,acpi,pertrauka,gesinimas,stabdymas, pristabdymas,energija +Keywords[lv]=enerģija,glabātājs,apm,acpi,dpms,taimauts,tukšs,gaidīt,izslēgt,iemidzināt,Barošana +Keywords[mk]=energy,saver,apm,acpi,dpms,timeout,blanking,stand by,suspend,power,енергија,штедач,истек на време +Keywords[mn]=Энерги,APM,ACPI,DPMS,Хугацаа хэтрэлт,Standby,Бэлэн байдал +Keywords[mt]=energy,saver,apm,acpi,dpms,timeout,blanking,stand by,suspend,power,dawl,enerġija,elettriku,konsum +Keywords[nb]=energi,sparing,apm,acpi,dpms,tidsgrense,tom skjerm,ventemodus,hvilemodus,dvalemodus,strøm +Keywords[nds]=Energie,sporen,apm,acpi,dpms,timeout,blanking,stand by,suspend,Energie +Keywords[ne]=शक्ति, बचतकर्ता, apm, acpi, dpms, समय समाप्त, रिक्त, उभिनु, निलम्बन, सामर्थ्य +Keywords[nl]=energie,besparing,apm,acpi,tijdslimiet,slaapstand,stand-by,suspend,power,wachtstand,laptop,beeldscherm,monitor,display,timeout +Keywords[nn]=energi,sparing,apm,acpi,dpms,tidsgrense,tom skjerm,standby,suspend,straum,dvale +Keywords[nso]=maatla,seboloki,apm,acpi,dpms,feletswe ke nako,ga ena selo, moemalegato,koba bonakwana,matla +Keywords[pa]=energy,saver,apm,acpi,dpms,timeout,blanking,stand by,suspend,ਊਰਜਾ,ਮੁਅੱਤਲ +Keywords[pl]=energia,zachowywanie,apm,acpi,dpms,limit czasu,wygaszenie ekranu,wyłączanie,uśpienie,hibernacja,zasilanie +Keywords[pt]=energia,poupança,apm,acpi,temporizador,stand by,suspender,alimentação +Keywords[pt_BR]=energia,poupar,APM,ACPI,dpms,tempo limite,desligamento,em espera,suspender,Força +Keywords[ro]=energie,salvare,apm,acpi,dpms,temporizare,stinge,stand by,suspendare,rețea electrică +Keywords[rw]=ingufu,mubika,apm,acpi,dpms,igihecyarenze,kugira ahatanditseho, kuba witeguye,gusubika,umuriro +Keywords[se]=árja,siestin,acpm,acpi,dpms,áigemearri,guorus šearbma,standby,suspend,el-rávdnji +Keywords[sk]=energia,apm,acpi,vypnúť,timeout,zhasnúť,suspend,stand by,šetrič +Keywords[sl]=energija,ohranjevalnik,varčevalnik,apm,acpi,suspend,potek,zatemnitev,energija +Keywords[sr]=енергија,штедња,apm,acpi,timeout,blanking,stand by,suspend,напајање +Keywords[sr@Latn]=energija,štednja,apm,acpi,timeout,blanking,stand by,suspend,napajanje +Keywords[sv]=energi,spar,apm,acpi,dpms,tidsgräns,viloläge,vänteläge,ström +Keywords[ta]=சக்தி,சேமிப்பான்,apm,acpi,dpms,நேரமுடிவு,இடைவெளி விடுதல்,ஆதாரம்,நீக்கம்,மின்சக்தி +Keywords[th]=พลังงาน,ประหยัด,apm,acpi,dpms,หมดเวลา,ว่าง,เตรียมตัว,ปิดชั่วคราว,พลัง +Keywords[tr]=enerji,apm,acpi,dpms,zaman aşımı,boşaltma,bekleme,karartma,güç +Keywords[uk]=енергія,живлення,зберігач,apm,acpi, тайм-аут,гасіння,режим чергування,призупинення +Keywords[uz]=energiya,tejash,apm,acpi,dpms,taymaut,blanking,stand by,suspend,elektr taʼminoti +Keywords[uz@cyrillic]=энергия,тежаш,apm,acpi,dpms,таймаут,blanking,stand by,suspend,электр таъминоти +Keywords[ven]=maanda,muvhulungi,apm,acpi,u fhela ha tshifhinga,blanking,zwanagatsini,phandela,Maanda +Keywords[vi]=năng lượng,tiết kiệm,apm,acpi,dpms,hết giờ,mất điện,tạm nghỉ,treo,công suất +Keywords[wa]=enerdjeye,schaper,schapeu,apm,acpi,dpms,timeout,blanking,stand by,suspend,power,djoker +Keywords[xh]=amandla,umgcini,apm,acpi,dpms,ixesha lokuphuma,engenambhalo,umphumzi,gxotha,amandla +Keywords[zh_CN]=energy,saver,apm,acpi,dpms,timeout,blanking,stand by,suspend,power,能源,节省,超时,黑屏,待机,休眠,电源 +Keywords[zh_TW]=energy,saver,apm,acpi,dpms,timeout,blanking,stand by,suspend,Power,能源,省電器,逾時,轉暗,待機,休眠,電源 +Keywords[zu]=umdlandla,umgcini,apm,acpi,isikhathi sokuphuma,ukuvimbela,lindela lengisa,amandla + diff --git a/kcontrol/energy/energy.h b/kcontrol/energy/energy.h new file mode 100644 index 000000000..d41b89e26 --- /dev/null +++ b/kcontrol/energy/energy.h @@ -0,0 +1,68 @@ +/* vi: ts=8 sts=4 sw=4 + * + * + * + * This file is part of the KDE project, module kcontrol. + * Copyright (C) 1999 Geert Jansen <[email protected]> + * + * You can Freely distribute this program under the GNU General Public + * License. See the file "COPYING" for the exact licensing terms. + * + * Based on kcontrol1 energy.h, Copyright (c) 1999 Tom Vijlbrief. + */ + +#ifndef __Energy_h_Included__ +#define __Energy_h_Included__ + +#include <qobject.h> +#include <kcmodule.h> + +class QCheckBox; +class KIntNumInput; +class KConfig; + +extern "C" void init_energy(); + +/** + * The Desktop/Energy tab in kcontrol. + */ +class KEnergy: public KCModule +{ + Q_OBJECT + +public: + KEnergy(QWidget *parent, const char *name); + ~KEnergy(); + + virtual void load(); + virtual void load( bool useDefaults ); + virtual void save(); + virtual void defaults(); + +private slots: + void slotChangeEnable(bool); + void slotChangeStandby(int); + void slotChangeSuspend(int); + void slotChangeOff(int); + void openURL(const QString &); + +private: + void readSettings(); + void writeSettings(); + void showSettings(); + + static void applySettings(bool, int, int, int); + friend void init_energy(); + + bool m_bChanged, m_bDPMS, m_bEnabled, m_bMaintainSanity; + int m_Standby, m_Suspend, m_Off; + int m_StandbyDesired, m_SuspendDesired, m_OffDesired; + + QCheckBox *m_pCBEnable; + KIntNumInput *m_pStandbySlider; + KIntNumInput *m_pSuspendSlider; + KIntNumInput *m_pOffSlider; + KConfig *m_pConfig; +}; + +#endif // __Energy_h_Included__ diff --git a/kcontrol/energy/pics/Makefile.am b/kcontrol/energy/pics/Makefile.am new file mode 100644 index 000000000..a53060d03 --- /dev/null +++ b/kcontrol/energy/pics/Makefile.am @@ -0,0 +1,5 @@ +pics_DATA = energybig.png lo-energy.png +picsdir = $(kde_datadir)/kcontrol/pics + +EXTRA_DIST = $(pics_DATA) + diff --git a/kcontrol/energy/pics/energybig.png b/kcontrol/energy/pics/energybig.png Binary files differnew file mode 100644 index 000000000..1a79fe748 --- /dev/null +++ b/kcontrol/energy/pics/energybig.png diff --git a/kcontrol/energy/pics/lo-energy.png b/kcontrol/energy/pics/lo-energy.png Binary files differnew file mode 100644 index 000000000..9706644b1 --- /dev/null +++ b/kcontrol/energy/pics/lo-energy.png |