diff options
author | Darrell Anderson <[email protected]> | 2014-02-10 16:29:07 -0600 |
---|---|---|
committer | Darrell Anderson <[email protected]> | 2014-02-10 16:29:07 -0600 |
commit | 50741cc5474353bba914746aa25b091aa609a38f (patch) | |
tree | 4749d137bae305e246f62dd290273b55d926ad3a /kcontrol/ioslaveinfo/kcmioslaveinfo.cpp | |
parent | 9abee0aada612f8cc875ff33f02c92c1211cb56f (diff) | |
download | tdebase-50741cc5474353bba914746aa25b091aa609a38f.tar.gz tdebase-50741cc5474353bba914746aa25b091aa609a38f.zip |
Remove KControl Protocols module, move protocol items to the help handbook,
rename TDEIOSlaves->Protocols, add new help files, update other help files,
make protocol handbooks consistent in format.
Diffstat (limited to 'kcontrol/ioslaveinfo/kcmioslaveinfo.cpp')
-rw-r--r-- | kcontrol/ioslaveinfo/kcmioslaveinfo.cpp | 159 |
1 files changed, 0 insertions, 159 deletions
diff --git a/kcontrol/ioslaveinfo/kcmioslaveinfo.cpp b/kcontrol/ioslaveinfo/kcmioslaveinfo.cpp deleted file mode 100644 index e1cdc10d2..000000000 --- a/kcontrol/ioslaveinfo/kcmioslaveinfo.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - * kcmioslaveinfo.cpp - * - * Copyright 2001 Alexander Neundorf <[email protected]> - * Copyright 2001 George Staikos <[email protected]> - * - * Requires the Qt widget libraries, available at no cost at - * http://www.troll.no/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include <tqfile.h> -#include <tqhbox.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqspinbox.h> -#include <tqtabwidget.h> -#include <tqtextcodec.h> -#include <tqvbox.h> -#include <tqwhatsthis.h> - -#include <tdeconfig.h> -#include <kdebug.h> -#include <kdialog.h> -#include <kgenericfactory.h> -#include <tdeglobal.h> -#include <kiconloader.h> -#include <tdeio/job.h> -#include <tdelocale.h> -#include <kprotocolinfo.h> -#include <kstandarddirs.h> - -#include "kcmioslaveinfo.h" - -typedef KGenericFactory<KCMIOSlaveInfo, TQWidget> SlaveFactory; -K_EXPORT_COMPONENT_FACTORY( kcm_ioslaveinfo, SlaveFactory("kcmioslaveinfo") ) - -KCMIOSlaveInfo::KCMIOSlaveInfo(TQWidget *parent, const char *name, const TQStringList &) - :TDECModule(SlaveFactory::instance(), parent,name),m_ioslavesLb(0),m_tfj(0) -{ - TQVBoxLayout *layout=new TQVBoxLayout(this, 0, KDialog::spacingHint()); - - setQuickHelp( i18n("<h1>IO slaves</h1> Gives you an overview of the installed ioslaves.")); - setButtons( TDECModule::Help ); - - TQLabel* label=new TQLabel(i18n("Available IO slaves:"),this); - TQHBox *hbox=new TQHBox(this); - m_ioslavesLb=new TDEListBox(hbox); - m_ioslavesLb->setMinimumSize(fontMetrics().width("blahfaselwhatever----"),10); - connect( m_ioslavesLb, TQT_SIGNAL( selectionChanged( TQListBoxItem * ) ), TQT_SLOT( showInfo( TQListBoxItem * ) ) ); - //TODO make something useful after 2.1 is released - m_info=new KTextBrowser(hbox); - hbox->setSpacing(KDialog::spacingHint()); - - layout->addWidget(label); - layout->addWidget(hbox); - hbox->setStretchFactor(m_ioslavesLb,1); - hbox->setStretchFactor(m_info,5); - - TQStringList protocols=KProtocolInfo::protocols(); - for (TQStringList::Iterator it=protocols.begin(); it!=protocols.end(); ++it) - { - TQString proto = *it; - m_ioslavesLb->insertItem( SmallIcon( KProtocolInfo::icon( proto )), - proto ); - }; - m_ioslavesLb->sort(); - m_ioslavesLb->setSelected(0, true); - - setButtons(TDECModule::Help); - - TDEAboutData *about = - new TDEAboutData(I18N_NOOP("kcmioslaveinfo"), - I18N_NOOP("TDE Panel System Information Control Module"), - 0, 0, TDEAboutData::License_GPL, - I18N_NOOP("(c) 2001 - 2002 Alexander Neundorf")); - - about->addAuthor("Alexander Neundorf", 0, "[email protected]"); - about->addAuthor("George Staikos", 0, "[email protected]"); - setAboutData( about ); - -} - -void KCMIOSlaveInfo::slaveHelp( TDEIO::Job *, const TQByteArray &data) -{ - if ( data.size() == 0 ) { // EOF - int index = helpData.find( "<meta http-equiv=\"Content-Type\"" ); - index = helpData.find( "charset=", index ) + 8; - TQString charset = helpData.mid( index, helpData.find( '\"', index ) - index ); - TQString text = TQTextCodec::codecForName(charset.latin1())->toUnicode( helpData ); - index = text.find( "<div class=\"titlepage\">" ); - text = text.mid( index ); - index = text.find( "<table width=\"100%\" class=\"bottom-nav\"" ); - text = text.left( index ); - m_info->setText(text); - return; - } - helpData += data; -} - -void KCMIOSlaveInfo::slotResult(TDEIO::Job *) -{ - m_tfj = 0; -} - -void KCMIOSlaveInfo::showInfo(const TQString& protocol) -{ - TQString file = TQString("tdeioslave/%1/index.docbook").arg( protocol ); - file = TDEGlobal::locale()->langLookup( file ); - if (m_tfj) - { - m_tfj->kill(); - m_tfj = 0; - } - - if (!file.isEmpty()) - { - helpData.truncate( 0 ); - m_tfj = TDEIO::get( KURL( TQString("help:/tdeioslave/%1/index.html").arg( protocol ) ), true, false ); - connect( m_tfj, TQT_SIGNAL( data( TDEIO::Job *, const TQByteArray &) ), TQT_SLOT( slaveHelp( TDEIO::Job *, const TQByteArray &) ) ); - connect( m_tfj, TQT_SIGNAL( result( TDEIO::Job * ) ), TQT_SLOT( slotResult( TDEIO::Job * ) ) ); - return; - } - else if (file.isEmpty()) - { - helpData.truncate( 0 ); - m_tfj = TDEIO::get( KURL( TQString("help:/khelpcenter/helpnotfound/index.html").arg( protocol ) ), true, false ); - connect( m_tfj, TQT_SIGNAL( data( TDEIO::Job *, const TQByteArray &) ), TQT_SLOT( slaveHelp( TDEIO::Job *, const TQByteArray &) ) ); - connect( m_tfj, TQT_SIGNAL( result( TDEIO::Job * ) ), TQT_SLOT( slotResult( TDEIO::Job * ) ) ); - return; - } - else - { - m_info->setText(i18n("There is no documentation available for %1:/ ...").arg(protocol)); - } -} - -void KCMIOSlaveInfo::showInfo(TQListBoxItem *item) -{ - if (item==0) - return; - showInfo( item->text() ); -} - -#include "kcmioslaveinfo.moc" - |