summaryrefslogtreecommitdiffstats
path: root/tdeutils
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-10-09 22:06:23 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-10-09 22:06:23 -0500
commit9a6735bb63e078fe0281bda13efa3c759f9bbd1d (patch)
treebac338f6f06f234c990189eace27239e18ac26d7 /tdeutils
parent54aa2cd493fb5fa2f699895b82b569baf5cc607a (diff)
downloadtdelibs-9a6735bb63e078fe0281bda13efa3c759f9bbd1d.tar.gz
tdelibs-9a6735bb63e078fe0281bda13efa3c759f9bbd1d.zip
Add handbookSection method to TDECModuleContainer
This relates to Bug 1850
Diffstat (limited to 'tdeutils')
-rw-r--r--tdeutils/tdecmodulecontainer.cpp30
-rw-r--r--tdeutils/tdecmodulecontainer.h6
2 files changed, 26 insertions, 10 deletions
diff --git a/tdeutils/tdecmodulecontainer.cpp b/tdeutils/tdecmodulecontainer.cpp
index 004ceb78a..2df7a0421 100644
--- a/tdeutils/tdecmodulecontainer.cpp
+++ b/tdeutils/tdecmodulecontainer.cpp
@@ -60,6 +60,7 @@ class TDECModuleContainer::TDECModuleContainerPrivate
KPushButton *btnRootMode;
TQHBoxLayout *btnLayout;
TQVBoxLayout *topLayout;
+ TQString handbookSection;
};
@@ -134,10 +135,14 @@ void TDECModuleContainer::addModule( const TQString& module )
return;
}
- if( !TDECModuleLoader::testModule( module ))
+ if( !TDECModuleLoader::testModule( module )) {
return;
+ }
TDECModuleProxy* proxy = new TDECModuleProxy( module, false, d->tabWidget, module.latin1());
+ if (allModules.count() < 1) {
+ d->handbookSection = proxy->handbookSection();
+ }
allModules.append( proxy );
d->tabWidget->addTab( proxy, TQIconSet(TDEGlobal::iconLoader()->loadIcon(
@@ -153,37 +158,42 @@ void TDECModuleContainer::addModule( const TQString& module )
d->buttons = d->buttons | proxy->realModule()->buttons();
/* If we should add an Administrator Mode button */
- if ( proxy->moduleInfo().needsRootPrivileges() )
+ if ( proxy->moduleInfo().needsRootPrivileges() ) {
d->hasRootKCM=true;
-
-
+ }
}
void TDECModuleContainer::tabSwitched( TQWidget * module )
{
- if ( !d->hasRootKCM )
+ TDECModuleProxy* mod = (TDECModuleProxy *) module;
+ d->handbookSection = mod->handbookSection();
+
+ if ( !d->hasRootKCM ) {
return;
+ }
/* Not like this. Not like this. */
disconnect( d->btnRootMode, 0, 0, 0 );
/* Welcome to the real world huh baby? */
-
- TDECModuleProxy* mod = (TDECModuleProxy *) module;
- if ( mod->moduleInfo().needsRootPrivileges() && !mod->rootMode() )
- {
+ if ( mod->moduleInfo().needsRootPrivileges() && !mod->rootMode() ) {
d->btnRootMode->setEnabled( true );
connect( d->btnRootMode, TQT_SIGNAL( clicked() ),
TQT_SLOT( runAsRoot() ));
connect( mod, TQT_SIGNAL( childClosed() ),
TQT_SLOT ( rootExited() ));
}
- else
+ else {
d->btnRootMode->setEnabled( false );
+ }
setQuickHelp( mod->quickHelp() );
setAboutData( const_cast<TDEAboutData*>(mod->aboutData()) );
+}
+TQString TDECModuleContainer::handbookSection() const
+{
+ return d->handbookSection;
}
void TDECModuleContainer::runAsRoot()
diff --git a/tdeutils/tdecmodulecontainer.h b/tdeutils/tdecmodulecontainer.h
index d4af182b4..6d6717370 100644
--- a/tdeutils/tdecmodulecontainer.h
+++ b/tdeutils/tdecmodulecontainer.h
@@ -118,6 +118,12 @@ class TDEUTILS_EXPORT TDECModuleContainer : public TDECModule
*/
void defaults();
+ /**
+ * Reimplemented for internal purposes.
+ * @internal
+ */
+ virtual TQString handbookSection() const;
+
protected:
/**