49 lines
1.8 KiB
C++
49 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include <QAbstractTableModel>
|
|
|
|
#include <array>
|
|
|
|
#include "entry.h"
|
|
|
|
class VpnModel : public QAbstractTableModel
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
VpnModel(QObject *parent = nullptr);
|
|
|
|
Entry &getEntry(const QModelIndex &index) { return getEntry(index.row()); }
|
|
const Entry &getEntry(const QModelIndex &index) const { return getEntry(index.row()); }
|
|
|
|
Entry &getEntry(int row) { return m_entries[row]; }
|
|
const Entry &getEntry(int row) const { return m_entries[row]; }
|
|
|
|
int rowCount(const QModelIndex &parent) const override;
|
|
int columnCount(const QModelIndex &parent) const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
|
|
|
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
|
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
|
|
|
private slots:
|
|
void entryChanged();
|
|
|
|
private:
|
|
std::array<Entry, 10> m_entries {
|
|
Entry { "Bamboo", "-L 127.1.0.1:2233:bamboo.avibit.com:2233", false },
|
|
Entry { "Bitbucket", "-L 127.2.0.1:2233:bitbucket.avibit.com:2233", false },
|
|
Entry { "Crucible", "-L 127.3.0.1:2233:crucible.avibit.com:2233", false },
|
|
Entry { "Confluence", "-L 127.4.0.1:2233:confluence.avibit.com:2233", false },
|
|
Entry { "Jira", "-L 127.5.0.1:2233:jira.avibit.com:2233", false },
|
|
|
|
Entry { "SVN", "-L 3690:svn.avibit.com:3690", false },
|
|
Entry { "Bitbucket SSH", "-L 127.2.0.1:7999:bitbucket.avibit.com:7999", false },
|
|
Entry { "Timetool", "-L 8080:timetool.avibit.com:8080", false },
|
|
//Entry { "Mirror", "-L 80:mirror.avibit.com:80", true },
|
|
Entry { "Intranet", "-L 80:intranet.avibit.com:80", true },
|
|
Entry { "Sonarqube", "-L 9000:localhost:9000", false }
|
|
};
|
|
};
|