diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-10-03 23:13:17 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-10-03 23:13:17 -0500 |
commit | 88a2e255141f97ac65c65fd89b5ef9a30b9138c4 (patch) | |
tree | 15dbaac8e5aaf4f3effed2d01ae9c82aa5f08236 /kcontrol/kcontrol | |
parent | 34cc40d9fb8f21485a467c2cfaba6fd0b063719f (diff) | |
download | tdebase-88a2e255141f97ac65c65fd89b5ef9a30b9138c4.tar.gz tdebase-88a2e255141f97ac65c65fd89b5ef9a30b9138c4.zip |
Add mechanism by which sections of relevant docbooks may be opened automatically based on active tab in TDECModule
Fix up several tabbed TDEControl modules to use this mechanism
Fix a couple of docbooks with missing section IDs
This relates to Bug 1850
Diffstat (limited to 'kcontrol/kcontrol')
-rw-r--r-- | kcontrol/kcontrol/helpwidget.cpp | 23 | ||||
-rw-r--r-- | kcontrol/kcontrol/helpwidget.h | 4 | ||||
-rw-r--r-- | kcontrol/kcontrol/proxywidget.cpp | 8 | ||||
-rw-r--r-- | kcontrol/kcontrol/proxywidget.h | 1 |
4 files changed, 30 insertions, 6 deletions
diff --git a/kcontrol/kcontrol/helpwidget.cpp b/kcontrol/kcontrol/helpwidget.cpp index 3e4fe717f..5407f8027 100644 --- a/kcontrol/kcontrol/helpwidget.cpp +++ b/kcontrol/kcontrol/helpwidget.cpp @@ -26,9 +26,13 @@ #include <krun.h> #include "global.h" +#include "dockcontainer.h" +#include "proxywidget.h" +#include "modules.h" + #include "helpwidget.h" -HelpWidget::HelpWidget(TQWidget *parent) : TQWhatsThis(parent) +HelpWidget::HelpWidget(DockContainer *parent) : TQWhatsThis(parent), _dock(parent) { setBaseText(); } @@ -60,16 +64,25 @@ TQString HelpWidget::text() const bool HelpWidget::clicked(const TQString & _url) { - if ( _url.isNull() ) + TQString textUrl = _url; + ConfigModule* dockModule = _dock->module(); + if ( dockModule) { + TQString section = dockModule->module()->handbookSection(); + if (section != "") { + textUrl = TQString( "%1#%2" ).arg( textUrl ).arg( section ); + } + } + + if ( textUrl.isNull() ) return true; - if ( _url.find('@') > -1 ) { - kapp->invokeMailer(_url); + if ( textUrl.find('@') > -1 ) { + kapp->invokeMailer(textUrl); return true; } TDEProcess process; - KURL url(KURL("help:/"), _url); + KURL url(KURL("help:/"), textUrl); if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") { process << "khelpcenter" diff --git a/kcontrol/kcontrol/helpwidget.h b/kcontrol/kcontrol/helpwidget.h index 1a01cc860..680184df5 100644 --- a/kcontrol/kcontrol/helpwidget.h +++ b/kcontrol/kcontrol/helpwidget.h @@ -22,11 +22,12 @@ class TQWidget; class TQWhatsThis; +class DockContainer; class HelpWidget : public TQWhatsThis { public: - HelpWidget(TQWidget *parent); + HelpWidget(DockContainer *parent); void setText( const TQString& docPath, const TQString& text); void setBaseText(); @@ -38,6 +39,7 @@ public: private: TQString docpath; TQString helptext; + DockContainer* _dock; }; #endif diff --git a/kcontrol/kcontrol/proxywidget.cpp b/kcontrol/kcontrol/proxywidget.cpp index 7aa2383b1..f937493fa 100644 --- a/kcontrol/kcontrol/proxywidget.cpp +++ b/kcontrol/kcontrol/proxywidget.cpp @@ -320,6 +320,14 @@ void ProxyWidget::clientChanged(bool state) emit changed(state); } +TQString ProxyWidget::handbookSection() const +{ + if (_client) + return _client->handbookSection(); + else + return TQString::null; +} + const TDEAboutData *ProxyWidget::aboutData() const { return _client->aboutData(); diff --git a/kcontrol/kcontrol/proxywidget.h b/kcontrol/kcontrol/proxywidget.h index bb951ccdf..874d30d4f 100644 --- a/kcontrol/kcontrol/proxywidget.h +++ b/kcontrol/kcontrol/proxywidget.h @@ -46,6 +46,7 @@ public: ~ProxyWidget(); TQString quickHelp() const; + TQString handbookSection() const; const TDEAboutData *aboutData() const; public slots: |