Exemplo n.º 1
0
void CSelectDrivesDlg::OnOK()
{
	UpdateData();

	m_drives.RemoveAll();
	m_selectedDrives.RemoveAll();
	if (m_radio == RADIO_AFOLDER)
	{
		m_folderName= MyGetFullPathName(m_folderName);
		UpdateData(false);
	}

	for (int i=0; i < m_list.GetItemCount(); i++)
	{
		CDriveItem *item= m_list.GetItem(i);

		if (m_radio == RADIO_ALLLOCALDRIVES && !item->IsRemote() && !item->IsSUBSTed()
		||  m_radio == RADIO_SOMEDRIVES && m_list.IsItemSelected(i))
		{
			m_drives.Add(item->GetDrive());
		}
		if (m_list.IsItemSelected(i))
			m_selectedDrives.Add(item->GetDrive());
	}

	CPersistence::SetSelectDrivesRadio(m_radio);
	CPersistence::SetSelectDrivesFolder(m_folderName);
	CPersistence::SetSelectDrivesDrives(m_selectedDrives);

	CDialog::OnOK();
}
Exemplo n.º 2
0
bool GetFullPathAndSplit(CFSTR path, FString &resDirPrefix, FString &resFileName)
{
  bool res = MyGetFullPathName(path, resFileName);
  if (!res)
    resFileName = path;
  int pos = resFileName.ReverseFind(FCHAR_PATH_SEPARATOR);
  if (pos >= 0)
  {
    resDirPrefix = resFileName.Left(pos + 1);
    resFileName = resFileName.Mid(pos + 1);
  }
  return res;
}