TQt4 convert kde-systemsettings

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kde-systemsettings@1234247 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 70a90e54df
commit 5ad8fdbf16

@ -22,18 +22,18 @@
#include <kapplication.h> #include <kapplication.h>
#include <kservicegroup.h> #include <kservicegroup.h>
#include <kdebug.h> #include <kdebug.h>
#include <qdict.h> #include <tqdict.h>
class KCModuleMenuPrivate { class KCModuleMenuPrivate {
public: public:
KCModuleMenuPrivate(){ KCModuleMenuPrivate(){
} }
QMap<QString, QValueList<MenuItem> > menus; TQMap<TQString, TQValueList<MenuItem> > menus;
QString basePath; TQString basePath;
}; };
KCModuleMenu::KCModuleMenu( const QString &menuName ) : KCModuleMenu::KCModuleMenu( const TQString &menuName ) :
d( new KCModuleMenuPrivate ) d( new KCModuleMenuPrivate )
{ {
kdDebug() << "MenuName: \"" << menuName << "\"." << endl; kdDebug() << "MenuName: \"" << menuName << "\"." << endl;
@ -53,7 +53,7 @@ KCModuleMenu::~KCModuleMenu()
delete d; delete d;
} }
void KCModuleMenu::readMenu( const QString &pathName ) void KCModuleMenu::readMenu( const TQString &pathName )
{ {
KServiceGroup::Ptr group = KServiceGroup::group( pathName ); KServiceGroup::Ptr group = KServiceGroup::group( pathName );
if ( !group || !group->isValid() ) if ( !group || !group->isValid() )
@ -64,7 +64,7 @@ void KCModuleMenu::readMenu( const QString &pathName )
return; return;
caption = group->caption(); caption = group->caption();
QValueList<MenuItem> currentMenu; TQValueList<MenuItem> currentMenu;
for( KServiceGroup::List::ConstIterator it = list.begin(); for( KServiceGroup::List::ConstIterator it = list.begin();
it != list.end(); it++) it != list.end(); it++)
@ -108,12 +108,12 @@ bool KCModuleMenu::addEntry( KSycocaEntry *entry ){
} }
QValueList<KCModuleInfo> KCModuleMenu::modules( const QString &menuPath ) TQValueList<KCModuleInfo> KCModuleMenu::modules( const TQString &menuPath )
{ {
QValueList<KCModuleInfo> list; TQValueList<KCModuleInfo> list;
QValueList<MenuItem> subMenu = menuList(menuPath); TQValueList<MenuItem> subMenu = menuList(menuPath);
QValueList<MenuItem>::iterator it; TQValueList<MenuItem>::iterator it;
for ( it = subMenu.begin(); it != subMenu.end(); ++it ){ for ( it = subMenu.begin(); it != subMenu.end(); ++it ){
if ( !(*it).menu ) if ( !(*it).menu )
list.append( (*it).item ); list.append( (*it).item );
@ -122,12 +122,12 @@ QValueList<KCModuleInfo> KCModuleMenu::modules( const QString &menuPath )
return list; return list;
} }
QStringList KCModuleMenu::submenus( const QString &menuPath ) TQStringList KCModuleMenu::submenus( const TQString &menuPath )
{ {
QStringList list; TQStringList list;
QValueList<MenuItem> subMenu = menuList(menuPath); TQValueList<MenuItem> subMenu = menuList(menuPath);
QValueList<MenuItem>::iterator it; TQValueList<MenuItem>::iterator it;
for ( it = subMenu.begin(); it != subMenu.end(); ++it ){ for ( it = subMenu.begin(); it != subMenu.end(); ++it ){
if ( (*it).menu ) if ( (*it).menu )
list.append( (*it).subMenu ); list.append( (*it).subMenu );
@ -136,11 +136,11 @@ QStringList KCModuleMenu::submenus( const QString &menuPath )
return list; return list;
} }
QValueList<MenuItem> KCModuleMenu::menuList( const QString &menuPath ) TQValueList<MenuItem> KCModuleMenu::menuList( const TQString &menuPath )
{ {
if( menuPath.isEmpty() ) { if( menuPath.isEmpty() ) {
if( d->basePath.isEmpty()) if( d->basePath.isEmpty())
return QValueList<MenuItem>(); return TQValueList<MenuItem>();
else else
return menuList( d->basePath ); return menuList( d->basePath );
} }
@ -171,12 +171,12 @@ QValueList<MenuItem> KCModuleMenu::menuList( const QString &menuPath )
* *
* "Michael D. Stemle, Jr." <manchicken@notsosoft.net> * "Michael D. Stemle, Jr." <manchicken@notsosoft.net>
*/ */
QString KCModuleMenu::deriveCaptionFromPath( const QString &menuPath ) TQString KCModuleMenu::deriveCaptionFromPath( const TQString &menuPath )
{ {
QStringList parts(QStringList::split("/",menuPath)); TQStringList parts(TQStringList::split("/",menuPath));
QString result(""); TQString result("");
QStringList::Iterator it = parts.end(); // Start at the end TQStringList::Iterator it = parts.end(); // Start at the end
// Find the last non-empty string in the split. // Find the last non-empty string in the split.
for (; it != parts.begin(); --it) { for (; it != parts.begin(); --it) {

@ -64,7 +64,7 @@ class KCModuleMenuPrivate;
* X-KDE-BaseGroup=examplemenu * X-KDE-BaseGroup=examplemenu
* \endcode * \endcode
* *
* example.menu should be installed in xdg/menus/ so that ksyscoco will find * example.menu should be installed in xdg/menus/ so that ksyscoco will tqfind
* it. See the above url for example menus. After changing the menu you need * it. See the above url for example menus. After changing the menu you need
* to run "kbuildsycoca" to regenerate the cache as ksyscoco will cache the * to run "kbuildsycoca" to regenerate the cache as ksyscoco will cache the
* menu and is a file that doesn't change on users. * menu and is a file that doesn't change on users.
@ -77,17 +77,17 @@ class MenuItem {
public: public:
MenuItem( bool isMenu=false ){ menu = isMenu; }; MenuItem( bool isMenu=false ){ menu = isMenu; };
bool menu; bool menu;
QString subMenu; TQString subMenu;
QString caption; TQString caption;
KCModuleInfo item; KCModuleInfo item;
}; };
class KCModuleMenu : public QValueList<KCModuleInfo> class KCModuleMenu : public TQValueList<KCModuleInfo>
{ {
public: public:
QString caption; TQString caption;
/** /**
* @param the X-KDE-BaseGroup item from the directory file * @param the X-KDE-BaseGroup item from the directory file
@ -98,7 +98,7 @@ public:
* X-KDE-BaseGroup=examplemenu * X-KDE-BaseGroup=examplemenu
* so menuName should be "systemsettings" * so menuName should be "systemsettings"
*/ */
KCModuleMenu( const QString &menuName ); KCModuleMenu( const TQString &menuName );
/** /**
* Deconstructor * Deconstructor
@ -111,21 +111,21 @@ public:
* @param path to return submenus from. * @param path to return submenus from.
* @return all items in menuPath. * @return all items in menuPath.
*/ */
QValueList<MenuItem> menuList( const QString &menuPath=QString::null ); TQValueList<MenuItem> menuList( const TQString &menuPath=TQString() );
/** /**
* Returns the modules in a menu path. An empty string is the top level. * Returns the modules in a menu path. An empty string is the top level.
* @param menu to return modules from. * @param menu to return modules from.
* @returns only the top level modules of menuPath * @returns only the top level modules of menuPath
*/ */
QValueList<KCModuleInfo> modules( const QString &menuPath=QString::null ); TQValueList<KCModuleInfo> modules( const TQString &menuPath=TQString() );
/** /**
* Returns the sub menus of a menu path. An empty string is the top level. * Returns the sub menus of a menu path. An empty string is the top level.
* @param path to return submenus from. * @param path to return submenus from.
* @return only the submenus of menuPath. * @return only the submenus of menuPath.
*/ */
QStringList submenus( const QString &menuPath=QString::null ); TQStringList submenus( const TQString &menuPath=TQString() );
protected: protected:
@ -135,7 +135,7 @@ protected:
* This is the <Name> from the merge.menu file * This is the <Name> from the merge.menu file
* @param pathName the base path name of the menu. * @param pathName the base path name of the menu.
*/ */
virtual void readMenu( const QString &pathName ); virtual void readMenu( const TQString &pathName );
/** /**
* Function that determines if the entry from readMenu * Function that determines if the entry from readMenu
@ -151,7 +151,7 @@ protected:
private: private:
KCModuleMenuPrivate *d; KCModuleMenuPrivate *d;
QString deriveCaptionFromPath( const QString &menuPath ); TQString deriveCaptionFromPath( const TQString &menuPath );
}; };
#endif // KCMMODULEMENU_H #endif // KCMMODULEMENU_H

@ -21,20 +21,20 @@
#include "kcmsearch.h" #include "kcmsearch.h"
#include <qregexp.h> #include <tqregexp.h>
#include <kdebug.h> #include <kdebug.h>
#include "modulesview.h" #include "modulesview.h"
#include "moduleiconitem.h" #include "moduleiconitem.h"
KcmSearch::KcmSearch( QPtrList<ModulesView> *moduleViewList, QWidget *parent, const char *name ) KcmSearch::KcmSearch( TQPtrList<ModulesView> *moduleViewList, TQWidget *tqparent, const char *name )
: KIconViewSearchLine(parent, moduleViewList->at(0)->groups[0], name){ : KIconViewSearchLine(tqparent, moduleViewList->at(0)->groups[0], name){
this->moduleViewList = moduleViewList; this->moduleViewList = moduleViewList;
} }
void KcmSearch::updateSearch( const QString &search ) { void KcmSearch::updateSearch( const TQString &search ) {
QValueList<RowIconView*>::iterator it; TQValueList<RowIconView*>::iterator it;
QPtrListIterator<ModulesView> moduleViewListIt(*moduleViewList); TQPtrListIterator<ModulesView> moduleViewListIt(*moduleViewList);
ModulesView *mainView; ModulesView *mainView;
int page = 0; int page = 0;
@ -45,7 +45,7 @@ void KcmSearch::updateSearch( const QString &search ) {
int count = 0; int count = 0;
for ( it = mainView->groups.begin(); it != mainView->groups.end(); ++it ){ for ( it = mainView->groups.begin(); it != mainView->groups.end(); ++it ){
QIconViewItem *item = (*it)->firstItem(); TQIconViewItem *item = (*it)->firstItem();
while( item ) { while( item ) {
bool hit = itemMatches(item, search); bool hit = itemMatches(item, search);
((ModuleIconItem*)item)->loadIcon(hit); ((ModuleIconItem*)item)->loadIcon(hit);
@ -62,13 +62,13 @@ void KcmSearch::updateSearch( const QString &search ) {
delete[] hitArray; delete[] hitArray;
} }
bool KcmSearch::itemMatches( const KCModuleInfo &module, const QString &search ) const bool KcmSearch::itemMatches( const KCModuleInfo &module, const TQString &search ) const
{ {
// Look in keywords // Look in keywords
QStringList kw = module.keywords(); TQStringList kw = module.keywords();
for(QStringList::ConstIterator it = kw.begin(); it != kw.end(); ++it) { for(TQStringList::ConstIterator it = kw.begin(); it != kw.end(); ++it) {
QString name = (*it).lower(); TQString name = (*it).lower();
if ( QRegExp(search+"*", false, true).search(name) >= 0){ if ( TQRegExp(search+"*", false, true).search(name) >= 0){
//kdDebug() << "MATCH:" << module.moduleName().latin1() //kdDebug() << "MATCH:" << module.moduleName().latin1()
// << "keyword:" << name.latin1() << endl; // << "keyword:" << name.latin1() << endl;
return true; return true;
@ -76,20 +76,20 @@ bool KcmSearch::itemMatches( const KCModuleInfo &module, const QString &search )
} }
// Don't forget to check the name :) // Don't forget to check the name :)
if ( QRegExp(search+"*", false, true).search(module.moduleName()) >= 0) if ( TQRegExp(search+"*", false, true).search(module.moduleName()) >= 0)
return true; return true;
//kdDebug() << "No MATCH:" << module.moduleName().latin1() << endl; //kdDebug() << "No MATCH:" << module.moduleName().latin1() << endl;
return false; return false;
} }
bool KcmSearch::itemMatches( const QIconViewItem *item, const QString & search ) const bool KcmSearch::itemMatches( const TQIconViewItem *item, const TQString & search ) const
{ {
if( !item ) if( !item )
return false; return false;
ModuleIconItem *mItem = (ModuleIconItem*)item; ModuleIconItem *mItem = (ModuleIconItem*)item;
QValueList<KCModuleInfo>::iterator it; TQValueList<KCModuleInfo>::iterator it;
for ( it = mItem->modules.begin(); it != mItem->modules.end(); ++it ){ for ( it = mItem->modules.begin(); it != mItem->modules.end(); ++it ){
if( itemMatches( (*it), search ) ) if( itemMatches( (*it), search ) )
return true; return true;

@ -34,33 +34,34 @@ class ModulesView;
class KcmSearch : public KIconViewSearchLine class KcmSearch : public KIconViewSearchLine
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KcmSearch( QPtrList<ModulesView> *moduleViewList, QWidget *parent = 0, const char *name = 0 ); KcmSearch( TQPtrList<ModulesView> *moduleViewList, TQWidget *tqparent = 0, const char *name = 0 );
public slots: public slots:
/** /**
* Go through all of the iconView groups in mainView and update * Go through all of the iconView groups in mainView and update
*/ */
virtual void updateSearch( const QString &search = QString::null ); virtual void updateSearch( const TQString &search = TQString() );
/** /**
* Check module associated with item or if a group check all modules of that group. * Check module associated with item or if a group check all modules of that group.
* @return true if search is in the module(s) keywords * @return true if search is in the module(s) keywords
*/ */
virtual bool itemMatches ( const QIconViewItem *item, const QString &search ) const; virtual bool itemMatches ( const TQIconViewItem *item, const TQString &search ) const;
signals: signals:
void searchHits(const QString &query, int *hitList, int length); void searchHits(const TQString &query, int *hitList, int length);
private: private:
/** /**
* Determine if module matches the search * Determine if module matches the search
* @return true if search is in module's keywords * @return true if search is in module's keywords
*/ */
bool itemMatches ( const KCModuleInfo &module, const QString &search ) const; bool itemMatches ( const KCModuleInfo &module, const TQString &search ) const;
// Friend class whos groups parsed, // Friend class whos groups parsed,
QPtrList<ModulesView> *moduleViewList; TQPtrList<ModulesView> *moduleViewList;
}; };
#endif // KCMSEARCH_H #endif // KCMSEARCH_H

@ -21,10 +21,10 @@
*/ */
#include <qcursor.h> #include <tqcursor.h>
#include <qhbox.h> #include <tqhbox.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <kaboutdata.h> #include <kaboutdata.h>
#include <kapplication.h> #include <kapplication.h>
@ -62,18 +62,18 @@ class KCMultiWidget::KCMultiWidgetPrivate
}; };
KCMultiWidget::KCMultiWidget(QWidget *parent, const char *name, bool modal) KCMultiWidget::KCMultiWidget(TQWidget *tqparent, const char *name, bool modal)
: KDialogBase(IconList, i18n("Configure"), Help | Default |Cancel | Apply | : KDialogBase(IconList, i18n("Configure"), Help | Default |Cancel | Apply |
Ok | User1 | User2 | User3, Ok, parent, name, modal, true, Ok | User1 | User2 | User3, Ok, tqparent, name, modal, true,
KStdGuiItem::reset(), KStdGuiItem::close(), KStdGuiItem::adminMode()) KStdGuiItem::reset(), KStdGuiItem::close(), KStdGuiItem::adminMode())
, dialogface( IconList ), d( new KCMultiWidgetPrivate ) , dialogface( IconList ), d( new KCMultiWidgetPrivate )
{ {
init(); init();
} }
KCMultiWidget::KCMultiWidget( int dialogFace, QWidget * parent, const char * name, bool modal ) KCMultiWidget::KCMultiWidget( int dialogFace, TQWidget * tqparent, const char * name, bool modal )
: KDialogBase( dialogFace, "Caption", Help | Default | Cancel | Apply | Ok | : KDialogBase( dialogFace, "Caption", Help | Default | Cancel | Apply | Ok |
User1 | User2 | User3, Ok, parent, name, modal, true, User1 | User2 | User3, Ok, tqparent, name, modal, true,
KStdGuiItem::reset(), KStdGuiItem::close(), KStdGuiItem::adminMode()) KStdGuiItem::reset(), KStdGuiItem::close(), KStdGuiItem::adminMode())
, dialogface( dialogFace ), d( new KCMultiWidgetPrivate ) , dialogface( dialogFace ), d( new KCMultiWidgetPrivate )
{ {
@ -82,7 +82,7 @@ KCMultiWidget::KCMultiWidget( int dialogFace, QWidget * parent, const char * nam
inline void KCMultiWidget::init() inline void KCMultiWidget::init()
{ {
connect( this, SIGNAL( finished()), SLOT( dialogClosed())); connect( this, TQT_SIGNAL( finished()), TQT_SLOT( dialogClosed()));
showButton( Ok, false ); showButton( Ok, false );
showButton( Cancel, false ); showButton( Cancel, false );
showButton( User1, true ); // Reset button showButton( User1, true ); // Reset button
@ -92,8 +92,8 @@ inline void KCMultiWidget::init()
enableButton(Apply, false); enableButton(Apply, false);
enableButton(User1, false); enableButton(User1, false);
connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); connect(this, TQT_SIGNAL(aboutToShowPage(TQWidget *)), this, TQT_SLOT(slotAboutToShow(TQWidget *)));
setInitialSize(QSize(640,480)); setInitialSize(TQSize(640,480));
moduleParentComponents.setAutoDelete( true ); moduleParentComponents.setAutoDelete( true );
} }
#include <kmessagebox.h> #include <kmessagebox.h>
@ -111,7 +111,7 @@ void KCMultiWidget::slotDefault()
ModuleList::Iterator end = m_modules.end(); ModuleList::Iterator end = m_modules.end();
for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it ) for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it )
if( pageIndex( ( QWidget * )( *it ).kcm->parent() ) == curPageIndex ) if( pageIndex( ( TQWidget * )( *it ).kcm->tqparent() ) == curPageIndex )
{ {
( *it ).kcm->defaults(); ( *it ).kcm->defaults();
clientChanged( true ); clientChanged( true );
@ -126,7 +126,7 @@ void KCMultiWidget::slotUser1()
ModuleList::Iterator end = m_modules.end(); ModuleList::Iterator end = m_modules.end();
for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it ) for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it )
if( pageIndex( ( QWidget * )( *it ).kcm->parent() ) == curPageIndex ) if( pageIndex( ( TQWidget * )( *it ).kcm->tqparent() ) == curPageIndex )
{ {
( *it ).kcm->load(); ( *it ).kcm->load();
clientChanged( false ); clientChanged( false );
@ -136,7 +136,7 @@ void KCMultiWidget::slotUser1()
void KCMultiWidget::apply() void KCMultiWidget::apply()
{ {
QStringList updatedModules; TQStringList updatedModules;
ModuleList::Iterator end = m_modules.end(); ModuleList::Iterator end = m_modules.end();
for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it ) for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it )
{ {
@ -144,14 +144,14 @@ void KCMultiWidget::apply()
if( m && m->changed() ) if( m && m->changed() )
{ {
m->save(); m->save();
QStringList * names = moduleParentComponents[ m ]; TQStringList * names = moduleParentComponents[ m ];
kdDebug() << k_funcinfo << *names << " saved and added to the list" << endl; kdDebug() << k_funcinfo << *names << " saved and added to the list" << endl;
for( QStringList::ConstIterator it = names->begin(); it != names->end(); ++it ) for( TQStringList::ConstIterator it = names->begin(); it != names->end(); ++it )
if( updatedModules.find( *it ) == updatedModules.end() ) if( updatedModules.tqfind( *it ) == updatedModules.end() )
updatedModules.append( *it ); updatedModules.append( *it );
} }
} }
for( QStringList::const_iterator it = updatedModules.begin(); it != updatedModules.end(); ++it ) for( TQStringList::const_iterator it = updatedModules.begin(); it != updatedModules.end(); ++it )
{ {
kdDebug() << k_funcinfo << *it << " " << ( *it ).latin1() << endl; kdDebug() << k_funcinfo << *it << " " << ( *it ).latin1() << endl;
emit configCommitted( ( *it ).latin1() ); emit configCommitted( ( *it ).latin1() );
@ -161,7 +161,7 @@ void KCMultiWidget::apply()
void KCMultiWidget::slotApply() void KCMultiWidget::slotApply()
{ {
QPushButton *button = actionButton(Apply); TQPushButton *button = actionButton(Apply);
if (button) if (button)
button->setFocus(); button->setFocus();
emit applyClicked(); emit applyClicked();
@ -171,7 +171,7 @@ void KCMultiWidget::slotApply()
void KCMultiWidget::slotOk() void KCMultiWidget::slotOk()
{ {
QPushButton *button = actionButton(Ok); TQPushButton *button = actionButton(Ok);
if (button) if (button)
button->setFocus(); button->setFocus();
emit okClicked(); emit okClicked();
@ -181,12 +181,12 @@ void KCMultiWidget::slotOk()
void KCMultiWidget::slotHelp() void KCMultiWidget::slotHelp()
{ {
QString docPath; TQString docPath;
int curPageIndex = activePageIndex(); int curPageIndex = activePageIndex();
ModuleList::Iterator end = m_modules.end(); ModuleList::Iterator end = m_modules.end();
for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it ) for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it )
if( pageIndex( ( QWidget * )( *it ).kcm->parent() ) == curPageIndex ) if( pageIndex( ( TQWidget * )( *it ).kcm->tqparent() ) == curPageIndex )
{ {
docPath = ( *it ).kcm->moduleInfo().docPath(); docPath = ( *it ).kcm->moduleInfo().docPath();
break; break;
@ -224,20 +224,20 @@ void KCMultiWidget::clientChanged(bool state)
enableButton( User1, false); enableButton( User1, false);
} }
void KCMultiWidget::addModule(const QString& path, bool withfallback) void KCMultiWidget::addModule(const TQString& path, bool withfallback)
{ {
QString complete = path; TQString complete = path;
if( !path.endsWith( ".desktop" )) if( !path.endsWith( ".desktop" ))
complete += ".desktop"; complete += ".desktop";
KService::Ptr service = KService::serviceByStorageId( complete ); KService::Ptr service = KService::serviceByStorageId( complete );
addModule( KCModuleInfo( service ), QStringList(), withfallback); addModule( KCModuleInfo( service ), TQStringList(), withfallback);
} }
void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo, void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
QStringList parentmodulenames, bool withfallback) TQStringList tqparentmodulenames, bool withfallback)
{ {
if( !moduleinfo.service() ) if( !moduleinfo.service() )
return; return;
@ -248,13 +248,13 @@ void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
if( !KCModuleLoader::testModule( moduleinfo )) if( !KCModuleLoader::testModule( moduleinfo ))
return; return;
QFrame* page = 0; TQFrame* page = 0;
if (!moduleinfo.service()->noDisplay()) if (!moduleinfo.service()->noDisplay())
switch( dialogface ) switch( dialogface )
{ {
case TreeList: case TreeList:
parentmodulenames += moduleinfo.moduleName(); tqparentmodulenames += moduleinfo.moduleName();
page = addHBoxPage( parentmodulenames, moduleinfo.comment(), page = addHBoxPage( tqparentmodulenames, moduleinfo.comment(),
SmallIcon( moduleinfo.icon(), SmallIcon( moduleinfo.icon(),
IconSize( KIcon::Small ) ) ); IconSize( KIcon::Small ) ) );
break; break;
@ -266,7 +266,7 @@ void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
break; break;
case Plain: case Plain:
page = plainPage(); page = plainPage();
( new QHBoxLayout( page ) )->setAutoAdd( true ); ( new TQHBoxLayout( page ) )->setAutoAdd( true );
break; break;
default: default:
kdError( 710 ) << "unsupported dialog face for KCMultiWidget" kdError( 710 ) << "unsupported dialog face for KCMultiWidget"
@ -278,7 +278,7 @@ void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
return; return;
} }
KCModuleProxy * module; KCModuleProxy * module;
if( m_orphanModules.contains( moduleinfo.service() ) ) if( m_orphanModules.tqcontains( moduleinfo.service() ) )
{ {
// the KCModule already exists - it was removed from the dialog in // the KCModule already exists - it was removed from the dialog in
// removeAllModules // removeAllModules
@ -287,7 +287,7 @@ void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
kdDebug( 710 ) << "Use KCModule from the list of orphans for " << kdDebug( 710 ) << "Use KCModule from the list of orphans for " <<
moduleinfo.moduleName() << ": " << module << endl; moduleinfo.moduleName() << ": " << module << endl;
module->reparent( page, 0, QPoint( 0, 0 ), true ); module->reparent( page, 0, TQPoint( 0, 0 ), true );
if( module->changed() ) if( module->changed() )
clientChanged( true ); clientChanged( true );
@ -300,12 +300,12 @@ void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
{ {
module = new KCModuleProxy( moduleinfo, withfallback, page ); module = new KCModuleProxy( moduleinfo, withfallback, page );
QStringList parentComponents = moduleinfo.service()->property( TQStringList tqparentComponents = moduleinfo.service()->property(
"X-KDE-ParentComponents" ).toStringList(); "X-KDE-ParentComponents" ).toStringList();
moduleParentComponents.insert( module, moduleParentComponents.insert( module,
new QStringList( parentComponents ) ); new TQStringList( tqparentComponents ) );
connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); connect(module, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(clientChanged(bool)));
} }
@ -357,9 +357,9 @@ void KCMultiWidget::applyOrRevert(KCModuleProxy * module){
} }
void KCMultiWidget::slotAboutToShow(QWidget *page) void KCMultiWidget::slotAboutToShow(TQWidget *page)
{ {
QObject * obj = page->child( 0, "KCModuleProxy" ); TQObject * obj = page->child( 0, "KCModuleProxy" );
if( ! obj ) if( ! obj )
return; return;
@ -391,14 +391,14 @@ void KCMultiWidget::slotAboutToShow(QWidget *page)
enableButton( KDialogBase::Help, buttons & KCModule::Help ); enableButton( KDialogBase::Help, buttons & KCModule::Help );
enableButton( KDialogBase::Default, buttons & KCModule::Default ); enableButton( KDialogBase::Default, buttons & KCModule::Default );
disconnect( this, SIGNAL(user3Clicked()), 0, 0 ); disconnect( this, TQT_SIGNAL(user3Clicked()), 0, 0 );
if (d->currentModule->moduleInfo().needsRootPrivileges() && if (d->currentModule->moduleInfo().needsRootPrivileges() &&
!d->currentModule->rootMode() ) !d->currentModule->rootMode() )
{ /* Enable the Admin Mode button */ { /* Enable the Admin Mode button */
enableButton( User3, true ); enableButton( User3, true );
connect( this, SIGNAL(user3Clicked()), d->currentModule, SLOT( runAsRoot() )); connect( this, TQT_SIGNAL(user3Clicked()), d->currentModule, TQT_SLOT( runAsRoot() ));
connect( this, SIGNAL(user3Clicked()), SLOT( disableRModeButton() )); connect( this, TQT_SIGNAL(user3Clicked()), TQT_SLOT( disableRModeButton() ));
} else { } else {
enableButton( User3, false ); enableButton( User3, false );
} }
@ -412,7 +412,7 @@ void KCMultiWidget::rootExit()
void KCMultiWidget::disableRModeButton() void KCMultiWidget::disableRModeButton()
{ {
enableButton( User3, false ); enableButton( User3, false );
connect ( d->currentModule, SIGNAL( childClosed() ), SLOT( rootExit() ) ); connect ( d->currentModule, TQT_SIGNAL( childClosed() ), TQT_SLOT( rootExit() ) );
} }
void KCMultiWidget::slotCancel() { void KCMultiWidget::slotCancel() {

@ -23,7 +23,7 @@
#ifndef KCMULTIDIALOG_H #ifndef KCMULTIDIALOG_H
#define KCMULTIDIALOG_H #define KCMULTIDIALOG_H
#include <qptrdict.h> #include <tqptrdict.h>
#include <kdialogbase.h> #include <kdialogbase.h>
#include <klocale.h> #include <klocale.h>
@ -40,29 +40,30 @@ class KCModule;
class KUTILS_EXPORT KCMultiWidget : public KDialogBase class KUTILS_EXPORT KCMultiWidget : public KDialogBase
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
/** /**
* Constructs a new KCMultiWidget * Constructs a new KCMultiWidget
* *
* @param parent The parent widget * @param tqparent The tqparent widget
* @param name The widget name * @param name The widget name
* @param modal If you pass true here, the dialog will be modal * @param modal If you pass true here, the dialog will be modal
**/ **/
KCMultiWidget( QWidget *parent=0, const char *name=0, bool modal=false ); KCMultiWidget( TQWidget *tqparent=0, const char *name=0, bool modal=false );
/** /**
* Construct a personalized KCMultiWidget. * Construct a personalized KCMultiWidget.
* *
* @param dialogFace You can use TreeList, Tabbed, Plain, Swallow or * @param dialogFace You can use TreeList, Tabbed, Plain, Swallow or
* IconList. * IconList.
* @param parent Parent of the dialog. * @param tqparent Parent of the dialog.
* @param name Dialog name (for internal use only). * @param name Dialog name (for internal use only).
* @param modal Controls dialog modality. If @p false, the rest of the * @param modal Controls dialog modality. If @p false, the rest of the
* program interface (example: other dialogs) is accessible while * program interface (example: other dialogs) is accessible while
* the dialog is open. * the dialog is open.
*/ */
KCMultiWidget( int dialogFace, QWidget * parent = 0, KCMultiWidget( int dialogFace, TQWidget * tqparent = 0,
const char * name = 0, bool modal = false ); const char * name = 0, bool modal = false );
@ -80,7 +81,7 @@ public:
* @param withfallback Try harder to load the module. Might result * @param withfallback Try harder to load the module. Might result
* in the module appearing outside the dialog. * in the module appearing outside the dialog.
**/ **/
void addModule(const QString& module, bool withfallback=true); void addModule(const TQString& module, bool withfallback=true);
/** /**
* Add a module. * Add a module.
@ -89,16 +90,16 @@ public:
* used for creating the module. It will be added * used for creating the module. It will be added
* to the list of modules the dialog will show. * to the list of modules the dialog will show.
* *
* @param parentmodulenames The names of the modules that should appear as * @param tqparentmodulenames The names of the modules that should appear as
* parents in the TreeList. Look at the * tqparents in the TreeList. Look at the
* KDialogBase::addPage documentation for more info * KDialogBase::addPage documentation for more info
* on this. * on this.
* *
* @param withfallback Try harder to load the module. Might result * @param withfallback Try harder to load the module. Might result
* in the module appearing outside the dialog. * in the module appearing outside the dialog.
**/ **/
void addModule(const KCModuleInfo& moduleinfo, QStringList void addModule(const KCModuleInfo& moduleinfo, TQStringList
parentmodulenames = QStringList(), bool withfallback=false); tqparentmodulenames = TQStringList(), bool withfallback=false);
/** /**
* @return the current module that is being shown. * @return the current module that is being shown.
@ -129,7 +130,7 @@ signals:
* @param instanceName The name of the instance that needs to reload its * @param instanceName The name of the instance that needs to reload its
* configuration. * configuration.
*/ */
void configCommitted( const QCString & instanceName ); void configCommitted( const TQCString & instanceName );
/** /**
* Emitted right before a module is shown. * Emitted right before a module is shown.
@ -192,7 +193,7 @@ protected slots:
private slots: private slots:
void slotAboutToShow(QWidget *); void slotAboutToShow(TQWidget *);
void clientChanged(bool state); void clientChanged(bool state);
@ -237,14 +238,14 @@ private:
bool adminmode; bool adminmode;
int buttons; int buttons;
}; };
typedef QValueList<CreatedModule> ModuleList; typedef TQValueList<CreatedModule> ModuleList;
ModuleList m_modules; ModuleList m_modules;
typedef QMap<KService::Ptr, KCModuleProxy*> OrphanMap; typedef TQMap<KService::Ptr, KCModuleProxy*> OrphanMap;
OrphanMap m_orphanModules; OrphanMap m_orphanModules;
QPtrDict<QStringList> moduleParentComponents; TQPtrDict<TQStringList> moduleParentComponents;
QString _docPath; TQString _docPath;
int dialogface; int dialogface;
class KCMultiWidgetPrivate; class KCMultiWidgetPrivate;

@ -20,19 +20,19 @@
#include "kcscrollview.h" #include "kcscrollview.h"
KCScrollView::KCScrollView( QWidget * parent, const char * name, WFlags f) : QScrollView(parent,name,f) { KCScrollView::KCScrollView( TQWidget * tqparent, const char * name, WFlags f) : TQScrollView(tqparent,name,f) {
setResizePolicy(AutoOneFit); setResizePolicy(AutoOneFit);
mainChild = 0; mainChild = 0;
} }
QSize KCScrollView::sizeHint() const { TQSize KCScrollView::tqsizeHint() const {
QSize vphint = mainChild->sizeHint(); TQSize vphint = mainChild->tqsizeHint();
vphint.setWidth(vphint.width()+2*frameWidth()); vphint.setWidth(vphint.width()+2*frameWidth());
vphint.setHeight(vphint.height()+2*frameWidth()); vphint.setHeight(vphint.height()+2*frameWidth());
return vphint; return vphint;
} }
void KCScrollView::addChild(QWidget *child, int x, int y) { void KCScrollView::addChild(TQWidget *child, int x, int y) {
mainChild = child; mainChild = child;
QScrollView::addChild(child,x,y); TQScrollView::addChild(child,x,y);
} }

@ -20,16 +20,16 @@
#ifndef KCSCROLLVIEW_H #ifndef KCSCROLLVIEW_H
#define KCSCROLLVIEW_H #define KCSCROLLVIEW_H
#include <qscrollview.h> #include <tqscrollview.h>
class KCScrollView : public QScrollView { class KCScrollView : public TQScrollView {
public: public:
KCScrollView ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); KCScrollView ( TQWidget * tqparent = 0, const char * name = 0, WFlags f = 0 );
virtual QSize sizeHint() const; virtual TQSize tqsizeHint() const;
virtual void addChild(QWidget *child, int x=0, int y=0); virtual void addChild(TQWidget *child, int x=0, int y=0);
private: private:
QWidget *mainChild; TQWidget *mainChild;
}; };
#endif #endif

@ -21,16 +21,16 @@
#include "mainwindow.h" #include "mainwindow.h"
#include <kstdaction.h> #include <kstdaction.h>
#include <qwhatsthis.h> #include <tqwhatsthis.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qvbox.h> #include <tqvbox.h>
#include <kaction.h> #include <kaction.h>
#include <qtoolbutton.h> #include <tqtoolbutton.h>
#include <klocale.h> #include <klocale.h>
#include <kservicegroup.h> #include <kservicegroup.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qwidgetstack.h> #include <tqwidgetstack.h>
#include <qtimer.h> #include <tqtimer.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kcmoduleloader.h> #include <kcmoduleloader.h>
#include <kdialogbase.h> #include <kdialogbase.h>
@ -43,7 +43,7 @@
#include <kmenubar.h> #include <kmenubar.h>
#include <kactionclasses.h> #include <kactionclasses.h>
#include <ktoolbarbutton.h> #include <ktoolbarbutton.h>
#include <qtabbar.h> #include <tqtabbar.h>
#include "kcmsearch.h" #include "kcmsearch.h"
#include "modulesview.h" #include "modulesview.h"
@ -51,19 +51,19 @@
#include "kcmodulemenu.h" #include "kcmodulemenu.h"
#include "kcmultiwidget.h" #include "kcmultiwidget.h"
MainWindow::MainWindow(bool embed, const QString & menuFile, MainWindow::MainWindow(bool embed, const TQString & menuFile,
QWidget *parent, const char *name) : TQWidget *tqparent, const char *name) :
KMainWindow(parent,name), menu(NULL), embeddedWindows(embed), KMainWindow(tqparent,name), menu(NULL), embeddedWindows(embed),
groupWidget(NULL), selectedPage(0), dummyAbout(NULL) { groupWidget(NULL), selectedPage(0), dummyAbout(NULL) {
// Load the menu structure in from disk. // Load the menu structure in from disk.
menu = new KCModuleMenu( menuFile ); menu = new KCModuleMenu( menuFile );
moduleTabs = new KTabWidget(this, "moduletabs", moduleTabs = new KTabWidget(this, "moduletabs",
QTabWidget::Top|QTabWidget::Rounded); TQTabWidget::Top|TQTabWidget::Rounded);
buildMainWidget(); buildMainWidget();
buildActions(); buildActions();
setupGUI(ToolBar|Save|Create,QString::null); setupGUI(ToolBar|Save|Create,TQString());
widgetChange(); widgetChange();
} }
@ -77,11 +77,11 @@ MainWindow::~MainWindow()
void MainWindow::buildMainWidget() void MainWindow::buildMainWidget()
{ {
windowStack = new QWidgetStack( this, "widgetstack" ); windowStack = new TQWidgetStack( this, "widgetstack" );
// Top level pages. // Top level pages.
QValueList<MenuItem> subMenus = menu->menuList(); TQValueList<MenuItem> subMenus = menu->menuList();
QValueList<MenuItem>::iterator it; TQValueList<MenuItem>::iterator it;
KCScrollView *modulesScroller; KCScrollView *modulesScroller;
moduleTabs->show(); moduleTabs->show();
for ( it = subMenus.begin(); it != subMenus.end(); ++it ) { for ( it = subMenus.begin(); it != subMenus.end(); ++it ) {
@ -89,7 +89,7 @@ void MainWindow::buildMainWidget()
modulesScroller = new KCScrollView(moduleTabs); modulesScroller = new KCScrollView(moduleTabs);
ModulesView *modulesView = new ModulesView( menu, (*it).subMenu, modulesScroller->viewport(), "modulesView" ); ModulesView *modulesView = new ModulesView( menu, (*it).subMenu, modulesScroller->viewport(), "modulesView" );
modulesViewList.append(modulesView); modulesViewList.append(modulesView);
connect(modulesView, SIGNAL(itemSelected(QIconViewItem* )), this, SLOT(slotItemSelected(QIconViewItem*))); connect(modulesView, TQT_SIGNAL(itemSelected(TQIconViewItem* )), TQT_TQOBJECT(this), TQT_SLOT(slotItemSelected(TQIconViewItem*)));
modulesScroller->addChild(modulesView); modulesScroller->addChild(modulesView);
moduleTabs->addTab(modulesScroller, (*it).caption); moduleTabs->addTab(modulesScroller, (*it).caption);
overviewPages.append(modulesScroller); overviewPages.append(modulesScroller);
@ -103,43 +103,43 @@ void MainWindow::buildMainWidget()
void MainWindow::buildActions() void MainWindow::buildActions()
{ {
KStdAction::quit(this, SLOT( close() ), actionCollection()); KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection());
resetModule = new KAction(i18n("Undo Changes"), 0, this, resetModule = new KAction(i18n("Undo Changes"), 0, TQT_TQOBJECT(this),
SLOT(showAllModules()), actionCollection(), "resetModule" ); TQT_SLOT(showAllModules()), actionCollection(), "resetModule" );
resetModule->setEnabled(false); resetModule->setEnabled(false);
defaultModule = new KAction(i18n("Reset to Defaults"), 0, this, defaultModule = new KAction(i18n("Reset to Defaults"), 0, TQT_TQOBJECT(this),
SLOT(showAllModules()), actionCollection(), "defaultModule" ); TQT_SLOT(showAllModules()), actionCollection(), "defaultModule" );
defaultModule->setEnabled(false); defaultModule->setEnabled(false);
if( embeddedWindows ) { if( embeddedWindows ) {
showAllAction = new KAction(i18n("Overview"), QApplication::reverseLayout() ? "forward" : "back", 0, this, showAllAction = new KAction(i18n("Overview"), TQApplication::reverseLayout() ? "forward" : "back", 0, TQT_TQOBJECT(this),
SLOT(showAllModules()), actionCollection(), "showAll" ); TQT_SLOT(showAllModules()), actionCollection(), "showAll" );
showAllAction->setEnabled(false); showAllAction->setEnabled(false);
} }
aboutModuleAction = new KAction(i18n("About Current Module"), 0, this, SLOT(aboutCurrentModule()), actionCollection(), "help_about_module"); aboutModuleAction = new KAction(i18n("About Current Module"), 0, TQT_TQOBJECT(this), TQT_SLOT(aboutCurrentModule()), actionCollection(), "help_about_module");
resetModuleHelp(); resetModuleHelp();
// Search // Search
QHBox *hbox = new QHBox(0); TQHBox *hbox = new TQHBox(0);
hbox->setMaximumWidth( 400 ); hbox->setMaximumWidth( 400 );
KcmSearch* search = new KcmSearch(&modulesViewList, hbox, "search"); KcmSearch* search = new KcmSearch(&modulesViewList, hbox, "search");
hbox->setStretchFactor(search,1); hbox->setStretchFactor(search,1);
connect(search, SIGNAL(searchHits(const QString &, int *, int)), this, SLOT(slotSearchHits(const QString &, int *, int))); connect(search, TQT_SIGNAL(searchHits(const TQString &, int *, int)), TQT_TQOBJECT(this), TQT_SLOT(slotSearchHits(const TQString &, int *, int)));
QVBox *vbox = new QVBox(hbox); TQVBox *vbox = new TQVBox(hbox);
generalHitLabel = new QLabel(vbox); generalHitLabel = new TQLabel(vbox);
vbox->setStretchFactor(generalHitLabel,1); vbox->setStretchFactor(generalHitLabel,1);
advancedHitLabel = new QLabel(vbox); advancedHitLabel = new TQLabel(vbox);
vbox->setStretchFactor(advancedHitLabel,1); vbox->setStretchFactor(advancedHitLabel,1);
hbox->setStretchFactor(vbox,1); hbox->setStretchFactor(vbox,1);
// "Search:" label // "Search:" label
QLabel *searchLabel = new QLabel( this, "SearchLabel"); TQLabel *searchLabel = new TQLabel( this, "SearchLabel");
searchLabel->setText( i18n("&Search:") ); searchLabel->setText( i18n("&Search:") );
searchLabel->setFont(KGlobalSettings::toolBarFont()); searchLabel->setFont(KGlobalSettings::toolBarFont());
searchLabel->setMargin(2); searchLabel->setMargin(2);
@ -151,21 +151,21 @@ void MainWindow::buildActions()
0, 0, actionCollection(), "search" ); 0, 0, actionCollection(), "search" );
searchAction->setShortcutConfigurable( false ); searchAction->setShortcutConfigurable( false );
searchAction->setAutoSized( true ); searchAction->setAutoSized( true );
QWhatsThis::add( search, i18n( "Search Bar<p>Enter a search term." ) ); TQWhatsThis::add( search, i18n( "Search Bar<p>Enter a search term." ) );
// The Clear search box button. // The Clear search box button.
KToolBarButton *clearWidget = new KToolBarButton(QApplication::reverseLayout() ? "clear_left" : "locationbar_erase", KToolBarButton *clearWidget = new KToolBarButton(TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase",
0, this); 0, this);
searchClear = new KWidgetAction( clearWidget, QString(""), CTRL+Key_L, search, SLOT(clear()), searchClear = new KWidgetAction( clearWidget, TQString(""), CTRL+Key_L, TQT_TQOBJECT(search), TQT_SLOT(clear()),
actionCollection(), "searchReset"); actionCollection(), "searchReset");
connect(clearWidget, SIGNAL(clicked()), searchClear, SLOT(activate())); connect(clearWidget, TQT_SIGNAL(clicked()), searchClear, TQT_SLOT(activate()));
searchClear->setWhatsThis( i18n( "Reset Search\n" searchClear->setWhatsThis( i18n( "Reset Search\n"
"Resets the search so that " "Resets the search so that "
"all items are shown again." ) ); "all items are shown again." ) );
// Top level pages. // Top level pages.
QValueList<MenuItem> subMenus = menu->menuList(); TQValueList<MenuItem> subMenus = menu->menuList();
QValueList<MenuItem>::iterator it; TQValueList<MenuItem>::iterator it;
for ( it = subMenus.begin(); it != subMenus.end(); ++it ) { for ( it = subMenus.begin(); it != subMenus.end(); ++it ) {
if( (*it).menu ) { if( (*it).menu ) {
KServiceGroup::Ptr group = KServiceGroup::group( (*it).subMenu ); KServiceGroup::Ptr group = KServiceGroup::group( (*it).subMenu );
@ -174,8 +174,8 @@ void MainWindow::buildActions()
continue; continue;
} }
KRadioAction *newAction = new KRadioAction( group->caption(), group->icon(), KShortcut(), this, KRadioAction *newAction = new KRadioAction( group->caption(), group->icon(), KShortcut(), TQT_TQOBJECT(this),
SLOT(slotTopPage()), actionCollection(), group->relPath() ); TQT_SLOT(slotTopPage()), actionCollection(), group->relPath() );
pageActions.append(newAction); pageActions.append(newAction);
kdDebug() << "relpath is :" << group->relPath() << endl; kdDebug() << "relpath is :" << group->relPath() << endl;
} }
@ -225,17 +225,17 @@ void MainWindow::showAllModules()
resetModuleHelp(); resetModuleHelp();
} }
void MainWindow::slotItemSelected( QIconViewItem *item ){ void MainWindow::slotItemSelected( TQIconViewItem *item ){
ModuleIconItem *mItem = (ModuleIconItem *)item; ModuleIconItem *mItem = (ModuleIconItem *)item;
if( !mItem ) if( !mItem )
return; return;
groupWidget = moduleItemToWidgetDict.find(mItem); groupWidget = moduleItemToWidgetDict.tqfind(mItem);
scrollView = moduleItemToScrollerDict.find(mItem); scrollView = moduleItemToScrollerDict.tqfind(mItem);
if(groupWidget==0) { if(groupWidget==0) {
QValueList<KCModuleInfo> list = mItem->modules; TQValueList<KCModuleInfo> list = mItem->modules;
KDialogBase::DialogType type = KDialogBase::IconList; KDialogBase::DialogType type = KDialogBase::IconList;
if(list.count() == 1) { if(list.count() == 1) {
type=KDialogBase::Plain; type=KDialogBase::Plain;
@ -248,18 +248,18 @@ void MainWindow::slotItemSelected( QIconViewItem *item ){
moduleItemToScrollerDict.insert(mItem,scrollView); moduleItemToScrollerDict.insert(mItem,scrollView);
moduleItemToWidgetDict.insert(mItem,groupWidget); moduleItemToWidgetDict.insert(mItem,groupWidget);
connect(groupWidget, SIGNAL(aboutToShow( KCModuleProxy * )), this, SLOT(updateModuleHelp( KCModuleProxy * ))); connect(groupWidget, TQT_SIGNAL(aboutToShow( KCModuleProxy * )), TQT_TQOBJECT(this), TQT_SLOT(updateModuleHelp( KCModuleProxy * )));
connect(groupWidget, SIGNAL(aboutToShowPage( QWidget* )), this, SLOT(widgetChange())); connect(groupWidget, TQT_SIGNAL(aboutToShowPage( TQWidget* )), TQT_TQOBJECT(this), TQT_SLOT(widgetChange()));
connect(groupWidget, SIGNAL(finished()), this, SLOT(groupModulesFinished())); connect(groupWidget, TQT_SIGNAL(finished()), TQT_TQOBJECT(this), TQT_SLOT(groupModulesFinished()));
connect(groupWidget, SIGNAL(close()), this, SLOT(showAllModules())); connect(groupWidget, TQT_SIGNAL(close()), TQT_TQOBJECT(this), TQT_SLOT(showAllModules()));
QValueList<KCModuleInfo>::iterator it; TQValueList<KCModuleInfo>::iterator it;
for ( it = list.begin(); it != list.end(); ++it ){ for ( it = list.begin(); it != list.end(); ++it ){
qDebug("adding %s %s", (*it).moduleName().latin1(), (*it).fileName().latin1()); qDebug("adding %s %s", (*it).moduleName().latin1(), (*it).fileName().latin1());
groupWidget->addModule( *it ); groupWidget->addModule( *it );
} }
groupWidget->reparent(scrollView->viewport(), 0, QPoint()); groupWidget->reparent(scrollView->viewport(), 0, TQPoint());
scrollView->reparent(windowStack, 0, QPoint()); scrollView->reparent(windowStack, 0, TQPoint());
} }
if( embeddedWindows ) { if( embeddedWindows ) {
@ -284,12 +284,12 @@ void MainWindow::slotItemSelected( QIconViewItem *item ){
// We resize and expand the window if neccessary, but only once the window has been updated. // We resize and expand the window if neccessary, but only once the window has been updated.
// Some modules seem to dynamically change thier size. The new size is only available // Some modules seem to dynamically change thier size. The new size is only available
// once the dialog is updated. :-/ -SBE // once the dialog is updated. :-/ -SBE
QTimer::singleShot(0,this,SLOT(timerResize())); TQTimer::singleShot(0,this,TQT_SLOT(timerResize()));
} }
void MainWindow::timerResize() { void MainWindow::timerResize() {
QSize currentSize = size(); TQSize currentSize = size();
QSize newSize = currentSize.expandedTo(sizeHint()); TQSize newSize = currentSize.expandedTo(tqsizeHint());
// Avoid resizing if possible. // Avoid resizing if possible.
if(newSize!=currentSize) { if(newSize!=currentSize) {
resize(newSize); resize(newSize);
@ -298,8 +298,8 @@ void MainWindow::timerResize() {
void MainWindow::updateModuleHelp( KCModuleProxy *currentModule ) { void MainWindow::updateModuleHelp( KCModuleProxy *currentModule ) {
if ( currentModule->aboutData() ) { if ( currentModule->aboutData() ) {
aboutModuleAction->setText(i18n("Help menu->about <modulename>", "About %1").arg( aboutModuleAction->setText(i18n("Help menu->about <modulename>", "About %1").tqarg(
currentModule->moduleInfo().moduleName().replace("&","&&"))); currentModule->moduleInfo().moduleName().tqreplace("&","&&")));
aboutModuleAction->setIcon(currentModule->moduleInfo().icon()); aboutModuleAction->setIcon(currentModule->moduleInfo().icon());
aboutModuleAction->setEnabled(true); aboutModuleAction->setEnabled(true);
} }
@ -310,12 +310,12 @@ void MainWindow::updateModuleHelp( KCModuleProxy *currentModule ) {
void MainWindow::resetModuleHelp() { void MainWindow::resetModuleHelp() {
aboutModuleAction->setText(i18n("About Current Module")); aboutModuleAction->setText(i18n("About Current Module"));
aboutModuleAction->setIconSet(QIconSet()); aboutModuleAction->setIconSet(TQIconSet());
aboutModuleAction->setEnabled(false); aboutModuleAction->setEnabled(false);
} }
void MainWindow::widgetChange() { void MainWindow::widgetChange() {
QString name; TQString name;
if( groupWidget && groupWidget->currentModule()) { if( groupWidget && groupWidget->currentModule()) {
name = groupWidget->currentModule()->moduleInfo().moduleName(); name = groupWidget->currentModule()->moduleInfo().moduleName();
} }
@ -332,7 +332,7 @@ void MainWindow::widgetChange() {
void MainWindow::slotTopPage() { void MainWindow::slotTopPage() {
KRadioAction *clickedRadioAction = (KRadioAction *)sender(); KRadioAction *clickedRadioAction = (KRadioAction *)sender();
selectedPage = pageActions.find(clickedRadioAction); selectedPage = pageActions.tqfind(clickedRadioAction);
KRadioAction *currentRadioAction; KRadioAction *currentRadioAction;
for ( currentRadioAction = pageActions.first(); currentRadioAction; currentRadioAction = pageActions.next()) { for ( currentRadioAction = pageActions.first(); currentRadioAction; currentRadioAction = pageActions.next()) {
@ -342,18 +342,18 @@ void MainWindow::slotTopPage() {
windowStack->raiseWidget(overviewPages.at(selectedPage)); windowStack->raiseWidget(overviewPages.at(selectedPage));
} }
void MainWindow::slotSearchHits(const QString &query, int *hitList, int length) { void MainWindow::slotSearchHits(const TQString &query, int *hitList, int length) {
if(query=="") { if(query=="") {
generalHitLabel->setText(""); generalHitLabel->setText("");
advancedHitLabel->setText(""); advancedHitLabel->setText("");
} else { } else {
if(length>=1) { if(length>=1) {
generalHitLabel->setText(i18n("%1 hit in General","%1 hits in General",hitList[0]).arg(hitList[0])); generalHitLabel->setText(i18n("%1 hit in General","%1 hits in General",hitList[0]).tqarg(hitList[0]));
} }
if(length>=2) { if(length>=2) {
advancedHitLabel->setText(i18n("%1 hit in Advanced","%1 hits in Advanced",hitList[1]).arg(hitList[1])); advancedHitLabel->setText(i18n("%1 hit in Advanced","%1 hits in Advanced",hitList[1]).tqarg(hitList[1]));
} }
} }

@ -24,16 +24,16 @@
#include <kmainwindow.h> #include <kmainwindow.h>
#include <kcmoduleinfo.h> #include <kcmoduleinfo.h>
#include <ktabwidget.h> #include <ktabwidget.h>
#include <qptrdict.h> #include <tqptrdict.h>
#include <qlabel.h> #include <tqlabel.h>
#include <kactionclasses.h> #include <kactionclasses.h>
#include <kiconviewsearchline.h> #include <kiconviewsearchline.h>
#include "kcscrollview.h" #include "kcscrollview.h"
#include "kcmodulemenu.h" #include "kcmodulemenu.h"
class QWidgetStack; class TQWidgetStack;
class QIconViewItem; class TQIconViewItem;
class KCMultiWidget; class KCMultiWidget;
class ModulesView; class ModulesView;
class KAction; class KAction;
@ -44,14 +44,15 @@ class KCModuleProxy;
class MainWindow : public KMainWindow class MainWindow : public KMainWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MainWindow(bool embed=true, const QString &menufile="systemsettings", MainWindow(bool embed=true, const TQString &menufile="systemsettings",
QWidget *parent=0, const char *name=0); TQWidget *tqparent=0, const char *name=0);
~MainWindow(); ~MainWindow();
private slots: private slots:
void slotItemSelected( QIconViewItem* item ); void slotItemSelected( TQIconViewItem* item );
void showAllModules(); void showAllModules();
void aboutCurrentModule(); void aboutCurrentModule();
void updateModuleHelp( KCModuleProxy * ); void updateModuleHelp( KCModuleProxy * );
@ -62,25 +63,25 @@ private slots:
void widgetChange(); void widgetChange();
void timerResize(); void timerResize();
void slotTopPage(); void slotTopPage();
void slotSearchHits(const QString &query, int *hitList, int length); void slotSearchHits(const TQString &query, int *hitList, int length);
private: private:
KCModuleMenu *menu; KCModuleMenu *menu;
bool embeddedWindows; bool embeddedWindows;
QWidgetStack *windowStack; TQWidgetStack *windowStack;
KTabWidget *moduleTabs; KTabWidget *moduleTabs;
QPtrList<ModulesView> modulesViewList; TQPtrList<ModulesView> modulesViewList;
QPtrList<QIconView> viewList; TQPtrList<TQIconView> viewList;
KCMultiWidget *groupWidget; KCMultiWidget *groupWidget;
KCScrollView *scrollView; KCScrollView *scrollView;
QPtrDict<KCMultiWidget> moduleItemToWidgetDict; TQPtrDict<KCMultiWidget> moduleItemToWidgetDict;
QPtrDict<KCScrollView> moduleItemToScrollerDict; TQPtrDict<KCScrollView> moduleItemToScrollerDict;
QPtrList<KRadioAction> pageActions; TQPtrList<KRadioAction> pageActions;
QPtrList<KCScrollView> overviewPages; TQPtrList<KCScrollView> overviewPages;
int selectedPage; int selectedPage;
KAction *resetModule; KAction *resetModule;
@ -96,8 +97,8 @@ private:
void buildMainWidget(); void buildMainWidget();
void buildActions(); void buildActions();
QLabel *generalHitLabel; TQLabel *generalHitLabel;
QLabel *advancedHitLabel; TQLabel *advancedHitLabel;
/** /**
* If someone wants to report a bug * If someone wants to report a bug

@ -24,17 +24,17 @@
#define IMAGE_SIZE 32 #define IMAGE_SIZE 32
ModuleIconItem::ModuleIconItem( KIconView *parent, KCModuleInfo module) ModuleIconItem::ModuleIconItem( KIconView *tqparent, KCModuleInfo module)
: QIconViewItem( parent, module.moduleName(), : TQIconViewItem( tqparent, module.moduleName(),
SmallIcon( module.icon(), IMAGE_SIZE ) ), SmallIcon( module.icon(), IMAGE_SIZE ) ),
currentState( KIcon::ActiveState), imageName(module.icon()) currentState( KIcon::ActiveState), imageName(module.icon())
{ {
modules.append(module); modules.append(module);
} }
ModuleIconItem::ModuleIconItem( KIconView *parent, const QString &text, ModuleIconItem::ModuleIconItem( KIconView *tqparent, const TQString &text,
const QString &imageName ) const TQString &imageName )
: QIconViewItem( parent, text, SmallIcon( imageName, IMAGE_SIZE ) ), : TQIconViewItem( tqparent, text, SmallIcon( imageName, IMAGE_SIZE ) ),
currentState( KIcon::ActiveState ) currentState( KIcon::ActiveState )
{ {
this->imageName = imageName; this->imageName = imageName;

@ -31,14 +31,14 @@ class ConfigModule;
* Stores information about what modules goes with this item. * Stores information about what modules goes with this item.
* Also provides means of loading the enabled/disabled image (see kcmsearch). * Also provides means of loading the enabled/disabled image (see kcmsearch).
*/ */
class ModuleIconItem : public QIconViewItem class ModuleIconItem : public TQIconViewItem
{ {
public: public:
ModuleIconItem( KIconView *parent, KCModuleInfo module ); ModuleIconItem( KIconView *tqparent, KCModuleInfo module );
ModuleIconItem( KIconView *parent, const QString &text, ModuleIconItem( KIconView *tqparent, const TQString &text,
const QString &imageName ); const TQString &imageName );
/** /**
* Update the icon to either be enabled or not. * Update the icon to either be enabled or not.
@ -46,11 +46,11 @@ public:
void loadIcon( bool enabled = true ); void loadIcon( bool enabled = true );
// The modules that go with this item // The modules that go with this item
QValueList<KCModuleInfo> modules; TQValueList<KCModuleInfo> modules;
private: private:
int currentState; int currentState;
QString imageName; TQString imageName;
}; };
#endif // MODULEICONITEM_H #endif // MODULEICONITEM_H

@ -20,10 +20,10 @@
#include "modulesview.h" #include "modulesview.h"
#include <qlabel.h> #include <tqlabel.h>
#include <klocale.h> #include <klocale.h>
#include <kservicegroup.h> #include <kservicegroup.h>
#include <qlayout.h> #include <tqlayout.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kcmultidialog.h> #include <kcmultidialog.h>
#include <kdialogbase.h> #include <kdialogbase.h>
@ -31,40 +31,40 @@
#include <kapplication.h> #include <kapplication.h>
#include <kaboutapplication.h> #include <kaboutapplication.h>
#include <kdebug.h> #include <kdebug.h>
#include <qiconview.h> #include <tqiconview.h>
#include "kcmsearch.h" #include "kcmsearch.h"
#include "moduleiconitem.h" #include "moduleiconitem.h"
#include "kcmodulemenu.h" #include "kcmodulemenu.h"
ModulesView::ModulesView( KCModuleMenu *rootMenu, const QString &menuPath, QWidget *parent, ModulesView::ModulesView( KCModuleMenu *rootMenu, const TQString &menuPath, TQWidget *tqparent,
const char *name ) : QWidget( parent, name ), rootMenu( NULL ) const char *name ) : TQWidget( tqparent, name ), rootMenu( NULL )
{ {
this->rootMenu = rootMenu; this->rootMenu = rootMenu;
this->menuPath = menuPath; this->menuPath = menuPath;
QVBoxLayout *layout = new QVBoxLayout( this, 11, 6, "layout" ); TQVBoxLayout *tqlayout = new TQVBoxLayout( this, 11, 6, "tqlayout" );
displayName = this->rootMenu->caption; displayName = this->rootMenu->caption;
QValueList<MenuItem> subMenus = rootMenu->menuList(menuPath); TQValueList<MenuItem> subMenus = rootMenu->menuList(menuPath);
QValueList<MenuItem>::iterator it; TQValueList<MenuItem>::iterator it;
for ( it = subMenus.begin(); it != subMenus.end(); ++it ){ for ( it = subMenus.begin(); it != subMenus.end(); ++it ){
if( !(*it).menu ) if( !(*it).menu )
continue; continue;
// After the first time around add a line // After the first time around add a line
if( it != subMenus.begin() ){ if( it != subMenus.begin() ){
QFrame *line = new QFrame( this, "line"); TQFrame *line = new TQFrame( this, "line");
line->setFrameShadow( QFrame::Sunken ); line->setFrameShadow( TQFrame::Sunken );
line->setFrameShape( QFrame::HLine ); line->setFrameShape( TQFrame::HLine );
layout->addWidget( line ); tqlayout->addWidget( line );
} }
// Build the row of modules/icons // Build the row of modules/icons
createRow( (*it).subMenu, layout ); createRow( (*it).subMenu, tqlayout );
} }
layout->addStretch(1); tqlayout->addStretch(1);
// Make empty iconView for the search widget // Make empty iconView for the search widget
if( groups.count()==0 ) { if( groups.count()==0 ) {
@ -78,9 +78,9 @@ ModulesView::ModulesView( KCModuleMenu *rootMenu, const QString &menuPath, QWidg
{ {
uint most = 0; uint most = 0;
QValueList<RowIconView*>::iterator it; TQValueList<RowIconView*>::iterator it;
for ( it = groups.begin(); it != groups.end(); ++it ){ for ( it = groups.begin(); it != groups.end(); ++it ){
QIconViewItem *item = (*it)->firstItem(); TQIconViewItem *item = (*it)->firstItem();
while( item ) { while( item ) {
if(item->width() > most) if(item->width() > most)
most = item->width(); most = item->width();
@ -98,30 +98,30 @@ ModulesView::~ModulesView()
{ {
} }
void ModulesView::createRow( const QString &parentPath, QBoxLayout *boxLayout ) void ModulesView::createRow( const TQString &tqparentPath, TQBoxLayout *boxLayout )
{ {
KServiceGroup::Ptr group = KServiceGroup::group( parentPath ); KServiceGroup::Ptr group = KServiceGroup::group( tqparentPath );
if ( !group ){ if ( !group ){
kdDebug() << "Invalid Group \"" << parentPath << "\". Check your installation."<< endl; kdDebug() << "Invalid Group \"" << tqparentPath << "\". Check your installation."<< endl;
return; return;
} }
// Make header // Make header
QHBoxLayout *rowLayout = new QHBoxLayout( 0, 0, 6, "rowLayout" ); TQHBoxLayout *rowLayout = new TQHBoxLayout( 0, 0, 6, "rowLayout" );
// Heaer Icon // Heaer Icon
QLabel *icon = new QLabel( this, "groupicon" ); TQLabel *icon = new TQLabel( this, "groupicon" );
icon->setPixmap( SmallIcon( group->icon() ) ); icon->setPixmap( SmallIcon( group->icon() ) );
icon->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, icon->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1,
(QSizePolicy::SizeType)5, 0, 0, icon->sizePolicy().hasHeightForWidth() ) ); (TQSizePolicy::SizeType)5, 0, 0, icon->sizePolicy().hasHeightForWidth() ) );
rowLayout->addWidget( icon ); rowLayout->addWidget( icon );
// Header Name // Header Name
QLabel *textLabel = new QLabel( this, "groupcaption" ); TQLabel *textLabel = new TQLabel( this, "groupcaption" );
textLabel->setText( group->caption() ); textLabel->setText( group->caption() );
textLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, textLabel->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7,
(QSizePolicy::SizeType)5, 0, 0, textLabel->sizePolicy().hasHeightForWidth())); (TQSizePolicy::SizeType)5, 0, 0, textLabel->sizePolicy().hasHeightForWidth()));
QFont textLabel_font( textLabel->font() ); TQFont textLabel_font( textLabel->font() );
textLabel_font.setBold( true ); textLabel_font.setBold( true );
textLabel->setFont( textLabel_font ); textLabel->setFont( textLabel_font );
rowLayout->addWidget( textLabel ); rowLayout->addWidget( textLabel );
@ -135,21 +135,21 @@ void ModulesView::createRow( const QString &parentPath, QBoxLayout *boxLayout )
iconView->setSpacing( 0 ); iconView->setSpacing( 0 );
iconView->setMargin( 0 ); iconView->setMargin( 0 );
iconView->setItemsMovable( false ); iconView->setItemsMovable( false );
iconView->setSelectionMode(QIconView::NoSelection); iconView->setSelectionMode(TQIconView::NoSelection);
groups.append( iconView ); groups.append( iconView );
connect(iconView, SIGNAL( clicked( QIconViewItem* ) ), connect(iconView, TQT_SIGNAL( clicked( TQIconViewItem* ) ),
this, SIGNAL( itemSelected( QIconViewItem* ) ) ); this, TQT_SIGNAL( itemSelected( TQIconViewItem* ) ) );
boxLayout->addWidget( iconView ); boxLayout->addWidget( iconView );
// Add all the items in their proper order // Add all the items in their proper order
QValueList<MenuItem> list = rootMenu->menuList( parentPath ); TQValueList<MenuItem> list = rootMenu->menuList( tqparentPath );
QValueList<MenuItem>::iterator it; TQValueList<MenuItem>::iterator it;
for ( it = list.begin(); it != list.end(); ++it ){ for ( it = list.begin(); it != list.end(); ++it ){
if( !(*it).menu ) if( !(*it).menu )
(void)new ModuleIconItem( iconView, (*it).item ); (void)new ModuleIconItem( iconView, (*it).item );
else else
{ {
QString path = (*it).subMenu; TQString path = (*it).subMenu;
KServiceGroup::Ptr group = KServiceGroup::group( path ); KServiceGroup::Ptr group = KServiceGroup::group( path );
if ( group ) { if ( group ) {
ModuleIconItem *item = new ModuleIconItem( ((KIconView*)iconView), ModuleIconItem *item = new ModuleIconItem( ((KIconView*)iconView),
@ -160,11 +160,11 @@ void ModulesView::createRow( const QString &parentPath, QBoxLayout *boxLayout )
} }
// Force the height for those items that have two words. // Force the height for those items that have two words.
iconView->setMinimumHeight( iconView->minimumSizeHint().height() ); iconView->setMinimumHeight( iconView->tqminimumSizeHint().height() );
} }
void ModulesView::clearSelection() { void ModulesView::clearSelection() {
QValueList<RowIconView*>::iterator it; TQValueList<RowIconView*>::iterator it;
for ( it = groups.begin(); it != groups.end(); ++it ) { for ( it = groups.begin(); it != groups.end(); ++it ) {
(*it)->clearSelection(); (*it)->clearSelection();
} }

@ -30,14 +30,14 @@ class RowIconView : public KIconView
{ {
public: public:
RowIconView( QWidget* parent, const char *name=0 ) RowIconView( TQWidget* tqparent, const char *name=0 )
: KIconView( parent, name ){ }; : KIconView( tqparent, name ){ };
// Figure out the hight/width to have only one row // Figure out the hight/width to have only one row
QSize minimumSizeHint() const { TQSize tqminimumSizeHint() const {
int width = 0; int width = 0;
/* /*
for ( QIconViewItem *item = firstItem(); item; item = item->nextItem() ) for ( TQIconViewItem *item = firstItem(); item; item = item->nextItem() )
width += item->width(); width += item->width();
width += spacing()*(count())+(margin()+frameWidth()+lineWidth()+midLineWidth())*2 ; width += spacing()*(count())+(margin()+frameWidth()+lineWidth()+midLineWidth())*2 ;
*/ */
@ -45,7 +45,7 @@ public:
width = count()*gridX()+frameWidth()*2; width = count()*gridX()+frameWidth()*2;
int height = 0; int height = 0;
for ( QIconViewItem *item = firstItem(); item; item = item->nextItem() ) for ( TQIconViewItem *item = firstItem(); item; item = item->nextItem() )
if(item->height() > height) if(item->height() > height)
height = item->height(); height = item->height();
// I honestly don't know where the 4+4 is coming from... // I honestly don't know where the 4+4 is coming from...
@ -59,41 +59,42 @@ public:
int f = 2 * frameWidth(); int f = 2 * frameWidth();
int height = ( 2*h ) + f + spacing() * 2 + 32 + lineWidth()*2 + 10; int height = ( 2*h ) + f + spacing() * 2 + 32 + lineWidth()*2 + 10;
*/ */
return QSize( width, height ); return TQSize( width, height );
}; };
}; };
class QBoxLayout; class TQBoxLayout;
class KCModuleMenu; class KCModuleMenu;
/** /**
* This widget contains the IconView's of all of the modules etc * This widget contains the IconView's of all of the modules etc
* It is the basic thing that users see. * It is the basic thing that users see.
*/ */
class ModulesView : public QWidget class ModulesView : public TQWidget
{ {
// To search the groups // To search the groups
friend class KcmSearch; friend class KcmSearch;
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
void clearSelection(); void clearSelection();
QString displayName; TQString displayName;
signals: signals:
void itemSelected( QIconViewItem* item ); void itemSelected( TQIconViewItem* item );
public: public:
ModulesView( KCModuleMenu *rootMenu, const QString &menuPath, QWidget *parent=0, const char *name=0 ); ModulesView( KCModuleMenu *rootMenu, const TQString &menuPath, TQWidget *tqparent=0, const char *name=0 );
~ModulesView(); ~ModulesView();
private: private:
QValueList<RowIconView*> groups; TQValueList<RowIconView*> groups;
KCModuleMenu *rootMenu; KCModuleMenu *rootMenu;
QString menuPath; TQString menuPath;
void createRow( const QString &parentPath, QBoxLayout *layout ); void createRow( const TQString &tqparentPath, TQBoxLayout *tqlayout );
}; };
#endif // MODULESVIEW_H #endif // MODULESVIEW_H

Loading…
Cancel
Save