summaryrefslogtreecommitdiff
path: root/src/gui/serverdialog.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-10-13 14:34:45 -0600
committerJared Adams <jaxad0127@gmail.com>2009-10-13 14:34:45 -0600
commitd51d85d49eb0429ba170c13de4ee8b4c277b7937 (patch)
treeed60233e128a6247b5cb029c75b564cf544d8c6b /src/gui/serverdialog.cpp
parent6158b18c81ea5a32acd8bdecafe1dfe32619d667 (diff)
downloadmana-client-d51d85d49eb0429ba170c13de4ee8b4c277b7937.tar.gz
mana-client-d51d85d49eb0429ba170c13de4ee8b4c277b7937.tar.bz2
mana-client-d51d85d49eb0429ba170c13de4ee8b4c277b7937.tar.xz
mana-client-d51d85d49eb0429ba170c13de4ee8b4c277b7937.zip
Handle canceled downloads more gracefully
Diffstat (limited to 'src/gui/serverdialog.cpp')
-rw-r--r--src/gui/serverdialog.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index f47f33ea..e97eb099 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -192,6 +192,7 @@ void ServerDialog::action(const gcn::ActionEvent &event)
}
else
{
+ mDownload->cancel();
mQuitButton->setEnabled(false);
mConnectButton->setEnabled(false);
@@ -234,6 +235,7 @@ void ServerDialog::action(const gcn::ActionEvent &event)
}
else if (event.getId() == "quit")
{
+ mDownload->cancel();
state = STATE_FORCE_QUIT;
}
else if (event.getId() == "addEntry")
@@ -401,6 +403,9 @@ void ServerDialog::loadServers()
int ServerDialog::downloadUpdate(void *ptr, DownloadStatus status,
size_t total, size_t remaining)
{
+ if (status == DOWNLOAD_STATUS_CANCELLED)
+ return -1;
+
ServerDialog *sd = reinterpret_cast<ServerDialog*>(ptr);
bool finished = false;