mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
fix
This commit is contained in:
@@ -34,5 +34,5 @@ popd
|
||||
|
||||
#### Go: nekobox_core ####
|
||||
pushd go/cmd/nekobox_core
|
||||
go build -v -o $DEST -trimpath -ldflags "-w -s -X $neko_common.Version_neko=$version_standalone" -tags "with_grpc,with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api"
|
||||
go build -v -o $DEST -trimpath -ldflags "-w -s -X $neko_common.Version_neko=$version_standalone" -tags "with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api"
|
||||
popd
|
||||
|
||||
@@ -23,27 +23,37 @@
|
||||
#define D_C_SAVE_STRING(a) NekoGui::dataStore->a = CACHE.a;
|
||||
|
||||
#define P_LOAD_STRING(a) ui->a->setText(bean->a);
|
||||
#define P_LOAD_STRING_PLAIN(a) ui->a->setPlainText(bean->a);
|
||||
#define P_SAVE_STRING(a) bean->a = ui->a->text();
|
||||
#define P_SAVE_STRING_QTEXTEDIT(a) bean->a = ui->a->toPlainText();
|
||||
#define P_SAVE_STRING_PLAIN(a) bean->a = ui->a->toPlainText();
|
||||
|
||||
#define D_LOAD_STRING(a) ui->a->setText(NekoGui::dataStore->a);
|
||||
#define D_LOAD_STRING_PLAIN(a) ui->a->setPlainText(NekoGui::dataStore->a);
|
||||
#define D_SAVE_STRING(a) NekoGui::dataStore->a = ui->a->text();
|
||||
#define D_SAVE_STRING_QTEXTEDIT(a) NekoGui::dataStore->a = ui->a->toPlainText();
|
||||
#define D_SAVE_STRING_PLAIN(a) NekoGui::dataStore->a = ui->a->toPlainText();
|
||||
|
||||
#define P_LOAD_INT(a) \
|
||||
ui->a->setText(Int2String(bean->a)); \
|
||||
ui->a->setValidator(QRegExpValidator_Number);
|
||||
#define P_SAVE_INT(a) bean->a = ui->a->text().toInt();
|
||||
|
||||
#define D_LOAD_INT(a) \
|
||||
ui->a->setText(Int2String(NekoGui::dataStore->a)); \
|
||||
ui->a->setValidator(QRegExpValidator_Number);
|
||||
#define D_SAVE_INT(a) NekoGui::dataStore->a = ui->a->text().toInt();
|
||||
|
||||
#define P_LOAD_COMBO_STRING(a) ui->a->setCurrentText(bean->a);
|
||||
#define P_SAVE_COMBO_STRING(a) bean->a = ui->a->currentText();
|
||||
|
||||
#define D_LOAD_COMBO_STRING(a) ui->a->setCurrentText(NekoGui::dataStore->a);
|
||||
#define D_SAVE_COMBO_STRING(a) NekoGui::dataStore->a = ui->a->currentText();
|
||||
|
||||
#define P_LOAD_COMBO_INT(a) ui->a->setCurrentIndex(bean->a);
|
||||
#define P_SAVE_COMBO_INT(a) bean->a = ui->a->currentIndex();
|
||||
|
||||
#define D_LOAD_BOOL(a) ui->a->setChecked(NekoGui::dataStore->a);
|
||||
#define D_SAVE_BOOL(a) NekoGui::dataStore->a = ui->a->isChecked();
|
||||
|
||||
#define P_LOAD_BOOL(a) ui->a->setChecked(bean->a);
|
||||
#define P_SAVE_BOOL(a) bean->a = ui->a->isChecked();
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ DialogVPNSettings::DialogVPNSettings(QWidget *parent) : QDialog(parent), ui(new
|
||||
ui->single_core->setVisible(IS_NEKO_BOX);
|
||||
ui->single_core->setChecked(NekoGui::dataStore->vpn_internal_tun);
|
||||
//
|
||||
D_LOAD_STRING(vpn_rule_cidr)
|
||||
D_LOAD_STRING(vpn_rule_process)
|
||||
D_LOAD_STRING_PLAIN(vpn_rule_cidr)
|
||||
D_LOAD_STRING_PLAIN(vpn_rule_process)
|
||||
//
|
||||
connect(ui->whitelist_mode, &QCheckBox::stateChanged, this, [=](int state) {
|
||||
if (state == Qt::Checked) {
|
||||
@@ -57,8 +57,8 @@ void DialogVPNSettings::accept() {
|
||||
NekoGui::dataStore->vpn_rule_white = ui->whitelist_mode->isChecked();
|
||||
NekoGui::dataStore->vpn_internal_tun = ui->single_core->isChecked();
|
||||
//
|
||||
D_SAVE_STRING_QTEXTEDIT(vpn_rule_cidr)
|
||||
D_SAVE_STRING_QTEXTEDIT(vpn_rule_process)
|
||||
D_SAVE_STRING_PLAIN(vpn_rule_cidr)
|
||||
D_SAVE_STRING_PLAIN(vpn_rule_process)
|
||||
//
|
||||
MW_dialog_message("", "UpdateDataStore,VPNChanged");
|
||||
QDialog::accept();
|
||||
|
||||
@@ -144,7 +144,7 @@ This needs to be run NekoBox with administrator privileges.</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="vpn_rule_cidr"/>
|
||||
<widget class="QPlainTextEdit" name="vpn_rule_cidr"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -156,7 +156,7 @@ This needs to be run NekoBox with administrator privileges.</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="vpn_rule_process"/>
|
||||
<widget class="QPlainTextEdit" name="vpn_rule_process"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
@@ -32,6 +32,7 @@ DialogEditGroup::DialogEditGroup(const std::shared_ptr<NekoGui::Group> &ent, QWi
|
||||
} else { // new group
|
||||
ui->front_proxy->hide();
|
||||
ui->front_proxy_l->hide();
|
||||
ui->front_proxy_clear->hide();
|
||||
}
|
||||
|
||||
CACHE.front_proxy = ent->front_proxy_id;
|
||||
|
||||
@@ -28,7 +28,7 @@ EditCustom::~EditCustom() {
|
||||
#define SAVE_CUSTOM_BEAN \
|
||||
P_SAVE_COMBO_STRING(core) \
|
||||
bean->command = ui->command->text().split(" "); \
|
||||
P_SAVE_STRING_QTEXTEDIT(config_simple) \
|
||||
P_SAVE_STRING_PLAIN(config_simple) \
|
||||
P_SAVE_COMBO_STRING(config_suffix) \
|
||||
P_SAVE_INT(mapping_port) \
|
||||
P_SAVE_INT(socks_port)
|
||||
@@ -62,7 +62,7 @@ void EditCustom::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
// load core ui
|
||||
P_LOAD_COMBO_STRING(core)
|
||||
ui->command->setText(bean->command.join(" "));
|
||||
P_LOAD_STRING(config_simple)
|
||||
ui->config_simple->setPlainText(bean->config_simple);
|
||||
P_LOAD_COMBO_STRING(config_suffix)
|
||||
P_LOAD_INT(mapping_port)
|
||||
P_LOAD_INT(socks_port)
|
||||
@@ -75,7 +75,7 @@ void EditCustom::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
||||
ui->core->setDisabled(true);
|
||||
ui->core->setCurrentText(preset_core);
|
||||
ui->command->setText(preset_command);
|
||||
ui->config_simple->setText(preset_config);
|
||||
ui->config_simple->setPlainText(preset_config);
|
||||
}
|
||||
|
||||
// custom internal
|
||||
@@ -145,6 +145,6 @@ void EditCustom::on_as_json_clicked() {
|
||||
auto editor = new JsonEditor(QString2QJsonObject(ui->config_simple->toPlainText()), this);
|
||||
auto result = editor->OpenEditor();
|
||||
if (!result.isEmpty()) {
|
||||
ui->config_simple->setText(QJsonObject2QString(result, false));
|
||||
ui->config_simple->setPlainText(QJsonObject2QString(result, false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="config_simple">
|
||||
<widget class="QPlainTextEdit" name="config_simple">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
|
||||
Reference in New Issue
Block a user