|
|
@ -26,6 +26,7 @@
|
|
|
|
#include <tdelocale.h>
|
|
|
|
#include <tdelocale.h>
|
|
|
|
#include <kiconloader.h>
|
|
|
|
#include <kiconloader.h>
|
|
|
|
#include <kservicegroup.h>
|
|
|
|
#include <kservicegroup.h>
|
|
|
|
|
|
|
|
#include <tdecmoduleloader.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <kdebug.h>
|
|
|
|
#include <tqwhatsthis.h>
|
|
|
|
#include <tqwhatsthis.h>
|
|
|
|
#include <tqbitmap.h>
|
|
|
|
#include <tqbitmap.h>
|
|
|
@ -91,6 +92,14 @@ ModuleTreeView::ModuleTreeView(ConfigModuleList *list, TQWidget * parent, const
|
|
|
|
|
|
|
|
|
|
|
|
void ModuleTreeView::fill()
|
|
|
|
void ModuleTreeView::fill()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
// If we have a currently selected module, preserve selection
|
|
|
|
|
|
|
|
ConfigModule *currentModule = nullptr;
|
|
|
|
|
|
|
|
if (currentItem())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
currentModule = static_cast<ModuleTreeItem*>(currentItem())->module();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// (Re)fill the tree view
|
|
|
|
clear();
|
|
|
|
clear();
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList subMenus = _modules->submenus(KCGlobal::baseGroup());
|
|
|
|
TQStringList subMenus = _modules->submenus(KCGlobal::baseGroup());
|
|
|
@ -109,6 +118,13 @@ void ModuleTreeView::fill()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new ModuleTreeItem(this, module);
|
|
|
|
new ModuleTreeItem(this, module);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Restore selection
|
|
|
|
|
|
|
|
if (currentModule)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
makeSelected(currentModule);
|
|
|
|
|
|
|
|
makeVisible(currentModule);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ModuleTreeView::fill(ModuleTreeItem *parent, const TQString &parentPath)
|
|
|
|
void ModuleTreeView::fill(ModuleTreeItem *parent, const TQString &parentPath)
|
|
|
@ -131,8 +147,6 @@ void ModuleTreeView::fill(ModuleTreeItem *parent, const TQString &parentPath)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQSize ModuleTreeView::sizeHint() const
|
|
|
|
TQSize ModuleTreeView::sizeHint() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return TQListView::sizeHint().boundedTo(
|
|
|
|
return TQListView::sizeHint().boundedTo(
|
|
|
@ -272,12 +286,7 @@ ModuleTreeItem::ModuleTreeItem(TQListViewItem *parent, ConfigModule *module)
|
|
|
|
, _tag(TQString::null)
|
|
|
|
, _tag(TQString::null)
|
|
|
|
, _maxChildIconWidth(0)
|
|
|
|
, _maxChildIconWidth(0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_module)
|
|
|
|
init();
|
|
|
|
{
|
|
|
|
|
|
|
|
setText(0, " " + module->moduleName());
|
|
|
|
|
|
|
|
_icon = module->icon();
|
|
|
|
|
|
|
|
setPixmap(0, appIcon(_icon));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ModuleTreeItem::ModuleTreeItem(TQListView *parent, ConfigModule *module)
|
|
|
|
ModuleTreeItem::ModuleTreeItem(TQListView *parent, ConfigModule *module)
|
|
|
@ -286,12 +295,7 @@ ModuleTreeItem::ModuleTreeItem(TQListView *parent, ConfigModule *module)
|
|
|
|
, _tag(TQString::null)
|
|
|
|
, _tag(TQString::null)
|
|
|
|
, _maxChildIconWidth(0)
|
|
|
|
, _maxChildIconWidth(0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_module)
|
|
|
|
init();
|
|
|
|
{
|
|
|
|
|
|
|
|
setText(0, " " + module->moduleName());
|
|
|
|
|
|
|
|
_icon = module->icon();
|
|
|
|
|
|
|
|
setPixmap(0, appIcon(_icon));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ModuleTreeItem::ModuleTreeItem(TQListViewItem *parent, const TQString& text)
|
|
|
|
ModuleTreeItem::ModuleTreeItem(TQListViewItem *parent, const TQString& text)
|
|
|
@ -308,6 +312,18 @@ ModuleTreeItem::ModuleTreeItem(TQListView *parent, const TQString& text)
|
|
|
|
, _maxChildIconWidth(0)
|
|
|
|
, _maxChildIconWidth(0)
|
|
|
|
{}
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ModuleTreeItem::init()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!_module) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setText(0, " " + _module->moduleName());
|
|
|
|
|
|
|
|
_icon = _module->icon();
|
|
|
|
|
|
|
|
setPixmap(0, appIcon(_icon));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setVisible(KCGlobal::showHiddenModules() || !_module->needsTest() || TDECModuleLoader::testModule(*_module));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ModuleTreeItem::setPixmap(int column, const TQPixmap& pm)
|
|
|
|
void ModuleTreeItem::setPixmap(int column, const TQPixmap& pm)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!pm.isNull())
|
|
|
|
if (!pm.isNull())
|
|
|
|