# HG changeset patch # User Santeri Piippo # Date 1387413036 -7200 # Node ID 0d6fce0628febe23c5e66c35b32985c630c9d69f # Parent 2fb6c500ff9e789161607661d07502265d31ebcc - ext programs requiring wine now properly display an error prompt if wine is missing diff -r 2fb6c500ff9e -r 0d6fce0628fe changelog.txt --- a/changelog.txt Thu Dec 19 01:25:50 2013 +0200 +++ b/changelog.txt Thu Dec 19 02:30:36 2013 +0200 @@ -10,6 +10,7 @@ the registry under Windows and into ~/.config/LDForge under Linux. Unfortunately this means settings get lost during transition from version 0.2 and 0.3. - Added a new editing mode for drawing circles. +- Fixed: File loading would skip every 300th line (don't ask me how this managed to happen). - Major corrections to the primitive generator: - Fixed: "Hi-Res" was not prepended to the names of 48/ primitives. - Fixed: Checking the Hi-Res option would not allow segment values over 16. @@ -44,7 +45,8 @@ and the algorithm can terminate early, hopefully this will save a few cycles on large parts. - The camera icons now draw real tooltips instead of emulated ones. - Color icon border now reflects the color's edge color. -- Fixed: File loading would skip every 300th line. +- [Linux] Fixed: If an external program is attempted to be launched requiring Wine but with Wine missing, + there was no error message and instead LDForge took this as no output from the program. - Fixed: LDForge would sometimes crash during startup over uninitialized data in the GL renderer. - Fixed: The message log was still written with black text with dark backgrounds. diff -r 2fb6c500ff9e -r 0d6fce0628fe src/extprogs.cc --- a/src/extprogs.cc Thu Dec 19 01:25:50 2013 +0200 +++ b/src/extprogs.cc Thu Dec 19 02:30:36 2013 +0200 @@ -113,10 +113,18 @@ // ============================================================================= // ----------------------------------------------------------------------------- -static str processErrorString (QProcess& proc) +static str processErrorString (extprog prog, QProcess& proc) { switch (proc.error()) { case QProcess::FailedToStart: - return "Failed to start (check your permissions)"; + { str wineblurb; + +#ifndef _WIN32 + if (g_extProgWine[prog]) + wineblurb = "make sure Wine is installed and "; +#endif + + return fmt ("Program failed to start, %1check your permissions", wineblurb); + } break; case QProcess::Crashed: return "Crashed."; @@ -177,6 +185,10 @@ writeObjects (objects, f); f.close(); + +#ifdef DEBUG + QFile::copy (fname, "debug_lastInput"); +#endif } // ============================================================================= @@ -229,6 +241,11 @@ proc.setStandardInputFile (inputname); proc.start (path, argv); + if (!proc.waitForStarted()) + { critical (fmt ("Couldn't start %1: %2\n", g_extProgNames[prog], processErrorString (prog, proc))); + return false; + } + // Write an enter, the utility tools all expect one stdinfp.write ("\n"); @@ -238,13 +255,13 @@ str err = ""; if (proc.exitStatus() != QProcess::NormalExit) - err = processErrorString (proc); + err = processErrorString (prog, proc); // Check the return code if (proc.exitCode() != 0) err = fmt ("Program exited abnormally (return code %1).", proc.exitCode()); - if (err.length() > 0) + if (!err.isEmpty()) { critical (fmt ("%1 failed: %2\n", g_extProgNames[prog], err)); return false; } @@ -256,7 +273,7 @@ // ----------------------------------------------------------------------------- static void insertOutput (str fname, bool replace, QList colorsToReplace) { -#ifndef RELEASE +#ifdef DEBUG QFile::copy (fname, "./debug_lastOutput"); #endif // RELEASE