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);
}
// 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))

View File

@@ -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`

View File

@@ -7,9 +7,10 @@
<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>
</qresource>
<qresource prefix="/nekoray">
<file>nekoray.png</file>
<file>nekoray.css</file>
<qresource prefix="/neko">
<file alias="nekobox.png">../assets/nekobox.png</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/sing-box-vpn.json">../examples/sing-box-vpn.json</file>
</qresource>

View File

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

View File

@@ -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));
}

View File

@@ -1,20 +1,22 @@
#include "TrayIcon.hpp"
#include "main/NekoRay.hpp"
#include <QPainter>
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;

View File

@@ -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;
}