diff --git a/rbutil/rbutil.cbp b/rbutil/rbutil.cbp
index 8c35bc246d..b1cadf4165 100644
--- a/rbutil/rbutil.cbp
+++ b/rbutil/rbutil.cbp
@@ -18,6 +18,7 @@
+
@@ -91,9 +92,6 @@
-
-
-
diff --git a/rbutil/rbutilCtrls.cpp b/rbutil/rbutilCtrls.cpp
index baa8bc8361..2a262d49e3 100644
--- a/rbutil/rbutilCtrls.cpp
+++ b/rbutil/rbutilCtrls.cpp
@@ -433,11 +433,15 @@ void DeviceSelectorCtrl::OnComboBox(wxCommandEvent& event)
void DeviceSelectorCtrl::OnAutoDetect(wxCommandEvent& event)
{
- AutoDetect();
+ if(!AutoDetect())
+ {
+ WARN_DIALOG(wxT("No Device detected. If you have a Device connected, select the correct one manually."),
+ wxT("Detecting a Device"));
+ }
}
-void DeviceSelectorCtrl::AutoDetect()
+bool DeviceSelectorCtrl::AutoDetect()
{
UsbDeviceInfo device;
@@ -453,19 +457,19 @@ void DeviceSelectorCtrl::AutoDetect()
{
gv->curdestdir = device.path;
}
+ return true;
}
else if(device.status == TOMANYDEVICES)
{
WARN_DIALOG(wxT("More then one device detected, please connect only One"),
wxT("Detecting a Device"));
- return;
+ return true;
}
}
else
{
- WARN_DIALOG(wxT("No Device detected. If you have a Device connected, select the correct one manually."),
- wxT("Detecting a Device"));
- return;
+
+ return false;
}
}
diff --git a/rbutil/rbutilCtrls.h b/rbutil/rbutilCtrls.h
index f31429fa16..7998dc69a4 100644
--- a/rbutil/rbutilCtrls.h
+++ b/rbutil/rbutilCtrls.h
@@ -177,7 +177,7 @@ public:
wxString getDevice();
void setDefault();
- void AutoDetect();
+ bool AutoDetect();
protected:
wxString m_currentDevice;