diff -Nur -x '*.orig' -x '*~' kdebase-3.5.8/kcontrol/kcontrol/modules.cpp kdebase-3.5.8.new/kcontrol/kcontrol/modules.cpp
--- kdebase-3.5.8/kcontrol/kcontrol/modules.cpp 2007-10-08 11:51:12.000000000 +0200
+++ kdebase-3.5.8.new/kcontrol/kcontrol/modules.cpp 2008-01-22 17:16:32.000000000 +0100
@@ -48,7 +48,7 @@
ConfigModule::ConfigModule(const KService::Ptr &s)
: KCModuleInfo(s), _changed(false), _module(0), _embedWidget(0),
- _rootProcess(0), _embedLayout(0), _embedFrame(0)
+ _rootProcess(0), _embedLayout(0), _embedFrame(0), _embedStack(0)
{
}
@@ -97,6 +97,8 @@
delete _embedWidget;
_embedWidget = 0;
+ delete _embedStack;
+ _embedStack = 0;
delete _embedFrame;
_embedFrame = 0;
kapp->syncX();
@@ -136,6 +138,7 @@
delete _rootProcess;
delete _embedWidget;
delete _embedLayout;
+ delete _embedStack;
// create an embed widget that will embed the
// kcmshell running as root
@@ -149,14 +152,18 @@
_embedFrame->setLineWidth( 2 );
_embedFrame->setMidLineWidth( 2 );
_embedLayout->addWidget(_embedFrame,1);
- _embedWidget = new QXEmbed(_embedFrame );
+ // cannot reparent anything else inside QXEmbed, so put the busy label separately
+ _embedStack = new QWidgetStack(_embedFrame);
+ _embedWidget = new KControlEmbed(_embedStack);
_module->hide();
_embedFrame->show();
- QLabel *_busy = new QLabel(i18n("Loading..."), _embedWidget);
+ QLabel *_busy = new QLabel(i18n("Loading..."), _embedStack);
_busy->setAlignment(AlignCenter);
_busy->setTextFormat(RichText);
_busy->setGeometry(0,0, _module->width(), _module->height());
_busy->show();
+ _embedStack->raiseWidget(_busy);
+ connect(_embedWidget, SIGNAL( windowEmbedded(WId)), SLOT( embedded()));
// prepare the process to run the kcmshell
QString cmd = service()->exec().stripWhiteSpace();
@@ -209,6 +216,8 @@
}
// clean up in case of failure
+ delete _embedStack;
+ _embedStack = 0;
delete _embedFrame;
_embedWidget = 0;
delete _embedLayout;
@@ -239,6 +248,11 @@
emit childClosed();
}
+void ConfigModule::embedded()
+{
+ _embedStack->raiseWidget(_embedWidget); // put it above the busy label
+}
+
const KAboutData *ConfigModule::aboutData() const
{
if (!_module) return 0;
diff -Nur -x '*.orig' -x '*~' kdebase-3.5.8/kcontrol/kcontrol/modules.h kdebase-3.5.8.new/kcontrol/kcontrol/modules.h
--- kdebase-3.5.8/kcontrol/kcontrol/modules.h 2005-10-10 17:03:43.000000000 +0200
+++ kdebase-3.5.8.new/kcontrol/kcontrol/modules.h 2008-01-22 17:16:32.000000000 +0100
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
template class QPtrList;
class QStringList;
@@ -33,6 +34,7 @@
class QXEmbed;
class QVBoxLayout;
class QVBox;
+class QWidgetStack;
class ConfigModule : public QObject, public KCModuleInfo
{
@@ -62,6 +64,7 @@
void clientChanged(bool state);
void runAsRoot();
void rootExited(KProcess *proc);
+ void embedded();
signals:
@@ -80,6 +83,7 @@
KProcess *_rootProcess;
QVBoxLayout *_embedLayout;
QVBox *_embedFrame;
+ QWidgetStack *_embedStack;
};
@@ -119,4 +123,14 @@
QDict