Files
StarPilot/selfdrive/ui/qt/widgets/offroad_alerts.h
T
Dean Lee 97e9d55588 cpplint: build/include_what_you_use (#29556)
* include_what_you_use

* remove comments

* include <memory>

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 2d99521e7500902070d0aacce69528bcfd8b9964
2023-08-23 13:25:17 -07:00

47 lines
755 B
C++

#pragma once
#include <map>
#include <string>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include "common/params.h"
class AbstractAlert : public QFrame {
Q_OBJECT
protected:
AbstractAlert(bool hasRebootBtn, QWidget *parent = nullptr);
QPushButton *snooze_btn;
QVBoxLayout *scrollable_layout;
Params params;
signals:
void dismiss();
};
class UpdateAlert : public AbstractAlert {
Q_OBJECT
public:
UpdateAlert(QWidget *parent = 0);
bool refresh();
private:
QLabel *releaseNotes = nullptr;
};
class OffroadAlert : public AbstractAlert {
Q_OBJECT
public:
explicit OffroadAlert(QWidget *parent = 0) : AbstractAlert(false, parent) {}
int refresh();
private:
std::map<std::string, QLabel*> alerts;
};