diff --git a/assets/nekobox.png b/assets/nekobox.png new file mode 100644 index 0000000..4ba56b0 Binary files /dev/null and b/assets/nekobox.png differ diff --git a/db/ConfigBuilder.cpp b/db/ConfigBuilder.cpp index 60c108a..06c1ae4 100644 --- a/db/ConfigBuilder.cpp +++ b/db/ConfigBuilder.cpp @@ -733,7 +733,7 @@ namespace NekoRay { cidr_rule = "," + QJsonObject2QString(rule, false); } // gen config - auto configFn = ":/nekoray/vpn/sing-box-vpn.json"; + auto configFn = ":/neko/vpn/sing-box-vpn.json"; if (QFile::exists("vpn/sing-box-vpn.json")) configFn = "vpn/sing-box-vpn.json"; auto config = ReadFileText(configFn) .replace("%IPV6_ADDRESS%", dataStore->vpn_ipv6 ? R"("inet6_address": "fdfe:dcba:9876::1/126",)" : "") @@ -753,7 +753,7 @@ namespace NekoRay { QString WriteVPNLinuxScript(const QString &protectPath, const QString &configPath) { // gen script - auto scriptFn = ":/nekoray/vpn/vpn-run-root.sh"; + auto scriptFn = ":/neko/vpn/vpn-run-root.sh"; if (QFile::exists("vpn/vpn-run-root.sh")) scriptFn = "vpn/vpn-run-root.sh"; auto script = ReadFileText(scriptFn) .replace("$PORT", Int2String(dataStore->inbound_socks_port)) diff --git a/examples/docs/Build_Linux.md b/examples/docs/Build_Linux.md index f4930a1..cd5551e 100644 --- a/examples/docs/Build_Linux.md +++ b/examples/docs/Build_Linux.md @@ -67,6 +67,7 @@ ninja #### Go 部分 1. 把 `Matsuridayo/Matsuri` `Matsuridayo/v2ray-core` 置于 `../` -2. 进入 `go` 文件夹 `go build` 得到 `nekoray_core`。 +2. 进入 `go/cmd/nekoray_core` 文件夹 `go build` 得到 `nekoray_core`。 +3. 进入 `go/cmd/nekobox_core` 文件夹 `go build` 得到 `nekobox_core`。 非官方构建无需编译 `updater` `launcher` diff --git a/res/nekoray.css b/res/neko.css similarity index 100% rename from res/nekoray.css rename to res/neko.css diff --git a/res/neko.qrc b/res/neko.qrc index aa7701b..6d546a9 100644 --- a/res/neko.qrc +++ b/res/neko.qrc @@ -7,9 +7,10 @@ icon/dialog-question.svg icon/system-software-update.svg - - nekoray.png - nekoray.css + + ../assets/nekobox.png + ../assets/nekoray.png + neko.css ../examples/vpn-run-root.sh ../examples/sing-box-vpn.json diff --git a/res/nekoray.png b/res/nekoray.png deleted file mode 120000 index e73720c..0000000 --- a/res/nekoray.png +++ /dev/null @@ -1 +0,0 @@ -../assets/nekoray.png \ No newline at end of file diff --git a/ui/ThemeManager.cpp b/ui/ThemeManager.cpp index 025589d..65da7a1 100644 --- a/ui/ThemeManager.cpp +++ b/ui/ThemeManager.cpp @@ -79,6 +79,6 @@ void ThemeManager::ApplyTheme(const QString &theme) { }; internal(); - auto nekoray_css = ReadFileText(":nekoray/nekoray.css"); + auto nekoray_css = ReadFileText(":/neko/neko.css"); qApp->setStyleSheet(qApp->styleSheet().append("\n").append(nekoray_css)); } diff --git a/ui/TrayIcon.cpp b/ui/TrayIcon.cpp index 4eac5b8..cd8414a 100644 --- a/ui/TrayIcon.cpp +++ b/ui/TrayIcon.cpp @@ -1,20 +1,22 @@ #include "TrayIcon.hpp" +#include "main/NekoRay.hpp" + #include QIcon TrayIcon::GetIcon(TrayIcon::TrayIconStatus status) { QPixmap pixmap; // software embedded icon - auto pixmap_read = QPixmap(":/nekoray/nekoray.png"); + auto pixmap_read = QPixmap(":/neko/" + software_name.toLower() + ".png"); if (!pixmap_read.isNull()) pixmap = pixmap_read; // software pack icon - pixmap_read = QPixmap("../nekoray.png"); + pixmap_read = QPixmap("../" + software_name.toLower() + ".png"); if (!pixmap_read.isNull()) pixmap = pixmap_read; // user icon - pixmap_read = QPixmap("./nekoray.png"); + pixmap_read = QPixmap("./" + software_name.toLower() + ".png"); if (!pixmap_read.isNull()) pixmap = pixmap_read; if (status == TrayIconStatus::NONE) return pixmap; diff --git a/ui/dialog_basic_settings.cpp b/ui/dialog_basic_settings.cpp index a9328a3..1f0740f 100644 --- a/ui/dialog_basic_settings.cpp +++ b/ui/dialog_basic_settings.cpp @@ -263,6 +263,7 @@ void DialogBasicSettings::accept() { void DialogBasicSettings::on_set_custom_icon_clicked() { auto title = ui->set_custom_icon->text(); + QString user_icon_path = "./" + software_name.toLower() + ".png"; auto c = QMessageBox::question(this, title, tr("Please select a PNG file."), tr("Select"), tr("Reset"), tr("Cancel"), 2, 2); if (c == 0) { @@ -274,10 +275,10 @@ void DialogBasicSettings::on_set_custom_icon_clicked() { MessageBoxWarning(title, tr("Please select a valid square image.")); return; } - QFile::copy(fn, "./nekoray.png"); + QFile::copy(fn, user_icon_path); } } else if (c == 1) { - QFile::remove("./nekoray.png"); + QFile::remove(user_icon_path); } else { return; }