qt: Add UUID features, MAC address configuration, machine move detection

This commit is contained in:
cold-brewed
2024-03-29 08:23:55 -04:00
parent c6289fd85a
commit 4d8e7bd24e
8 changed files with 139 additions and 6 deletions

View File

@@ -30,6 +30,7 @@
#include <QFont>
#include <QDialog>
#include <QMessageBox>
#include <QPushButton>
#ifdef QT_STATIC
/* Static builds need plugin imports */
@@ -71,6 +72,7 @@ extern "C" {
#include "cocoa_mouse.hpp"
#include "qt_styleoverride.hpp"
#include "qt_unixmanagerfilter.hpp"
#include "qt_util.hpp"
// Void Cast
#define VC(x) const_cast<wchar_t *>(x)
@@ -220,6 +222,25 @@ main(int argc, char *argv[])
return 6;
}
// UUID / copy / move detection
if(!util::compareUuid()) {
QMessageBox movewarnbox;
movewarnbox.setIcon(QMessageBox::Icon::Warning);
movewarnbox.setText("This machine might have been moved or copied.");
movewarnbox.setInformativeText("In order to ensure proper networking functionality, 86Box needs to know if this machine was moved or copied.\n\nSelect \"I Copied It\" if you are not sure.");
const QPushButton *movedButton = movewarnbox.addButton(QObject::tr("I Moved It"), QMessageBox::AcceptRole);
const QPushButton *copiedButton = movewarnbox.addButton(QObject::tr("I Copied It"), QMessageBox::DestructiveRole);
QPushButton *cancelButton = movewarnbox.addButton(QObject::tr("Cancel"), QMessageBox::RejectRole);
movewarnbox.setDefaultButton(cancelButton);
movewarnbox.exec();
if (movewarnbox.clickedButton() == copiedButton) {
util::storeCurrentUuid();
util::generateNewMacAdresses();
} else if (movewarnbox.clickedButton() == movedButton) {
util::storeCurrentUuid();
}
}
#ifdef Q_OS_WINDOWS
# if !defined(EMU_BUILD_NUM) || (EMU_BUILD_NUM != 5624)
HWND winbox = FindWindow("TWinBoxMain", NULL);