Make the new GUI actually work, to a certain extent.

This commit is contained in:
dg
2023-04-02 22:54:09 +00:00
parent 137658d1d6
commit 1f74d9189f
8 changed files with 1575 additions and 1967 deletions

View File

@@ -16,7 +16,7 @@ static USB* usb = NULL;
USB::~USB() {}
static std::unique_ptr<CandidateDevice> selectDevice()
static std::shared_ptr<CandidateDevice> selectDevice()
{
auto candidates = findUsbDevices();
if (candidates.size() == 0)
@@ -29,14 +29,14 @@ static std::unique_ptr<CandidateDevice> selectDevice()
for (auto& c : candidates)
{
if (c->serial == wantedSerial)
return std::move(c);
return c;
}
Error() << "serial number not found (try without one to list or "
"autodetect devices)";
}
if (candidates.size() == 1)
return std::move(candidates[0]);
return candidates[0];
std::cerr << "More than one device detected; use --usb.serial=<serial> to "
"select one:\n";