diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-16 15:45:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-16 15:45:40 +0300 |
commit | fdbf478bdce6cdbad0a532621b2ef559a51b3daa (patch) | |
tree | fc4bce3ebdbac3fa67ac9da3de9e2da27d003bb8 /src/gui/windows/serverdialog.cpp | |
parent | 04febee98f22dd2af0c2e712542ba40083be680f (diff) | |
download | manaverse-fdbf478bdce6cdbad0a532621b2ef559a51b3daa.tar.gz manaverse-fdbf478bdce6cdbad0a532621b2ef559a51b3daa.tar.bz2 manaverse-fdbf478bdce6cdbad0a532621b2ef559a51b3daa.tar.xz manaverse-fdbf478bdce6cdbad0a532621b2ef559a51b3daa.zip |
Move serverdialogdownloadstatus into separate file.
And convert into strong typed enum.
Diffstat (limited to 'src/gui/windows/serverdialog.cpp')
-rw-r--r-- | src/gui/windows/serverdialog.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 82d44c1b0..93512e053 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -123,7 +123,7 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, mServerInfo(serverInfo), mPersistentIPCheckBox(nullptr), mDownloadProgress(-1.0F), - mDownloadStatus(DOWNLOADING_UNKNOWN) + mDownloadStatus(ServerDialogDownloadStatus::UNKNOWN) { if (isSafeMode) { @@ -390,28 +390,28 @@ void ServerDialog::logic() BLOCK_START("ServerDialog::logic") { MutexLocker tempLock(&mMutex); - if (mDownloadStatus == DOWNLOADING_COMPLETE) + if (mDownloadStatus == ServerDialogDownloadStatus::COMPLETE) { - mDownloadStatus = DOWNLOADING_OVER; + mDownloadStatus = ServerDialogDownloadStatus::OVER; mDescription->setCaption(std::string()); } - else if (mDownloadStatus == DOWNLOADING_IN_PROGRESS) + else if (mDownloadStatus == ServerDialogDownloadStatus::IN_PROGRESS) { // TRANSLATORS: servers dialog label mDescription->setCaption(strprintf(_("Downloading server list..." "%2.2f%%"), static_cast<double>(mDownloadProgress * 100))); } - else if (mDownloadStatus == DOWNLOADING_IDLE) + else if (mDownloadStatus == ServerDialogDownloadStatus::IDLE) { // TRANSLATORS: servers dialog label mDescription->setCaption(_("Waiting for server...")); } - else if (mDownloadStatus == DOWNLOADING_PREPARING) + else if (mDownloadStatus == ServerDialogDownloadStatus::PREPARING) { // TRANSLATORS: servers dialog label mDescription->setCaption(_("Preparing download")); } - else if (mDownloadStatus == DOWNLOADING_ERROR) + else if (mDownloadStatus == ServerDialogDownloadStatus::ERROR) { // TRANSLATORS: servers dialog label mDescription->setCaption(_("Error retreiving server list!")); @@ -764,7 +764,7 @@ int ServerDialog::downloadUpdate(void *ptr, { logger->log("Error retreiving server list: %s\n", sd->mDownload->getError()); - sd->mDownloadStatus = DOWNLOADING_ERROR; + sd->mDownloadStatus = ServerDialogDownloadStatus::ERROR; } else { @@ -778,7 +778,7 @@ int ServerDialog::downloadUpdate(void *ptr, progress = 1.0F; MutexLocker lock1(&sd->mMutex); - sd->mDownloadStatus = DOWNLOADING_IN_PROGRESS; + sd->mDownloadStatus = ServerDialogDownloadStatus::IN_PROGRESS; sd->mDownloadProgress = progress; } @@ -786,7 +786,7 @@ int ServerDialog::downloadUpdate(void *ptr, { sd->loadServers(); MutexLocker lock1(&sd->mMutex); - sd->mDownloadStatus = DOWNLOADING_COMPLETE; + sd->mDownloadStatus = ServerDialogDownloadStatus::COMPLETE; } return 0; |