mirror of
https://github.com/86Box/86Box.git
synced 2026-02-24 02:18:20 -07:00
clang-format in src/qt
This commit is contained in:
@@ -30,17 +30,16 @@
|
||||
#include <QCloseEvent>
|
||||
#include <QDesktopServices>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
extern "C" {
|
||||
extern void config_load_global();
|
||||
extern void config_save_global();
|
||||
}
|
||||
|
||||
VMManagerMainWindow* vmm_main_window = nullptr;
|
||||
extern WindowsDarkModeFilter* vmm_dark_mode_filter;
|
||||
VMManagerMainWindow *vmm_main_window = nullptr;
|
||||
extern WindowsDarkModeFilter *vmm_dark_mode_filter;
|
||||
|
||||
VMManagerMainWindow::
|
||||
VMManagerMainWindow(QWidget *parent)
|
||||
VMManagerMainWindow(QWidget *parent)
|
||||
: ui(new Ui::VMManagerMainWindow)
|
||||
, vmm(new VMManagerMain(this))
|
||||
, statusLeft(new QLabel)
|
||||
@@ -63,14 +62,14 @@ VMManagerMainWindow(QWidget *parent)
|
||||
connect(ui->actionHard_Reset, &QAction::triggered, vmm, &VMManagerMain::restartButtonPressed);
|
||||
connect(ui->actionForce_Shutdown, &QAction::triggered, vmm, &VMManagerMain::shutdownForceButtonPressed);
|
||||
|
||||
// Set up menu actions
|
||||
// (Disable this if the EMU_BUILD_NUM == 0)
|
||||
#if EMU_BUILD_NUM == 0
|
||||
ui->actionCheck_for_updates->setVisible(false);
|
||||
#else
|
||||
connect(ui->actionCheck_for_updates, &QAction::triggered, this, &VMManagerMainWindow::checkForUpdatesTriggered);
|
||||
#endif
|
||||
|
||||
// Set up menu actions
|
||||
// (Disable this if the EMU_BUILD_NUM == 0)
|
||||
#if EMU_BUILD_NUM == 0
|
||||
ui->actionCheck_for_updates->setVisible(false);
|
||||
#else
|
||||
connect(ui->actionCheck_for_updates, &QAction::triggered, this, &VMManagerMainWindow::checkForUpdatesTriggered);
|
||||
#endif
|
||||
|
||||
// TODO: Remove all of this (all the way to END REMOVE) once certain the search will no longer be in the toolbar.
|
||||
// BEGIN REMOVE
|
||||
// Everything is still setup here for it but it is all hidden. None of it will be
|
||||
@@ -90,7 +89,7 @@ VMManagerMainWindow(QWidget *parent)
|
||||
searchBar->setClearButtonEnabled(true);
|
||||
// Spacer to make the search go all the way to the right
|
||||
const auto spacer = new QWidget();
|
||||
spacer->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
|
||||
spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||
ui->toolBar->addWidget(spacer);
|
||||
ui->toolBar->addWidget(searchBar);
|
||||
// Connect signal for search
|
||||
@@ -127,7 +126,7 @@ VMManagerMainWindow(QWidget *parent)
|
||||
connect(this, &VMManagerMainWindow::languageUpdated, vmm, &VMManagerMain::onLanguageUpdated);
|
||||
#ifdef Q_OS_WINDOWS
|
||||
connect(this, &VMManagerMainWindow::darkModeUpdated, vmm, &VMManagerMain::onDarkModeUpdated);
|
||||
connect(this, &VMManagerMainWindow::preferencesUpdated, [] () { vmm_dark_mode_filter->reselectDarkMode(); });
|
||||
connect(this, &VMManagerMainWindow::preferencesUpdated, []() { vmm_dark_mode_filter->reselectDarkMode(); });
|
||||
#endif
|
||||
|
||||
{
|
||||
@@ -136,7 +135,7 @@ VMManagerMainWindow(QWidget *parent)
|
||||
QString coords = config->getStringValue("window_coordinates");
|
||||
if (!coords.isEmpty()) {
|
||||
QStringList list = coords.split(',');
|
||||
for (auto& cur : list) {
|
||||
for (auto &cur : list) {
|
||||
cur = cur.trimmed();
|
||||
}
|
||||
QRect geom;
|
||||
@@ -155,7 +154,7 @@ VMManagerMainWindow(QWidget *parent)
|
||||
QString splitter = config->getStringValue("window_splitter");
|
||||
if (!splitter.isEmpty()) {
|
||||
QStringList list = splitter.split(',');
|
||||
for (auto& cur : list) {
|
||||
for (auto &cur : list) {
|
||||
cur = cur.trimmed();
|
||||
}
|
||||
QList<int> paneSizes;
|
||||
@@ -173,8 +172,7 @@ VMManagerMainWindow(QWidget *parent)
|
||||
}
|
||||
}
|
||||
|
||||
VMManagerMainWindow::~
|
||||
VMManagerMainWindow()
|
||||
VMManagerMainWindow::~VMManagerMainWindow()
|
||||
= default;
|
||||
|
||||
void
|
||||
@@ -224,7 +222,7 @@ void
|
||||
VMManagerMainWindow::saveSettings() const
|
||||
{
|
||||
const auto currentSelection = vmm->getCurrentSelection();
|
||||
const auto config = new VMManagerConfig(VMManagerConfig::ConfigType::General);
|
||||
const auto config = new VMManagerConfig(VMManagerConfig::ConfigType::General);
|
||||
config->setStringValue("last_selection", currentSelection);
|
||||
if (!!config->getStringValue("window_remember").toInt()) {
|
||||
config->setStringValue("window_coordinates", QString::asprintf("%i, %i, %i, %i", this->geometry().x(), this->geometry().y(), this->geometry().width(), this->geometry().height()));
|
||||
@@ -249,7 +247,6 @@ VMManagerMainWindow::updateLanguage()
|
||||
emit languageUpdated();
|
||||
}
|
||||
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
void
|
||||
VMManagerMainWindow::updateDarkMode()
|
||||
|
||||
Reference in New Issue
Block a user