summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-02-27 10:35:57 -0700
committerJared Adams <jaxad0127@gmail.com>2010-02-27 11:01:24 -0700
commit43ccd84af0707b29b146a9ea3d21094d6eb30e3a (patch)
treec2e371bf82366bbcae1ede8758d087c54572c489 /src
parent024ad66a350883597ba4c34d1c5868ef43c086a0 (diff)
downloadmana-43ccd84af0707b29b146a9ea3d21094d6eb30e3a.tar.gz
mana-43ccd84af0707b29b146a9ea3d21094d6eb30e3a.tar.bz2
mana-43ccd84af0707b29b146a9ea3d21094d6eb30e3a.tar.xz
mana-43ccd84af0707b29b146a9ea3d21094d6eb30e3a.zip
Report more info on client in cURL useragent and Desktop
Reviewed-by: Thorbjørn Lindeijer Reviewed-by: Chuck Miller
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/desktop.cpp12
-rw-r--r--src/main.h29
-rw-r--r--src/net/download.cpp11
3 files changed, 45 insertions, 7 deletions
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp
index e7cd949a..2a80cc11 100644
--- a/src/gui/widgets/desktop.cpp
+++ b/src/gui/widgets/desktop.cpp
@@ -20,6 +20,7 @@
#include "gui/widgets/desktop.h"
+#include "configuration.h"
#include "graphics.h"
#include "log.h"
#include "main.h"
@@ -32,6 +33,8 @@
#include "resources/resourcemanager.h"
#include "resources/wallpaper.h"
+#include "utils/stringutils.h"
+
Desktop::Desktop()
: mWallpaper(0)
{
@@ -39,7 +42,14 @@ Desktop::Desktop()
Wallpaper::loadWallpapers();
- mVersionLabel = new Label(FULL_VERSION);
+ std::string appName = branding.getValue("appName", "");
+
+ if (appName.empty())
+ mVersionLabel = new Label(FULL_VERSION);
+ else
+ mVersionLabel = new Label(strprintf("%s (Mana %s)", appName.c_str(),
+ FULL_VERSION));
+
mVersionLabel->setBackgroundColor(gcn::Color(255, 255, 255, 128));
add(mVersionLabel, 25, 2);
}
diff --git a/src/main.h b/src/main.h
index 03e0c7b3..3f30ef14 100644
--- a/src/main.h
+++ b/src/main.h
@@ -55,7 +55,7 @@
#elif defined WIN32
#include "winver.h"
#elif defined __APPLE__
-#define PACKAGE_VERSION "0.0.29.1"
+#define PACKAGE_VERSION "1.0.0"
#endif
#ifdef PACKAGE_VERSION
@@ -64,6 +64,33 @@
#define FULL_VERSION "Unknown Version"
#endif
+#ifdef PACKAGE_OS
+// If it's already been defined, let's not change it
+#elif defined __APPLE__
+#define PACKAGE_OS "Apple"
+#elif defined __FreeBSD__ || defined __DragonFly__
+#define PACKAGE_OS "FreeBSD"
+#elif defined __NetBSD__
+#define PACKAGE_OS "NetBSD"
+#elif defined __OpenBSD__
+#define PACKAGE_OS "OpenBSD"
+#elif defined __linux__ || defined __linux
+#define PACKAGE_OS "Linux"
+#elif defined __GNU__
+#define PACKAGE_OS "GNU Hurd"
+#elif defined WIN32 || defined _WIN32 || defined __WIN32__ || defined __NT__ \
+ || defined WIN64 || defined _WIN64 || defined __WIN64__
+#define PACKAGE_OS "Windows"
+#else
+#define PACKAGE_OS "Other"
+#endif
+
+#ifdef PACKAGE_VERSION
+#define PACKAGE_EXTENDED_VERSION "Mana/" PACKAGE_VERSION " (" PACKAGE_OS "; %s)"
+#else
+#define PACKAGE_EXTENDED_VERSION "Mana (" PACKAGE_OS "; %s)"
+#endif
+
#ifndef PKG_DATADIR
#define PKG_DATADIR ""
#endif
diff --git a/src/net/download.cpp b/src/net/download.cpp
index ba5b6b35..2b96a6b9 100644
--- a/src/net/download.cpp
+++ b/src/net/download.cpp
@@ -20,9 +20,12 @@
#include "net/download.h"
+#include "configuration.h"
#include "log.h"
#include "main.h"
+#include "utils/stringutils.h"
+
#include <curl/curl.h>
#include <SDL.h>
@@ -217,11 +220,9 @@ int Download::downloadThread(void *ptr)
curl_easy_setopt(d->mCurl, CURLOPT_WRITEDATA, file);
}
-#ifdef PACKAGE_VERSION
- curl_easy_setopt(d->mCurl, CURLOPT_USERAGENT, "Mana/" PACKAGE_VERSION);
-#else
- curl_easy_setopt(d->mCurl, CURLOPT_USERAGENT, "Mana");
-#endif
+ curl_easy_setopt(d->mCurl, CURLOPT_USERAGENT,
+ strprintf(PACKAGE_EXTENDED_VERSION, branding
+ .getValue("appShort", "mana").c_str()).c_str());
curl_easy_setopt(d->mCurl, CURLOPT_ERRORBUFFER, d->mError);
curl_easy_setopt(d->mCurl, CURLOPT_URL, d->mUrl.c_str());
curl_easy_setopt(d->mCurl, CURLOPT_NOPROGRESS, 0);