summaryrefslogtreecommitdiff
path: root/src/gui/updatewindow.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-09-29 23:59:08 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-09-29 23:59:08 +0000
commite8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3 (patch)
treee8dc775e12f6b4eb0a6d56448f05286c774bbb8a /src/gui/updatewindow.cpp
parent0e8c09433f3a193b5a94a1ad572d8237113cdfbf (diff)
downloadmana-e8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3.tar.gz
mana-e8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3.tar.bz2
mana-e8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3.tar.xz
mana-e8f94fe7ca5e7e7838eaa84f1792b4b42b4bada3.zip
Merged trunk changes from revision 2618 to 2716 into the 0.1.0 branch.
Diffstat (limited to 'src/gui/updatewindow.cpp')
-rw-r--r--src/gui/updatewindow.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp
index 77a026fe..00b10406 100644
--- a/src/gui/updatewindow.cpp
+++ b/src/gui/updatewindow.cpp
@@ -48,9 +48,9 @@ UpdaterWindow::UpdaterWindow():
Window("Updating..."),
mThread(NULL), mMutex(NULL), mDownloadStatus(UPDATE_NEWS),
mUpdateHost(""), mCurrentFile("news.txt"), mBasePath(""),
- mStoreInMemory(true), mDownloadComplete(true), mDownloadedBytes(0),
- mMemoryBuffer(NULL), mCurlError(new char[CURL_ERROR_SIZE]),
- mFileIndex(0)
+ mStoreInMemory(true), mDownloadComplete(true), mUserCancel(false),
+ mDownloadedBytes(0), mMemoryBuffer(NULL),
+ mCurlError(new char[CURL_ERROR_SIZE]), mFileIndex(0)
{
mCurlError[0] = 0;
@@ -133,6 +133,8 @@ void UpdaterWindow::action(const std::string &eventId, gcn::Widget *widget)
{
if (eventId == "cancel")
{
+ // Register the user cancel
+ mUserCancel=true;
// Skip the updating process
if (mDownloadStatus == UPDATE_COMPLETE)
{
@@ -329,7 +331,15 @@ void UpdaterWindow::logic()
case UPDATE_ERROR:
if (mThread)
{
- SDL_WaitThread(mThread, NULL);
+ if(mUserCancel){
+ // Kill the thread, because user has canceled
+ SDL_KillThread(mThread);
+ // Set the flag to false again
+ mUserCancel = false;
+ }
+ else{
+ SDL_WaitThread(mThread, NULL);
+ }
mThread = NULL;
}
addRow("");