mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-02 14:19:02 +00:00
Notify user that USB won't work if libusb init fails
This commit is contained in:
parent
f5a3aac8e1
commit
db7ee668ff
1 changed files with 7 additions and 4 deletions
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include "Common/LibusbContext.h"
|
#include "Common/LibusbContext.h"
|
||||||
#include "Common/MsgHandler.h"
|
#include "Common/MsgHandler.h"
|
||||||
|
#include "Common/StringUtil.h"
|
||||||
|
|
||||||
namespace LibusbContext
|
namespace LibusbContext
|
||||||
{
|
{
|
||||||
|
@ -24,10 +25,12 @@ static libusb_context* Create()
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
is_windows = true;
|
is_windows = true;
|
||||||
#endif
|
#endif
|
||||||
if (is_windows && ret == LIBUSB_ERROR_NOT_FOUND)
|
const std::string reason =
|
||||||
PanicAlertT("Failed to initialize libusb because usbdk is not installed.");
|
is_windows && ret == LIBUSB_ERROR_NOT_FOUND ?
|
||||||
else
|
GetStringT("Failed to initialize libusb because usbdk is not installed.") :
|
||||||
PanicAlertT("Failed to initialize libusb: %s", libusb_error_name(ret));
|
StringFromFormat(GetStringT("Failed to initialize libusb (%s).").c_str(),
|
||||||
|
libusb_error_name(ret));
|
||||||
|
PanicAlertT("%s\nSome USB features will not work.", reason.c_str());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return context;
|
return context;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue