- if (list.count() > mediaImages.count()) {
- throw EmuFrontException(tr("Select %1 media images for this emulator configuration").arg(list.count()));
- }
- if (list.count() > 1) {
- // more than one placeholder for media image in the command line ($1, $2, ...)
- int lim = list.count() == mediaImages.count() ? list.count() - 1 : list.count();
- // user sets the order of media images
- for(int i = 0; i < lim; i++) {
+ if (list.count() > mediaImages.count()) {
+ throw EmuFrontException(tr("Select %1 media images for this emulator configuration").arg(list.count()));
+ }
+ if (list.count() > 1) {
+ // more than one placeholder for media image in the command line ($1, $2, ...)
+ int lim = list.count() == mediaImages.count() ? list.count() - 1 : list.count();
+ // user sets the order of media images
+ 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);
+ }
+ // there should be at least one media image left in mediaImages map...
+ /*if (mediaImages.count() == 1) {
+ selectedImages << mediaImages.values().first();
+ } ... this is added later-> */
+ }
+ else if (mediaImages.count() > 1) {
+ // show select boot image dialog