You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.5 KiB
70 lines
1.5 KiB
#pragma once
|
|
|
|
#include <QFrame>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QStackedLayout>
|
|
#include <QTimer>
|
|
#include <QWidget>
|
|
|
|
#include "common/params.h"
|
|
#include "selfdrive/ui/qt/offroad/driverview.h"
|
|
#include "selfdrive/ui/qt/body.h"
|
|
#include "selfdrive/ui/qt/onroad.h"
|
|
#include "selfdrive/ui/qt/sidebar.h"
|
|
#include "selfdrive/ui/qt/widgets/controls.h"
|
|
#include "selfdrive/ui/qt/widgets/offroad_alerts.h"
|
|
#include "selfdrive/ui/ui.h"
|
|
|
|
class OffroadHome : public QFrame {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit OffroadHome(QWidget* parent = 0);
|
|
|
|
private:
|
|
void showEvent(QShowEvent *event) override;
|
|
void hideEvent(QHideEvent *event) override;
|
|
void refresh();
|
|
|
|
Params params;
|
|
|
|
QTimer* timer;
|
|
ElidedLabel* version;
|
|
QStackedLayout* center_layout;
|
|
UpdateAlert *update_widget;
|
|
OffroadAlert* alerts_widget;
|
|
QPushButton* alert_notif;
|
|
QPushButton* update_notif;
|
|
};
|
|
|
|
class HomeWindow : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit HomeWindow(QWidget* parent = 0);
|
|
|
|
signals:
|
|
void openSettings();
|
|
void closeSettings();
|
|
|
|
public slots:
|
|
void offroadTransition(bool offroad);
|
|
void showDriverView(bool show);
|
|
void showSidebar(bool show);
|
|
|
|
protected:
|
|
void mousePressEvent(QMouseEvent* e) override;
|
|
void mouseDoubleClickEvent(QMouseEvent* e) override;
|
|
|
|
private:
|
|
Sidebar *sidebar;
|
|
OffroadHome *home;
|
|
OnroadWindow *onroad;
|
|
BodyWindow *body;
|
|
DriverViewWindow *driver_view;
|
|
QStackedLayout *slayout;
|
|
|
|
private slots:
|
|
void updateState(const UIState &s);
|
|
};
|
|
|