void CSelectDiskDlg::OnOK(UINT /*wNotifyCode*/, int /*wID*/, HWND /*hwndCtl*/) { CDiskObjectList listSelected;// = m_wndListSingle.GetSelectedDiskObjectList(); if ( listSelected.size() == 0 ) // TODO : Display message to select return; ATLASSERT( listSelected.size() == 1 ); m_pSelectedDisk = boost::dynamic_pointer_cast<CUnitDiskObject>(listSelected.front()); // Check if the selected disk's size is not smaller than the source disk's size EndDialog(IDOK); }
void CUnBindDlg::SetDiskToUnbind(CDiskObjectPtr obj) { m_pDiskUnbind = obj; CFindIfVisitor<TRUE> unitDiskFinder; CDiskObjectList listUnbind; // List of disks to unbind listUnbind = unitDiskFinder.FindIf( m_pDiskUnbind, IsUnitDisk); // // Data is deleted only when the disks are aggregated // Thus, change message if they are not. // CUnitDiskObjectPtr unitDisk = boost::dynamic_pointer_cast<CUnitDiskObject>(listUnbind.front()); if ( unitDisk->GetInfoHandler()->IsBoundAndNotSingleMirrored() ) { IDD = IDD_UNBIND_MIRROR; } }
void CSelectMirDlg::OnOK(UINT /*wNotifyCode*/, int /*wID*/, HWND /*hwndCtl*/) { CDiskObjectList listSelected = m_wndListSingle.GetSelectedDiskObjectList(); if ( listSelected.size() == 0 ) // TODO : Display message to select return; ATLASSERT( listSelected.size() == 1 ); m_pSelectedDisk = boost::dynamic_pointer_cast<CUnitDiskObject>(listSelected.front()); // Check if the selected disk's size is not smaller than the source disk's size if ( m_pSelectedDisk->GetInfoHandler()->GetUserSectorCount() < m_pSourceDisk->GetInfoHandler()->GetUserSectorCount() ) { MessageBox( _T("A disk cannot be mirrored by a smaller disk."), _T(PROGRAM_TITLE), MB_OK ); return; } // FIXME : Confirmation would be necessary. EndDialog(IDOK); }