Merge pull request #6004 from 86Box/feature/vmm-config-toggle
Enable VM Manager by default
This commit is contained in:
@@ -584,7 +584,7 @@ main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!vmm_enabled)
|
||||
if (!start_vmm)
|
||||
#ifdef Q_OS_MACOS
|
||||
qt_set_sequence_auto_mnemonic(false);
|
||||
#else
|
||||
@@ -625,10 +625,7 @@ main(int argc, char *argv[])
|
||||
return 6;
|
||||
}
|
||||
|
||||
if (!vmm_enabled)
|
||||
pc_init_modules();
|
||||
|
||||
if (vmm_enabled) {
|
||||
if (start_vmm) {
|
||||
// VMManagerMain vmm;
|
||||
// // Hackish until there is a proper solution
|
||||
// QApplication::setApplicationName("86Box VM Manager");
|
||||
@@ -643,6 +640,8 @@ main(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
pc_init_modules();
|
||||
|
||||
// UUID / copy / move detection
|
||||
if(!util::compareUuid()) {
|
||||
QMessageBox movewarnbox;
|
||||
|
||||
@@ -694,6 +694,13 @@ plat_get_temp_dir(char *outbuf, const uint8_t len)
|
||||
strncpy(outbuf, dir.canonicalPath().toUtf8().constData(), len);
|
||||
}
|
||||
|
||||
void
|
||||
plat_get_vmm_dir(char *outbuf, const size_t len)
|
||||
{
|
||||
const auto path = QDir::home().filePath("86Box VMs");
|
||||
strncpy(outbuf, path.toUtf8().constData(), len);
|
||||
}
|
||||
|
||||
void
|
||||
plat_init_rom_paths(void)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ StyleOverride::styleHint(
|
||||
QStyleHintReturn *returnData) const
|
||||
{
|
||||
/* Disable using menu with alt key */
|
||||
if (!vmm_enabled && (!kbd_req_capture || mouse_capture) && (hint == QStyle::SH_MenuBar_AltKeyNavigation))
|
||||
if (!start_vmm && (!kbd_req_capture || mouse_capture) && (hint == QStyle::SH_MenuBar_AltKeyNavigation))
|
||||
return 0;
|
||||
|
||||
return QProxyStyle::styleHint(hint, option, widget, returnData);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QStyle>
|
||||
#include <cstring>
|
||||
|
||||
#include "qt_progsettings.hpp"
|
||||
#include "qt_vmmanager_preferences.hpp"
|
||||
@@ -37,7 +38,7 @@ VMManagerPreferences(QWidget *parent) : ui(new Ui::VMManagerPreferences)
|
||||
connect(ui->dirSelectButton, &QPushButton::clicked, this, &VMManagerPreferences::chooseDirectoryLocation);
|
||||
|
||||
const auto config = new VMManagerConfig(VMManagerConfig::ConfigType::General);
|
||||
const auto configSystemDir = config->getStringValue("system_directory");
|
||||
const auto configSystemDir = QString(vmm_path_cfg);
|
||||
if(!configSystemDir.isEmpty()) {
|
||||
// Prefer this one
|
||||
ui->systemDirectory->setText(configSystemDir);
|
||||
@@ -91,8 +92,8 @@ void
|
||||
VMManagerPreferences::accept()
|
||||
{
|
||||
const auto config = new VMManagerConfig(VMManagerConfig::ConfigType::General);
|
||||
config->setStringValue("system_directory", ui->systemDirectory->text());
|
||||
|
||||
strncpy(vmm_path_cfg, ui->systemDirectory->text().toUtf8().constData(), sizeof(vmm_path_cfg) - 1);
|
||||
lang_id = ui->comboBoxLanguage->currentData().toInt();
|
||||
config_save_global();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user