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
pull/2/head
Timothy Pearson 10 years ago
parent 34cc40d9fb
commit 88a2e25514

@ -160,7 +160,7 @@ scheme, discarding your changes.</para></important> </sect3>
</sect2>
<sect2>
<sect2 id="key-bindings-modifiers">
<title>Modifier Keys</title>
<para>Different keyboards offer different sets of modifier keys. A

@ -29,7 +29,7 @@
<sect1 id="window-deco">
<title>Window Decoration</title>
<sect2>
<sect2 id="window-deco-general">
<title>General</title>
<para>This module allows you to select a style for the borders around
@ -61,7 +61,7 @@ use.</para>
</sect2>
<sect2>
<sect2 id="window-deco-buttons">
<title>Buttons</title>
<para>This page has instructions directly on it - just drag around the

@ -100,6 +100,21 @@ TQString IconModule::quickHelp() const
"<p>You can also specify effects that should be applied to the icons.</p>");
}
TQString IconModule::handbookSection() const
{
int index = tab->currentPageIndex();
if (index == 0) {
//return "icon-theme";
return TQString::null;
}
else if (index == 1) {
return "icons-use";
}
else {
return TQString::null;
}
}
#include "main.moc"

@ -40,6 +40,7 @@ public:
void save();
void defaults();
TQString quickHelp() const;
virtual TQString handbookSection() const;
protected slots:
void moduleChanged(bool state);

@ -890,4 +890,28 @@ void MouseConfig::slotScrollPolarityChanged()
settings->m_handedNeedsApply = true;
}
TQString MouseConfig::handbookSection() const
{
int index = tabwidget->currentPageIndex();
if (index == 0) {
//return "mouse-general";
return TQString::null;
}
else if (index == 1) {
return "cursor-theme";
}
else if (index == 2) {
return "mouse-advanced";
}
else if (index == 3) {
return "mouse-navigation";
}
else if (index >= 4) {
return "logitech-mouse";
}
else {
return TQString::null;
}
}
#include "mouse.moc"

@ -102,6 +102,8 @@ public:
void load( bool useDefaults );
void defaults();
virtual TQString handbookSection() const;
private slots:
void slotClick();

@ -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"

@ -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

@ -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();

@ -46,6 +46,7 @@ public:
~ProxyWidget();
TQString quickHelp() const;
TQString handbookSection() const;
const TDEAboutData *aboutData() const;
public slots:

@ -125,6 +125,25 @@ void KeyModule::resizeEvent( TQResizeEvent * )
m_pTab->setGeometry( 0, 0, width(), height() );
}
TQString KeyModule::handbookSection() const
{
int index = m_pTab->currentPageIndex();
if (index == 0) {
//return "key-bindings-intro";
return TQString::null;
}
else if (index == 1) {
//return "key-bindings-use";
return TQString::null;
}
else if (index == 2) {
return "key-bindings-modifiers";
}
else {
return TQString::null;
}
}
//----------------------------------------------------
extern "C"

@ -43,6 +43,8 @@ class KeyModule : public TDECModule
void save();
void defaults();
virtual TQString handbookSection() const;
protected:
void initGUI();
void resizeEvent( TQResizeEvent* );

@ -485,4 +485,22 @@ TQString DesktopBehavior::quickHelp() const
"Use the \"What's This?\" (Shift+F1) to get help on specific options.");
}
TQString DesktopBehavior::handbookSection() const
{
int index = behaviorTab->currentPageIndex();
if (index == 0) {
//return "desktop-desktop";
return TQString::null;
}
else if (index == 1) {
return "desktop-behavior-file-icons";
}
else if (index == 2) {
return "desktop-behavior-device-icons";
}
else {
return TQString::null;
}
}
#include "desktopbehavior_impl.moc"

@ -36,8 +36,9 @@ public:
virtual void save();
virtual void defaults();
virtual TQString quickHelp() const;
virtual TQString handbookSection() const;
friend class DesktopBehaviorPreviewItem;
friend class DesktopBehaviorMediaItem;
friend class DesktopBehaviorMediaItem;
signals:
void changed();
@ -71,6 +72,7 @@ public:
virtual void load() { m_behavior->load(); emit TDECModule::changed( false ); }
virtual void save() { m_behavior->save(); emit TDECModule::changed( false ); }
virtual void defaults() { m_behavior->defaults(); emit TDECModule::changed( true ); }
virtual TQString handbookSection() const { return m_behavior->handbookSection(); };
private slots:
void changed();

@ -49,7 +49,7 @@ Config::Config( TQWidget* parent_P, const char* )
" You can configure settings that improve TDE performance here." ));
TQVBoxLayout *topLayout = new TQVBoxLayout( this );
TQTabWidget* tabs = new TQTabWidget( this );
tabs = new TQTabWidget( this );
konqueror_widget = new Konqueror( tabs );
konqueror_widget->layout()->setMargin( KDialog::marginHint() );
connect( konqueror_widget, TQT_SIGNAL( changed()), TQT_SLOT( changed()));
@ -85,6 +85,21 @@ void Config::defaults()
load( true );
}
TQString Config::handbookSection() const
{
int index = tabs->currentPageIndex();
if (index == 0) {
//return "konqueror-performance";
return TQString::null;
}
else if (index == 1) {
return "system-performance";
}
else {
return TQString::null;
}
}
KonquerorConfig::KonquerorConfig( TQWidget* parent_P, const char* )
: TDECModule( parent_P, "kcmperformance" )
{

@ -37,9 +37,11 @@ class Config
virtual void load( bool useDefaults );
virtual void save();
virtual void defaults();
virtual TQString handbookSection() const;
private:
Konqueror* konqueror_widget;
SystemWidget* system_widget;
TQTabWidget* tabs;
};
class KonquerorConfig

@ -1138,6 +1138,18 @@ void KCMStyle::addWhatsThis()
"or submenu appears.") );
}
TQString KCMStyle::handbookSection() const
{
int index = tabWidget->currentPageIndex();
if (index == 0) {
//return "style-intro";
return TQString::null;
}
else {
return TQString::null;
}
}
#include "kcmstyle.moc"
// vim: set noet ts=4:

@ -73,6 +73,8 @@ public:
virtual void save();
virtual void defaults();
virtual TQString handbookSection() const;
protected:
bool findStyle( const TQString& str, int& combobox_item );
void switchStyle(const TQString& styleName, bool force = false);

@ -956,6 +956,20 @@ TQString KWinDecorationModule::quickHelp() const
" In the \"Buttons\" tab you can change the positions of the buttons to your liking.</p>" );
}
TQString KWinDecorationModule::handbookSection() const
{
int index = tabWidget->currentPageIndex();
if (index == 0) {
//return "window-deco-general";
return TQString::null;
}
else if (index == 1) {
return "window-deco-buttons";
}
else {
return TQString::null;
}
}
void KWinDecorationModule::resetKWin()
{

@ -73,6 +73,8 @@ class KWinDecorationModule : public TDECModule, virtual public KWinDecorationIfa
TQString quickHelp() const;
virtual TQString handbookSection() const;
virtual void dcopUpdateClientList();
signals:

@ -200,6 +200,40 @@ void KWinOptions::moduleChanged(bool state)
emit TDECModule::changed(state);
}
TQString KWinOptions::handbookSection() const
{
int index = tab->currentPageIndex();
if (index == 0)
{
//return "focus";
return TQString::null;
}
else if (index == 1)
{
return "titlebar-actions";
}
else if (index == 2)
{
return "window-actions";
}
else if (index == 3)
{
return "moving";
}
else if (index == 4)
{
return "advanced";
}
else if (index == 5)
{
return "translucency";
}
else
{
return TQString::null;
}
}
TDEActionsOptions::TDEActionsOptions(TQWidget *parent, const char *name)
: TDECModule(parent, name)

@ -48,6 +48,7 @@ public:
void save();
void defaults();
TQString quickHelp() const;
virtual TQString handbookSection() const;
protected slots:

Loading…
Cancel
Save