pkiutilities/CertmanUi/SRC/CertmanuicontainerTrust.cpp
branchRCL_3
changeset 49 09b1ac925e3f
parent 16 9971b621ef6c
child 50 03674e5abf46
equal deleted inserted replaced
47:63339781d179 49:09b1ac925e3f
     1 /*
     1 /*
     2 * Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   168       " CCertManUIContainerTrust::HandleListBoxEventL" );
   168       " CCertManUIContainerTrust::HandleListBoxEventL" );
   169 
   169 
   170     switch( aEventType )
   170     switch( aEventType )
   171         {
   171         {
   172         case EEventItemSingleClicked:
   172         case EEventItemSingleClicked:
   173             ChangeTrustChangeSettingSingleClickL();
   173             if ( !iKeeper.iWrapper->IsActive() )
       
   174                 {
       
   175                 iParent.ChangeTrustL();
       
   176                 }
   174             break;
   177             break;
   175         default:
   178         default:
   176             {
   179             {
   177             break;
   180             break;
   178             }
   181             }
   429         resIndex = KTrustSettingsResourceIndexOCSPCheck;
   432         resIndex = KTrustSettingsResourceIndexOCSPCheck;
   430         }
   433         }
   431     else if ( aTrusterUid == KCertManUIViewTrustVPNId )
   434     else if ( aTrusterUid == KCertManUIViewTrustVPNId )
   432         {
   435         {
   433         resIndex = KTrustSettingsResourceIndexVPN;
   436         resIndex = KTrustSettingsResourceIndexVPN;
   434         }
       
   435     else if ( aTrusterUid == KCertManUIViewTrustWidgetInstallingId )
       
   436         {
       
   437         resIndex = KTrustSettingsResourceIndexWidget;
       
   438         }
   437         }
   439     else
   438     else
   440         {
   439         {
   441         resIndex = KErrNotFound;
   440         resIndex = KErrNotFound;
   442         }
   441         }
   594             {
   593             {
   595             item = (*iTrustedClients)[ KTrustSettingsResourceIndexAppCtrl ];
   594             item = (*iTrustedClients)[ KTrustSettingsResourceIndexAppCtrl ];
   596             }
   595             }
   597         else if ( id == KCertManUIViewTrustMailAndImageConnId )
   596         else if ( id == KCertManUIViewTrustMailAndImageConnId )
   598             {
   597             {
   599             item = (*iTrustedClients)[ KTrustSettingsResourceIndexMailAndImageConn ];
   598             item =
       
   599              (*iTrustedClients)[ KTrustSettingsResourceIndexMailAndImageConn ];
   600             }
   600             }
   601         else if ( id == KCertManUIViewTrustJavaInstallingId )
   601         else if ( id == KCertManUIViewTrustJavaInstallingId )
   602             {
   602             {
   603             item = (*iTrustedClients)[ KTrustSettingsResourceIndexJavaInstall ];
   603             item =
       
   604              (*iTrustedClients)[ KTrustSettingsResourceIndexJavaInstall ];
   604             }
   605             }
   605         else if ( id == KCertManUIViewOCSPCheckInstallingId )
   606         else if ( id == KCertManUIViewOCSPCheckInstallingId )
   606             {
   607             {
   607             item = (*iTrustedClients)[ KTrustSettingsResourceIndexOCSPCheck ];
   608             item =
       
   609              (*iTrustedClients)[ KTrustSettingsResourceIndexOCSPCheck ];
   608             }
   610             }
   609         else if ( id == KCertManUIViewTrustVPNId )
   611         else if ( id == KCertManUIViewTrustVPNId )
   610             {
   612             {
   611             item = (*iTrustedClients)[ KTrustSettingsResourceIndexVPN ];
   613             item =
   612             }
   614              (*iTrustedClients)[ KTrustSettingsResourceIndexVPN ];
   613         else if ( id == KCertManUIViewTrustWidgetInstallingId )
       
   614             {
       
   615             item = (*iTrustedClients)[ KTrustSettingsResourceIndexWidget ];
       
   616             }
   615             }
   617         else
   616         else
   618             {
   617             {
   619             if ( iApps.Count() > 0 )
   618             if ( iApps.Count() > 0 )
   620                 {
   619                 {
   696 
   695 
   697     CERTMANUILOGGER_LEAVEFN( " CCertManUIContainerTrust::ShowTrustChangeSettingPageL" );
   696     CERTMANUILOGGER_LEAVEFN( " CCertManUIContainerTrust::ShowTrustChangeSettingPageL" );
   698     }
   697     }
   699 
   698 
   700 // ---------------------------------------------------------------------------
   699 // ---------------------------------------------------------------------------
   701 // CCertManUIContainerTrust::ChangeTrustChangeSettingSingleClickL()
       
   702 // ---------------------------------------------------------------------------
       
   703 //
       
   704 void CCertManUIContainerTrust::ChangeTrustChangeSettingSingleClickL()
       
   705     {
       
   706     if( !iKeeper.iWrapper->IsActive() )
       
   707         {
       
   708         TInt certIndex = iKeeper.iCurrentCACertForTrustSettings;
       
   709 
       
   710         if( certIndex >= 0 && certIndex < iKeeper.iCALabelEntries.Count() )
       
   711             {
       
   712             CCTCertInfo* entry = iKeeper.iCALabelEntries[ certIndex ]->iCAEntry;
       
   713             if( entry && entry->IsDeletable() )
       
   714                 {
       
   715                 TInt currentTrustSetting = iListBox->CurrentItemIndex();
       
   716                 if( currentTrustSetting >= 0 && currentTrustSetting < iClientUids.Count() )
       
   717                     {
       
   718                     TUid uid = iClientUids[ currentTrustSetting ];
       
   719                     ChangeTrustValueL( *entry, uid );
       
   720                     UpdateTrustListboxItemL( *entry, currentTrustSetting );
       
   721                     }
       
   722                 }
       
   723             }
       
   724         }
       
   725     }
       
   726 
       
   727 // ---------------------------------------------------------------------------
       
   728 // CCertManUIContainerTrust::PopupTrustChangeSettingPageL(
   700 // CCertManUIContainerTrust::PopupTrustChangeSettingPageL(
   729 //      TInt aCertificateIndex)
   701 //      TInt aCertificateIndex)
   730 // Finds out which client was focused in Trust Settings view and calls
   702 // Finds out which client was focused in Trust Settings view and calls
   731 // ShowTrustChangeSettingPageL This is accessed only by X509S
   703 // ShowTrustChangeSettingPageL This is accessed only by X509S
   732 // certificates, located in CertMan and having one or more clients
   704 // certificates, located in CertMan and having one or more clients
   746     if( !entry->IsDeletable() )
   718     if( !entry->IsDeletable() )
   747     	{
   719     	{
   748         CERTMANUILOGGER_LEAVEFN( "- PopupTrustChangeSettingPageL - read-only" );
   720         CERTMANUILOGGER_LEAVEFN( "- PopupTrustChangeSettingPageL - read-only" );
   749     	return;
   721     	return;
   750     	}
   722     	}
   751 
   723     
   752     TUid id = KCertManUINullId;
   724     TUid id = KCertManUINullId;
   753     TInt poppableItems = 0;
   725     TInt poppableItems = 0;
   754 
   726 
   755     TBuf<KMaxLengthTextSettListOne> clientName;
   727     TBuf<KMaxLengthTextSettListOne> clientName;
   756 
   728