diff --git a/src/dataStore/Database.cpp b/src/dataStore/Database.cpp index 6d16d9b..c0ad251 100644 --- a/src/dataStore/Database.cpp +++ b/src/dataStore/Database.cpp @@ -95,9 +95,9 @@ namespace NekoGui { NekoGui::profileManager->AddGroup(defaultGroup); } - if (routes.count(0) == 0) { - auto defaultRoute = NekoGui::RoutingChain::GetDefaultChain(); - NekoGui::profileManager->AddRouteChain(defaultRoute); + if (routes.empty()) { + auto defaultRoute = RoutingChain::GetDefaultChain(); + profileManager->AddRouteChain(defaultRoute); } // Add default route chains diff --git a/src/ui/setting/RouteItem.cpp b/src/ui/setting/RouteItem.cpp index 09bbafa..67369b1 100644 --- a/src/ui/setting/RouteItem.cpp +++ b/src/ui/setting/RouteItem.cpp @@ -144,6 +144,13 @@ RouteItem::RouteItem(QWidget *parent, const std::shared_ptrsetPlainText(chain->GetSimpleRules(NekoGui::block)); simpleProxy->setPlainText(chain->GetSimpleRules(NekoGui::proxy)); + if (chain->isViewOnly()) + { + ui->simple_direct_box->setEnabled(false); + ui->simple_block_box->setEnabled(false); + ui->simple_proxy_box->setEnabled(false); + } + connect(ui->tabWidget->tabBar(), &QTabBar::currentChanged, this, [=]() { if (ui->tabWidget->tabBar()->currentIndex() == 1)