summaryrefslogtreecommitdiff
path: root/rbutil/rbutilCtrls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilCtrls.cpp')
-rw-r--r--rbutil/rbutilCtrls.cpp40
1 files changed, 19 insertions, 21 deletions
diff --git a/rbutil/rbutilCtrls.cpp b/rbutil/rbutilCtrls.cpp
index 887f2e7fb1..441d046ca8 100644
--- a/rbutil/rbutilCtrls.cpp
+++ b/rbutil/rbutilCtrls.cpp
@@ -439,35 +439,33 @@ void DeviceSelectorCtrl::OnAutoDetect(wxCommandEvent& event)
439 439
440void DeviceSelectorCtrl::AutoDetect() 440void DeviceSelectorCtrl::AutoDetect()
441{ 441{
442 UsbDeviceInfo device;
442 443
444 if(detectDevices(&device))
445 {
443 446
444 UsbDeviceInfo device = detectDevicesViaPatchers(); 447 if(device.status == DEVICEFOUND)
448 {
449 m_deviceCbx->SetValue(gv->plat_name[device.device_index]);
450 gv->curplat=gv->plat_id[device.device_index];
445 451
446 if( device.status == NODEVICE) 452 if(device.path != wxT(""))
447 { 453 {
448 WARN_DIALOG(wxT("No Device detected. (This function currently only works for Ipods and Sansas)."), 454 gv->curdestdir = device.path;
455 }
456 }
457 else if(device.status == TOMANYDEVICES)
458 {
459 WARN_DIALOG(wxT("More then one device detected, please connect only One"),
449 wxT("Detecting a Device")); 460 wxT("Detecting a Device"));
450 return; 461 return;
462 }
451 } 463 }
452 464 else
453 if( device.status == TOMANYDEVICES)
454 { 465 {
455 WARN_DIALOG(wxT("More then one device detected, please connect only One"), 466 WARN_DIALOG(wxT("No Device detected. (This function only works if you have already installed rockbox or if you use a ipod or a sansa)."),
456 wxT("Detecting a Device")); 467 wxT("Detecting a Device"));
457 return; 468 return;
458
459 }
460
461 if (device.status == 0 ) /* everything is ok */
462 {
463 m_deviceCbx->SetValue(gv->plat_name[device.device_index]);
464 gv->curplat=gv->plat_id[device.device_index];
465
466 if(device.path != wxT(""))
467 {
468 gv->curdestdir = device.path;
469 }
470
471 } 469 }
472 470
473} 471}