diff -r 8bfb9186a8b8 -r 4bd5176e1bc8 widgets/widgetapp/src/WidgetUiWindow.cpp --- a/widgets/widgetapp/src/WidgetUiWindow.cpp Tue May 11 17:13:44 2010 +0300 +++ b/widgets/widgetapp/src/WidgetUiWindow.cpp Tue May 25 13:52:38 2010 +0300 @@ -29,7 +29,7 @@ #include #include #include - +#include #include #include #include "WidgetInstallerInternalCRKeys.h" @@ -56,7 +56,9 @@ const TUint KWmlNoDefaultAccessPoint = KMaxTUint; // see cenrep setting default -1 as int, here as uint const TUint KWmlNoDefaultSnapId = KMaxTUint; // see cenrep setting default -1 as int, here as uint +#ifdef BRDO_OCC_ENABLED_FF const TInt KRetryConnectivityTimeout( 2*1000*1000 ); // 2 seconds +#endif // MACROS @@ -112,7 +114,8 @@ void CWidgetUiWindow::ConstructL( const TUid& aUid ) { iUid = aUid; - + iDialogsProvider = CBrowserDialogsProvider::NewL( NULL ); + iPenEnabled = AknLayoutUtils::PenEnabled(); iShowSoftkeys = iPenEnabled; @@ -125,7 +128,7 @@ iUrl = GetUlrL( clientSession, aUid ); iWidgetUiObserver = CWidgetUiObserver::NewL( *this ); - iWidgetUiDialogsProviderProxy = CWidgetUiDialogsProviderProxy::NewL(*(iWindowManager.DialogsProvider()), NULL, *this); + iWidgetUiDialogsProviderProxy = CWidgetUiDialogsProviderProxy::NewL(*iDialogsProvider, NULL, *this); #ifdef BRDO_WRT_HS_FF iNetworkModeWait = new(ELeave) CActiveSchedulerWait(); @@ -219,6 +222,10 @@ // CWidgetUiWindow::~CWidgetUiWindow() { + if( iDialogsProvider) + { + iDialogsProvider->CancelAll(); + } if (iEngine && iWidgetUiObserver) { iEngine->RemoveLoadEventObserver( iWidgetUiObserver ); @@ -246,7 +253,8 @@ iAsyncCallBack->Cancel(); } delete iAsyncCallBack; - iAsyncCallBack=NULL; + iAsyncCallBack=NULL; + delete iDialogsProvider; } // ----------------------------------------------------------------------------- @@ -356,7 +364,7 @@ TBool CWidgetUiWindow::DialogMimeFileSelectLC(HBufC*& aSelectedFileName, const TDesC& aMimeType) { - return iWindowManager.DialogsProvider()->DialogMimeFileSelectLC(aSelectedFileName, aMimeType); + return iDialogsProvider->DialogMimeFileSelectLC(aSelectedFileName, aMimeType); } // ----------------------------------------------------------------------------- @@ -795,13 +803,11 @@ if ( prompt ) { - CBrowserDialogsProvider* dialogProvider - = iWindowManager.DialogsProvider(); TBool grant = EFalse; HBufC* message = StringLoader::LoadLC( R_WIDGETUI_NETWORK_ACCESS ); HBufC* yes = StringLoader::LoadLC( R_WIDGETUI_SOFTKEY_YES ); HBufC* no = StringLoader::LoadLC( R_WIDGETUI_SOFTKEY_NO ); - grant = dialogProvider->DialogConfirmL( _L(""), *message, *yes, *no ); + grant = iDialogsProvider->DialogConfirmL( _L(""), *message, *yes, *no ); CleanupStack::PopAndDestroy( 3 ); // save prompt result for session SetNetworkAccessGrant( grant? EAllow : EDeny ); @@ -1308,8 +1314,10 @@ CWidgetUiWindow* self = (CWidgetUiWindow*)aPtr; CWidgetUiWindowManager* p = &self->iWindowManager; delete self; + //The Correct fix is to call AppUI::Exit() + //But that is leaving if(p->WindowListCount() == 0) - p->ExitNow(); + User::Exit(KErrNone); return 0; } @@ -1320,20 +1328,22 @@ // void CWidgetUiWindow::ConnectionStageAchievedL() { - iWindowManager.GetConnection()->Disconnect(); - - TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) ); - SetRetryFlag(ETrue); + + TNifProgressBuf buf = iConnStageNotifier->GetProgressBuffer(); + if( buf().iError == KErrDisconnected ) + { + TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandSetRetryConnectivityFlag + (TInt)TBrCtlDefs::ECommandIdBase ) ); + SetRetryFlag(ETrue); - TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelQueuedTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) ); + TRAP_IGNORE( Engine()->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelQueuedTransactions + (TInt)TBrCtlDefs::ECommandIdBase ) ); - if( iRetryConnectivity && iRetryConnectivity->IsActive()) - { - iRetryConnectivity->Cancel(); - } - iRetryConnectivity->Start(KRetryConnectivityTimeout, 0,TCallBack(RetryConnectivity,this)); - + if( iRetryConnectivity && iRetryConnectivity->IsActive()) + { + iRetryConnectivity->Cancel(); + } + iRetryConnectivity->Start(KRetryConnectivityTimeout, 0,TCallBack(RetryConnectivity,this)); + } } void CWidgetUiWindow::ConnNeededStatusL( TInt aErr ) @@ -1416,5 +1426,18 @@ { return reConnectivityFlag; } + + void CWidgetUiWindow::CancelAllDialogs() + { + if( iDialogsProvider) + { + iDialogsProvider->CancelAll(); + } + } + + TBool CWidgetUiWindow::IsDialogsLaunched() + { + return (iDialogsProvider && iDialogsProvider->IsDialogLaunched() ); + } #endif // End of file