vmm preview
This commit is contained in:
committed by
Alexander Babikov
parent
138e54d16f
commit
c6da2caff2
@@ -77,6 +77,8 @@ extern "C" {
|
||||
#include "qt_styleoverride.hpp"
|
||||
#include "qt_unixmanagerfilter.hpp"
|
||||
#include "qt_util.hpp"
|
||||
#include "qt_vmmanager_clientsocket.hpp"
|
||||
#include "qt_vmmanager_mainwindow.hpp"
|
||||
|
||||
// Void Cast
|
||||
#define VC(x) const_cast<wchar_t *>(x)
|
||||
@@ -662,6 +664,19 @@ main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (vmm_enabled) {
|
||||
// VMManagerMain vmm;
|
||||
// // Hackish until there is a proper solution
|
||||
// QApplication::setApplicationName("86Box VM Manager");
|
||||
// QApplication::setApplicationDisplayName("86Box VM Manager");
|
||||
// vmm.show();
|
||||
// vmm.exec();
|
||||
const auto vmm_main_window = new VMManagerMainWindow();
|
||||
vmm_main_window->show();
|
||||
QApplication::exec();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef DISCORD
|
||||
discord_load();
|
||||
#endif
|
||||
@@ -758,6 +773,36 @@ main(int argc, char *argv[])
|
||||
socket.connectToServer(qgetenv("86BOX_MANAGER_SOCKET"));
|
||||
}
|
||||
|
||||
VMManagerClientSocket manager_socket;
|
||||
if (qgetenv("VMM_86BOX_SOCKET").size()) {
|
||||
manager_socket.IPCConnect(qgetenv("VMM_86BOX_SOCKET"));
|
||||
QObject::connect(&manager_socket, &VMManagerClientSocket::pause, main_window, &MainWindow::togglePause);
|
||||
QObject::connect(&manager_socket, &VMManagerClientSocket::resetVM, main_window, &MainWindow::hardReset);
|
||||
QObject::connect(&manager_socket, &VMManagerClientSocket::showsettings, main_window, &MainWindow::showSettings);
|
||||
QObject::connect(&manager_socket, &VMManagerClientSocket::ctrlaltdel, []() { pc_send_cad(); });
|
||||
QObject::connect(&manager_socket, &VMManagerClientSocket::request_shutdown, main_window, &MainWindow::close);
|
||||
QObject::connect(&manager_socket, &VMManagerClientSocket::force_shutdown, []() {
|
||||
do_stop();
|
||||
emit main_window->close();
|
||||
});
|
||||
QObject::connect(main_window, &MainWindow::vmmRunningStateChanged, &manager_socket, &VMManagerClientSocket::clientRunningStateChanged);
|
||||
main_window->installEventFilter(&manager_socket);
|
||||
}
|
||||
|
||||
/* Warn the user about unsupported configs */
|
||||
if (cpu_override) {
|
||||
QMessageBox warningbox(QMessageBox::Icon::Warning, QObject::tr("You are loading an unsupported configuration"),
|
||||
QObject::tr("CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid."),
|
||||
QMessageBox::NoButton, main_window);
|
||||
warningbox.addButton(QObject::tr("Continue"), QMessageBox::AcceptRole);
|
||||
warningbox.addButton(QObject::tr("Exit"), QMessageBox::RejectRole);
|
||||
warningbox.exec();
|
||||
if (warningbox.result() == QDialog::Accepted) {
|
||||
confirm_exit_cmdl = 0; /* skip the confirmation prompt without touching the config */
|
||||
emit main_window->close();
|
||||
}
|
||||
}
|
||||
|
||||
// pc_reset_hard_init();
|
||||
|
||||
QTimer onesec;
|
||||
|
||||
Reference in New Issue
Block a user