708 } |
708 } |
709 } |
709 } |
710 |
710 |
711 void CPodcastFeedView::HandleImportFeedsL() |
711 void CPodcastFeedView::HandleImportFeedsL() |
712 { |
712 { |
713 TFileName fileName; |
713 // TFileName fileName; |
714 fileName.Zero(); |
714 // fileName.Zero(); |
715 TFileName startFolder; |
715 // TFileName startFolder; |
716 startFolder.Zero(); |
716 // startFolder.Zero(); |
717 TInt types = AknCommonDialogsDynMem::EMemoryTypePhone | AknCommonDialogsDynMem::EMemoryTypeMMC |AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| AknCommonDialogsDynMem::EMemoryTypeRemote; |
717 // TInt types = AknCommonDialogsDynMem::EMemoryTypePhone | AknCommonDialogsDynMem::EMemoryTypeMMC |AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| AknCommonDialogsDynMem::EMemoryTypeRemote; |
718 |
718 // |
719 HBufC *title = iCoeEnv->AllocReadResourceLC(R_PODCAST_SELECT_OPML); |
719 // HBufC *title = iCoeEnv->AllocReadResourceLC(R_PODCAST_SELECT_OPML); |
720 if (AknCommonDialogsDynMem::RunSelectDlgLD (types, fileName, |
720 // if (AknCommonDialogsDynMem::RunSelectDlgLD (types, fileName, |
721 startFolder, NULL, NULL, *title)) |
721 // startFolder, NULL, NULL, *title)) |
722 { |
722 // { |
723 |
723 // |
724 if(fileName.Length()>0) |
724 // if(fileName.Length()>0) |
725 { |
725 // { |
726 HBufC *waitText = iEikonEnv->AllocReadResourceLC(R_IMPORTING); |
726 // HBufC *waitText = iEikonEnv->AllocReadResourceLC(R_IMPORTING); |
727 iOpmlState = EOpmlImporting; |
727 // iOpmlState = EOpmlImporting; |
728 ShowWaitDialogL(*waitText); |
728 // ShowWaitDialogL(*waitText); |
729 CleanupStack::PopAndDestroy(waitText); |
729 // CleanupStack::PopAndDestroy(waitText); |
730 |
730 // |
731 TRAPD(err, iPodcastModel.FeedEngine().ImportFeedsL(fileName)); |
731 // TRAPD(err, iPodcastModel.FeedEngine().ImportFeedsL(fileName)); |
732 |
732 // |
733 if (err != KErrNone) { |
733 // if (err != KErrNone) { |
734 TBuf<KMaxMessageLength> message; |
734 // TBuf<KMaxMessageLength> message; |
735 iEikonEnv->ReadResourceL(message, R_IMPORT_FEED_FAILURE); |
735 // iEikonEnv->ReadResourceL(message, R_IMPORT_FEED_FAILURE); |
736 ShowErrorMessageL(message); |
736 // ShowErrorMessageL(message); |
737 } |
737 // } |
738 } |
738 // } |
739 |
739 // |
740 } |
740 // } |
741 CleanupStack::PopAndDestroy(title); |
741 // CleanupStack::PopAndDestroy(title); |
742 } |
742 } |
743 |
743 |
744 void CPodcastFeedView::HandleExportFeedsL() |
744 void CPodcastFeedView::HandleExportFeedsL() |
745 { |
745 { |
746 TFileName fileName; |
746 // TFileName fileName; |
747 fileName.Copy(_L("feeds.opml")); |
747 // fileName.Copy(_L("feeds.opml")); |
748 TFileName startFolder; |
748 // TFileName startFolder; |
749 startFolder.Zero(); |
749 // startFolder.Zero(); |
750 TInt types = AknCommonDialogsDynMem::EMemoryTypePhone | AknCommonDialogsDynMem::EMemoryTypeMMC |AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| AknCommonDialogsDynMem::EMemoryTypeRemote; |
750 // TInt types = AknCommonDialogsDynMem::EMemoryTypePhone | AknCommonDialogsDynMem::EMemoryTypeMMC |AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| AknCommonDialogsDynMem::EMemoryTypeRemote; |
751 |
751 // |
752 HBufC *title = iCoeEnv->AllocReadResourceLC(R_PODCAST_SELECT_FOLDER); |
752 // HBufC *title = iCoeEnv->AllocReadResourceLC(R_PODCAST_SELECT_FOLDER); |
753 if (AknCommonDialogsDynMem::RunSaveDlgLD (types, fileName, |
753 // if (AknCommonDialogsDynMem::RunSaveDlgLD (types, fileName, |
754 startFolder, NULL, NULL, *title)) |
754 // startFolder, NULL, NULL, *title)) |
755 { |
755 // { |
756 TFileName temp; |
756 // TFileName temp; |
757 TRAPD(err, iPodcastModel.FeedEngine().ExportFeedsL(temp)); |
757 // TRAPD(err, iPodcastModel.FeedEngine().ExportFeedsL(temp)); |
758 BaflUtils::CopyFile(iEikonEnv->FsSession(), temp, fileName); |
758 // BaflUtils::CopyFile(iEikonEnv->FsSession(), temp, fileName); |
759 BaflUtils::DeleteFile(iEikonEnv->FsSession(),temp); |
759 // BaflUtils::DeleteFile(iEikonEnv->FsSession(),temp); |
760 if (err == KErrNone) |
760 // if (err == KErrNone) |
761 { |
761 // { |
762 UpdateListboxItemsL(); |
762 // UpdateListboxItemsL(); |
763 TInt numFeeds = iPodcastModel.FeedEngine().GetSortedFeeds().Count(); |
763 // TInt numFeeds = iPodcastModel.FeedEngine().GetSortedFeeds().Count(); |
764 |
764 // |
765 TBuf<KMaxMessageLength> message; |
765 // TBuf<KMaxMessageLength> message; |
766 TBuf<KMaxMessageLength> templ; |
766 // TBuf<KMaxMessageLength> templ; |
767 iEikonEnv->ReadResourceL(templ, R_EXPORT_FEED_SUCCESS); |
767 // iEikonEnv->ReadResourceL(templ, R_EXPORT_FEED_SUCCESS); |
768 message.Format(templ, numFeeds); |
768 // message.Format(templ, numFeeds); |
769 ShowOkMessageL(message); |
769 // ShowOkMessageL(message); |
770 } |
770 // } |
771 else |
771 // else |
772 { |
772 // { |
773 TBuf<KMaxMessageLength> message; |
773 // TBuf<KMaxMessageLength> message; |
774 iEikonEnv->ReadResourceL(message, R_EXPORT_FEED_FAILURE); |
774 // iEikonEnv->ReadResourceL(message, R_EXPORT_FEED_FAILURE); |
775 ShowErrorMessageL(message); |
775 // ShowErrorMessageL(message); |
776 } |
776 // } |
777 } |
777 // } |
778 CleanupStack::PopAndDestroy(title); |
778 // CleanupStack::PopAndDestroy(title); |
779 } |
779 } |
780 |
780 |
781 void CPodcastFeedView::CheckResumeDownloadL() |
781 void CPodcastFeedView::CheckResumeDownloadL() |
782 { |
782 { |
783 // if there are shows queued for downloading, ask if we should resume now |
783 // if there are shows queued for downloading, ask if we should resume now |