diff options
author | Reid <reidyaro@gmail.com> | 2012-03-01 22:03:01 +0100 |
---|---|---|
committer | Reid <reidyaro@gmail.com> | 2012-03-01 22:03:01 +0100 |
commit | 490862919d79369112c75955a9c36ff8a081efd3 (patch) | |
tree | 6fe89466b9c53ba811f298174e6d787bbae71e09 /src/gui/updaterwindow.cpp | |
parent | dff814619d63496acd3c4e8730b828b5d4d931fb (diff) | |
parent | d873da3e8e57480016596f714845c1bc7e712e68 (diff) | |
download | mv-490862919d79369112c75955a9c36ff8a081efd3.tar.gz mv-490862919d79369112c75955a9c36ff8a081efd3.tar.bz2 mv-490862919d79369112c75955a9c36ff8a081efd3.tar.xz mv-490862919d79369112c75955a9c36ff8a081efd3.zip |
Merge branch 'master' of gitorious.org:manaplus/manaplus
Diffstat (limited to 'src/gui/updaterwindow.cpp')
-rw-r--r-- | src/gui/updaterwindow.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp index 3aaf93557..9bac5e311 100644 --- a/src/gui/updaterwindow.cpp +++ b/src/gui/updaterwindow.cpp @@ -298,9 +298,26 @@ void UpdaterWindow::loadNews() // Tokenize and add each line separately char *line = strtok(mMemoryBuffer, "\n"); + bool firstLine(true); while (line) { - mBrowserBox->addRow(line); + if (firstLine) + { + firstLine = false; + std::string str = line; + unsigned i = str.find("##9 Latest client version: ##6"); + if (!i) + { + line = strtok(nullptr, "\n"); + continue; + } + + mBrowserBox->addRow(str); + } + else + { + mBrowserBox->addRow(line); + } line = strtok(nullptr, "\n"); } @@ -332,6 +349,15 @@ void UpdaterWindow::loadPatch() if (line) { version = line; + if (serverVersion < 1) + { + line = strtok(nullptr, "\n"); + if (line) + { + mBrowserBox->addRow("##9 Latest client version: ##6ManaPlus " + + std::string(line), true); + } + } if (version > CHECK_VERSION) { mBrowserBox->addRow("", true); @@ -554,8 +580,8 @@ void UpdaterWindow::logic() if (mUpdateFiles.size() && mUpdateIndex <= mUpdateFiles.size()) { mProgressBar->setText(strprintf("%d/%d", mUpdateIndex - + mUpdateIndexOffset + 1, (int)mUpdateFiles.size() - + (int)mTempUpdateFiles.size() + 1)); + + mUpdateIndexOffset + 1, static_cast<int>(mUpdateFiles.size()) + + static_cast<int>(mTempUpdateFiles.size()) + 1)); } else { |