- for(int i = 0; i < list.count(); i++) {
- //QInputDialog::getItem();
- // TODO: Use input dialog here
- // Create a new input dialog class for emufrontobjects
+ int lim = list.count() == mediaImages.count() ? list.count() - 1 : list.count();
+ for(int i = 0; i < lim; i++) {
+ EmuFrontObject *efo = EmuFrontInputDialog::getItem(
+ this, tr("Select image no. %1").arg(i+1), tr("Select"), mediaImages.values(), 0, false, &ok);
+ if (!ok) {
+ throw EmuFrontException(tr("Boot image selection was canceled, aborting."));
+ }
+ selectedImages << efo;
+ MediaImage *mi = dynamic_cast<MediaImage*>(efo);
+ QString key = mi->getCheckSum();
+ mediaImages.remove(key);
+ }
+ if (mediaImages.count() == 1) {
+ // there should be at least one media image left in mediaImages map
+ selectedImages << mediaImages.values().first();