diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 4aed2c8219774f5d797760606b8489a92ddc5163 (patch) | |
tree | 3f8c130f7d269626bf6a9447407ef6c35954426a /kcontrol/kded | |
download | tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/kded')
-rw-r--r-- | kcontrol/kded/Makefile.am | 15 | ||||
-rw-r--r-- | kcontrol/kded/kcmkded.cpp | 363 | ||||
-rw-r--r-- | kcontrol/kded/kcmkded.desktop | 236 | ||||
-rw-r--r-- | kcontrol/kded/kcmkded.h | 78 |
4 files changed, 692 insertions, 0 deletions
diff --git a/kcontrol/kded/Makefile.am b/kcontrol/kded/Makefile.am new file mode 100644 index 000000000..af2d54142 --- /dev/null +++ b/kcontrol/kded/Makefile.am @@ -0,0 +1,15 @@ +kde_module_LTLIBRARIES = kcm_kded.la + +kcm_kded_la_SOURCES = kcmkded.cpp + +kcm_kded_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined +kcm_kded_la_LIBADD = $(LIB_KIO) + +AM_CPPFLAGS= $(all_includes) + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kcmkded.pot + +xdg_apps_DATA = kcmkded.desktop diff --git a/kcontrol/kded/kcmkded.cpp b/kcontrol/kded/kcmkded.cpp new file mode 100644 index 000000000..e30d73b6f --- /dev/null +++ b/kcontrol/kded/kcmkded.cpp @@ -0,0 +1,363 @@ +/* This file is part of the KDE project + Copyright (C) 2002 Daniel Molkentin <molkentin@kde.org> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include <qheader.h> +#include <qlayout.h> +#include <qpushbutton.h> +#include <qtimer.h> +#include <qvgroupbox.h> +#include <qwhatsthis.h> + +#include <dcopclient.h> +#include <dcopref.h> + +#include <kaboutdata.h> +#include <kapplication.h> +#include <kbuttonbox.h> +#include <kdebug.h> +#include <kdesktopfile.h> +#include <kdialog.h> +#include <kgenericfactory.h> +#include <klistview.h> +#include <kmessagebox.h> +#include <kservice.h> +#include <kstandarddirs.h> + +#include "kcmkded.h" +#include "kcmkded.moc" + +typedef KGenericFactory<KDEDConfig, QWidget> KDEDFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_kded, KDEDFactory( "kcmkded" ) ) + + +KDEDConfig::KDEDConfig(QWidget* parent, const char* name, const QStringList &) : + KCModule( KDEDFactory::instance(), parent, name ) +{ + KAboutData *about = + new KAboutData( I18N_NOOP( "kcmkded" ), I18N_NOOP( "KDE Service Manager" ), + 0, 0, KAboutData::License_GPL, + I18N_NOOP( "(c) 2002 Daniel Molkentin" ) ); + about->addAuthor("Daniel Molkentin",0,"molkentin@kde.org"); + setAboutData( about ); + + setQuickHelp( i18n("<h1>Service Manager</h1><p>This module allows you to have an overview of all plugins of the " + "KDE Daemon, also referred to as KDE Services. Generally, there are two types of service:</p>" + "<ul><li>Services invoked at startup</li><li>Services called on demand</li></ul>" + "<p>The latter are only listed for convenience. The startup services can be started and stopped. " + "In Administrator mode, you can also define whether services should be loaded at startup.</p>" + "<p><b> Use this with care: some services are vital for KDE; do not deactivate services if you" + " do not know what you are doing.</b></p>")); + + RUNNING = i18n("Running")+" "; + NOT_RUNNING = i18n("Not running")+" "; + + QVBoxLayout *lay = new QVBoxLayout( this, 0, KDialog::spacingHint() ); + + QGroupBox *gb = new QVGroupBox(i18n("Load-on-Demand Services"), this ); + QWhatsThis::add(gb, i18n("This is a list of available KDE services which will " + "be started on demand. They are only listed for convenience, as you " + "cannot manipulate these services.")); + lay->addWidget( gb ); + + _lvLoD = new KListView( gb ); + _lvLoD->addColumn(i18n("Service")); + _lvLoD->addColumn(i18n("Description")); + _lvLoD->addColumn(i18n("Status")); + _lvLoD->setAllColumnsShowFocus(true); + _lvLoD->header()->setStretchEnabled(true, 1); + + gb = new QVGroupBox(i18n("Startup Services"), this ); + QWhatsThis::add(gb, i18n("This shows all KDE services that can be loaded " + "on KDE startup. Checked services will be invoked on next startup. " + "Be careful with deactivation of unknown services.")); + lay->addWidget( gb ); + + _lvStartup = new KListView( gb ); + _lvStartup->addColumn(i18n("Use")); + _lvStartup->addColumn(i18n("Service")); + _lvStartup->addColumn(i18n("Description")); + _lvStartup->addColumn(i18n("Status")); + _lvStartup->setAllColumnsShowFocus(true); + _lvStartup->header()->setStretchEnabled(true, 2); + + KButtonBox *buttonBox = new KButtonBox( gb, Horizontal); + _pbStart = buttonBox->addButton( i18n("Start")); + _pbStop = buttonBox->addButton( i18n("Stop")); + + _pbStart->setEnabled( false ); + _pbStop->setEnabled( false ); + + connect(_pbStart, SIGNAL(clicked()), SLOT(slotStartService())); + connect(_pbStop, SIGNAL(clicked()), SLOT(slotStopService())); + connect(_lvStartup, SIGNAL(selectionChanged(QListViewItem*)), SLOT(slotEvalItem(QListViewItem*)) ); + + load(); +} + +void setModuleGroup(KConfig *config, const QString &filename) +{ + QString module = filename; + int i = module.findRev('/'); + if (i != -1) + module = module.mid(i+1); + i = module.findRev('.'); + if (i != -1) + module = module.left(i); + + config->setGroup(QString("Module-%1").arg(module)); +} + +bool KDEDConfig::autoloadEnabled(KConfig *config, const QString &filename) +{ + setModuleGroup(config, filename); + return config->readBoolEntry("autoload", true); +} + +void KDEDConfig::setAutoloadEnabled(KConfig *config, const QString &filename, bool b) +{ + setModuleGroup(config, filename); + return config->writeEntry("autoload", b); +} + +void KDEDConfig::load() { + load ( false ); +} + + +void KDEDConfig::load( bool useDefaults ) { + KConfig kdedrc("kdedrc", true, false); + kdedrc.setReadDefaults( useDefaults ); + + _lvStartup->clear(); + _lvLoD->clear(); + + QStringList files; + KGlobal::dirs()->findAllResources( "services", + QString::fromLatin1( "kded/*.desktop" ), + true, true, files ); + + QListViewItem* item = 0L; + CheckListItem* clitem; + for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) { + + if ( KDesktopFile::isDesktopFile( *it ) ) { + KDesktopFile file( *it, true, "services" ); + + if ( file.readBoolEntry("X-KDE-Kded-autoload") ) { + clitem = new CheckListItem(_lvStartup, QString::null); + connect(clitem, SIGNAL(changed(QCheckListItem*)), SLOT(slotItemChecked(QCheckListItem*))); + clitem->setOn(autoloadEnabled(&kdedrc, *it)); + item = clitem; + item->setText(1, file.readName()); + item->setText(2, file.readComment()); + item->setText(3, NOT_RUNNING); + item->setText(4, file.readEntry("X-KDE-Library")); + } + else if ( file.readBoolEntry("X-KDE-Kded-load-on-demand") ) { + item = new QListViewItem(_lvLoD, file.readName()); + item->setText(1, file.readComment()); + item->setText(2, NOT_RUNNING); + item->setText(4, file.readEntry("X-KDE-Library")); + } + } + } + + getServiceStatus(); + emit changed( useDefaults ); +} + +void KDEDConfig::save() { + QCheckListItem* item = 0L; + + QStringList files; + KGlobal::dirs()->findAllResources( "services", + QString::fromLatin1( "kded/*.desktop" ), + true, true, files ); + + KConfig kdedrc("kdedrc", false, false); + + for ( QStringList::ConstIterator it = files.begin(); it != files.end(); ++it ) { + + if ( KDesktopFile::isDesktopFile( *it ) ) { + + KConfig file( *it, false, false, "services" ); + file.setGroup("Desktop Entry"); + + if (file.readBoolEntry("X-KDE-Kded-autoload")){ + + item = static_cast<QCheckListItem *>(_lvStartup->findItem(file.readEntry("X-KDE-Library"),4)); + if (item) { + // we found a match, now compare and see what changed + setAutoloadEnabled(&kdedrc, *it, item->isOn()); + } + } + } + } + kdedrc.sync(); + + DCOPRef( "kded", "kded" ).call( "reconfigure" ); + QTimer::singleShot(0, this, SLOT(slotServiceRunningToggled())); +} + + +void KDEDConfig::defaults() +{ + load( true ); +} + + +void KDEDConfig::getServiceStatus() +{ + QCStringList modules; + QCString replyType; + QByteArray replyData; + + + if (!kapp->dcopClient()->call( "kded", "kded", "loadedModules()", QByteArray(), + replyType, replyData ) ) { + + _lvLoD->setEnabled( false ); + _lvStartup->setEnabled( false ); + KMessageBox::error(this, i18n("Unable to contact KDED.")); + return; + } + else { + + if ( replyType == "QCStringList" ) { + QDataStream reply(replyData, IO_ReadOnly); + reply >> modules; + } + } + + for( QListViewItemIterator it( _lvLoD); it.current() != 0; ++it ) + it.current()->setText(2, NOT_RUNNING); + for( QListViewItemIterator it( _lvStartup); it.current() != 0; ++it ) + it.current()->setText(3, NOT_RUNNING); + for ( QCStringList::Iterator it = modules.begin(); it != modules.end(); ++it ) + { + QListViewItem *item = _lvLoD->findItem(*it, 4); + if ( item ) + { + item->setText(2, RUNNING); + } + + item = _lvStartup->findItem(*it, 4); + if ( item ) + { + item->setText(3, RUNNING); + } + } +} + +void KDEDConfig::slotReload() +{ + QString current = _lvStartup->currentItem()->text(4); + load(); + QListViewItem *item = _lvStartup->findItem(current, 4); + if (item) + _lvStartup->setCurrentItem(item); +} + +void KDEDConfig::slotEvalItem(QListViewItem * item) +{ + if (!item) + return; + + if ( item->text(3) == RUNNING ) { + _pbStart->setEnabled( false ); + _pbStop->setEnabled( true ); + } + else if ( item->text(3) == NOT_RUNNING ) { + _pbStart->setEnabled( true ); + _pbStop->setEnabled( false ); + } + else // Error handling, better do nothing + { + _pbStart->setEnabled( false ); + _pbStop->setEnabled( false ); + } + + getServiceStatus(); +} + +void KDEDConfig::slotServiceRunningToggled() +{ + getServiceStatus(); + slotEvalItem(_lvStartup->currentItem()); +} + +void KDEDConfig::slotStartService() +{ + QCString service = _lvStartup->currentItem()->text(4).latin1(); + + QByteArray data, replyData; + QCString replyType; + QDataStream arg( data, IO_WriteOnly ); + arg << service; + if (kapp->dcopClient()->call( "kded", "kded", "loadModule(QCString)", data, replyType, replyData ) ) { + QDataStream reply(replyData, IO_ReadOnly); + if ( replyType == "bool" ) + { + bool result; + reply >> result; + if ( result ) + slotServiceRunningToggled(); + else + KMessageBox::error(this, i18n("Unable to start service.")); + } else { + kdDebug() << "loadModule() on kded returned an unexpected type of reply: " << replyType << endl; + } + } + else { + KMessageBox::error(this, i18n("Unable to contact KDED.")); + } +} + +void KDEDConfig::slotStopService() +{ + QCString service = _lvStartup->currentItem()->text(4).latin1(); + kdDebug() << "Stopping: " << service << endl; + QByteArray data; + QDataStream arg( data, IO_WriteOnly ); + + arg << service; + if (kapp->dcopClient()->send( "kded", "kded", "unloadModule(QCString)", data ) ) { + slotServiceRunningToggled(); + } + else { + KMessageBox::error(this, i18n("Unable to stop service.")); + } + +} + +void KDEDConfig::slotItemChecked(QCheckListItem*) +{ + emit changed(true); +} + +CheckListItem::CheckListItem(QListView *parent, const QString &text) + : QObject(parent), + QCheckListItem(parent, text, CheckBox) +{ } + +void CheckListItem::stateChange(bool on) +{ + QCheckListItem::stateChange(on); + emit changed(this); +} diff --git a/kcontrol/kded/kcmkded.desktop b/kcontrol/kded/kcmkded.desktop new file mode 100644 index 000000000..fe45333a3 --- /dev/null +++ b/kcontrol/kded/kcmkded.desktop @@ -0,0 +1,236 @@ +[Desktop Entry] +Exec=kcmshell kcmkded +Icon=services +Type=Application + + +X-KDE-Library=kded +X-KDE-Factoryname=kded +X-KDE-ParentApp=kcontrol + +Name=Service Manager +Name[af]=Diens Bestuurder +Name[ar]=مدبر الخدمات +Name[az]=Xidmət İdarəçisi +Name[be]=Кіраўнік сервісаў +Name[bg]=Системни услуги +Name[bn]=সার্ভিস ম্যানেজার +Name[br]=Merour ar servijoù +Name[bs]=Upravljač servisa +Name[ca]=Gestor del servei +Name[cs]=Správce služeb +Name[csb]=Menedżer ùsłëżnotów +Name[cy]=Rheolydd Gwasanaethau +Name[da]=Service-håndtering +Name[de]=Diensteverwaltung +Name[el]=Διαχειριστής υπηρεσιών +Name[eo]=Servo-Administrilo +Name[es]=Gestor de servicios +Name[et]=Teenuste haldur +Name[eu]=Zerbitzu kudeatzailea +Name[fa]=مدیر خدمت +Name[fi]=Palvelunhallinta +Name[fr]=Gestionnaire de services +Name[fy]=KDE-systeemtsjinsten +Name[ga]=Bainisteoir Seirbhíse +Name[gl]=Xestor de Servizos +Name[he]=מנהל השירותים +Name[hi]=सेवा प्रबंधक +Name[hr]=Upravljanje uslugama +Name[hu]=Szolgáltatások +Name[is]=Þjónustustjóri +Name[it]=Gestione servizi +Name[ja]=サービスマネージャ +Name[ka]=სერვის მენეჯერი +Name[kk]=Қызметтерді басқару +Name[km]=កម្មវិធីគ្រប់គ្រងសេវា +Name[ko]=서비스 관리자 +Name[lo]=ຕົວຈັດການ Dhcp +Name[lt]=Tarnybų tvarkyklė +Name[lv]=Servisu Menedžeris +Name[mk]=Менаџер на сервиси +Name[mn]=Үйлчилгээ удирдагч +Name[ms]=Pengurus Servis +Name[mt]=Manager tas-servizzi +Name[nb]=Tjenestebehandler +Name[nds]=Deenstpleger +Name[ne]=सेवा प्रबन्धक +Name[nl]=KDE-systeemdiensten +Name[nn]=Tenestehandsamar +Name[nso]=Molaodi wa Tirelo +Name[pa]=ਸੇਵਾਵਾਂ ਮੈਨੇਜਰ +Name[pl]=Menedżer usług +Name[pt]=Gestor de Serviços +Name[pt_BR]=Gerenciador de Serviços +Name[ro]=Managerul de servicii +Name[ru]=Управление службами +Name[rw]=MugengaSerivise +Name[se]=Bálvalusgieđahalli +Name[sk]=Správca služieb +Name[sl]=Upravitelj storitev +Name[sr]=Менаџер сервиса +Name[sr@Latn]=Menadžer servisa +Name[sv]=Tjänsthanterare +Name[ta]=சேவை மேலாளர் +Name[tg]=Мудири хидмат +Name[th]=ตัวจัดการรบริการ +Name[tr]=Servis Yöneticisi +Name[tt]=Xezmät İdäräçe +Name[uk]=Менеджер служб +Name[uz]=Xizmat boshqaruvchisi +Name[uz@cyrillic]=Хизмат бошқарувчиси +Name[ven]=Mulanguli wa tshumelo +Name[vi]=Trình quản lý Dịch vụ +Name[wa]=Manaedjeu di siervices +Name[xh]=Umphathi Wenkonzo +Name[zh_CN]=服务管理器 +Name[zh_TW]=服務管理程式 +Name[zu]=Imenenja Yomsebenzi +Comment=System Services Configuration +Comment[af]=Stelsel Dienste Opstelling +Comment[ar]=تهيئة خدمات النظام +Comment[az]=Sistem Xidmətləri Qurğuları +Comment[be]=Настаўленні сістэмных сервісаў +Comment[bg]=Настройване на системните услуги +Comment[bn]=সিস্টেম সার্ভিস কনফিগারেশন +Comment[br]=Kefluniadur servijerien ar reiziad +Comment[bs]=Postavke sistemskih servisa +Comment[ca]=Configura els serveis del sistema +Comment[cs]=Nastavení systémových služeb +Comment[csb]=Kònfigùracëjô systemòwëch ùsłëżnotów +Comment[cy]=Ffurfweddu Gwasanaethau Cysawd +Comment[da]=Opsætning af systemtjenester +Comment[de]=Einrichtung von Systemdiensten +Comment[el]=Ρύθμιση των υπηρεσιών συστήματος +Comment[eo]=Agordo de la sistemservoj +Comment[es]=Configuración de los servicios del sistema +Comment[et]=Süsteemsete teenuste seadistamine +Comment[eu]=Sistemaren zerbitzuen konfigurazioa +Comment[fa]=پیکربندی خدمات سیستم +Comment[fi]=Järjestelmän palveluiden asetus +Comment[fr]=Configuration des services du système +Comment[fy]=KDE-systeemtsjinsten ynstelle +Comment[ga]=Cumraíocht seirbhísí an chórais +Comment[gl]=Configuración dos Servizos do Sistema +Comment[he]=שינוי הגדרות שירותי המערכת +Comment[hi]=तंत्र सेवा कॉन्फ़िगरेशन +Comment[hr]=Konfiguracija usluga sustava +Comment[hu]=A rendszerszolgáltatások beállításai +Comment[is]=Stillingar kerfisþjónusta +Comment[it]=Configurazione dei servizi di sistema +Comment[ja]=システムサービスの設定 +Comment[ka]=სისტემური სერვისების კონფიგურაცია +Comment[kk]=Жүйелік қызметтерді баптау +Comment[km]=ការកំណត់រចនាសម្ព័ន្ធសេវាប្រព័ន្ធ +Comment[ko]=KDE 서비스 설정 +Comment[lo]=ປັບແຕ່ງອອດລະບົບ +Comment[lt]=Sistemos tarnybų konfigūravimas +Comment[lv]=Sistēmas Servisu Konfigurācija +Comment[mk]=Конфигурација на системските сервиси +Comment[mn]=Системийн үйлчилгээний тохируулга +Comment[ms]=Konfigurasi Servis Sistem +Comment[mt]=Konfigurazzjoni tas-servizzi tas-sistema +Comment[nb]=Systemtjenesteinnstillinger +Comment[nds]=Systeemdeensten instellen +Comment[ne]=प्रणाली सेवा कन्फिगरेसन +Comment[nl]=KDE-systeemdiensten instellen +Comment[nn]=Oppsett av systemtenester +Comment[nso]=Peakanyo ya Ditirelo tsa System +Comment[pa]=ਸਿਸਟਮ ਸੇਵਾਵਾਂ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja usług systemowych +Comment[pt]=Configuração dos Serviços do Sistema +Comment[pt_BR]=Configuração de Serviços do Sistema +Comment[ro]=Configurează serviciile de sistem +Comment[ru]=Настройка системных служб +Comment[rw]=Iboneza rya Serivise Sisitemu +Comment[se]=Vuogádatbálvalusaid heiveheapmi +Comment[sk]=Nastavenie systémových služieb +Comment[sl]=Nastavitve sistemskih storitev +Comment[sr]=Подешавање системских сервиса +Comment[sr@Latn]=Podešavanje sistemskih servisa +Comment[sv]=Anpassa systemets tjänster +Comment[ta]=சாதன சேவை அமைப்பு +Comment[tg]=Танзими хидматҳои система +Comment[th]=ปรับแต่งบริการของระบบ +Comment[tr]=Sistem Servisleri Yapılandırması +Comment[tt]=Sistem Xezmätlären Caylawçı +Comment[uk]=Конфігурація служб систем +Comment[uz]=Tizimning xizmatlarini moslash +Comment[uz@cyrillic]=Тизимнинг хизматларини мослаш +Comment[ven]=Bzudzanyo ya tshumelo ya sisitemu +Comment[vi]=Cấu hình Dịch vụ Hệ thống +Comment[wa]=Apontiaedje des siervices do sistinme +Comment[xh]=Uqwalaselo Lweenkonzo Zendlela zokuseneza +Comment[zh_CN]=系统服务配置 +Comment[zh_TW]=系統服務組態 +Comment[zu]=Inhlanganisela Yemisebenzi Yesistimu +Keywords=KDED,Daemon,Services +Keywords[ar]=KDED,Daemon,Services,مراقب,خدمات +Keywords[az]=KDED,Demon,Xidmətlər +Keywords[be]=Дэман,Сервісы,KDED,Daemon,Services +Keywords[bg]=услуга, обслужване, сървър, демон, KDED, Daemon, Services +Keywords[br]=KDED,Diaoul,Servijoù +Keywords[ca]=KDED,Dimoni,Serveis +Keywords[cs]=KDED,démon,služby +Keywords[csb]=KDED,demóna,ùsłëżnotë +Keywords[cy]=KDED,Daemon,Gwasanaethau +Keywords[da]=KDED,Dæmon,Tjenester +Keywords[de]=KDED,Dämon,Dienst,Daemon,Services,Dienste +Keywords[el]=KDED,Δαίμονας,Υπηρεσίες +Keywords[eo]=KDED,demono,servoj +Keywords[es]=KDED,Demonio,servicios +Keywords[et]=KDED,deemon,teenused +Keywords[eu]=KDED,Daemon-a,Zerbitzuak +Keywords[fa]=KDED،شبح، خدمات +Keywords[fi]=KDED,Palvelin,Palvelut +Keywords[fr]=KDED,Daemon,Démon,Services +Keywords[fy]=KDED,Daemon,services,tsjinsten,systeemtsjinsten,systeem +Keywords[ga]=KDED,Deamhan,Seirbhísí +Keywords[gl]=KDED,Demo,Servizos +Keywords[he]=KDED,תהליך רקע,שירותים,Daemon,Services +Keywords[hi]=केडीईडी,डेमन,सेवाएँ +Keywords[hr]=KDED,Daemon,Services,Demon,Usluge +Keywords[hu]=KDED,démon,szolgáltatás +Keywords[is]=KDED,þjónn,Þjónustur,púki,þræll +Keywords[it]=KDED,demone,servizi +Keywords[ja]=KDED,デーモン,サービス +Keywords[km]=KDED,Daemon,សេវា +Keywords[lt]=KDED,Daemon,Services, demonas,tarnybos +Keywords[lv]=KDED,Dēmoni,Servisi +Keywords[mn]=КДЭХ,Хэвтүүл,Services,Үйлчилгээ +Keywords[ms]=KDED,Daemon,Servis +Keywords[mt]=KDED,Daemon,Services,servizzi +Keywords[nb]=KDED,nisse,tjenester,daemon +Keywords[nds]=KDED,Daemon,Services,Dämoon,Deenst,Deensten +Keywords[ne]=KDED, डेइमन, सेवा +Keywords[nl]=KDED,Daemon,services,diensten,systeemdiensten,systeem +Keywords[nn]=KDED,daemon,nisse,tenester +Keywords[nso]=KDED,Daemon,Ditirelo +Keywords[pa]=KDED,Daemon,Services,ਸੇਵਾਵਾਂ +Keywords[pl]=KDED,demon,usługi +Keywords[pt]=KDED,Servidor,Serviços +Keywords[pt_BR]=KDED,Servidor,Serviços +Keywords[ro]=KDED,demon,servicii +Keywords[ru]=KDED,Daemon,Services,службы,служба +Keywords[rw]=KDED, Dayimoni,Serivise +Keywords[se]=KDED,daemon,bálvalusat +Keywords[sk]=KDED,Daemon,služby +Keywords[sl]=KDED,demon,storitve +Keywords[sr]=KDED, Демон, Сервиси +Keywords[sr@Latn]=KDED, Demon, Servisi +Keywords[sv]=KDED,Demon,Tjänster +Keywords[ta]=KDED,டேமான்,சேவைகள் +Keywords[th]=KDED,เดมอน,บริการ +Keywords[tr]=KDED,program,servisler +Keywords[uk]=KDED,демон,служби +Keywords[uz]=KDED,xizmat,xizmatlar +Keywords[uz@cyrillic]=KDED,хизмат,хизматлар +Keywords[ven]=KDED,Daemon,Dzitshumelo +Keywords[vi]=KDED,Trình nền,Dịch vụ +Keywords[wa]=KDED,Daemon,Services,demon,siervices +Keywords[xh]=KDED,Daemon,Iinkonzo +Keywords[zh_CN]=KDED,Daemon,Services,守护程序,服务 +Keywords[zh_TW]=KDED,Daemon,Services,伺服程式,服務 +Keywords[zu]=KDED,Daemon,Imisebenzi + +Categories=Qt;KDE;X-KDE-settings-components; diff --git a/kcontrol/kded/kcmkded.h b/kcontrol/kded/kcmkded.h new file mode 100644 index 000000000..b945ff52f --- /dev/null +++ b/kcontrol/kded/kcmkded.h @@ -0,0 +1,78 @@ +/* This file is part of the KDE project + Copyright (C) 2002 Daniel Molkentin <molkentin@kde.org> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + */ +#ifndef KCMKDED_H +#define KCMKDED_H + +#include <qlistview.h> + +#include <kcmodule.h> + +class KListView; + +class QStringList; +class QPushButton; + +class KDEDConfig : public KCModule +{ +Q_OBJECT +public: + KDEDConfig(QWidget* parent, const char* name= 0L, const QStringList& foo = QStringList()); + ~KDEDConfig() {}; + + void load(); + void load( bool useDefaults ); + void save(); + void defaults(); + +protected slots: + void slotReload(); + void slotStartService(); + void slotStopService(); + void slotServiceRunningToggled(); + void slotEvalItem(QListViewItem *item); + void slotItemChecked(QCheckListItem *item); + void getServiceStatus(); + + bool autoloadEnabled(KConfig *config, const QString &filename); + void setAutoloadEnabled(KConfig *config, const QString &filename, bool b); + +private: + KListView *_lvLoD; + KListView *_lvStartup; + QPushButton *_pbStart; + QPushButton *_pbStop; + + QString RUNNING; + QString NOT_RUNNING; +}; + +class CheckListItem : public QObject, public QCheckListItem +{ + Q_OBJECT +public: + CheckListItem(QListView* parent, const QString &text); + ~CheckListItem() { } +signals: + void changed(QCheckListItem*); +protected: + virtual void stateChange(bool); +}; + +#endif // KCMKDED_H + |