Add AppleWin version number in the About dialog box.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
parent
a27585d2a6
commit
da7ac10987
4 changed files with 24 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
add_custom_command(OUTPUT linux/version.hpp
|
||||
COMMAND grep FILEVERSION ${CMAKE_CURRENT_SOURCE_DIR}/../resource/Applewin.rc | sed 's/FILEVERSION/\#define FILEVERSION/' > linux/version.hpp
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../resource/Applewin.rc
|
||||
)
|
||||
|
||||
add_library(appleii SHARED
|
||||
SaveState.cpp
|
||||
Pravets.cpp
|
||||
|
@ -24,6 +29,8 @@ add_library(appleii SHARED
|
|||
linux/state.cpp
|
||||
linux/benchmark.cpp
|
||||
linux/paddle.cpp
|
||||
linux/version.cpp
|
||||
linux/version.hpp
|
||||
|
||||
Z80VICE/z80.cpp
|
||||
Z80VICE/z80mem.cpp
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "linux/data.h"
|
||||
#include "linux/benchmark.h"
|
||||
#include "linux/version.h"
|
||||
|
||||
#include "emulator.h"
|
||||
#include "memorycontainer.h"
|
||||
|
@ -305,7 +306,9 @@ void QApple::on_actionAbout_Qt_triggered()
|
|||
|
||||
void QApple::on_actionAbout_triggered()
|
||||
{
|
||||
QMessageBox::about(this, QApplication::applicationName(), "Apple ][ emulator\n\nBased on AppleWin\n");
|
||||
QString qversion = QString::fromStdString(getVersion());
|
||||
QString message = QString("Apple ][ emulator\n\nBased on AppleWin %1\n").arg(qversion);
|
||||
QMessageBox::about(this, QApplication::applicationName(), message);
|
||||
}
|
||||
|
||||
QString getImageFilename()
|
||||
|
|
10
source/linux/version.cpp
Normal file
10
source/linux/version.cpp
Normal file
|
@ -0,0 +1,10 @@
|
|||
#include "linux/version.h"
|
||||
#include "linux/version.hpp"
|
||||
|
||||
#define xstr(a) str(a)
|
||||
#define str(a, b, c, d) #a"."#b"."#c"."#d
|
||||
|
||||
std::string getVersion()
|
||||
{
|
||||
return xstr(FILEVERSION);
|
||||
}
|
3
source/linux/version.h
Normal file
3
source/linux/version.h
Normal file
|
@ -0,0 +1,3 @@
|
|||
#include <string>
|
||||
|
||||
std::string getVersion();
|
Loading…
Add table
Reference in a new issue