mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
fix custom core #41
This commit is contained in:
@@ -145,7 +145,7 @@ void DialogEditProfile::typeSelected(const QString &newType) {
|
|||||||
auto _innerWidget = new EditCustom(this);
|
auto _innerWidget = new EditCustom(this);
|
||||||
innerWidget = _innerWidget;
|
innerWidget = _innerWidget;
|
||||||
innerEditor = _innerWidget;
|
innerEditor = _innerWidget;
|
||||||
if (type == "hysteria" || ent->CustomBean()->core == "hysteria") {
|
if (type == "hysteria" || (!newEnt && ent->CustomBean()->core == "hysteria")) {
|
||||||
_innerWidget->preset_core = type;
|
_innerWidget->preset_core = type;
|
||||||
_innerWidget->preset_command = Preset::Hysteria::command;
|
_innerWidget->preset_command = Preset::Hysteria::command;
|
||||||
_innerWidget->preset_config = Preset::Hysteria::config;
|
_innerWidget->preset_config = Preset::Hysteria::config;
|
||||||
|
|||||||
@@ -25,16 +25,16 @@ void EditCustom::onStart(QSharedPointer<NekoRay::ProxyEntity> _ent) {
|
|||||||
this->ent = _ent;
|
this->ent = _ent;
|
||||||
auto bean = this->ent->CustomBean();
|
auto bean = this->ent->CustomBean();
|
||||||
|
|
||||||
P_LOAD_COMBO(core)
|
|
||||||
ui->command->setText(bean->command.join(" "));
|
|
||||||
P_LOAD_STRING(config_simple)
|
|
||||||
|
|
||||||
// load known core
|
// load known core
|
||||||
auto core_map = QString2QJsonObject(NekoRay::dataStore->extraCore->core_map);
|
auto core_map = QString2QJsonObject(NekoRay::dataStore->extraCore->core_map);
|
||||||
for (const auto &key: core_map.keys()) {
|
for (const auto &key: core_map.keys()) {
|
||||||
ui->core->addItem(key);
|
ui->core->addItem(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
P_LOAD_COMBO(core)
|
||||||
|
ui->command->setText(bean->command.join(" "));
|
||||||
|
P_LOAD_STRING(config_simple)
|
||||||
|
|
||||||
if (!bean->core.isEmpty()) {
|
if (!bean->core.isEmpty()) {
|
||||||
ui->core->setDisabled(true);
|
ui->core->setDisabled(true);
|
||||||
} else if (!preset_core.isEmpty()) {
|
} else if (!preset_core.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user