| 628 | } |
| 629 | |
| 630 | int ProfilesDialog::LoadProfiles() { |
| 631 | HWND hListProfile = ::GetDlgItem(m_hwnd, IDC_LIST_PROFILES); |
| 632 | |
| 633 | ListBox_ResetContent(hListProfile); |
| 634 | |
| 635 | for(size_t i = 0; i < m_profiles->size(); i++) { |
| 636 | int index = ListBox_AddString(hListProfile, m_profiles->at(i)->GetName()); |
| 637 | if (index == LB_ERR || index == LB_ERRSPACE) |
| 638 | return -1; |
| 639 | ListBox_SetItemData(hListProfile, index, m_profiles->at(i)); |
| 640 | if (m_currentProfile == m_profiles->at(i)) { |
| 641 | ListBox_SetCurSel(hListProfile, index); |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | return 0; |
| 646 | } |
| 647 | |
| 648 | int ProfilesDialog::OnSelectProfile(FTPProfile * profile) { |
| 649 | if (profile == m_currentProfile && profile != NULL) |