2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-08 22:05:53 +00:00

More complete package step verification

This commit is contained in:
Jack Andersen 2018-01-13 20:42:13 -10:00
parent 1b2ee6749d
commit 2fd21e3270
5 changed files with 36 additions and 4 deletions

View File

@ -10,6 +10,8 @@ find_package(Qt5Xml)
if(APPLE) if(APPLE)
set(PLAT_SRCS MacOSSystemVersion.hpp MacOSSystemVersion.mm) set(PLAT_SRCS MacOSSystemVersion.hpp MacOSSystemVersion.mm)
set_source_files_properties(MacOSSystemVersion.mm
PROPERTIES COMPILE_FLAGS -fobjc-arc)
find_library(FOUNDATION_LIBRARY Foundation) find_library(FOUNDATION_LIBRARY Foundation)
set(PLAT_LIBS ${FOUNDATION_LIBRARY}) set(PLAT_LIBS ${FOUNDATION_LIBRARY})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")

View File

@ -2,6 +2,10 @@
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
#include <Foundation/Foundation.h> #include <Foundation/Foundation.h>
#if !__has_feature(objc_arc)
#error ARC Required
#endif
void GetMacOSSystemVersion(int& major, int& minor, int& patch) void GetMacOSSystemVersion(int& major, int& minor, int& patch)
{ {
major = 0; major = 0;

View File

@ -317,7 +317,7 @@ void MainWindow::enableOperations()
if (QFile::exists(m_path + "/MP1/!original_ids.yaml")) if (QFile::exists(m_path + "/MP1/!original_ids.yaml"))
{ {
m_ui->packageBtn->setEnabled(true); m_ui->packageBtn->setEnabled(true);
if (QFile::exists(m_path + "/out/MP1/!original_ids.upak")) if (isPackageComplete())
m_ui->launchBtn->setEnabled(true); m_ui->launchBtn->setEnabled(true);
} }
@ -331,6 +331,30 @@ void MainWindow::enableOperations()
insertContinueNote("Press 'Extract' to begin."); insertContinueNote("Press 'Extract' to begin.");
} }
bool MainWindow::isPackageComplete() const
{
return
QFile::exists(m_path + "/out/MP1/!original_ids.upak") &&
QFile::exists(m_path + "/out/MP1/AudioGrp.upak") &&
QFile::exists(m_path + "/out/MP1/GGuiSys.upak") &&
QFile::exists(m_path + "/out/MP1/Metroid1.upak") &&
QFile::exists(m_path + "/out/MP1/Metroid2.upak") &&
QFile::exists(m_path + "/out/MP1/Metroid3.upak") &&
QFile::exists(m_path + "/out/MP1/Metroid4.upak") &&
QFile::exists(m_path + "/out/MP1/metroid5.upak") &&
QFile::exists(m_path + "/out/MP1/Metroid6.upak") &&
QFile::exists(m_path + "/out/MP1/Metroid7.upak") &&
QFile::exists(m_path + "/out/MP1/Metroid8.upak") &&
QFile::exists(m_path + "/out/MP1/MidiData.upak") &&
QFile::exists(m_path + "/out/MP1/MiscData.upak") &&
QFile::exists(m_path + "/out/MP1/NoARAM.upak") &&
QFile::exists(m_path + "/out/MP1/SamGunFx.upak") &&
QFile::exists(m_path + "/out/MP1/SamusGun.upak") &&
QFile::exists(m_path + "/out/MP1/SlideShow.upak") &&
QFile::exists(m_path + "/out/MP1/TestAnim.upak") &&
QFile::exists(m_path + "/out/MP1/Tweaks.upak");
}
static bool GetDLPackage(const QString& path, QString& dlPackage) static bool GetDLPackage(const QString& path, QString& dlPackage)
{ {
QProcess proc; QProcess proc;
@ -464,7 +488,6 @@ void MainWindow::initSlots()
connect(&m_heclProc, &QProcess::readyRead, [=](){ connect(&m_heclProc, &QProcess::readyRead, [=](){
QByteArray bytes = m_heclProc.readAll(); QByteArray bytes = m_heclProc.readAll();
setTextTermFormatting(bytes); setTextTermFormatting(bytes);
m_ui->processOutput->ensureCursorVisible();
}); });
connect(m_ui->extractBtn, SIGNAL(clicked()), this, SLOT(onExtract())); connect(m_ui->extractBtn, SIGNAL(clicked()), this, SLOT(onExtract()));
@ -519,6 +542,7 @@ void MainWindow::setTextTermFormatting(const QString& text)
} }
} }
m_cursor.setCharFormat(defaultTextCharFormat); m_cursor.setCharFormat(defaultTextCharFormat);
m_ui->processOutput->ensureCursorVisible();
} }
void MainWindow::insertContinueNote(const QString& text) void MainWindow::insertContinueNote(const QString& text)
@ -532,4 +556,5 @@ void MainWindow::insertContinueNote(const QString& text)
textCharFormat.setForeground(QColor(0,255,0)); textCharFormat.setForeground(QColor(0,255,0));
m_cursor.insertText(text, textCharFormat); m_cursor.insertText(text, textCharFormat);
m_cursor.insertBlock(); m_cursor.insertBlock();
m_ui->processOutput->ensureCursorVisible();
} }

View File

@ -62,6 +62,7 @@ private:
void onBinaryFailed(); void onBinaryFailed();
void disableOperations(); void disableOperations();
void enableOperations(); void enableOperations();
bool isPackageComplete() const;
}; };
#endif // MAINWINDOW_HPP #endif // MAINWINDOW_HPP

View File

@ -120,7 +120,7 @@ SysReqTableModel::SysReqTableModel(QObject* parent)
#else #else
m_memorySize = uint64_t(sysconf(_SC_PHYS_PAGES)) * sysconf(_SC_PAGESIZE); m_memorySize = uint64_t(sysconf(_SC_PHYS_PAGES)) * sysconf(_SC_PAGESIZE);
#endif #endif
m_memorySizeStr.sprintf("%g GB", m_memorySize / 1024.f / 1024.f / 1024.f); m_memorySizeStr.sprintf("%g GiB", m_memorySize / 1024.f / 1024.f / 1024.f);
#ifdef __APPLE__ #ifdef __APPLE__
GetMacOSSystemVersion(m_macosMajor, m_macosMinor, m_macosPatch); GetMacOSSystemVersion(m_macosMajor, m_macosMinor, m_macosPatch);
if (m_macosPatch == 0) if (m_macosPatch == 0)
@ -213,7 +213,7 @@ QVariant SysReqTableModel::data(const QModelIndex& index, int role) const
case 1: case 1:
return QStringLiteral("1.5 GHz"); return QStringLiteral("1.5 GHz");
case 2: case 2:
return QStringLiteral("3 GB"); return QStringLiteral("3 GiB");
case 3: case 3:
return QStringLiteral("16 GB (MP1)"); return QStringLiteral("16 GB (MP1)");
case 4: case 4: