Reflect language and color scheme changes in global config in manager and all its VMs

This commit is contained in:
Cacodemon345
2025-08-28 17:56:33 +06:00
parent 4f81c12b81
commit 30524acbbd
22 changed files with 194 additions and 44 deletions

View File

@@ -31,10 +31,13 @@
#include <atomic>
#include "qt_vmmanager_main.hpp"
#include "qt_vmmanager_mainwindow.hpp"
#include "ui_qt_vmmanager_main.h"
#include "qt_vmmanager_model.hpp"
#include "qt_vmmanager_addmachine.hpp"
extern VMManagerMainWindow* vmm_main_window;
// https://stackoverflow.com/a/36460740
bool copyPath(QString sourceDir, QString destinationDir, bool overWriteDirectory)
{
@@ -348,6 +351,10 @@ illegal_chars:
}
});
connect(vm_model, &VMManagerModel::globalConfigurationChanged, this, [this] () {
vmm_main_window->updateSettings();
});
// Initial default details view
vm_details = new VMManagerDetails(ui->detailsArea);
ui->detailsArea->layout()->addWidget(vm_details);
@@ -400,6 +407,12 @@ VMManagerMain::~VMManagerMain() {
delete vm_model;
}
void
VMManagerMain::updateGlobalSettings()
{
vmm_main_window->updateSettings();
}
void
VMManagerMain::currentSelectionChanged(const QModelIndex &current,
const QModelIndex &previous)
@@ -768,6 +781,10 @@ VMManagerMain::onPreferencesUpdated()
if (oldRegexSearch != regexSearch) {
ui->searchBar->clear();
}
if (vm_model) {
vm_model->sendGlobalConfigurationChanged();
}
}
void