• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KUtils

  • kutils
  • ksettings
dialog.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2003 Matthias Kretz <kretz@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17
18*/
19
20#include "dialog.h"
21#include "dialog_p.h"
22
23#include "dispatcher.h"
24//#include "componentsdialog_p.h"
25
26#include <klocale.h>
27#include <kservicegroup.h>
28#include <kdebug.h>
29#include <kservicetypetrader.h>
30#include <kconfig.h>
31#include <kstandarddirs.h>
32#include <kcomponentdata.h>
33#include <kiconloader.h>
34#include <QtCore/QFile>
35#include <QtGui/QCheckBox>
36#include <QtCore/QStack>
37
38uint qHash(const KCModuleInfo &info)
39{
40 return qHash(info.fileName());
41}
42
43namespace KSettings
44{
45
46Dialog::Dialog(QWidget *parent)
47 : KCMultiDialog(*new DialogPrivate, new KPageWidget, parent)
48{
49}
50
51Dialog::Dialog(const QStringList &components, QWidget *parent)
52 : KCMultiDialog(*new DialogPrivate, new KPageWidget, parent)
53{
54 Q_D(Dialog);
55 d->components = components;
56}
57
58Dialog::~Dialog()
59{
60}
61
62void Dialog::setAllowComponentSelection(bool selection)
63{
64 d_func()->staticlistview = !selection;
65}
66
67bool Dialog::allowComponentSelection() const
68{
69 return !d_func()->staticlistview;
70}
71
72void Dialog::setKCMArguments(const QStringList& arguments)
73{
74 Q_D(Dialog);
75 d->arguments = arguments;
76}
77
78void Dialog::setComponentBlacklist(const QStringList& blacklist)
79{
80 Q_D(Dialog);
81 d->componentBlacklist = blacklist;
82}
83
84void Dialog::addPluginInfos(const KPluginInfo::List &plugininfos)
85{
86 Q_D(Dialog);
87 for (KPluginInfo::List::ConstIterator it = plugininfos.begin();
88 it != plugininfos.end(); ++it ) {
89 d->registeredComponents.append(it->pluginName());
90 if (it->kcmServices().isEmpty()) {
91 // this plugin has no kcm services, still we want to show the disable/enable stuff
92 // so add a dummy kcm
93 KService::Ptr service = it->service();
94 d->kcmInfos << KCModuleInfo(service);
95 continue;
96 }
97 foreach (const KService::Ptr &service, it->kcmServices()) {
98 d->kcmInfos << KCModuleInfo(service);
99 }
100 }
101
102 // The plugin, when disabled, disables all the KCMs described by kcmServices().
103 // - Normally they are grouped using a .setdlg file so that the group parent can get a
104 // checkbox to enable/disable the plugin.
105 // - If the plugin does not belong to a group and has only one KCM the checkbox can be
106 // used with this KCM.
107 // - If the plugin belongs to a group but there are other modules in the group that do not
108 // belong to this plugin we give a kError and show no checkbox
109 // - If the plugin belongs to multiple groups we give a kError and show no checkbox
110 d->plugininfos = plugininfos;
111}
112
113KPluginInfo::List Dialog::pluginInfos() const
114{
115 return d_func()->plugininfos;
116}
117
118void Dialog::showEvent(QShowEvent *)
119{
120 Q_D(Dialog);
121 if (d->firstshow) {
122 setUpdatesEnabled(false);
123 d->kcmInfos += d->instanceServices();
124 if (!d->components.isEmpty()) {
125 d->kcmInfos += d->parentComponentsServices(d->components);
126 }
127 d->createDialogFromServices();
128 d->firstshow = false;
129 setUpdatesEnabled(true);
130 }
131 Dispatcher::syncConfiguration();
132}
133
134DialogPrivate::DialogPrivate()
135 : staticlistview(true), firstshow(true), pluginStateDirty(0)
136{
137}
138
139QSet<KCModuleInfo> DialogPrivate::instanceServices()
140{
141 //kDebug(700) ;
142 QString componentName = KGlobal::mainComponent().componentName();
143 registeredComponents.append(componentName);
144 //kDebug(700) << "calling KServiceGroup::childGroup( " << componentName << " )";
145 KServiceGroup::Ptr service = KServiceGroup::childGroup( componentName );
146
147 QSet<KCModuleInfo> ret;
148
149 if( service && service->isValid() )
150 {
151 //kDebug(700) << "call was successful";
152 const KServiceGroup::List list = service->entries();
153 for( KServiceGroup::List::ConstIterator it = list.begin();
154 it != list.end(); ++it )
155 {
156 KSycocaEntry::Ptr p = (*it);
157 if( p->isType( KST_KService ) )
158 {
159 //kDebug( 700 ) << "found service";
160 ret << KCModuleInfo(KService::Ptr::staticCast(p));
161 }
162 else
163 kWarning( 700 ) << "KServiceGroup::childGroup returned"
164 " something else than a KService" << endl;
165 }
166 }
167
168 return ret;
169}
170
171QSet<KCModuleInfo> DialogPrivate::parentComponentsServices(const QStringList &kcdparents)
172{
173 registeredComponents += kcdparents;
174 QString constraint = kcdparents.join("' in [X-KDE-ParentComponents]) or ('");
175 constraint = "('" + constraint + "' in [X-KDE-ParentComponents])";
176
177 //kDebug(700) << "constraint = " << constraint;
178 const QList<KService::Ptr> services = KServiceTypeTrader::self()->query("KCModule", constraint);
179 QSet<KCModuleInfo> ret;
180 foreach (const KService::Ptr &service, services) {
181 ret << KCModuleInfo(service);
182 }
183 return ret;
184}
185
186bool DialogPrivate::isPluginForKCMEnabled(const KCModuleInfo *moduleinfo, KPluginInfo &pinfo) const
187{
188 // if the user of this class requested to hide disabled modules
189 // we check whether it should be enabled or not
190 bool enabled = true;
191 //kDebug(700) << "check whether the '" << moduleinfo->moduleName() << "' KCM should be shown";
192 // for all parent components
193 const QStringList parentComponents = moduleinfo->service()->property(
194 "X-KDE-ParentComponents" ).toStringList();
195 for( QStringList::ConstIterator pcit = parentComponents.begin();
196 pcit != parentComponents.end(); ++pcit )
197 {
198 // if the parentComponent is not registered ignore it
199 if (!registeredComponents.contains(*pcit)) {
200 continue;
201 }
202
203 // we check if the parent component is a plugin
204 // if not the KCModule must be enabled
205 enabled = true;
206 if (pinfo.pluginName() == *pcit) {
207 // it is a plugin: we check whether the plugin is enabled
208 pinfo.load();
209 enabled = pinfo.isPluginEnabled();
210 //kDebug(700) << "parent " << *pcit << " is " << (enabled ? "enabled" : "disabled");
211 }
212 // if it is enabled we're done for this KCModuleInfo
213 if (enabled) {
214 return true;
215 }
216 }
217 return enabled;
218}
219
220bool DialogPrivate::isPluginImmutable(const KPluginInfo &pinfo) const
221{
222 return pinfo.property("X-KDE-PluginInfo-Immutable").toBool();
223}
224
225KPageWidgetItem *DialogPrivate::createPageItem(KPageWidgetItem *parentItem,
226 const QString &name, const QString &comment,
227 const QString &iconName, int weight)
228{
229 Q_Q(Dialog);
230 QWidget * page = new QWidget( q );
231
232 QCheckBox *checkBox = new QCheckBox(i18n("Enable component"), page);
233 QLabel *iconLabel = new QLabel(page);
234 QLabel *commentLabel = new QLabel(comment, page);
235 commentLabel->setTextFormat(Qt::RichText);
236 QVBoxLayout * layout = new QVBoxLayout(page);
237 layout->addWidget(checkBox);
238 layout->addWidget(iconLabel);
239 layout->addWidget(commentLabel);
240 layout->addStretch();
241 page->setLayout(layout);
242
243 KPageWidgetItem *item = new KPageWidgetItem(page, name);
244 item->setIcon(KIcon(iconName));
245 iconLabel->setPixmap(item->icon().pixmap(128, 128));
246 item->setProperty("_k_weight", weight);
247 checkBoxForItem.insert(item, checkBox);
248
249 const KPageWidgetModel *model = qobject_cast<const KPageWidgetModel *>(q->pageWidget()->model());
250 Q_ASSERT(model);
251
252 if (parentItem) {
253 const QModelIndex parentIndex = model->index(parentItem);
254 const int siblingCount = model->rowCount(parentIndex);
255 int row = 0;
256 for (; row < siblingCount; ++row) {
257 KPageWidgetItem *siblingItem = model->item(parentIndex.child(row, 0));
258 if (siblingItem->property("_k_weight").toInt() > weight) {
259 // the item we found is heavier than the new module
260 q->insertPage(siblingItem, item);
261 break;
262 }
263 }
264 if (row == siblingCount) {
265 // the new module is either the first or the heaviest item
266 q->addSubPage(parentItem, item);
267 }
268 } else {
269 const int siblingCount = model->rowCount();
270 int row = 0;
271 for (; row < siblingCount; ++row) {
272 KPageWidgetItem *siblingItem = model->item(model->index(row, 0));
273 if (siblingItem->property("_k_weight").toInt() > weight) {
274 // the item we found is heavier than the new module
275 q->insertPage(siblingItem, item);
276 break;
277 }
278 }
279 if (row == siblingCount) {
280 // the new module is either the first or the heaviest item
281 q->addPage(item);
282 }
283 }
284
285 return (item);
286}
287
288void DialogPrivate::parseGroupFile( const QString & filename )
289{
290 KConfig file( filename, KConfig::SimpleConfig );
291 const QStringList groups = file.groupList();
292 foreach (const QString &group, groups) {
293 if (group.isEmpty()) {
294 continue;
295 }
296 KConfigGroup conf(&file, group);
297
298 const QString parentId = conf.readEntry("Parent");
299 KPageWidgetItem *parentItem = pageItemForGroupId.value(parentId);
300 KPageWidgetItem *item = createPageItem(parentItem, conf.readEntry("Name"), conf.readEntry("Comment"),
301 conf.readEntry("Icon"), conf.readEntry("Weight", 100));
302 pageItemForGroupId.insert(group, item);
303 }
304}
305
306void DialogPrivate::createDialogFromServices()
307{
308 Q_Q(Dialog);
309 // read .setdlg files
310 QString setdlgpath = KStandardDirs::locate( "appdata",
311 KGlobal::mainComponent().componentName() + ".setdlg" );
312 const QStringList setdlgaddon = KGlobal::dirs()->findAllResources( "appdata",
313 "ksettingsdialog/*.setdlg" );
314 if (!setdlgpath.isNull()) {
315 parseGroupFile(setdlgpath);
316 }
317 if (setdlgaddon.size() > 0) {
318 for (QStringList::ConstIterator it = setdlgaddon.begin(); it != setdlgaddon.end(); ++it) {
319 parseGroupFile(*it);
320 }
321 }
322
323 //kDebug(700) << kcmInfos.count();
324 foreach (const KCModuleInfo &info, kcmInfos) {
325 const QStringList parentComponents = info.service()->property("X-KDE-ParentComponents").toStringList();
326 bool blacklisted = false;
327 foreach (const QString &parentComponent, parentComponents) {
328 if (componentBlacklist.contains(parentComponent)) {
329 blacklisted = true;
330 break;
331 }
332 }
333 if (blacklisted) {
334 continue;
335 }
336 const QString parentId = info.service()->property("X-KDE-CfgDlgHierarchy", QVariant::String).toString();
337 KPageWidgetItem *parent = pageItemForGroupId.value(parentId);
338 if (!parent) {
339 // dummy kcm
340 bool foundPlugin = false;
341 foreach (const KPluginInfo &pinfo, plugininfos) {
342 if (pinfo.service() == info.service()) {
343 if (!pinfo.kcmServices().count()) {
344 const KService::Ptr service = info.service();
345 // FIXME get weight from service or plugin info
346 const int weight = 1000;
347 KPageWidgetItem *item = createPageItem(0, service->name(), service->comment(), service->icon(), weight);
348 connectItemCheckBox(item, pinfo, pinfo.isPluginEnabled());
349 foundPlugin = true;
350 break;
351 }
352 }
353 }
354 if (foundPlugin) {
355 continue;
356 }
357 }
358 KPageWidgetItem *item = q->addModule(info, parent, arguments);
359 kDebug(700) << "added KCM '" << info.moduleName() << "'";
360 foreach (KPluginInfo pinfo, plugininfos) {
361 kDebug(700) << pinfo.pluginName();
362 if (pinfo.kcmServices().contains(info.service())) {
363 const bool isEnabled = isPluginForKCMEnabled(&info, pinfo);
364 kDebug(700) << "correct KPluginInfo for this KCM";
365 // this KCM belongs to a plugin
366 if (parent && pinfo.kcmServices().count() >= 1) {
367 item->setEnabled(isEnabled);
368 const KPluginInfo &plugin = pluginForItem.value(parent);
369 if (plugin.isValid()) {
370 if (plugin != pinfo) {
371 kError(700) << "A group contains more than one plugin: '"
372 << plugin.pluginName() << "' and '" << pinfo.pluginName()
373 << "'. Now it won't be possible to enable/disable the plugin."
374 << endl;
375 parent->setCheckable(false);
376 q->disconnect(parent, SIGNAL(toggled(bool)), q, SLOT(_k_updateEnabledState(bool)));
377 }
378 // else everything is fine
379 } else {
380 connectItemCheckBox(parent, pinfo, isEnabled);
381 }
382 } else {
383 pluginForItem.insert(item, pinfo);
384 item->setCheckable(!isPluginImmutable(pinfo));
385 item->setChecked(isEnabled);
386 q->connect(item, SIGNAL(toggled(bool)), q, SLOT(_k_updateEnabledState(bool)));
387 }
388 break;
389 }
390 }
391 }
392 // now that the KCMs are in, check for empty groups and remove them again
393 {
394 const KPageWidgetModel *model = qobject_cast<const KPageWidgetModel *>(q->pageWidget()->model());
395 const QHash<QString, KPageWidgetItem *>::ConstIterator end = pageItemForGroupId.constEnd();
396 QHash<QString, KPageWidgetItem *>::ConstIterator it = pageItemForGroupId.constBegin();
397 for (; it != end; ++it) {
398 const QModelIndex index = model->index(it.value());
399 KPluginInfo pinfo;
400 foreach (const KPluginInfo &p, plugininfos) {
401 if (p.name()==it.key()) {
402 pinfo = p;
403 break;
404 }
405 }
406 bool allowEmpty = false;
407 if (pinfo.isValid()) {
408 allowEmpty = pinfo.property("X-KDE-PluginInfo-AllowEmptySettings").toBool();
409 }
410
411 if (!index.child(0, 0).isValid()) {
412 // no children, and it's not allowed => remove this item
413 if (!allowEmpty) {
414 q->removePage(it.value());
415 } else {
416 connectItemCheckBox(it.value(), pinfo, pinfo.isPluginEnabled());
417 }
418 }
419 }
420 }
421
422 // TODO: Don't show the reset button until the issue with the
423 // KPluginSelector::load() method is solved.
424 // Problem:
425 // KCMultiDialog::show() call KCModule::load() to reset all KCMs
426 // (KPluginSelector::load() resets all plugin selections and all plugin
427 // KCMs).
428 // The reset button calls KCModule::load(), too but in this case we want the
429 // KPluginSelector to only reset the current visible plugin KCM and not
430 // touch the plugin selections.
431 // I have no idea how to check that in KPluginSelector::load()...
432 //q->showButton(KDialog::User1, true);
433
434 QObject::connect(q, SIGNAL(okClicked()), q, SLOT(_k_syncConfiguration()));
435 QObject::connect(q, SIGNAL(applyClicked()), q, SLOT(_k_syncConfiguration()));
436 QObject::connect(q, SIGNAL(configCommitted(QByteArray)), q,
437 SLOT(_k_reparseConfiguration(QByteArray)));
438}
439
440void DialogPrivate::connectItemCheckBox(KPageWidgetItem *item, const KPluginInfo &pinfo, bool isEnabled)
441{
442 Q_Q(Dialog);
443 QCheckBox *checkBox = checkBoxForItem.value(item);
444 Q_ASSERT(checkBox);
445 pluginForItem.insert(item, pinfo);
446 item->setCheckable(!isPluginImmutable(pinfo));
447 item->setChecked(isEnabled);
448 checkBox->setVisible(!isPluginImmutable(pinfo));
449 checkBox->setChecked(isEnabled);
450 q->connect(item, SIGNAL(toggled(bool)), q, SLOT(_k_updateEnabledState(bool)));
451 q->connect(item, SIGNAL(toggled(bool)), checkBox, SLOT(setChecked(bool)));
452 q->connect(checkBox, SIGNAL(clicked(bool)), item, SLOT(setChecked(bool)));
453}
454
455void DialogPrivate::_k_syncConfiguration()
456{
457 Q_Q(Dialog);
458 const QHash<KPageWidgetItem *, KPluginInfo>::Iterator endIt = pluginForItem.end();
459 QHash<KPageWidgetItem *, KPluginInfo>::Iterator it = pluginForItem.begin();
460 for (; it != endIt; ++it) {
461 KPageWidgetItem *item = it.key();
462 KPluginInfo pinfo = it.value();
463 pinfo.setPluginEnabled(item->isChecked());
464 pinfo.save();
465 }
466 if (pluginStateDirty > 0) {
467 emit q->pluginSelectionChanged();
468 pluginStateDirty = 0;
469 }
470 Dispatcher::syncConfiguration();
471}
472
473void DialogPrivate::_k_reparseConfiguration(const QByteArray &a)
474{
475 Dispatcher::reparseConfiguration(a);
476}
477
478/*
479void DialogPrivate::_k_configureTree()
480{
481 kDebug( 700 ) ;
482 QObject::connect(subdlg, SIGNAL(okClicked()), q, SLOT(_k_updateTreeList()));
483 QObject::connect(subdlg, SIGNAL(applyClicked()), q, SLOT(_k_updateTreeList()));
484 QObject::connect(subdlg, SIGNAL(okClicked()), q, SIGNAL(pluginSelectionChanged()));
485 QObject::connect(subdlg, SIGNAL(applyClicked()), q, SIGNAL(pluginSelectionChanged()));
486}
487*/
488
489void DialogPrivate::_k_clientChanged()
490{
491 if (pluginStateDirty > 0) {
492 Q_Q(Dialog);
493 q->enableButton(KDialog::Apply, true);
494 } else {
495 KCMultiDialogPrivate::_k_clientChanged();
496 }
497}
498
499void DialogPrivate::_k_updateEnabledState(bool enabled)
500{
501 Q_Q(Dialog);
502 KPageWidgetItem *item = qobject_cast<KPageWidgetItem *>(q->sender());
503 if (!item) {
504 kWarning(700) << "invalid sender";
505 return;
506 }
507
508 // iterate over all child KPageWidgetItem objects and check whether they need to be enabled/disabled
509 const KPageWidgetModel *model = qobject_cast<const KPageWidgetModel *>(q->pageWidget()->model());
510 Q_ASSERT(model);
511 QModelIndex index = model->index(item);
512 if (!index.isValid()) {
513 kWarning(700) << "could not find item in model";
514 return;
515 }
516
517 const KPluginInfo &pinfo = pluginForItem.value(item);
518 if (!pinfo.isValid()) {
519 kWarning(700) << "could not find KPluginInfo in item";
520 return;
521 }
522 if (pinfo.isPluginEnabled() != enabled) {
523 ++pluginStateDirty;
524 } else {
525 --pluginStateDirty;
526 }
527 if (pluginStateDirty < 2) {
528 _k_clientChanged();
529 }
530
531 //kDebug(700) ;
532
533 QModelIndex firstborn = index.child(0, 0);
534 if (firstborn.isValid()) {
535 //kDebug(700) << "iterating over children";
536 // change all children
537 index = firstborn;
538 QStack<QModelIndex> stack;
539 while (index.isValid()) {
540 //kDebug(700) << index;
541 KPageWidgetItem *item = model->item(index);
542 //kDebug(700) << "item->setEnabled(" << enabled << ')';
543 item->setEnabled(enabled);
544 firstborn = index.child(0, 0);
545 if (firstborn.isValid()) {
546 stack.push(index);
547 index = firstborn;
548 } else {
549 index = index.sibling(index.row() + 1, 0);
550 while (!index.isValid() && !stack.isEmpty()) {
551 index = stack.pop();
552 index = index.sibling(index.row() + 1, 0);
553 }
554 }
555 }
556 }
557}
558
559} //namespace
560
561#include "dialog.moc"
562
563// vim: ts=4
KCModuleInfo
A class that provides information about a KCModule.
Definition: kcmoduleinfo.h:48
KCModuleInfo::fileName
QString fileName() const
Definition: kcmoduleinfo.cpp:141
KCModuleInfo::service
KService::Ptr service() const
Definition: kcmoduleinfo.cpp:156
KCModuleInfo::moduleName
QString moduleName() const
Definition: kcmoduleinfo.cpp:151
KCMultiDialogPrivate::_k_clientChanged
virtual void _k_clientChanged()
Definition: kcmultidialog.cpp:108
KCMultiDialog
A class that offers a KPageDialog containing arbitrary KControl Modules.
Definition: kcmultidialog.h:38
KComponentData::componentName
QString componentName() const
KConfigGroup
KConfig
KConfig::SimpleConfig
SimpleConfig
KDialog::Apply
Apply
KIcon
KPageWidgetItem
KPageWidgetItem::icon
KIcon icon
KPageWidgetItem::setChecked
void setChecked(bool checked)
KPageWidgetItem::isChecked
bool isChecked() const
KPageWidgetItem::setEnabled
void setEnabled(bool)
KPageWidgetItem::setIcon
void setIcon(const KIcon &icon)
KPageWidgetItem::setCheckable
void setCheckable(bool checkable)
KPageWidgetModel
KPageWidgetModel::rowCount
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
KPageWidgetModel::item
KPageWidgetItem * item(const QModelIndex &index) const
KPageWidgetModel::index
QModelIndex index(const KPageWidgetItem *item) const
KPageWidget
KPluginInfo
KPluginInfo::save
void save(KConfigGroup config=KConfigGroup())
KPluginInfo::isValid
bool isValid() const
KPluginInfo::pluginName
QString pluginName() const
KPluginInfo::property
QVariant property(const QString &key) const
KPluginInfo::kcmServices
QList< KService::Ptr > kcmServices() const
KPluginInfo::service
KService::Ptr service() const
KPluginInfo::name
QString name() const
KPluginInfo::isPluginEnabled
bool isPluginEnabled() const
KPluginInfo::load
void load(const KConfigGroup &config=KConfigGroup())
KPluginInfo::setPluginEnabled
void setPluginEnabled(bool enabled)
KServiceGroup::childGroup
static Ptr childGroup(const QString &parent)
KServiceTypeTrader::self
static KServiceTypeTrader * self()
KServiceTypeTrader::query
KService::List query(const QString &servicetype, const QString &constraint=QString()) const
KSettings::DialogPrivate
Definition: dialog_p.h:45
KSettings::DialogPrivate::registeredComponents
QStringList registeredComponents
Definition: dialog_p.h:56
KSettings::DialogPrivate::_k_updateEnabledState
void _k_updateEnabledState(bool)
Definition: dialog.cpp:499
KSettings::DialogPrivate::_k_clientChanged
virtual void _k_clientChanged()
Definition: dialog.cpp:489
KSettings::DialogPrivate::connectItemCheckBox
void connectItemCheckBox(KPageWidgetItem *item, const KPluginInfo &pinfo, bool isEnabled)
Definition: dialog.cpp:440
KSettings::DialogPrivate::arguments
QStringList arguments
Definition: dialog_p.h:59
KSettings::DialogPrivate::DialogPrivate
DialogPrivate()
Definition: dialog.cpp:134
KSettings::DialogPrivate::_k_syncConfiguration
void _k_syncConfiguration()
Definition: dialog.cpp:455
KSettings::DialogPrivate::kcmInfos
QSet< KCModuleInfo > kcmInfos
Definition: dialog_p.h:57
KSettings::DialogPrivate::componentBlacklist
QStringList componentBlacklist
Definition: dialog_p.h:58
KSettings::DialogPrivate::plugininfos
KPluginInfo::List plugininfos
Definition: dialog_p.h:54
KSettings::DialogPrivate::createPageItem
KPageWidgetItem * createPageItem(KPageWidgetItem *parentItem, const QString &name, const QString &comment, const QString &iconName, int weight)
Definition: dialog.cpp:225
KSettings::DialogPrivate::checkBoxForItem
QHash< KPageWidgetItem *, QCheckBox * > checkBoxForItem
Definition: dialog_p.h:53
KSettings::DialogPrivate::_k_reparseConfiguration
void _k_reparseConfiguration(const QByteArray &a)
Definition: dialog.cpp:473
KSettings::DialogPrivate::pageItemForGroupId
QHash< QString, KPageWidgetItem * > pageItemForGroupId
Definition: dialog_p.h:51
KSettings::DialogPrivate::pluginForItem
QHash< KPageWidgetItem *, KPluginInfo > pluginForItem
Definition: dialog_p.h:52
KSettings::DialogPrivate::pluginStateDirty
quint32 pluginStateDirty
Definition: dialog_p.h:64
KSettings::Dialog
Generic configuration dialog that works over component boundaries.
Definition: dialog.h:74
KSettings::Dialog::setAllowComponentSelection
void setAllowComponentSelection(bool allowSelection)
Tells the dialog whether the entries in the listview are all static or whether it should add checkbox...
Definition: dialog.cpp:62
KSettings::Dialog::~Dialog
~Dialog()
Definition: dialog.cpp:58
KSettings::Dialog::setComponentBlacklist
void setComponentBlacklist(const QStringList &blacklist)
Set the blacklisted component list.
Definition: dialog.cpp:78
KSettings::Dialog::pluginInfos
QList< KPluginInfo > pluginInfos() const
Returns a list of all KPluginInfo objects the dialog uses.
Definition: dialog.cpp:113
KSettings::Dialog::Dialog
Dialog(QWidget *parent=0)
Construct a new Preferences Dialog for the application.
Definition: dialog.cpp:46
KSettings::Dialog::allowComponentSelection
bool allowComponentSelection() const
Definition: dialog.cpp:67
KSettings::Dialog::addPluginInfos
void addPluginInfos(const QList< KPluginInfo > &plugininfos)
If you use a Configurable dialog you need to pass KPluginInfo objects that the dialog should configur...
Definition: dialog.cpp:84
KSettings::Dialog::setKCMArguments
void setKCMArguments(const QStringList &arguments)
Sets the argument list that is given to all the KControlModule's when they are created.
Definition: dialog.cpp:72
KSettings::Dialog::showEvent
void showEvent(QShowEvent *)
Reimplemented to lazy create the dialog on first show.
Definition: dialog.cpp:118
KSharedPtr< KService >
KSharedPtr< KService >::staticCast
static KSharedPtr< T > staticCast(const KSharedPtr< U > &o)
KStandardDirs::findAllResources
QStringList findAllResources(const char *type, const QString &filter, SearchOptions options, QStringList &relPaths) const
KStandardDirs::locate
static QString locate(const char *type, const QString &filename, const KComponentData &cData=KGlobal::mainComponent())
QHash
QLabel
QList< KPluginInfo >
QSet
QWidget
qHash
uint qHash(const KCModuleInfo &info)
Definition: dialog.cpp:38
dialog.h
dialog_p.h
dispatcher.h
kDebug
#define kDebug
kWarning
#define kWarning
kcomponentdata.h
kconfig.h
kdebug.h
kiconloader.h
klocale.h
i18n
QString i18n(const char *text)
kservicegroup.h
kservicetypetrader.h
kstandarddirs.h
KGlobal::mainComponent
const KComponentData & mainComponent()
KGlobal::dirs
KStandardDirs * dirs()
group
group
list
QStringList list(const QString &fileClass)
KSettings::Dispatcher::syncConfiguration
void syncConfiguration()
When this function is called the KConfig objects of all the registered instances are sync()ed.
Definition: dispatcher.cpp:97
KSettings::Dispatcher::reparseConfiguration
void reparseConfiguration(const QString &componentName)
Call this function when the configuration belonging to the associated componentData name has changed.
Definition: dispatcher.cpp:81
KSettings
A collection of classes to create configuration dialogs that work over component boundaries.
Definition: componentsdialog.cpp:34
name
const char * name(StandardAction id)
end
const KShortcut & end()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KUtils

Skip menu "KUtils"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal