2021-09-04 12:53:58 +03:00
|
|
|
#ifndef START_PAGE_LOGIC_H
|
|
|
|
|
#define START_PAGE_LOGIC_H
|
|
|
|
|
|
2021-09-07 21:01:56 +03:00
|
|
|
#include "PageLogicBase.h"
|
2021-09-04 12:53:58 +03:00
|
|
|
|
2022-10-15 19:46:26 +03:00
|
|
|
#include <QRegularExpression>
|
2022-08-29 12:21:09 +04:30
|
|
|
|
2021-09-04 12:53:58 +03:00
|
|
|
class UiLogic;
|
|
|
|
|
|
2021-09-07 21:01:56 +03:00
|
|
|
class StartPageLogic : public PageLogicBase
|
2021-09-04 12:53:58 +03:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
2021-09-08 14:23:02 +03:00
|
|
|
AUTO_PROPERTY(bool, pushButtonConnectEnabled)
|
|
|
|
|
AUTO_PROPERTY(bool, pushButtonConnectKeyChecked)
|
|
|
|
|
AUTO_PROPERTY(QString, pushButtonConnectText)
|
2021-09-08 13:52:36 +03:00
|
|
|
AUTO_PROPERTY(QString, lineEditStartExistingCodeText)
|
2021-09-08 14:23:02 +03:00
|
|
|
AUTO_PROPERTY(QString, textEditSshKeyText)
|
|
|
|
|
AUTO_PROPERTY(QString, lineEditIpText)
|
|
|
|
|
AUTO_PROPERTY(QString, lineEditPasswordText)
|
|
|
|
|
AUTO_PROPERTY(QString, lineEditLoginText)
|
|
|
|
|
AUTO_PROPERTY(bool, labelWaitInfoVisible)
|
|
|
|
|
AUTO_PROPERTY(QString, labelWaitInfoText)
|
2021-09-08 13:52:36 +03:00
|
|
|
AUTO_PROPERTY(bool, pushButtonBackFromStartVisible)
|
|
|
|
|
|
2022-08-29 12:21:09 +04:30
|
|
|
READONLY_PROPERTY(QRegularExpression, ipAddressPortRegex)
|
2021-09-04 12:53:58 +03:00
|
|
|
public:
|
2021-09-22 14:49:08 +03:00
|
|
|
Q_INVOKABLE void onUpdatePage() override;
|
2021-09-04 12:53:58 +03:00
|
|
|
|
2021-09-08 14:23:02 +03:00
|
|
|
Q_INVOKABLE void onPushButtonConnect();
|
|
|
|
|
Q_INVOKABLE void onPushButtonImport();
|
2021-12-20 02:29:23 +03:00
|
|
|
Q_INVOKABLE void onPushButtonImportOpenFile();
|
|
|
|
|
|
|
|
|
|
bool importConnection(const QJsonObject &profile);
|
|
|
|
|
bool importConnectionFromCode(QString code);
|
|
|
|
|
bool importConnectionFromQr(const QByteArray &data);
|
2021-09-04 12:53:58 +03:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit StartPageLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
|
|
|
|
~StartPageLogic() = default;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
#endif // START_PAGE_LOGIC_H
|