[Subscription] Added vmess convertion option for Subscriptions

Former-commit-id: f88d5986cf
This commit is contained in:
Leroy.H.Y 2019-08-27 14:26:54 +08:00
parent 621bc1efdf
commit 94b46523f1
4 changed files with 8 additions and 8 deletions

View File

@ -56,7 +56,7 @@ namespace Qv2ray
bool SaveConnectionConfig(QJsonObject obj, const QString *alias);
bool RenameConnection(QString originalName, QString newName);
// VMess Protocol
QJsonObject ConvertConfigFromVMessString(QString vmess);
QJsonObject ConvertConfigFromVMessString(QString vmess, QString source = QV2RAY_CONFIG_TYPE_CONNECTIONSTRING);
QJsonObject ConvertConfigFromFile(QString sourceFilePath, bool overrideInbounds);
// Load Configs
QMap<QString, QJsonObject> GetConnections(list<string> connections);

View File

@ -11,7 +11,7 @@ namespace Qv2ray
}
// This generates global config containing only one outbound....
QJsonObject ConvertConfigFromVMessString(QString str)
QJsonObject ConvertConfigFromVMessString(QString str, QString source)
{
DROOT
QStringRef vmessJsonB64(&str, 8, str.length() - 8);
@ -66,7 +66,7 @@ namespace Qv2ray
outbounds.append(outbound);
root.insert("outbounds", outbounds);
root.insert("QV2RAY_ALIAS", QString::fromStdString(vmessConf.ps));
root.insert(QV2RAY_CONFIG_TYPE_JSON_KEY, QV2RAY_CONFIG_TYPE_CONNECTIONSTRING);
root.insert(QV2RAY_CONFIG_TYPE_JSON_KEY, source);
RROOT
}

View File

@ -1,5 +1,5 @@
#include "w_RouteEditor.h"
#include "ui_w_OutboundEditor.h"
#include "ui_w_RouteEditor.h"
RouteEditor::RouteEditor(QWidget *parent) :
QDialog(parent),

View File

@ -98,10 +98,10 @@
<widget class="QListWidget" name="subscribeList">
<property name="geometry">
<rect>
<x>530</x>
<y>101</y>
<width>181</width>
<height>121</height>
<x>430</x>
<y>10</y>
<width>281</width>
<height>211</height>
</rect>
</property>
</widget>