|
|
@ -58,7 +58,7 @@ class KCMultiWidget::KCMultiWidgetPrivate
|
|
|
|
{}
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
bool hasRootKCM;
|
|
|
|
bool hasRootKCM;
|
|
|
|
KCModuleProxy* currentModule;
|
|
|
|
TDECModuleProxy* currentModule;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -140,7 +140,7 @@ void KCMultiWidget::apply()
|
|
|
|
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 )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KCModuleProxy * m = ( *it ).kcm;
|
|
|
|
TDECModuleProxy * m = ( *it ).kcm;
|
|
|
|
if( m && m->changed() )
|
|
|
|
if( m && m->changed() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m->save();
|
|
|
|
m->save();
|
|
|
@ -233,10 +233,10 @@ void KCMultiWidget::addModule(const TQString& path, bool withfallback)
|
|
|
|
|
|
|
|
|
|
|
|
KService::Ptr service = KService::serviceByStorageId( complete );
|
|
|
|
KService::Ptr service = KService::serviceByStorageId( complete );
|
|
|
|
|
|
|
|
|
|
|
|
addModule( KCModuleInfo( service ), TQStringList(), withfallback);
|
|
|
|
addModule( TDECModuleInfo( service ), TQStringList(), withfallback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
|
|
|
|
void KCMultiWidget::addModule(const TDECModuleInfo& moduleinfo,
|
|
|
|
TQStringList parentmodulenames, bool withfallback)
|
|
|
|
TQStringList parentmodulenames, bool withfallback)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( !moduleinfo.service() )
|
|
|
|
if( !moduleinfo.service() )
|
|
|
@ -245,7 +245,7 @@ void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
|
|
|
|
if ( !kapp->authorizeControlModule( moduleinfo.service()->menuId() ))
|
|
|
|
if ( !kapp->authorizeControlModule( moduleinfo.service()->menuId() ))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if( !KCModuleLoader::testModule( moduleinfo ))
|
|
|
|
if( !TDECModuleLoader::testModule( moduleinfo ))
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
TQFrame* page = 0;
|
|
|
|
TQFrame* page = 0;
|
|
|
@ -274,17 +274,17 @@ void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!page) {
|
|
|
|
if(!page) {
|
|
|
|
KCModuleLoader::unloadModule(moduleinfo);
|
|
|
|
TDECModuleLoader::unloadModule(moduleinfo);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
KCModuleProxy * module;
|
|
|
|
TDECModuleProxy * module;
|
|
|
|
if( m_orphanModules.contains( moduleinfo.service() ) )
|
|
|
|
if( m_orphanModules.contains( moduleinfo.service() ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// the KCModule already exists - it was removed from the dialog in
|
|
|
|
// the TDECModule already exists - it was removed from the dialog in
|
|
|
|
// removeAllModules
|
|
|
|
// removeAllModules
|
|
|
|
module = m_orphanModules[ moduleinfo.service() ];
|
|
|
|
module = m_orphanModules[ moduleinfo.service() ];
|
|
|
|
m_orphanModules.remove( moduleinfo.service() );
|
|
|
|
m_orphanModules.remove( moduleinfo.service() );
|
|
|
|
kdDebug( 710 ) << "Use KCModule from the list of orphans for " <<
|
|
|
|
kdDebug( 710 ) << "Use TDECModule from the list of orphans for " <<
|
|
|
|
moduleinfo.moduleName() << ": " << module << endl;
|
|
|
|
moduleinfo.moduleName() << ": " << module << endl;
|
|
|
|
|
|
|
|
|
|
|
|
module->reparent( page, 0, TQPoint( 0, 0 ), true );
|
|
|
|
module->reparent( page, 0, TQPoint( 0, 0 ), true );
|
|
|
@ -298,7 +298,7 @@ void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
module = new KCModuleProxy( moduleinfo, withfallback, page );
|
|
|
|
module = new TDECModuleProxy( moduleinfo, withfallback, page );
|
|
|
|
|
|
|
|
|
|
|
|
TQStringList parentComponents = moduleinfo.service()->property(
|
|
|
|
TQStringList parentComponents = moduleinfo.service()->property(
|
|
|
|
"X-TDE-ParentComponents" ).toStringList();
|
|
|
|
"X-TDE-ParentComponents" ).toStringList();
|
|
|
@ -331,14 +331,14 @@ void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KCModuleProxy * KCMultiWidget::currentModule() {
|
|
|
|
TDECModuleProxy * KCMultiWidget::currentModule() {
|
|
|
|
if(d) {
|
|
|
|
if(d) {
|
|
|
|
return d->currentModule;
|
|
|
|
return d->currentModule;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KCMultiWidget::applyOrRevert(KCModuleProxy * module){
|
|
|
|
void KCMultiWidget::applyOrRevert(TDECModuleProxy * module){
|
|
|
|
if( !module || !module->changed() )
|
|
|
|
if( !module || !module->changed() )
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
@ -359,11 +359,11 @@ void KCMultiWidget::applyOrRevert(KCModuleProxy * module){
|
|
|
|
|
|
|
|
|
|
|
|
void KCMultiWidget::slotAboutToShow(TQWidget *page)
|
|
|
|
void KCMultiWidget::slotAboutToShow(TQWidget *page)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQObject * obj = page->child( 0, "KCModuleProxy" );
|
|
|
|
TQObject * obj = page->child( 0, "TDECModuleProxy" );
|
|
|
|
if( ! obj )
|
|
|
|
if( ! obj )
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
KCModuleProxy *module = ( KCModuleProxy* )obj->tqt_cast( "KCModuleProxy" );
|
|
|
|
TDECModuleProxy *module = ( TDECModuleProxy* )obj->tqt_cast( "TDECModuleProxy" );
|
|
|
|
if( ! module )
|
|
|
|
if( ! module )
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
@ -382,14 +382,14 @@ void KCMultiWidget::slotAboutToShow(TQWidget *page)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
showButton(Apply, buttons & KCModule::Apply);
|
|
|
|
showButton(Apply, buttons & TDECModule::Apply);
|
|
|
|
showButton(User1, buttons & KCModule::Apply); // Reset button.
|
|
|
|
showButton(User1, buttons & TDECModule::Apply); // Reset button.
|
|
|
|
|
|
|
|
|
|
|
|
// Close button. No Apply button implies a Close button.
|
|
|
|
// Close button. No Apply button implies a Close button.
|
|
|
|
showButton(User2, (buttons & KCModule::Apply)==0);
|
|
|
|
showButton(User2, (buttons & TDECModule::Apply)==0);
|
|
|
|
|
|
|
|
|
|
|
|
enableButton( KDialogBase::Help, buttons & KCModule::Help );
|
|
|
|
enableButton( KDialogBase::Help, buttons & TDECModule::Help );
|
|
|
|
enableButton( KDialogBase::Default, buttons & KCModule::Default );
|
|
|
|
enableButton( KDialogBase::Default, buttons & TDECModule::Default );
|
|
|
|
|
|
|
|
|
|
|
|
disconnect( this, TQT_SIGNAL(user3Clicked()), 0, 0 );
|
|
|
|
disconnect( this, TQT_SIGNAL(user3Clicked()), 0, 0 );
|
|
|
|
|
|
|
|
|
|
|
|