1
0
forked from BRT/arc
arc/views/MainWindow.h

53 lines
1.4 KiB
C++

#pragma once
#include <QListWidget>
#include <QMainWindow>
#include <QVBoxLayout>
#include <QStackedWidget>
#include <QTimer>
#include <QLabel>
#include <QPixmap>
#include "TutorialWindow.h"
#include "bank/AccountWindow.h"
#include "db/DeviceInfo.h"
#include "log/FileLogWindow.h"
#include "widget/common/FlowLayout.h"
class MainWindow final : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
void loadDevices();
public slots:
// Подключается к NetworkService::syncHealthChanged. healthy=false показывает
// индикатор «нет связи» в status bar, healthy=true прячет (правило #9).
void setSyncHealth(bool healthy, int consecutiveFailures);
private:
QWidget *central;
FlowLayout *flowLayout;
QTimer *timer;
QStackedWidget *stackedWidget;
QLabel *m_noDevicesLabel = nullptr;
QPixmap m_noDevicesPixmap;
QWidget *m_scrollArea = nullptr;
QWidget *m_devicesWindow = nullptr;
QWidget *m_accountsWindow = nullptr;
QWidget *m_tutorialWindow = nullptr;
QWidget *m_bankListWindow = nullptr;
FileLogWindow *m_fileLogWindow = nullptr;
QWidget *m_eventWindow = nullptr;
QListWidget *m_logList = nullptr;
QLabel *m_syncHealthLabel = nullptr;
void createDevicePage();
void deleteDevicePage();
void updateLogPanel();
void resizeEvent(QResizeEvent *event) override;
};