Revision: 201011 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 22:01:53 +0300
branchRCL_3
changeset 12 bdac6c462392
parent 11 23553eb4e470
child 13 f392bfb21e08
Revision: 201011 Kit: 201013
gssettingsuis/Gs/GSNetworkPlugin/Inc/PSMNetworkPlugin.h
gssettingsuis/Gs/GSNetworkPlugin/Src/PSMNetworkPlugin.cpp
gssettingsuis/Gs/help/data/xhtml.zip
profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp
profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.h
profilesservices/ProfileEngine/WrapperSrc/ProEngWrapper.rss
profilesservices/ProfileEngine/group/ProfileEngine.mmp
--- a/gssettingsuis/Gs/GSNetworkPlugin/Inc/PSMNetworkPlugin.h	Mon Mar 15 12:41:46 2010 +0200
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Inc/PSMNetworkPlugin.h	Wed Mar 31 22:01:53 2010 +0300
@@ -23,8 +23,10 @@
 #include <e32std.h>
 #include <e32base.h>
 #include <psmpluginbase.h> //CPsmPluginBase
+#include <psmtypes.h>
 
 class CGSNetworkPluginModel;
+class CRepository;
 
 /**
 *  PSMNetwork plugin stub
@@ -67,9 +69,18 @@
         */
         TBool IsPhoneOfflineL() const;
         
+        /**
+         * To verify if the network mode needs to be changed.
+         * not change when from EPsmsrvModeNormal to EPsmsrvPartialMode
+         * and from EPsmsrvModePowerSave to EPsmsrvPartialMode
+         */
+        TBool IsChangeNetworkMode( TPsmsrvMode& aOldMode, TPsmsrvMode aNewMode );
+        
     private: // data
 
         CGSNetworkPluginModel *iModel;        //data model
+        CRepository* iPsmRepository;
+        TPsmsrvMode iPsmMode;
 
     };
 
--- a/gssettingsuis/Gs/GSNetworkPlugin/Src/PSMNetworkPlugin.cpp	Mon Mar 15 12:41:46 2010 +0200
+++ b/gssettingsuis/Gs/GSNetworkPlugin/Src/PSMNetworkPlugin.cpp	Wed Mar 31 22:01:53 2010 +0300
@@ -53,6 +53,11 @@
     __GSLOGSTRING( "[GS]-->[CPSMNetworkPlugin::ConstructL]" );
     
     iModel = CGSNetworkPluginModel::NewL( NULL,NULL );
+    iPsmRepository = CRepository::NewL( KCRUidPowerSaveMode );
+    // Read from CenRep so iPsmMode gets correct init value
+    TInt psmMode;
+    iPsmRepository->Get( KPsmCurrentMode, psmMode );
+    iPsmMode = ( TPsmsrvMode )psmMode;
     
     __GSLOGSTRING( "[GS]<--[CPSMNetworkPlugin::ConstructL]" );
     }
@@ -84,6 +89,8 @@
     __GSLOGSTRING( "[CPSMNetworkPlugin::~CPSMNetworkPlugin]" );
     delete iModel;
     iModel = NULL;
+    delete iPsmRepository;
+    iPsmRepository = NULL;
 	}
 
 // ---------------------------------------------------------
@@ -130,9 +137,10 @@
 //
 void CPSMNetworkPlugin::DoModeChangeL( const TInt aMode )
     {
+	TPsmsrvMode newMode = ( TPsmsrvMode )aMode;
     if ( !IsPhoneOfflineL() && 
          FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma ) &&
-         iModel->IsNetworkModeVisible() )
+         iModel->IsNetworkModeVisible() && IsChangeNetworkMode ( iPsmMode, newMode ) )
         {
         RConfigInfoArray infoArray;
     
@@ -141,7 +149,7 @@
         info1.iConfigType = EConfigTypeInt;
         info1.iIntValue = iModel->GetNetworkMode();
         infoArray.Append( info1 );
-    
+        
         __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL] Switching to mode:%d", aMode );
     
         __GSLOGSTRING1( "[CPSMNetworkPlugin::NotifyModeChangeL]: oldValue info1: %d", infoArray[0].iIntValue );
@@ -161,6 +169,26 @@
         }
     }
 
+// ----------------------------------------------------------------------------------
+// CPSMNetworkPlugin::IsChangeNetworkMode
+// ----------------------------------------------------------------------------------
+//
+TBool CPSMNetworkPlugin::IsChangeNetworkMode( TPsmsrvMode& aOldMode, TPsmsrvMode aNewMode )
+	{
+	TPsmsrvMode oldMode = aOldMode;
+	aOldMode = aNewMode;
+	if ( ( oldMode == EPsmsrvModeNormal && aNewMode == EPsmsrvPartialMode )
+			|| ( oldMode == EPsmsrvModePowerSave && aNewMode
+					== EPsmsrvPartialMode ) )
+		{
+		return EFalse;
+		}
+	else
+		{
+		return ETrue;
+		}
+	}
+
 //End of File
 
 
Binary file gssettingsuis/Gs/help/data/xhtml.zip has changed
--- a/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp	Mon Mar 15 12:41:46 2010 +0200
+++ b/profilesservices/ProfileEngine/ProfileScheduleEventSrc/CProfileChangeEvent.cpp	Wed Mar 31 22:01:53 2010 +0300
@@ -28,7 +28,7 @@
 #include    <barsc.h>
 #include    <bautils.h>
 
-#include	<secondarydisplay\SecondaryDisplayProfilesAPI.h>
+#include	<SeconDarydisplay/SecondaryDisplayProfilesAPI.h>
 #include	<aknSDData.h>
 #include	<featmgr.h>
 
--- a/profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp	Mon Mar 15 12:41:46 2010 +0200
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.cpp	Wed Mar 31 22:01:53 2010 +0300
@@ -27,7 +27,20 @@
 #include    "CProEngProfileImpl.h"
 #include    "CProEngToneHandler.h"
 #include    "CProEngProfileNameArrayImpl.h"
+#include    <ProEngWrapper.rsg>
+#include    <ConeResLoader.h> 
+#include 	<startupdomainpskeys.h>
+#include    <StringLoader.h>
+#include    <AknQueryDialog.h>
+#include    <aknnotewrappers.h>
+#include    <barsc.h>  // RResourceFile
+#include    <bautils.h> // BaflUtils
 
+namespace
+	{
+	// The filename of the resource file
+	_LIT( KProEngResourceFileName, "Z:ProEngWrapper.RSC" );
+	}
 // ============================ MEMBER FUNCTIONS ===============================
 
 // -----------------------------------------------------------------------------
@@ -47,6 +60,8 @@
     {
     iProfileEngine = CreateProfileEngineExtendedL();
     iToneHandler = CProEngToneHandler::NewL();
+	iFs = new ( ELeave ) RFs;
+    User::LeaveIfError( iFs->Connect() );
     }
 
 // -----------------------------------------------------------------------------
@@ -125,6 +140,8 @@
         iProfileEngine->Release();
         }
     delete iToneHandler;
+    iFs->Close();
+    delete iFs;
     }
 
 // -----------------------------------------------------------------------------
@@ -188,10 +205,45 @@
 // CProEngEngineImpl::SetActiveProfileL
 // -----------------------------------------------------------------------------
 //
-void CProEngEngineImpl::SetActiveProfileL( TInt aId )
-    {
-    iProfileEngine->SetActiveProfileL( aId );
-    }
+void CProEngEngineImpl::SetActiveProfileL(TInt aId)
+	{
+	if ( //  active profile is Off-line
+	( iProfileEngine->ActiveProfileId() == EProfileOffLineId ) &&
+	// and currently focused profile is not Off-line
+			( aId != EProfileOffLineId ) )
+		{
+
+		TInt simCStatus( ESimNotPresent );
+		RProperty simStatus;
+		User::LeaveIfError( simStatus.Attach(KPSUidStartup, KPSSimStatus ) );
+		User::LeaveIfError( simStatus.Get( simCStatus ) );
+		simStatus.Close();
+
+		TParse* fp = new ( ELeave ) TParse();
+		fp->Set( KProEngResourceFileName, &KDC_RESOURCE_FILES_DIR, NULL );
+		TFileName localizedFileName( fp->FullName() );
+		delete fp;
+
+		BaflUtils::NearestLanguageFile( *iFs, localizedFileName );
+		RConeResourceLoader resourceLoader( *CCoeEnv::Static() );
+		TRAP_IGNORE( resourceLoader.OpenL( localizedFileName ) );
+
+		if ( simCStatus == ESimNotPresent )
+			{
+			// SIM card does not exist.
+			HBufC* infoNoteText = StringLoader::LoadLC(
+					R_PROFILE_TEXT_INSERT_SIM );
+			CAknInformationNote* note = new ( ELeave ) CAknInformationNote( ETrue );
+			note->ExecuteLD( *infoNoteText );
+			CleanupStack::PopAndDestroy( infoNoteText );
+			resourceLoader.Close();	
+			return;
+			}
+		resourceLoader.Close();
+		}
+
+	iProfileEngine->SetActiveProfileL(aId);
+	}
 
 // -----------------------------------------------------------------------------
 // CProEngEngineImpl::ProfileLC
--- a/profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.h	Mon Mar 15 12:41:46 2010 +0200
+++ b/profilesservices/ProfileEngine/WrapperSrc/CProEngEngineImpl.h	Wed Mar 31 22:01:53 2010 +0300
@@ -174,6 +174,8 @@
 
         // Own: tone handler for DRM checkups etc.
         CProEngToneHandler* iToneHandler;
+	    // File server session
+        RFs* iFs;
     };
 
 #endif      //  CPROENGENGINEIMPL_H
--- a/profilesservices/ProfileEngine/WrapperSrc/ProEngWrapper.rss	Mon Mar 15 12:41:46 2010 +0200
+++ b/profilesservices/ProfileEngine/WrapperSrc/ProEngWrapper.rss	Wed Mar 31 22:01:53 2010 +0300
@@ -24,6 +24,9 @@
 //  INCLUDES
 #include <eikon.rh>
 #include <drmcommon.loc>
+#include <avkon.rsg>
+#include <avkon.rh>
+#include <avkon.loc>
 
 //  CONSTANTS
 //  MACROS
@@ -47,4 +50,12 @@
 //
 RESOURCE LBUF r_proeng_text_drm_prev_rights_set { txt = qtn_drm_prev_rights_set; }
 
+// -----------------------------------------------------------------------------
+//
+// r_profile_text_insert_sim
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_profile_text_insert_sim { buf = qtn_su_note_insert_sim; }
+
 // End of File
--- a/profilesservices/ProfileEngine/group/ProfileEngine.mmp	Mon Mar 15 12:41:46 2010 +0200
+++ b/profilesservices/ProfileEngine/group/ProfileEngine.mmp	Wed Mar 31 22:01:53 2010 +0300
@@ -75,7 +75,11 @@
 LIBRARY         PlatformEnv.lib  // PathInfo
 LIBRARY         ContentListingFramework.lib
 LIBRARY         mmfcontrollerframework.lib
-
+LIBRARY         avkon.lib 
+LIBRARY         eikcdlg.lib 
+LIBRARY         eikctl.lib 
+LIBRARY	        CommonEngine.lib 
+LIBRARY         cone.lib
 LIBRARY         DRMCommon.lib
 LIBRARY         DrmRights.lib
 LIBRARY		caf.lib	cafutils.lib // Content access framework