00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "StdAfx.h"
00023 #include "Shareaza.h"
00024 #include "Settings.h"
00025 #include "Library.h"
00026 #include "LibraryFolders.h"
00027 #include "AlbumFolder.h"
00028 #include "SharedFile.h"
00029 #include "Schema.h"
00030 #include "ShellIcons.h"
00031 #include "PageProfileFiles.h"
00032
00033 #ifdef _DEBUG
00034 #define new DEBUG_NEW
00035 #undef THIS_FILE
00036 static char THIS_FILE[] = __FILE__;
00037 #endif
00038
00039 IMPLEMENT_DYNCREATE(CFilesProfilePage, CSettingsPage)
00040
00041 BEGIN_MESSAGE_MAP(CFilesProfilePage, CSettingsPage)
00042
00043
00044 END_MESSAGE_MAP()
00045
00046
00048
00049
00050 CFilesProfilePage::CFilesProfilePage() : CSettingsPage( CFilesProfilePage::IDD )
00051 {
00052
00053
00054 }
00055
00056 CFilesProfilePage::~CFilesProfilePage()
00057 {
00058 }
00059
00060 void CFilesProfilePage::DoDataExchange(CDataExchange* pDX)
00061 {
00062 CSettingsPage::DoDataExchange(pDX);
00063
00064 DDX_Control(pDX, IDC_FILE_LIST, m_wndList);
00065
00066 }
00067
00069
00070
00071 BOOL CFilesProfilePage::OnInitDialog()
00072 {
00073 CSettingsPage::OnInitDialog();
00074
00075 CRect rc;
00076 m_wndList.GetClientRect( &rc );
00077 rc.right -= GetSystemMetrics( SM_CXVSCROLL ) + 1;
00078 m_wndList.InsertColumn( 0, _T("File"), LVCFMT_LEFT, rc.right, -1 );
00079 m_wndList.SetImageList( ShellIcons.GetObject( 16 ), LVSIL_SMALL );
00080
00081 {
00082 CQuickLock oLock( Library.m_pSection );
00083
00084 CAlbumFolder* pFolder = LibraryFolders.GetAlbumTarget( CSchema::uriFavouritesFolder, _T("Title"), NULL );
00085
00086 if ( pFolder != NULL )
00087 {
00088 for ( POSITION pos = pFolder->GetFileIterator() ; pos ; )
00089 {
00090 CLibraryFile* pFile = pFolder->GetNextFile( pos );
00091
00092 if ( pFile->IsShared() )
00093 {
00094 m_wndList.InsertItem( LVIF_TEXT|LVIF_IMAGE|LVIF_PARAM, m_wndList.GetItemCount(),
00095 pFile->m_sName, 0, 0, ShellIcons.Get( pFile->m_sName, 16 ), pFile->m_nIndex );
00096 }
00097 }
00098 }
00099 }
00100
00101 UpdateData( FALSE );
00102
00103 return TRUE;
00104 }
00105
00106 void CFilesProfilePage::OnOK()
00107 {
00108 CSettingsPage::OnOK();
00109 }