diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/desktop.cpp | 12 | ||||
-rw-r--r-- | src/main.h | 29 | ||||
-rw-r--r-- | src/net/download.cpp | 11 |
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); } @@ -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); |