From kde-commits Thu Dec 30 09:51:12 2010 From: Tobias Koenig Date: Thu, 30 Dec 2010 09:51:12 +0000 To: kde-commits Subject: KDE/kdepimlibs/akonadi Message-Id: <20101230095112.E3AB1AC8AC () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129370271806035 SVN commit 1210260 by tokoe: Disable the base widget only if it is not the overlay's parent If the base widget is the direct or indirect parent of the overlay, disabling the base widget will disable the overlay widget as well, which results in a disabled 'Start' button and makes the application unusable. CCMAIL: vkrause@kde.org M +9 -1 erroroverlay.cpp M +1 -1 erroroverlay_p.h --- trunk/KDE/kdepimlibs/akonadi/erroroverlay.cpp #1210259:1210260 @@ -54,10 +54,13 @@ ErrorOverlay::ErrorOverlay( QWidget *baseWidget, QWidget * parent ) : QWidget( parent ? parent : baseWidget->window() ), mBaseWidget( baseWidget ), + mBaseWidgetIsParent( false ), ui( new Ui::ErrorOverlay ) { Q_ASSERT( baseWidget ); + mBaseWidgetIsParent = isParentOf( mBaseWidget, this ); + // check existing overlays to detect cascading for ( QVector, QPointer > >::Iterator it = sInstanceOverlay->baseWidgets.begin(); it != sInstanceOverlay->baseWidgets.end(); ) { @@ -113,7 +116,7 @@ ErrorOverlay::~ ErrorOverlay() { - if ( mBaseWidget ) + if ( mBaseWidget && !mBaseWidgetIsParent ) mBaseWidget->setEnabled( mPreviousState ); } @@ -176,13 +179,18 @@ if ( state == ServerManager::Running && mOverlayActive ) { mOverlayActive = false; hide(); + if ( !mBaseWidgetIsParent ) mBaseWidget->setEnabled( mPreviousState ); } else if ( !mOverlayActive ) { mOverlayActive = true; if ( mBaseWidget->isVisible() ) show(); + + if ( !mBaseWidgetIsParent ) { mPreviousState = mBaseWidget->isEnabled(); mBaseWidget->setEnabled( false ); + } + reposition(); } --- trunk/KDE/kdepimlibs/akonadi/erroroverlay_p.h #1210259:1210260 @@ -67,8 +67,8 @@ QPointer mBaseWidget; bool mPreviousState; bool mOverlayActive; + bool mBaseWidgetIsParent; boost::scoped_ptr ui; - }; }