133 //check when Remove location information is selected. |
133 //check when Remove location information is selected. |
134 iLocationinfo = EFalse; |
134 iLocationinfo = EFalse; |
135 |
135 |
136 //Flag to indicate rename command is started |
136 //Flag to indicate rename command is started |
137 iRenameStarted = EFalse; |
137 iRenameStarted = EFalse; |
|
138 |
|
139 // Flag to indicate text entry popup display status |
|
140 iIsPopupShown = EFalse; |
138 } |
141 } |
139 |
142 |
140 // --------------------------------------------------------- |
143 // --------------------------------------------------------- |
141 // ~CGlxMetadataContainer |
144 // ~CGlxMetadataContainer |
142 // --------------------------------------------------------- |
145 // --------------------------------------------------------- |
812 CleanupStack::PopAndDestroy(buf); |
815 CleanupStack::PopAndDestroy(buf); |
813 if (aItem == EDescriptionItem) |
816 if (aItem == EDescriptionItem) |
814 { |
817 { |
815 popup->SetLeftSoftKeyL(ETrue); |
818 popup->SetLeftSoftKeyL(ETrue); |
816 } |
819 } |
|
820 iIsPopupShown = ETrue; |
817 |
821 |
818 //action upon selecting ok from the editor |
822 //action upon selecting ok from the editor |
819 if (popup->ExecuteLD() == EEikBidOk) |
823 if (popup->ExecuteLD() == EEikBidOk) |
820 { |
824 { |
821 if(0 != (popupText.Compare(*textBuf))) |
825 iIsPopupShown = EFalse; |
|
826 if (iItemMediaList->Count() && 0 != (popupText.Compare(*textBuf))) |
822 { |
827 { |
823 TFileName fileName = ParseFileName(*textBuf); |
828 TFileName fileName = ParseFileName(*textBuf); |
824 //check If filename already exists |
829 //check If filename already exists |
825 if ((aItem == ENameItem) && (BaflUtils::FileExists( |
830 if ((aItem == ENameItem) && (BaflUtils::FileExists( |
826 ControlEnv()->FsSession(), fileName))) |
831 ControlEnv()->FsSession(), fileName))) |
919 } |
924 } |
920 CleanupStack::PopAndDestroy(textBuf); |
925 CleanupStack::PopAndDestroy(textBuf); |
921 |
926 |
922 //notify observer that some operation has happened. So refresh the toolbar area.. |
927 //notify observer that some operation has happened. So refresh the toolbar area.. |
923 iResetToolbarObs.HandleToolbarResetting(EFalse); |
928 iResetToolbarObs.HandleToolbarResetting(EFalse); |
|
929 if (!iItemMediaList->Count()) |
|
930 { |
|
931 iDialogObesrver.HandleItemRemovedL(); |
|
932 } |
924 } |
933 } |
925 |
934 |
926 // ---------------------------------------------------------------------------- |
935 // ---------------------------------------------------------------------------- |
927 // CGlxMetadataContainer::UpdateTagsL() |
936 // CGlxMetadataContainer::UpdateTagsL() |
928 // ---------------------------------------------------------------------------- |
937 // ---------------------------------------------------------------------------- |
1058 TGlxMedia item = iItemMediaList->Item(0); |
1067 TGlxMedia item = iItemMediaList->Item(0); |
1059 //Create the string convertor instance |
1068 //Create the string convertor instance |
1060 CGlxUStringConverter* stringConverter = |
1069 CGlxUStringConverter* stringConverter = |
1061 CGlxUStringConverter::NewL(); |
1070 CGlxUStringConverter::NewL(); |
1062 CleanupStack::PushL(stringConverter); |
1071 CleanupStack::PushL(stringConverter); |
1063 |
1072 //fetch media uri |
1064 //fetch media uri |
1073 stringConverter->AsStringL(item, aAttributes[index], 0, modifiedUri); |
1065 stringConverter->AsStringL(item, aAttributes[index], 0, |
1074 if (modifiedUri) |
1066 modifiedUri); |
1075 { |
1067 CleanupStack::PopAndDestroy(stringConverter); |
1076 CleanupStack::PushL(modifiedUri); |
1068 |
1077 //Check if media item was renamed |
1069 //Check if media item was renamed |
1078 if (modifiedUri->Compare(*iUri) != 0) |
1070 if (modifiedUri && modifiedUri->Compare(*iUri) != 0) |
1079 { |
1071 { |
1080 //Set rename command as started since |
1072 //Set rename command as started since |
1081 //Rename is also possible from File Manager |
1073 //Rename is also possible from File Manager |
1082 iRenameStarted = ETrue; |
1074 iRenameStarted = ETrue; |
1083 RefreshMediaListL(*modifiedUri); |
1075 CleanupStack::PushL(modifiedUri); |
1084 } |
1076 RefreshMediaListL(*modifiedUri); |
1085 CleanupStack::PopAndDestroy(modifiedUri); |
1077 CleanupStack::PopAndDestroy(modifiedUri); |
1086 } |
1078 } |
1087 CleanupStack::PopAndDestroy(stringConverter); |
1079 } |
1088 } |
1080 |
1089 |
1081 } |
1090 } |
1082 |
1091 |
1083 TMPXAttribute titleAttrib(KMPXMediaGeneralTitle); |
1092 TMPXAttribute titleAttrib(KMPXMediaGeneralTitle); |
1084 TIdentityRelation<TMPXAttribute> match(&TMPXAttribute::Match); |
1093 TIdentityRelation<TMPXAttribute> match(&TMPXAttribute::Match); |
1276 // |
1285 // |
1277 void CGlxMetadataContainer::HandleItemRemovedL(TInt /*aStartIndex*/, |
1286 void CGlxMetadataContainer::HandleItemRemovedL(TInt /*aStartIndex*/, |
1278 TInt /*aEndIndex*/, MGlxMediaList* /*aList*/) |
1287 TInt /*aEndIndex*/, MGlxMediaList* /*aList*/) |
1279 { |
1288 { |
1280 TRACER("CGlxMetadataContainer::HandleItemRemovedL()"); |
1289 TRACER("CGlxMetadataContainer::HandleItemRemovedL()"); |
1281 if (iItemMediaList->Count() == 0) |
1290 if (!iItemMediaList->Count() && !iIsPopupShown) |
1282 { |
1291 { |
1283 iDialogObesrver.HandleItemRemovedL(); |
1292 iDialogObesrver.HandleItemRemovedL(); |
1284 } |
1293 } |
1285 } |
1294 } |
1286 |
1295 |