From 69241529ffa4b45b3ebf408e4ed81b6a4142728f Mon Sep 17 00:00:00 2001 From: Dominik Wenger Date: Fri, 22 Jun 2007 18:53:27 +0000 Subject: 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 --- rbutil/rbutilCtrls.cpp | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'rbutil/rbutilCtrls.cpp') 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) void DeviceSelectorCtrl::AutoDetect() { + UsbDeviceInfo device; + if(detectDevices(&device)) + { - UsbDeviceInfo device = detectDevicesViaPatchers(); + if(device.status == DEVICEFOUND) + { + m_deviceCbx->SetValue(gv->plat_name[device.device_index]); + gv->curplat=gv->plat_id[device.device_index]; - if( device.status == NODEVICE) - { - WARN_DIALOG(wxT("No Device detected. (This function currently only works for Ipods and Sansas)."), + if(device.path != wxT("")) + { + gv->curdestdir = device.path; + } + } + else if(device.status == TOMANYDEVICES) + { + WARN_DIALOG(wxT("More then one device detected, please connect only One"), wxT("Detecting a Device")); - return; + return; + } } - - if( device.status == TOMANYDEVICES) + else { - WARN_DIALOG(wxT("More then one device detected, please connect only One"), + 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)."), wxT("Detecting a Device")); return; - - } - - if (device.status == 0 ) /* everything is ok */ - { - m_deviceCbx->SetValue(gv->plat_name[device.device_index]); - gv->curplat=gv->plat_id[device.device_index]; - - if(device.path != wxT("")) - { - gv->curdestdir = device.path; - } - } } -- cgit v1.2.3