update qrc

This commit is contained in:
arm64v8a
2022-09-25 13:41:54 +08:00
parent bbcd9df977
commit 45a07039af
9 changed files with 17 additions and 13 deletions

BIN
assets/nekobox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@@ -733,7 +733,7 @@ namespace NekoRay {
cidr_rule = "," + QJsonObject2QString(rule, false); cidr_rule = "," + QJsonObject2QString(rule, false);
} }
// gen config // 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"; if (QFile::exists("vpn/sing-box-vpn.json")) configFn = "vpn/sing-box-vpn.json";
auto config = ReadFileText(configFn) auto config = ReadFileText(configFn)
.replace("%IPV6_ADDRESS%", dataStore->vpn_ipv6 ? R"("inet6_address": "fdfe:dcba:9876::1/126",)" : "") .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) { QString WriteVPNLinuxScript(const QString &protectPath, const QString &configPath) {
// gen script // 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"; if (QFile::exists("vpn/vpn-run-root.sh")) scriptFn = "vpn/vpn-run-root.sh";
auto script = ReadFileText(scriptFn) auto script = ReadFileText(scriptFn)
.replace("$PORT", Int2String(dataStore->inbound_socks_port)) .replace("$PORT", Int2String(dataStore->inbound_socks_port))

View File

@@ -67,6 +67,7 @@ ninja
#### Go 部分 #### Go 部分
1.`Matsuridayo/Matsuri` `Matsuridayo/v2ray-core` 置于 `../` 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` 非官方构建无需编译 `updater` `launcher`

View File

@@ -7,9 +7,10 @@
<file alias="icon/b-dialog-question.svg">icon/dialog-question.svg</file> <file alias="icon/b-dialog-question.svg">icon/dialog-question.svg</file>
<file alias="icon/b-system-software-update.svg">icon/system-software-update.svg</file> <file alias="icon/b-system-software-update.svg">icon/system-software-update.svg</file>
</qresource> </qresource>
<qresource prefix="/nekoray"> <qresource prefix="/neko">
<file>nekoray.png</file> <file alias="nekobox.png">../assets/nekobox.png</file>
<file>nekoray.css</file> <file alias="nekoray.png">../assets/nekoray.png</file>
<file>neko.css</file>
<file alias="vpn/vpn-run-root.sh">../examples/vpn-run-root.sh</file> <file alias="vpn/vpn-run-root.sh">../examples/vpn-run-root.sh</file>
<file alias="vpn/sing-box-vpn.json">../examples/sing-box-vpn.json</file> <file alias="vpn/sing-box-vpn.json">../examples/sing-box-vpn.json</file>
</qresource> </qresource>

View File

@@ -1 +0,0 @@
../assets/nekoray.png

View File

@@ -79,6 +79,6 @@ void ThemeManager::ApplyTheme(const QString &theme) {
}; };
internal(); internal();
auto nekoray_css = ReadFileText(":nekoray/nekoray.css"); auto nekoray_css = ReadFileText(":/neko/neko.css");
qApp->setStyleSheet(qApp->styleSheet().append("\n").append(nekoray_css)); qApp->setStyleSheet(qApp->styleSheet().append("\n").append(nekoray_css));
} }

View File

@@ -1,20 +1,22 @@
#include "TrayIcon.hpp" #include "TrayIcon.hpp"
#include "main/NekoRay.hpp"
#include <QPainter> #include <QPainter>
QIcon TrayIcon::GetIcon(TrayIcon::TrayIconStatus status) { QIcon TrayIcon::GetIcon(TrayIcon::TrayIconStatus status) {
QPixmap pixmap; QPixmap pixmap;
// software embedded icon // 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; if (!pixmap_read.isNull()) pixmap = pixmap_read;
// software pack icon // software pack icon
pixmap_read = QPixmap("../nekoray.png"); pixmap_read = QPixmap("../" + software_name.toLower() + ".png");
if (!pixmap_read.isNull()) pixmap = pixmap_read; if (!pixmap_read.isNull()) pixmap = pixmap_read;
// user icon // user icon
pixmap_read = QPixmap("./nekoray.png"); pixmap_read = QPixmap("./" + software_name.toLower() + ".png");
if (!pixmap_read.isNull()) pixmap = pixmap_read; if (!pixmap_read.isNull()) pixmap = pixmap_read;
if (status == TrayIconStatus::NONE) return pixmap; if (status == TrayIconStatus::NONE) return pixmap;

View File

@@ -263,6 +263,7 @@ void DialogBasicSettings::accept() {
void DialogBasicSettings::on_set_custom_icon_clicked() { void DialogBasicSettings::on_set_custom_icon_clicked() {
auto title = ui->set_custom_icon->text(); 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."), auto c = QMessageBox::question(this, title, tr("Please select a PNG file."),
tr("Select"), tr("Reset"), tr("Cancel"), 2, 2); tr("Select"), tr("Reset"), tr("Cancel"), 2, 2);
if (c == 0) { if (c == 0) {
@@ -274,10 +275,10 @@ void DialogBasicSettings::on_set_custom_icon_clicked() {
MessageBoxWarning(title, tr("Please select a valid square image.")); MessageBoxWarning(title, tr("Please select a valid square image."));
return; return;
} }
QFile::copy(fn, "./nekoray.png"); QFile::copy(fn, user_icon_path);
} }
} else if (c == 1) { } else if (c == 1) {
QFile::remove("./nekoray.png"); QFile::remove(user_icon_path);
} else { } else {
return; return;
} }