Files
sunnypilot/selfdrive/ui/qt/window.h
T
DevTekVE beef2f0be9 Refactor SunnyPilot preprocessor directives in UI code
This commit simplifies the conditional preprocessor directives related to SunnyPilot in various parts of the UI code. The previous use of #ifdef SUNNYPILOT has been consolidated to make the code cleaner and easier to read. Also, some unused code blocks have been removed. This refactoring simplifies the management of different configuration setups.
2024-07-14 11:43:10 +02:00

34 lines
811 B
C++

#pragma once
#include <QStackedLayout>
#include <QWidget>
#include "selfdrive/ui/qt/offroad/onboarding.h"
#ifdef SUNNYPILOT
#include "selfdrive/ui/sunnypilot/qt/offroad/sp_priv_settings.h"
#include "selfdrive/ui/sunnypilot/qt/sp_priv_home.h"
#define HomeWindow HomeWindowSP
#define SettingsWindow SettingsWindowSP
#else
#include "selfdrive/ui/qt/offroad/settings.h"
#include "selfdrive/ui/qt/home.h"
#endif
class MainWindow : public QWidget {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
private:
bool eventFilter(QObject *obj, QEvent *event) override;
void openSettings(int index = 0, const QString &param = "");
void closeSettings();
QStackedLayout *main_layout;
HomeWindow *homeWindow;
SettingsWindow *settingsWindow;
OnboardingWindow *onboardingWindow;
};