Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

PageProfileFiles.cpp

Go to the documentation of this file.
00001 //
00002 // PageProfileFiles.cpp
00003 //
00004 // Copyright (c) Shareaza Development Team, 2002-2005.
00005 // This file is part of SHAREAZA (www.shareaza.com)
00006 //
00007 // Shareaza is free software; you can redistribute it
00008 // and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2 of
00010 // the License, or (at your option) any later version.
00011 //
00012 // Shareaza is distributed in the hope that it will be useful,
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 // GNU General Public License for more details.
00016 //
00017 // You should have received a copy of the GNU General Public License
00018 // along with Shareaza; if not, write to the Free Software
00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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         //{{AFX_MSG_MAP(CFilesProfilePage)
00043         //}}AFX_MSG_MAP
00044 END_MESSAGE_MAP()
00045 
00046 
00048 // CFilesProfilePage property page
00049 
00050 CFilesProfilePage::CFilesProfilePage() : CSettingsPage( CFilesProfilePage::IDD )
00051 {
00052         //{{AFX_DATA_INIT(CFilesProfilePage)
00053         //}}AFX_DATA_INIT
00054 }
00055 
00056 CFilesProfilePage::~CFilesProfilePage()
00057 {
00058 }
00059 
00060 void CFilesProfilePage::DoDataExchange(CDataExchange* pDX)
00061 {
00062         CSettingsPage::DoDataExchange(pDX);
00063         //{{AFX_DATA_MAP(CFilesProfilePage)
00064         DDX_Control(pDX, IDC_FILE_LIST, m_wndList);
00065         //}}AFX_DATA_MAP
00066 }
00067 
00069 // CFilesProfilePage message handlers
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 }

Generated on Thu Dec 15 10:39:45 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2