Windows fixes

This commit is contained in:
Jack Andersen 2017-12-26 18:10:44 -10:00
parent a686debdcf
commit 4658c9fbc5
7 changed files with 90 additions and 38 deletions

View File

@ -14,7 +14,7 @@ if(APPLE)
endif()
if(WIN32)
list(APPEND PLAT_SRCS platforms/win/urde.rc)
list(APPEND PLAT_SRCS platforms/win/hecl-gui.rc platforms/win/hecl-gui.manifest)
elseif(APPLE)
list(APPEND PLAT_SRCS platforms/mac/mainicon.icns)
set_source_files_properties(platforms/mac/mainicon.icns PROPERTIES
@ -37,4 +37,4 @@ add_executable(hecl-gui WIN32 MACOSX_BUNDLE
set_target_properties(hecl-gui PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/platforms/mac/Info.plist")
target_link_libraries(hecl-gui ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES} ${PLAT_LIBS} zeus)
target_link_libraries(hecl-gui ${PLAT_LIBS} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES} zeus)

View File

@ -721,7 +721,7 @@ void MainWindow::initSlots()
connect(m_ui->browseBtn, &QPushButton::clicked, [=]() {
FileDirDialog dialog(this);
dialog.setWindowTitle("Select ISO or Directory");
dialog.setWindowTitle("Select Working Directory");
int res = dialog.exec();//QFileDialog::getOpenFileName(this, "Select ISO or Directory");
if (res == QFileDialog::Rejected)
return;

View File

@ -4,12 +4,34 @@
#include <QHeaderView>
#if _WIN32
#include <Windows.h>
#include <VersionHelpers.h>
#else
#include <unistd.h>
#endif
#if __APPLE__
#include "MacOSSystemVersion.hpp"
#elif _WIN32
static QString GetWindowsVersionString()
{
if (IsWindows10OrGreater())
return QStringLiteral("Windows 10");
else if (IsWindows8Point1OrGreater())
return QStringLiteral("Windows 8.1");
else if (IsWindows8OrGreater())
return QStringLiteral("Windows 8");
else if (IsWindows7SP1OrGreater())
return QStringLiteral("Windows 7 SP1");
else if (IsWindows7OrGreater())
return QStringLiteral("Windows 7");
else if (IsWindowsVistaOrGreater())
return QStringLiteral("Windows Vista");
else if (IsWindowsXPOrGreater())
return QStringLiteral("Windows XP");
else
return QStringLiteral("Windows Old And Won't Work");
}
#endif
SysReqTableModel::SysReqTableModel(QObject* parent)
@ -24,6 +46,10 @@ SysReqTableModel::SysReqTableModel(QObject* parent)
}
m_cpuSpeedStr.sprintf("%g GHz", m_cpuSpeed / 1000.f);
#if _WIN32
MEMORYSTATUSEX memStat = {};
memStat.dwLength = sizeof(memStat);
GlobalMemoryStatusEx(&memStat);
m_memorySize = memStat.ullTotalPhys;
#else
m_memorySize = uint64_t(sysconf(_SC_PHYS_PAGES)) * sysconf(_SC_PAGESIZE);
#endif
@ -34,6 +60,9 @@ SysReqTableModel::SysReqTableModel(QObject* parent)
m_osVersion.sprintf("macOS %d.%d", m_macosMajor, m_macosMinor);
else
m_osVersion.sprintf("macOS %d.%d.%d", m_macosMajor, m_macosMinor, m_macosPatch);
#elif _WIN32
m_win7SP1OrGreater = IsWindows7SP1OrGreater();
m_osVersion = GetWindowsVersionString();
#endif
}
@ -67,6 +96,8 @@ QVariant SysReqTableModel::data(const QModelIndex& index, int role) const
case 3:
#ifdef __APPLE__
return m_macosMajor > 10 || m_macosMinor >= 9;
#elif defined(_WIN32)
return m_win7SP1OrGreater;
#else
return true;
#endif
@ -92,6 +123,8 @@ QVariant SysReqTableModel::data(const QModelIndex& index, int role) const
case 3:
#ifdef __APPLE__
return QStringLiteral("macOS 10.9");
#elif defined(_WIN32)
return QStringLiteral("Windows 7 SP1");
#else
return {};
#endif

View File

@ -17,6 +17,8 @@ class SysReqTableModel : public QAbstractTableModel
int m_macosMajor = 0;
int m_macosMinor = 0;
int m_macosPatch = 0;
#elif _WIN32
bool m_win7SP1OrGreater = false;
#endif
QString m_osVersion;
public:

View File

@ -3,8 +3,7 @@
#include "MainWindow.hpp"
#include "Common.hpp"
extern const size_t MAINICON_QT_SZ;
extern const uint8_t MAINICON_QT[];
extern "C" const uint8_t MAINICON_QT[];
static QIcon MakeAppIcon()
{

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<description> my exe </description>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
</assembly>

View File

@ -1,33 +1,33 @@
#include "winver.h"
#define IDI_ICON1 101
IDI_ICON1 ICON DISCARDABLE "mainicon.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGS 0x0L
FILEFLAGSMASK 0x3fL
FILEOS 0x00040004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "CompanyName", "Antidote / Jackoalan"
VALUE "FileDescription", "HECL"
VALUE "FileVersion", "BETA"
VALUE "LegalCopyright", "Copyright (C) 2015-2017 Antidote / Jackoalan"
VALUE "InternalName", "urde"
VALUE "OriginalFilename", "hecl.exe"
VALUE "ProductName", "HECL"
VALUE "ProductVersion", "BETA"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1200
END
END
#include "winver.h"
#define IDI_ICON1 101
IDI_ICON1 ICON DISCARDABLE "mainicon.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGS 0x0L
FILEFLAGSMASK 0x3fL
FILEOS 0x00040004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "CompanyName", "Antidote / Jackoalan"
VALUE "FileDescription", "HECL"
VALUE "FileVersion", "BETA"
VALUE "LegalCopyright", "Copyright (C) 2015-2017 Antidote / Jackoalan"
VALUE "InternalName", "urde"
VALUE "OriginalFilename", "hecl.exe"
VALUE "ProductName", "HECL"
VALUE "ProductVersion", "BETA"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1200
END
END