diff -r b01126ce0bec -r ba63c83f4716 idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp --- a/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Wed Sep 15 12:00:00 2010 +0300 +++ b/idlehomescreen/xmluirendering/uiengine/src/xneditor.cpp Wed Oct 13 14:18:30 2010 +0300 @@ -57,6 +57,7 @@ #include "xnviewdata.h" #include "xnwallpaperview.h" #include "xnbackgroundmanager.h" +#include "xnpopupcontroladapter.h" #include "xneditor.h" #include "xnpanic.h" @@ -234,7 +235,7 @@ CXnPluginData* plugin( viewData.Plugin( node ) ); - if ( plugin && !plugin->Occupied() && plugin->Editable() ) + if ( plugin && !plugin->Occupied() ) { return plugin; } @@ -628,6 +629,18 @@ } if( ui ) { + CXnNode* popup( iViewManager.UiEngine().StylusPopupNode() ); + if ( popup ) + { + CXnPopupControlAdapter* control = + static_cast< CXnPopupControlAdapter* >( + popup->Control() ); + + if ( control ) + { + control->HideMenuL(); + } + } ui->SetContentController( this ); ui->Activate(); @@ -1074,14 +1087,6 @@ } } -// ----------------------------------------------------------------------------- -// CXnEditor::NotifyViewLoadedL -// ----------------------------------------------------------------------------- -// -void CXnEditor::NotifyViewLoadedL( const CXnViewData& /*aViewData*/ ) - { - } - // --------------------------------------------------------------------------- // CXnEditor::NotifyConfigureWidgetL // --------------------------------------------------------------------------- @@ -1334,7 +1339,7 @@ // CXnEditor::NotifyViewAdditionL // --------------------------------------------------------------------------- // -void CXnEditor::NotifyViewAdditionL( const CXnViewData& /*aViewData*/ ) +void CXnEditor::NotifyViewAdditionL( const CXnPluginData& /*aPluginData*/ ) { NotifyViewListChanged(); } @@ -1343,7 +1348,7 @@ // CXnEditor::NotifyViewRemovalL // --------------------------------------------------------------------------- // -void CXnEditor::NotifyViewRemovalL( const CXnViewData& /*aViewData*/ ) +void CXnEditor::NotifyViewRemovalL( const CXnPluginData& /*aPluginData*/ ) { NotifyViewListChanged(); } @@ -1417,6 +1422,7 @@ KNotifyWidgetListChangedDelay, KNotifyWidgetListChangedDelay, TCallBack( WidgetListChangedCallBack, this ) ); + } // --------------------------------------------------------------------------- @@ -1922,23 +1928,12 @@ const TDesC8& type( aInfo.Type() ); if ( ( type != KKeyWidget && type != KKeyTemplate ) || - aInfo.Uid() == KNullDesC8 ) + aInfo.Uid() == KNullDesC8 || !aInfo.CanBeAdded() ) { // malformed content info return KErrArgument; } - // the widget can not be added. Return proper error code - if ( IsCurrentViewFull() ) - { - return KHsErrorViewFull; - } - else if ( !aInfo.CanBeAdded() ) - { - return KHsErrorMaxInstanceCountExceeded; - } - - CXnPluginData* plugin( NULL ); if( iTargetPlugin ) @@ -1952,9 +1947,27 @@ iTargetPlugin = NULL; - if ( !plugin ) + // the widget can not be added. Return proper error code + if ( IsCurrentViewFull() || !plugin ) + { + return KHsErrorViewFull; + } + else { - return KErrGeneral; + TInt result; + if ( aInfo.Type() != KKeyTemplate() ) + { + result = NonTemplateWidgetCanBeAddedRemovedL( aInfo ); + } + else + { + result = TemplateWidgetCanBeAddedRemovedL( aInfo ); + } + + if ( !( result & ECanBeAdded ) ) + { + return KHsErrorMaxInstanceCountExceeded; + } } ret = iViewManager.LoadWidgetToPluginL( aInfo, *plugin ); @@ -2180,7 +2193,7 @@ { CXnPluginData* plugin = plugins[ i ]; - if ( plugin && !plugin->Occupied() && plugin->Editable() ) + if ( !plugin->Occupied() ) { isFull = EFalse; break;