18 |
18 |
19 #include <QFile> |
19 #include <QFile> |
20 #include <QDataStream> |
20 #include <QDataStream> |
21 #include <QMessageBox> |
21 #include <QMessageBox> |
22 #include <QProcess> |
22 #include <QProcess> |
|
23 #include <errno.h> |
23 #include <commonlib/misc.h> |
24 #include <commonlib/misc.h> |
24 #include <commonlib/config.h> |
25 #include <commonlib/config.h> |
25 #include <commonlib/version.h> |
26 #include <commonlib/version.h> |
26 #include "demo.h" |
27 #include "demo.h" |
27 #include "prompts.h" |
28 #include "prompts.h" |
303 |
306 |
304 QString iwadpath; |
307 QString iwadpath; |
305 QStringList pwadpaths; |
308 QStringList pwadpaths; |
306 |
309 |
307 // Find the WADs |
310 // Find the WADs |
308 for (const QString& wad : wads) |
311 for (int i = 0; i < wads.size(); ++i) |
309 { |
312 { |
|
313 const QString& wad = wads[i]; |
310 QString path = findWAD (wad); |
314 QString path = findWAD (wad); |
311 |
315 |
312 // WAD names are case-sensitive under non-Windows and they can appear in uppercase |
316 // WAD names are case-sensitive under non-Windows and they can appear in uppercase |
313 // so we need to test that too. |
317 // so we need to test that too. |
314 if (path.isEmpty()) |
318 if (path.isEmpty()) |
328 |
332 |
329 if (not Config::get ("noprompt").toBool()) |
333 if (not Config::get ("noprompt").toBool()) |
330 { |
334 { |
331 QString pwadtext; |
335 QString pwadtext; |
332 |
336 |
333 for (const QString& wad : wads) |
337 for (int i = 0; i < wads.size(); ++i) |
334 { |
338 { |
335 if (&wad == &wads.first()) |
339 if (i == 0) |
336 continue; // skip the IWAD |
340 continue; // skip the IWAD |
337 |
341 |
338 if (not pwadtext.isEmpty()) |
342 if (not pwadtext.isEmpty()) |
339 pwadtext += "<br />"; |
343 pwadtext += "<br />"; |
340 |
344 |
341 pwadtext += wad; |
345 pwadtext += wads[i]; |
342 } |
346 } |
343 |
347 |
344 QDialog* dlg = new QDialog; |
348 QDialog* dlg = new QDialog; |
345 Ui_DemoPrompt ui; |
349 Ui_DemoPrompt ui; |
346 ui.setupUi (dlg); |
350 ui.setupUi (dlg); |