diff options
Diffstat (limited to 'rbutil/rbutilCtrls.cpp')
-rw-r--r-- | rbutil/rbutilCtrls.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
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) | |||
433 | 433 | ||
434 | void DeviceSelectorCtrl::OnAutoDetect(wxCommandEvent& event) | 434 | void DeviceSelectorCtrl::OnAutoDetect(wxCommandEvent& event) |
435 | { | 435 | { |
436 | AutoDetect(); | 436 | if(!AutoDetect()) |
437 | { | ||
438 | WARN_DIALOG(wxT("No Device detected. If you have a Device connected, select the correct one manually."), | ||
439 | wxT("Detecting a Device")); | ||
440 | } | ||
437 | } | 441 | } |
438 | 442 | ||
439 | 443 | ||
440 | void DeviceSelectorCtrl::AutoDetect() | 444 | bool DeviceSelectorCtrl::AutoDetect() |
441 | { | 445 | { |
442 | UsbDeviceInfo device; | 446 | UsbDeviceInfo device; |
443 | 447 | ||
@@ -453,19 +457,19 @@ void DeviceSelectorCtrl::AutoDetect() | |||
453 | { | 457 | { |
454 | gv->curdestdir = device.path; | 458 | gv->curdestdir = device.path; |
455 | } | 459 | } |
460 | return true; | ||
456 | } | 461 | } |
457 | else if(device.status == TOMANYDEVICES) | 462 | else if(device.status == TOMANYDEVICES) |
458 | { | 463 | { |
459 | WARN_DIALOG(wxT("More then one device detected, please connect only One"), | 464 | WARN_DIALOG(wxT("More then one device detected, please connect only One"), |
460 | wxT("Detecting a Device")); | 465 | wxT("Detecting a Device")); |
461 | return; | 466 | return true; |
462 | } | 467 | } |
463 | } | 468 | } |
464 | else | 469 | else |
465 | { | 470 | { |
466 | WARN_DIALOG(wxT("No Device detected. If you have a Device connected, select the correct one manually."), | 471 | |
467 | wxT("Detecting a Device")); | 472 | return false; |
468 | return; | ||
469 | } | 473 | } |
470 | 474 | ||
471 | } | 475 | } |