qml: move OS list fetch to backend

- Simple implementation of OS list fetching in backend
- Replace frontend OS list fetching by calls to backend
- OS list updates are brought in asynchronously, avoiding excessive UI
  blockage.
- "Erase" and "Custom" OS list options are always present, even in a
  no-internet scenario

Based-On: cillian64/rpi-imager/oslist_backend
This commit is contained in:
Tom Dewey 2023-11-09 14:38:34 +00:00 committed by Tom Dewey
parent 54ae0f889c
commit 673b3c7a33
4 changed files with 274 additions and 135 deletions

View file

@ -346,6 +346,7 @@ int main(int argc, char *argv[])
qmlwindow->connect(&imageWriter, SIGNAL(cancelled()), qmlwindow, SLOT(onCancelled()));
qmlwindow->connect(&imageWriter, SIGNAL(finalizing()), qmlwindow, SLOT(onFinalizing()));
qmlwindow->connect(&imageWriter, SIGNAL(networkOnline()), qmlwindow, SLOT(fetchOSlist()));
qmlwindow->connect(&imageWriter, SIGNAL(osListPrepared()), qmlwindow, SLOT(onOsListPrepared()));
#ifndef QT_NO_WIDGETS
/* Set window position */
@ -374,6 +375,8 @@ int main(int argc, char *argv[])
qmlwindow->setProperty("y", y);
#endif
imageWriter.beginOSListFetch();
int rc = app.exec();
#ifndef QT_NO_WIDGETS