2020-11-25 14:40:16 +01:00
|
|
|
/****************************************************************************
|
|
|
|
** Modern Linbo GUI
|
|
|
|
** Copyright (C) 2020 Dorian Zedler <dorian@itsblue.de>
|
|
|
|
**
|
|
|
|
** This program is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU Affero General Public License as published
|
|
|
|
** by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** This program is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU Affero General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU Affero General Public License
|
|
|
|
** along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2020-11-19 14:39:32 +01:00
|
|
|
#ifndef LINBOSTARTACTIONS_H
|
|
|
|
#define LINBOSTARTACTIONS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QStackedWidget>
|
2020-11-20 15:09:36 +01:00
|
|
|
#include <QList>
|
2020-11-24 20:25:39 +01:00
|
|
|
#include <QLabel>
|
2020-11-19 14:39:32 +01:00
|
|
|
|
|
|
|
#include "linbobackend.h"
|
2020-11-24 20:25:39 +01:00
|
|
|
#include "linbologger.h"
|
2020-11-19 14:39:32 +01:00
|
|
|
#include "linboosselectionrow.h"
|
|
|
|
#include "qmodernstackedwidget.h"
|
|
|
|
#include "qmodernpushbutton.h"
|
|
|
|
#include "qmodernprogressbar.h"
|
|
|
|
|
|
|
|
class LinboStartActions : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2020-11-23 11:57:51 +01:00
|
|
|
explicit LinboStartActions(LinboBackend* backend, QWidget *parent = nullptr);
|
2020-11-19 14:39:32 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
LinboBackend* backend;
|
|
|
|
|
|
|
|
QModernStackedWidget* stackView;
|
|
|
|
|
|
|
|
QWidget* buttonWidget;
|
2020-11-20 15:09:36 +01:00
|
|
|
QModernPushButton* startOsButton;
|
|
|
|
QModernPushButton* syncOsButton;
|
|
|
|
QModernPushButton* reinstallOsButton;
|
|
|
|
QList<QModernPushButton*> actionButtons;
|
2020-11-25 14:40:16 +01:00
|
|
|
QLabel* noBaseImageLabel;
|
|
|
|
QFont noBaseImageLabelFont;
|
2020-11-19 14:39:32 +01:00
|
|
|
|
|
|
|
QWidget* progressBarWidget;
|
|
|
|
QModernProgressBar* progressBar;
|
2020-11-24 20:25:39 +01:00
|
|
|
QFont logFont;
|
|
|
|
QLabel* logLabel;
|
2020-11-26 15:53:27 +01:00
|
|
|
QModernPushButton* cancelButton;
|
|
|
|
|
|
|
|
QWidget* errorWidget;
|
|
|
|
QVBoxLayout* errorLayout;
|
|
|
|
QLabel* errorLabel;
|
|
|
|
QFont errorLabelFont;
|
|
|
|
QLabel* errorDetailsLabel;
|
|
|
|
QFont errorDetailsFont;
|
|
|
|
QModernPushButton* resetErrorButton;
|
2020-11-19 14:39:32 +01:00
|
|
|
|
2020-11-23 11:57:51 +01:00
|
|
|
bool inited;
|
2020-11-19 14:39:32 +01:00
|
|
|
|
|
|
|
private slots:
|
2020-11-23 11:57:51 +01:00
|
|
|
void resizeAndPositionAllItems();
|
|
|
|
void handleCurrentOsChanged(LinboOs* newOs);
|
|
|
|
void handleLinboStateChanged(LinboBackend::LinboState newState);
|
2020-11-24 20:25:39 +01:00
|
|
|
void handleLatestLogChanged(const LinboLogger::LinboLog& latestLog);
|
2020-11-24 21:42:47 +01:00
|
|
|
void handleAutostartTimeoutProgressChanged();
|
2020-11-19 14:39:32 +01:00
|
|
|
|
|
|
|
signals:
|
2020-11-20 15:09:36 +01:00
|
|
|
void selectedOsChanged();
|
2020-11-19 14:39:32 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LINBOSTARTACTIONS_H
|