From d02fc4b6115d391e4f2c6886333010639a77a3a7 Mon Sep 17 00:00:00 2001 From: Sander Speetjens Date: Fri, 17 Oct 2025 20:47:01 +0200 Subject: [PATCH] client clean up mainwindow files --- client/mainwindow.cpp | 2 ++ client/mainwindow.hpp | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index 69acf58..42708ee 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -1,5 +1,7 @@ #include "mainwindow.hpp" +#include "simulator_base.hpp" #include "ui_mainwindow.h" +#include "web_socket_wrapper.hpp" #include #include #include diff --git a/client/mainwindow.hpp b/client/mainwindow.hpp index d493867..23d2f4a 100644 --- a/client/mainwindow.hpp +++ b/client/mainwindow.hpp @@ -1,13 +1,16 @@ #pragma once -#include "simulator_base.hpp" -#include "web_socket_wrapper.hpp" +#include "nlohmann/json.hpp" #include #include +using json = nlohmann::json; + #define INSERT_SIMULATOR(type) \ m_sims.insert(std::make_pair(type().sim_name(), std::make_unique(m_web_socket.get(), this))) Q_FORWARD_DECLARE_OBJC_CLASS(QMessageBox); +Q_FORWARD_DECLARE_OBJC_CLASS(Web_socket_wrapper); +Q_FORWARD_DECLARE_OBJC_CLASS(Simulator_base); namespace Ui { @@ -22,6 +25,10 @@ class MainWindow : public QMainWindow explicit MainWindow(QUrl ws_url, QString sim, QWidget *parent = nullptr); ~MainWindow(); + private: + void showEvent(QShowEvent *event); + void hideEvent(QHideEvent *event); + void default_sim(QString name); void pase_sim_names(json &sims); void open_sim_window(void); @@ -29,10 +36,6 @@ class MainWindow : public QMainWindow void open_sim(QString sim_name); void setup_cb(void); - private: - void showEvent(QShowEvent *event); - void hideEvent(QHideEvent *event); - void on_cmd_cb(json &j); bool m_default_sim = false;