mpxplugins/viewplugins/views/metadataeditordialog/src/mpxmetadataeditordialog.cpp
equal
deleted
inserted
replaced
72 #include "mpxcommonuihelper.h" |
72 #include "mpxcommonuihelper.h" |
73 #include "mpxmetadataeditordialog.h" |
73 #include "mpxmetadataeditordialog.h" |
74 #include "mpxmetadataeditordialog.hrh" |
74 #include "mpxmetadataeditordialog.hrh" |
75 #include "mpxmetadataeditordialog.hlp.hrh" |
75 #include "mpxmetadataeditordialog.hlp.hrh" |
76 #include "mpxlog.h" |
76 #include "mpxlog.h" |
|
77 #include <drmuihandling.h> |
|
78 |
77 |
79 |
78 // CONSTANTS |
80 // CONSTANTS |
79 const TInt KMPXFileDetailsMaxTitleLen = 32; |
81 const TInt KMPXFileDetailsMaxTitleLen = 32; |
80 const TInt KMPXFileDetailsMaxBufferLen = 255; |
82 const TInt KMPXFileDetailsMaxBufferLen = 255; |
81 const TInt KMPXMinNumDateTrack = 0; |
83 const TInt KMPXMinNumDateTrack = 0; |
231 } |
233 } |
232 if ( iDrmResourceOffset ) |
234 if ( iDrmResourceOffset ) |
233 { |
235 { |
234 iEikonEnv->DeleteResourceFile( iDrmResourceOffset ); |
236 iEikonEnv->DeleteResourceFile( iDrmResourceOffset ); |
235 } |
237 } |
|
238 if(iDrmUiHandler) |
|
239 { |
|
240 delete iDrmUiHandler; |
|
241 } |
236 } |
242 } |
237 |
243 |
238 // ---------------------------------------------------------------------------- |
244 // ---------------------------------------------------------------------------- |
239 // CMPXMetadataEditorDialog::SetParamL |
245 // CMPXMetadataEditorDialog::SetParamL |
240 // parameter passed in from viewframework |
246 // parameter passed in from viewframework |
511 TInt val(0); |
517 TInt val(0); |
512 CRepository* repository = CRepository::NewL( KCRUidMPXMPFeatures ); |
518 CRepository* repository = CRepository::NewL( KCRUidMPXMPFeatures ); |
513 repository->Get( KMPXMPLocalVariation, val ); |
519 repository->Get( KMPXMPLocalVariation, val ); |
514 iDisablePodcasting = val&KMPXDisablePodcastingOption ? ETrue : EFalse; |
520 iDisablePodcasting = val&KMPXDisablePodcastingOption ? ETrue : EFalse; |
515 delete repository; |
521 delete repository; |
|
522 |
|
523 //DRM information popup |
|
524 iDrmUiHandler = DRM::CDrmUiHandling::NewL(); |
516 } |
525 } |
517 |
526 |
518 // ----------------------------------------------------------------------------- |
527 // ----------------------------------------------------------------------------- |
519 // CMPXMetadataEditorDialog::CleanUpGenreText |
528 // CMPXMetadataEditorDialog::CleanUpGenreText |
520 // Clean up function for genre related members. |
529 // Clean up function for genre related members. |
2407 MPX_FUNC( "CMPXMetadataEditorDialog::OfferKeyEventL" ); |
2416 MPX_FUNC( "CMPXMetadataEditorDialog::OfferKeyEventL" ); |
2408 TKeyResponse res = CAknForm::OfferKeyEventL( aKeyEvent, aType ); |
2417 TKeyResponse res = CAknForm::OfferKeyEventL( aKeyEvent, aType ); |
2409 |
2418 |
2410 if ( aType == EEventKey ) |
2419 if ( aType == EEventKey ) |
2411 { |
2420 { |
2412 switch ( aKeyEvent.iScanCode ) |
2421 if (aKeyEvent.iScanCode && (aKeyEvent.iScanCode == EStdKeyUpArrow |
2413 { |
2422 || aKeyEvent.iScanCode == EStdKeyDownArrow)) |
2414 case EStdKeyUpArrow: |
2423 { |
2415 case EStdKeyDownArrow: |
2424 UpdateSoftkeyL(); |
2416 { |
2425 } |
2417 UpdateSoftkeyL(); |
2426 |
2418 break; |
2427 else if ((aKeyEvent.iCode == EKeyOK || aKeyEvent.iCode == EKeyEnter) |
2419 } |
2428 && (IdOfFocusControl() == EMPXMetadataEditorDlgCtrlIdDRMDetail)) |
2420 default: |
2429 { |
2421 { |
2430 LaunchDrmInfoL(); |
2422 break; |
|
2423 } |
|
2424 } |
2431 } |
2425 } |
2432 } |
2426 |
2433 |
2427 return res; |
2434 return res; |
2428 } |
2435 } |
2842 TBool drmProtected(iMedia->ValueTObjectL<TBool> (KMPXMediaDrmProtected)); |
2849 TBool drmProtected(iMedia->ValueTObjectL<TBool> (KMPXMediaDrmProtected)); |
2843 MPX_DEBUG2( "CMPXMetadataEditorDialog::PopulateFileDetailsL drm protected: %d", drmProtected ); |
2850 MPX_DEBUG2( "CMPXMetadataEditorDialog::PopulateFileDetailsL drm protected: %d", drmProtected ); |
2844 |
2851 |
2845 if (drmProtected) |
2852 if (drmProtected) |
2846 { |
2853 { |
2847 //TODO: Pending for UI Spec and localisation |
2854 HBufC* detail = StringLoader::LoadLC( R_MPX_CUI_LICENCE_DET_LINK ); |
|
2855 InsertLineL(9,R_MPX_CUI_LICENCE_INFO,ActivePageId() ); |
|
2856 SetControlTextL(EMPXMetadataEditorDlgCtrlIdDRMDetail, detail->Des(), |
|
2857 KNullDesC); |
|
2858 CleanupStack::PopAndDestroy( detail ); |
2848 } |
2859 } |
2849 |
2860 |
2850 // Get filename |
2861 // Get filename |
2851 const TDesC& uri = iMedia->ValueText(KMPXMediaGeneralUri); |
2862 const TDesC& uri = iMedia->ValueText(KMPXMediaGeneralUri); |
2852 TParsePtrC parse(uri); |
2863 TParsePtrC parse(uri); |
3114 SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished, |
3125 SetControlTextL(EMPXMetadataEditorDlgCtrlIdLastPublished, |
3115 KNullDesC, KNullDesC); |
3126 KNullDesC, KNullDesC); |
3116 } |
3127 } |
3117 } |
3128 } |
3118 |
3129 |
|
3130 // ----------------------------------------------------------------------------- |
|
3131 // CMPXMetadataEditorDialog::LaunchDrmInfoL |
|
3132 // ----------------------------------------------------------------------------- |
|
3133 // |
|
3134 void CMPXMetadataEditorDialog::LaunchDrmInfoL() |
|
3135 |
|
3136 { |
|
3137 MPX_FUNC( "CMPXMetadataEditorDialog::LaunchDrmInfoL" ); |
|
3138 const TDesC& aFileName = iMedia->ValueText(KMPXMediaGeneralUri); |
|
3139 RFs fs; |
|
3140 User::LeaveIfError( fs.Connect() ); |
|
3141 CleanupClosePushL( fs ); |
|
3142 RFile64 drmFile; |
|
3143 User::LeaveIfError( drmFile.Open( |
|
3144 fs, aFileName, EFileRead | EFileShareReadersOrWriters ) ); |
|
3145 CleanupClosePushL( drmFile ); |
|
3146 iDrmUiHandler->ShowDetailsViewL( drmFile ); |
|
3147 CleanupStack::PopAndDestroy( &drmFile ); |
|
3148 CleanupStack::PopAndDestroy( &fs ); |
|
3149 } |
3119 // End of File |
3150 // End of File |