QML ServerContainers page refact
This commit is contained in:
parent
9ae2e3fba2
commit
0faf6c8599
90 changed files with 5651 additions and 125 deletions
|
@ -113,6 +113,7 @@ constexpr char serverPskKeyPath[] = "/opt/amnezia/wireguard/wireguard_psk.key";
|
|||
|
||||
} // namespace protocols
|
||||
|
||||
Q_NAMESPACE
|
||||
enum class Protocol {
|
||||
Any,
|
||||
OpenVpn,
|
||||
|
@ -120,6 +121,8 @@ enum class Protocol {
|
|||
Cloak,
|
||||
WireGuard
|
||||
};
|
||||
Q_ENUM_NS(Protocol)
|
||||
|
||||
QVector<Protocol> allProtocols();
|
||||
|
||||
Protocol protoFromString(QString proto);
|
||||
|
@ -129,6 +132,16 @@ QMap<Protocol, QString> protocolHumanNames();
|
|||
QMap<Protocol, QString> protocolDescriptions();
|
||||
bool isProtocolVpnType(Protocol p);
|
||||
|
||||
static void declareQmlProtocolEnum() {
|
||||
qmlRegisterUncreatableMetaObject(
|
||||
PageEnumNS::staticMetaObject,
|
||||
"ProtocolEnum",
|
||||
1, 0,
|
||||
"ProtocolEnum",
|
||||
"Error: only enums"
|
||||
);
|
||||
}
|
||||
|
||||
} // namespace amnezia
|
||||
|
||||
QDebug operator<<(QDebug debug, const amnezia::Protocol &p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue