From 67314f0622d7914cce7383e1f76486f4109cbc6d Mon Sep 17 00:00:00 2001 From: "Raine M. Ekman" Date: Fri, 31 Jan 2014 21:39:03 +0200 Subject: [PATCH] Move version details into .h file and add them to main.cpp --- include/versioninfo.h | 29 +++++++++++++++++++++++++++++ src/core/main.cpp | 13 ++++++++----- src/gui/about_dialog.cpp | 32 ++------------------------------ 3 files changed, 39 insertions(+), 35 deletions(-) create mode 100644 include/versioninfo.h diff --git a/include/versioninfo.h b/include/versioninfo.h new file mode 100644 index 000000000..0fd315299 --- /dev/null +++ b/include/versioninfo.h @@ -0,0 +1,29 @@ +#ifdef __GNUC__ +#define GCC_VERSION "GCC "__VERSION__ +#else +#define GCC_VERSION "unknown compiler" +#endif + +#ifdef LMMS_HOST_X86 +#define MACHINE "i386" +#endif + +#ifdef LMMS_HOST_X86_64 +#define MACHINE "x86_64" +#endif + +#ifndef MACHINE +#define MACHINE "unknown processor" +#endif + +#ifdef LMMS_BUILD_LINUX +#define PLATFORM "Linux" +#endif + +#ifdef LMMS_BUILD_APPLE +#define PLATFORM "OS X" +#endif + +#ifdef LMMS_BUILD_WIN32 +#define PLATFORM "win32" +#endif diff --git a/src/core/main.cpp b/src/core/main.cpp index e64a8e494..8912a6b20 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -25,6 +25,7 @@ #include "lmmsconfig.h" #include "lmmsversion.h" +#include "versioninfo.h" #include #include @@ -130,21 +131,23 @@ int main( int argc, char * * argv ) if( QString( argv[i] ) == "--version" || QString( argv[i] ) == "-v" ) { - printf( "\nLinux MultiMedia Studio %s\n\n" - "Copyright (c) 2004-2013 LMMS developers.\n\n" + printf( "\nLinux MultiMedia Studio %s\n(%s %s, Qt %s, %s)\n\n" + "Copyright (c) 2004-2014 LMMS developers.\n\n" "This program is free software; you can redistribute it and/or\n" "modify it under the terms of the GNU General Public\n" "License as published by the Free Software Foundation; either\n" "version 2 of the License, or (at your option) any later version.\n\n" - "Try \"%s --help\" for more information.\n\n", LMMS_VERSION, - argv[0] ); + "Try \"%s --help\" for more information.\n\n", LMMS_VERSION, + PLATFORM, MACHINE, QT_VERSION_STR, GCC_VERSION, + argv[0] ); + return( EXIT_SUCCESS ); } else if( argc > i && ( QString( argv[i] ) == "--help" || QString( argv[i] ) == "-h" ) ) { printf( "\nLinux MultiMedia Studio %s\n" - "Copyright (c) 2004-2013 LMMS developers.\n\n" + "Copyright (c) 2004-2014 LMMS developers.\n\n" "usage: lmms [ -r ] [ options ]\n" " [ -u ]\n" " [ -d ]\n" diff --git a/src/gui/about_dialog.cpp b/src/gui/about_dialog.cpp index 94b6fb217..056732643 100644 --- a/src/gui/about_dialog.cpp +++ b/src/gui/about_dialog.cpp @@ -28,38 +28,9 @@ #include "embed.h" #include "engine.h" #include "MainWindow.h" +#include "versioninfo.h" -#ifdef __GNUC__ -#define GCC_VERSION "GCC "__VERSION__ -#else -#define GCC_VERSION "unknown compiler" -#endif - -#ifdef LMMS_HOST_X86 -#define MACHINE "i386" -#endif - -#ifdef LMMS_HOST_X86_64 -#define MACHINE "x86_64" -#endif - -#ifndef MACHINE -#define MACHINE "unknown processor" -#endif - -#ifdef LMMS_BUILD_LINUX -#define PLATFORM "Linux" -#endif - -#ifdef LMMS_BUILD_APPLE -#define PLATFORM "OS X" -#endif - -#ifdef LMMS_BUILD_WIN32 -#define PLATFORM "win32" -#endif - aboutDialog::aboutDialog() : QDialog( engine::mainWindow() ), @@ -67,6 +38,7 @@ aboutDialog::aboutDialog() : { setupUi( this ); + iconLabel->setPixmap( embed::getIconPixmap( "icon", 64, 64 ) ); versionLabel->setText( versionLabel->text().