summaryrefslogtreecommitdiff
path: root/rbutil/rbutilCtrls.cpp
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-06-22 18:53:27 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-06-22 18:53:27 +0000
commit69241529ffa4b45b3ebf408e4ed81b6a4142728f (patch)
treee8aa1bcb5827ad4f6e8e16f105eaf7fc0d5ae764 /rbutil/rbutilCtrls.cpp
parent00cc66c6332f66b13f7bce4fc7791261735b1ba7 (diff)
downloadrockbox-69241529ffa4b45b3ebf408e4ed81b6a4142728f.tar.gz
rockbox-69241529ffa4b45b3ebf408e4ed81b6a4142728f.zip
rbutil: reworked device detection, now uses rockbox-info.txt and the patchers to detect the device.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13687 a1c6a512-1295-4272-9138-f99709370657
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}