# # # patch "src/Guitone.cpp" # from [bb356b30edc1384597338c9ce9cc2ab7bc2bd294] # to [fceb51956b79942a19ebf94aa068e19318377ae6] # # patch "src/Guitone.h" # from [0019cd72ab359d06301a1d5e8321c3f284351a4c] # to [635d5952618d31c3c98767ebd169fff18c60704d] # # patch "src/monotone/MonotoneManager.cpp" # from [54e438b649a9ec2fef348acd644a838725744103] # to [5adaee6b8019cb96b37107ffc51c768c9c1e2843] # # patch "src/monotone/MonotoneManager.h" # from [a3047e1cacbd06d1d46cfae6a8c8fd32957d8be6] # to [2d0e2ae2f15828a9d289a6332e1dbcfb7af55b0c] # # patch "src/monotone/MonotoneThread.cpp" # from [05acb212fc9dce4c276d00cce24105fc8c6bc1f3] # to [950941c64a5728f680cbdbae2509184f3a8e6c51] # ============================================================ --- src/Guitone.cpp bb356b30edc1384597338c9ce9cc2ab7bc2bd294 +++ src/Guitone.cpp fceb51956b79942a19ebf94aa068e19318377ae6 @@ -54,6 +54,11 @@ Guitone::Guitone(int & argc, char** argv monotoneManager = new MonotoneManager(); + connect( + monotoneManager, SIGNAL(threadAborted(const QString &)), + this, SLOT(threadAborted(const QString &)) + ); + // Try to load something given on the command line // or found in one of the recent items lists as soon as // the manager got a valid binary path set @@ -425,3 +430,19 @@ void Guitone::raiseAllWindows() } } +void Guitone::threadAborted(const QString & message) +{ + QMessageBox::critical( + NULL, + tr("Error"), + message, + QMessageBox::Ok, 0, 0 + ); + + if (openPrompt) + { + openPrompt->setEnabled(true); + openPrompt->raise(); + } +} + ============================================================ --- src/Guitone.h 0019cd72ab359d06301a1d5e8321c3f284351a4c +++ src/Guitone.h 635d5952618d31c3c98767ebd169fff18c60704d @@ -64,6 +64,7 @@ private slots: void windowClosed(MainWindow *); void setMonotoneBinaryPath(); void loadSomething(); + void threadAborted(const QString &); private: bool tryLoadSomething(const QString &); ============================================================ --- src/monotone/MonotoneManager.cpp 54e438b649a9ec2fef348acd644a838725744103 +++ src/monotone/MonotoneManager.cpp 5adaee6b8019cb96b37107ffc51c768c9c1e2843 @@ -266,6 +266,9 @@ void MonotoneManager::aborted(int thread threadMap.remove(threadNumber); identMap.remove(threadNumber); + // wait until the thread has finished execution + thread->wait(); + delete thread; // @@ -316,12 +319,7 @@ void MonotoneManager::aborted(int thread userMessage.append(tr("\n\nLast error output was:\n%1").arg(mtnError)); } - QMessageBox::critical( - NULL, - tr("Error"), - userMessage, - QMessageBox::Ok, 0, 0 - ); + emit threadAborted(userMessage); } bool MonotoneManager::singleRun(const QString & mtnBinary, ============================================================ --- src/monotone/MonotoneManager.h a3047e1cacbd06d1d46cfae6a8c8fd32957d8be6 +++ src/monotone/MonotoneManager.h 2d0e2ae2f15828a9d289a6332e1dbcfb7af55b0c @@ -65,6 +65,10 @@ public: //! the maximum allowed interface version (excluding this particular version) static const QString MaxInterfaceVersion; +signals: + //! is emitted if a thread is aborted and contains some diagnostic message + void threadAborted(const QString &); + private: MonotoneThread * getThread(const DatabaseFile &, const WorkspacePath &); ============================================================ --- src/monotone/MonotoneThread.cpp 05acb212fc9dce4c276d00cce24105fc8c6bc1f3 +++ src/monotone/MonotoneThread.cpp 950941c64a5728f680cbdbae2509184f3a8e6c51 @@ -192,8 +192,7 @@ void MonotoneThread::run() "errors on execution. Its recommended you remove " "this workspace before you retry this again!").arg(tmpPath)); - // the process hasn't yet been started, so we don't need to - // clean it up + cleanup(process); return; } process->setWorkingDirectory(tmpPath);