mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Notify user that USB won't work if libusb init fails
This commit is contained in:
@ -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;
|
||||||
|
Reference in New Issue
Block a user