mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-18 14:52:08 +08:00
beef2f0be9
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.
34 lines
811 B
C++
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 ¶m = "");
|
|
void closeSettings();
|
|
|
|
QStackedLayout *main_layout;
|
|
HomeWindow *homeWindow;
|
|
SettingsWindow *settingsWindow;
|
|
OnboardingWindow *onboardingWindow;
|
|
};
|