2021-09-20 21:51:28 +03:00
|
|
|
#ifndef SERVER_CONFIGURING_PROGRESS_LOGIC_H
|
|
|
|
|
#define SERVER_CONFIGURING_PROGRESS_LOGIC_H
|
2021-09-07 11:48:25 +03:00
|
|
|
|
2021-09-21 01:49:28 +03:00
|
|
|
#include <functional>
|
2021-09-07 21:01:56 +03:00
|
|
|
#include "PageLogicBase.h"
|
2022-08-25 17:35:28 +03:00
|
|
|
#include "core/defs.h"
|
|
|
|
|
|
|
|
|
|
using namespace amnezia;
|
2021-09-07 11:48:25 +03:00
|
|
|
|
|
|
|
|
class UiLogic;
|
|
|
|
|
|
2021-09-20 21:51:28 +03:00
|
|
|
class ServerConfiguringProgressLogic : public PageLogicBase
|
2021-09-07 11:48:25 +03:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
2021-09-07 22:11:43 +03:00
|
|
|
AUTO_PROPERTY(double, progressBarValue)
|
|
|
|
|
AUTO_PROPERTY(bool, labelWaitInfoVisible)
|
|
|
|
|
AUTO_PROPERTY(QString, labelWaitInfoText)
|
|
|
|
|
AUTO_PROPERTY(bool, progressBarVisible)
|
|
|
|
|
AUTO_PROPERTY(int, progressBarMaximium)
|
|
|
|
|
AUTO_PROPERTY(bool, progressBarTextVisible)
|
|
|
|
|
AUTO_PROPERTY(QString, progressBarText)
|
2021-09-07 11:48:25 +03:00
|
|
|
|
|
|
|
|
public:
|
2021-09-20 21:51:28 +03:00
|
|
|
explicit ServerConfiguringProgressLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
|
|
|
|
~ServerConfiguringProgressLogic() = default;
|
2021-09-07 11:48:25 +03:00
|
|
|
|
2021-11-06 13:47:52 +03:00
|
|
|
void onUpdatePage() override;
|
2021-09-21 01:49:28 +03:00
|
|
|
ErrorCode doInstallAction(const std::function<ErrorCode()> &action);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
struct ProgressFunc {
|
|
|
|
|
std::function<void(bool)> setVisibleFunc;
|
|
|
|
|
std::function<void(int)> setValueFunc;
|
|
|
|
|
std::function<int(void)> getValueFunc;
|
|
|
|
|
std::function<int(void)> getMaximiumFunc;
|
|
|
|
|
std::function<void(bool)> setTextVisibleFunc;
|
|
|
|
|
std::function<void(const QString&)> setTextFunc;
|
|
|
|
|
};
|
|
|
|
|
struct PageFunc {
|
|
|
|
|
std::function<void(bool)> setEnabledFunc;
|
|
|
|
|
};
|
|
|
|
|
struct ButtonFunc {
|
|
|
|
|
std::function<void(bool)> setVisibleFunc;
|
|
|
|
|
};
|
|
|
|
|
struct LabelFunc {
|
|
|
|
|
std::function<void(bool)> setVisibleFunc;
|
|
|
|
|
std::function<void(const QString&)> setTextFunc;
|
|
|
|
|
};
|
|
|
|
|
|
2021-09-07 11:48:25 +03:00
|
|
|
};
|
2021-09-20 21:51:28 +03:00
|
|
|
#endif // SERVER_CONFIGURING_PROGRESS_LOGIC_H
|