diff options
Diffstat (limited to 'kcontrol/energy')
-rw-r--r-- | kcontrol/energy/CMakeLists.txt | 65 | ||||
-rw-r--r-- | kcontrol/energy/Makefile.am | 18 | ||||
-rw-r--r-- | kcontrol/energy/configure.in.in | 1 | ||||
-rw-r--r-- | kcontrol/energy/energy.cpp | 506 | ||||
-rw-r--r-- | kcontrol/energy/energy.desktop | 242 | ||||
-rw-r--r-- | kcontrol/energy/energy.h | 70 | ||||
-rw-r--r-- | kcontrol/energy/pics/CMakeLists.txt | 12 | ||||
-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 |
10 files changed, 919 insertions, 0 deletions
diff --git a/kcontrol/energy/CMakeLists.txt b/kcontrol/energy/CMakeLists.txt new file mode 100644 index 000000000..9e194602a --- /dev/null +++ b/kcontrol/energy/CMakeLists.txt @@ -0,0 +1,65 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +option( WITH_DPMS "Enable DPMS power saving" ON ) + +if( WITH_DPMS ) + + include( CheckCSourceCompiles ) + + set( CMAKE_REQUIRED_LIBRARIES Xext ) + + check_c_source_compiles(" + #include <sys/types.h> + #include <netinet/in.h> + #include <arpa/nameser.h> + #include <resolv.h> + #include <X11/Xproto.h> + #include <X11/X.h> + #include <X11/Xlib.h> + #include <X11/extensions/dpms.h> + int main() + { return DPMSSetTimeouts( 0, 0, 0, 0 ); }" + HAVE_DPMS ) + + if( NOT HAVE_DPMS ) + tde_message_fatal( "DPMS support are requested, but is not detected on you system.\n libXext (and its devel package) are installed?" ) + endif() + + set( XEXT_LIBRARY Xext ) + +endif() + +add_subdirectory( pics ) + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + +##### other data ################################ + +install( FILES energy.desktop DESTINATION ${APPS_INSTALL_DIR}/.hidden ) + + +##### kcm_energy (module) ####################### + +tde_add_kpart( kcm_energy AUTOMOC + SOURCES energy.cpp + LINK tdeio-shared ${XEXT_LIBRARY} + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/kcontrol/energy/Makefile.am b/kcontrol/energy/Makefile.am new file mode 100644 index 000000000..7d42e5afa --- /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_TDEUI) $(LIB_TDEIO) +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..5129e365d --- /dev/null +++ b/kcontrol/energy/energy.cpp @@ -0,0 +1,506 @@ +/* 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 <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> +#include <tqpushbutton.h> + +#include <tdeconfig.h> +#include <kcursor.h> +#include <kdialog.h> +#include <kiconloader.h> +#include <tdelocale.h> +#include <knuminput.h> +#include <krun.h> +#include <kstandarddirs.h> +#include <kurllabel.h> +#include <dcopref.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 TDECModule *create_energy(TQWidget *parent, char *) { + return new KEnergy(parent, "kcmenergy"); + } + + KDE_EXPORT void init_energy() { +#ifdef HAVE_DPMS + TDEConfig *cfg = new TDEConfig("kcmdisplayrc", true /*readonly*/, false /*no globals*/); + cfg->setGroup("DisplayEnergy"); + + Display *dpy = tqt_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(TQWidget *parent, const char *name) + : TDECModule(parent, name) +{ + m_bChanged = false; + m_bEnabled = false; + m_Standby = DFLT_STANDBY; + m_Suspend = DFLT_SUSPEND; + m_Off = DFLT_OFF; + m_bDPMS = false; + m_bKPowersave = false; + m_bTDEPowersave = 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(tqt_xdisplay(), &dummy, &dummy); + + DCOPRef kpowersave("kpowersave", "KPowersaveIface"); + DCOPReply managingDPMS = kpowersave.call("currentSchemeManagesDPMS()"); + if (managingDPMS.isValid()) { + m_bKPowersave = managingDPMS; + m_bDPMS = !m_bKPowersave; + } + + DCOPRef tdepowersave("tdepowersave", "tdepowersaveIface"); + managingDPMS = tdepowersave.call("currentSchemeManagesDPMS()"); + if (managingDPMS.isValid()) { + m_bTDEPowersave = managingDPMS; + m_bDPMS = !m_bTDEPowersave; + } +#endif + + TQVBoxLayout *top = new TQVBoxLayout(this, 0, KDialog::spacingHint()); + TQHBoxLayout *hbox = new TQHBoxLayout(); + top->addLayout(hbox); + + TQLabel *lbl; + if (m_bDPMS) { + TDEGlobal::locale()->insertCatalogue("kpowersave"); + // ### these i18n strings need to be synced with kpowersave !! + m_pCBEnable= new TQCheckBox(i18n("&Enable display power management" ), this); + connect(m_pCBEnable, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotChangeEnable(bool))); + hbox->addWidget(m_pCBEnable); + + TQWhatsThis::add( m_pCBEnable, i18n("Check this option to enable the" + " power saving features of your display.") ); + // ### + } else if(m_bKPowersave || m_bTDEPowersave) { + m_pCBEnable = new TQCheckBox(i18n("&Enable specific display power management"), this); + hbox->addWidget(m_pCBEnable); + m_bEnabled = false; + m_pCBEnable->setChecked(true); + m_pCBEnable->setEnabled(false); + } else { + lbl = new TQLabel(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(TQPixmap(locate("data", "kcontrol/pics/energybig.png"))); + logo->setTipText(i18n("Learn more about the Energy Star program")); + logo->setUseTips(true); +connect(logo, TQT_SIGNAL(leftClickedURL(const TQString&)), TQT_SLOT(openURL(const TQString &))); + + hbox->addStretch(); + hbox->addWidget(logo); + + // Sliders + if (!m_bKPowersave && !m_bTDEPowersave) { + 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, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotChangeStandby(int))); + top->addWidget(m_pStandbySlider); + TQWhatsThis::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, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotChangeSuspend(int))); + top->addWidget(m_pSuspendSlider); + TQWhatsThis::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, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotChangeOff(int))); + top->addWidget(m_pOffSlider); + TQWhatsThis::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.") ); + + } else { + m_pStandbySlider = 0; + m_pSuspendSlider = 0; + m_pOffSlider = 0; + if(m_bKPowersave) { + TQPushButton* btnKPowersave = new TQPushButton(this); + btnKPowersave->setText(i18n("Configure KPowersave...")); + connect(btnKPowersave, TQT_SIGNAL(clicked()), TQT_SLOT(slotLaunchKPowersave())); + top->addWidget(btnKPowersave); + } + if(m_bTDEPowersave) { + TQPushButton* btnTDEPowersave = new TQPushButton(this); + btnTDEPowersave->setText(i18n("Configure TDEPowersave...")); + connect(btnTDEPowersave, TQT_SIGNAL(clicked()), TQT_SLOT(slotLaunchTDEPowersave())); + top->addWidget(btnTDEPowersave); + } + } + + top->addStretch(); + + if (m_bDPMS) + setButtons( TDECModule::Help | TDECModule::Default | TDECModule::Apply ); + else + setButtons( TDECModule::Help ); + + m_pConfig = new TDEConfig("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() +{ + if (m_bDPMS) { + 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::slotLaunchKPowersave() +{ + DCOPRef r("kpowersave", "KPowersaveIface"); + r.send("openConfigureDialog()"); +} + +void KEnergy::slotLaunchTDEPowersave() +{ + DCOPRef r("tdepowersave", "tdepowersaveIface"); + r.send("openConfigureDialog()"); +} + +void KEnergy::showSettings() +{ + m_bMaintainSanity = false; + + if (m_bDPMS) { + m_pCBEnable->setChecked(m_bEnabled); + } + + if (!m_bKPowersave && !m_bTDEPowersave) { + 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 = tqt_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 + tqWarning("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 TQString &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..506b3be37 --- /dev/null +++ b/kcontrol/energy/energy.desktop @@ -0,0 +1,242 @@ +[Desktop Entry] +Exec=tdecmshell energy +Icon=energy_star +X-DocPath=kcontrol/energy/index.html +Type=Application +X-TDE-Library=energy +X-TDE-Init=energy +X-TDE-ParentApp=kcontrol +X-TDE-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..765fdb2b9 --- /dev/null +++ b/kcontrol/energy/energy.h @@ -0,0 +1,70 @@ +/* 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 <tqobject.h> +#include <tdecmodule.h> + +class TQCheckBox; +class KIntNumInput; +class TDEConfig; + +extern "C" void init_energy(); + +/** + * The Desktop/Energy tab in kcontrol. + */ +class KEnergy: public TDECModule +{ + Q_OBJECT + +public: + KEnergy(TQWidget *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 slotLaunchKPowersave(); + void slotLaunchTDEPowersave(); + void openURL(const TQString &); + +private: + void readSettings(); + void writeSettings(); + void showSettings(); + + static void applySettings(bool, int, int, int); + friend void init_energy(); + + bool m_bChanged, m_bDPMS, m_bKPowersave, m_bTDEPowersave, m_bEnabled, m_bMaintainSanity; + int m_Standby, m_Suspend, m_Off; + int m_StandbyDesired, m_SuspendDesired, m_OffDesired; + + TQCheckBox *m_pCBEnable; + KIntNumInput *m_pStandbySlider; + KIntNumInput *m_pSuspendSlider; + KIntNumInput *m_pOffSlider; + TDEConfig *m_pConfig; +}; + +#endif // __Energy_h_Included__ diff --git a/kcontrol/energy/pics/CMakeLists.txt b/kcontrol/energy/pics/CMakeLists.txt new file mode 100644 index 000000000..a65779060 --- /dev/null +++ b/kcontrol/energy/pics/CMakeLists.txt @@ -0,0 +1,12 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +install( FILES energybig.png lo-energy.png DESTINATION ${DATA_INSTALL_DIR}/kcontrol/pics ) 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 |