added installController with logic for server/container installation

This commit is contained in:
vladimir.kuznetsov 2023-05-17 23:28:27 +08:00
parent 03a0e2084a
commit acca85b99a
19 changed files with 519 additions and 151 deletions

View file

@ -15,12 +15,14 @@ class ContainersModel : public QAbstractListModel
public:
ContainersModel(std::shared_ptr<Settings> settings, QObject *parent = nullptr);
public:
enum ContainersModelRoles {
enum Roles {
NameRole = Qt::UserRole + 1,
DescRole,
ServiceTypeRole,
ConfigRole,
DockerContainerRole,
IsInstalledRole,
IsCurrentlyInstalled,
IsDefaultRole
};
@ -28,20 +30,20 @@ public:
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Q_INVOKABLE void setSelectedServerIndex(int index);
Q_INVOKABLE void setCurrentlyInstalledContainerIndex(int index);
Q_INVOKABLE QString getCurrentlyInstalledContainerName();
public slots:
DockerContainer getDefaultContainer();
void setCurrentlyProcessedServerIndex(int index);
void setCurrentlyInstalledContainerIndex(int index);
int getCurrentlyInstalledContainerIndex();
protected:
QHash<int, QByteArray> roleNames() const override;
private:
int m_selectedServerIndex;
QModelIndex m_currentlyInstalledContainerIndex;
int m_currentlyProcessedServerIndex;
int m_currentlyInstalledContainerIndex;
std::shared_ptr<Settings> m_settings;
};