# # # patch "guitone/res/i18n/guitone_de.ts" # from [8a9f18c91d4da422143541bbe523025eb7a280d3] # to [cf253683411fe5f117013753b5e2c7d77c1f0310] # # patch "guitone/src/monotone/Monotone.cpp" # from [70ccad4aa0480ca1c0b18c00699c682b68244e4c] # to [b8f251abac1aee8cc276be23dc2807e1c66061f3] # # patch "guitone/src/monotone/Monotone.h" # from [1d79fc7759d55b8f1774f4dd892f56b8d54831b9] # to [99eae4dc0a19bca4b8dda00a5b67dbf397016dc5] # ============================================================ --- guitone/res/i18n/guitone_de.ts 8a9f18c91d4da422143541bbe523025eb7a280d3 +++ guitone/res/i18n/guitone_de.ts cf253683411fe5f117013753b5e2c7d77c1f0310 @@ -902,23 +902,23 @@ Sie können zum Arbeitsbereich-Modus jed Monotone - + The monotone process exited unexpectedly (process error %1). Please reconfigure the path to the monotone binary in the Preferences dialog or check if the version of the database you try to load matches the monotone version you are using. monotone returned: %2 - Der monotone-Prozess wurde unerwartet beendet (Prozess-Fehler %1). Bitte konfigurieren Sie den Pfad zur ausführbaren Datei von monotone im Einstellungsdialog neu oder überprüfen Sie, ob die Version der Datenbank, die Sie versucht haben zu laden, mit der Version von monotone übereinstimmt, die Sie benutzen. + Der monotone-Prozess wurde unerwartet beendet (Prozess-Fehler %1). Bitte konfigurieren Sie den Pfad zur ausführbaren Datei von monotone im Einstellungsdialog neu oder überprüfen Sie, ob die Version der Datenbank, die Sie versucht haben zu laden, mit der Version von monotone übereinstimmt, die Sie benutzen. monotone gab zurück: %2 - + The monotone process exited unexpectedly (return code %1). Please reconfigure the path to the monotone binary in the Preferences dialog or check if the version of the database you try to load matches the monotone version you are using. monotone returned: %2 - Der monotone-Prozess wurde unerwartet beendet (Rückgabewert %1). Bitte konfigurieren Sie den Pfad zur ausführbaren Datei von monotone im Einstellungsdialog neu oder überprüfen Sie, ob die Version der Datenbank, die Sie versucht haben zu laden, mit der Version von monotone übereinstimmt, die Sie benutzen. + Der monotone-Prozess wurde unerwartet beendet (Rückgabewert %1). Bitte konfigurieren Sie den Pfad zur ausführbaren Datei von monotone im Einstellungsdialog neu oder überprüfen Sie, ob die Version der Datenbank, die Sie versucht haben zu laden, mit der Version von monotone übereinstimmt, die Sie benutzen. monotone gab zurück: %2 ============================================================ --- guitone/src/monotone/Monotone.cpp 70ccad4aa0480ca1c0b18c00699c682b68244e4c +++ guitone/src/monotone/Monotone.cpp b8f251abac1aee8cc276be23dc2807e1c66061f3 @@ -203,13 +203,13 @@ void Monotone::setupNewProcess() // monitor if the process is exited unexpectedly connect( process, SIGNAL(finished(int, QProcess::ExitStatus)), - this, SLOT(processTerminated(int, QProcess::ExitStatus)) + this, SLOT(processFinished(int, QProcess::ExitStatus)) ); // check if there occurs an startup error connect( process, SIGNAL(error(QProcess::ProcessError)), - this, SLOT(startupError(QProcess::ProcessError)) + this, SLOT(processError(QProcess::ProcessError)) ); if (mode == Workspace) @@ -252,32 +252,51 @@ bool Monotone::loadDatabase(QString db) return true; } -void Monotone::startupError(QProcess::ProcessError error) +void Monotone::processError(QProcess::ProcessError error) { if (isCleanExit) return; - // FIXME: we need a better error handling here afterwards, i.e. inform - // the GUI that nothing is available - QString msg(process->readAllStandardError()); - emit criticalError(tr( - "The monotone process exited unexpectedly (process error %1). Please " - "reconfigure the path to the monotone binary in the Preferences dialog " - "or check if the version of the database you try to load matches the " - "monotone version you are using.\n\n" - "monotone returned:\n%2" - ).arg(error).arg(stripMtnPrefix(msg)) - ); + // FIXME: a process error can be anything process related. We need to handle + // this differently and give the user the proper information he needs to + // resolve the problem. + // The problem why we don't do that now is that we have no knowledge + // if the error which occured here will also trigger the finished() signal, + // which then is handled properly and also contains some process output + // to throw at the user. + // + // There are six different process errors which can come up: + // + // QProcess::FailedToStart: + // unlikely, since we check the executable version + // before we actually open the stdio process - this could theoretically + // popup if the binary is changed / removed between the program start + // and the actual start of a stdio process - usually the last workspace + // or database is loaded right after start + // QProcess::Crashed: + // we need to determine if this also triggers finished()... if we'd + // only have mtn automate crash... and then this should probably be + // handled + // QProcess::Timeout: + // occurs on a timeout for any last waitFor...() function - we use + // waitForStarted to ensure the process runs before we throw the first + // data onto it - maybe this should be handled + // QProcess::WriteError / QProcess::ReadError: + // occur either if a process is not running (crashed? failedToStart?) + // or closed its input channel - for any case I believe finished() + // is called as well, but this is speculation. + // QProcess::UnknownError: + // yeah, unknown errors, I love these - absolutely no idea what + // to do on this or even when it can come up + qCritical("received process error %d", error); } -void Monotone::processTerminated(int code, QProcess::ExitStatus status) +void Monotone::processFinished(int code, QProcess::ExitStatus status) { // this was a normal exit if (code == 0 || isCleanExit) return; - // FIXME: we need a better error handling here afterwards, i.e. inform - // the GUI that nothing is available - QString msg(process->readAllStandardError()); - emit criticalError(tr( + QString msg(process->readAllStandardError()); + emit criticalError(tr( "The monotone process exited unexpectedly (return code %1). Please " "reconfigure the path to the monotone binary in the Preferences dialog " "or check if the version of the database you try to load matches the " @@ -657,6 +676,6 @@ QString Monotone::stripMtnPrefix(const Q } output += list[i] + " "; } - return output; + return output.trimmed(); } ============================================================ --- guitone/src/monotone/Monotone.h 1d79fc7759d55b8f1774f4dd892f56b8d54831b9 +++ guitone/src/monotone/Monotone.h 99eae4dc0a19bca4b8dda00a5b67dbf397016dc5 @@ -80,8 +80,8 @@ class Monotone : public QObject private slots: void readAndProcessCommand(); - void processTerminated(int, QProcess::ExitStatus); - void startupError(QProcess::ProcessError); + void processFinished(int, QProcess::ExitStatus); + void processError(QProcess::ProcessError); void timedOut(); signals: