mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-24 02:20:16 +08:00
minor improvements
This commit is contained in:
parent
0d2f073069
commit
c83d3c7506
7
3rdparty/qv2ray/v2/ui/LogHighlighter.cpp
vendored
7
3rdparty/qv2ray/v2/ui/LogHighlighter.cpp
vendored
@ -76,13 +76,6 @@ namespace Qv2ray::ui {
|
|||||||
rule.format = v2rayComponentFormat;
|
rule.format = v2rayComponentFormat;
|
||||||
highlightingRules.append(rule);
|
highlightingRules.append(rule);
|
||||||
//
|
//
|
||||||
failedFormat.setFontWeight(QFont::Bold);
|
|
||||||
failedFormat.setBackground(Qt::red);
|
|
||||||
failedFormat.setForeground(Qt::white);
|
|
||||||
rule.pattern = QRegularExpression("failed");
|
|
||||||
rule.format = failedFormat;
|
|
||||||
highlightingRules.append(rule);
|
|
||||||
//
|
|
||||||
rule.pattern = QRegularExpression(">>>>+");
|
rule.pattern = QRegularExpression(">>>>+");
|
||||||
rule.format = warningFormat;
|
rule.format = warningFormat;
|
||||||
highlightingRules.append(rule);
|
highlightingRules.append(rule);
|
||||||
|
|||||||
1
3rdparty/qv2ray/v2/ui/LogHighlighter.hpp
vendored
1
3rdparty/qv2ray/v2/ui/LogHighlighter.hpp
vendored
@ -77,7 +77,6 @@ namespace Qv2ray {
|
|||||||
QTextCharFormat dateFormat;
|
QTextCharFormat dateFormat;
|
||||||
QTextCharFormat acceptedFormat;
|
QTextCharFormat acceptedFormat;
|
||||||
QTextCharFormat rejectedFormat;
|
QTextCharFormat rejectedFormat;
|
||||||
QTextCharFormat failedFormat;
|
|
||||||
QTextCharFormat warningFormat;
|
QTextCharFormat warningFormat;
|
||||||
QTextCharFormat warningFormat2;
|
QTextCharFormat warningFormat2;
|
||||||
QTextCharFormat infoFormat;
|
QTextCharFormat infoFormat;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <QElapsedTimer>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
|
|
||||||
namespace NekoGui_sys {
|
namespace NekoGui_sys {
|
||||||
@ -10,7 +11,6 @@ namespace NekoGui_sys {
|
|||||||
QString tag;
|
QString tag;
|
||||||
QString program;
|
QString program;
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
QStringList env;
|
|
||||||
|
|
||||||
~CoreProcess();
|
~CoreProcess();
|
||||||
|
|
||||||
@ -31,6 +31,8 @@ namespace NekoGui_sys {
|
|||||||
bool failed_to_start = false;
|
bool failed_to_start = false;
|
||||||
bool restarting = false;
|
bool restarting = false;
|
||||||
|
|
||||||
|
QElapsedTimer coreRestartTimer;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool started = false;
|
bool started = false;
|
||||||
bool killed = false;
|
bool killed = false;
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QElapsedTimer>
|
|
||||||
|
|
||||||
namespace NekoGui_sys {
|
namespace NekoGui_sys {
|
||||||
CoreProcess::~CoreProcess() {
|
CoreProcess::~CoreProcess() {
|
||||||
@ -20,12 +19,7 @@ namespace NekoGui_sys {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
|
|
||||||
QElapsedTimer coreRestartTimer;
|
|
||||||
|
|
||||||
CoreProcess::CoreProcess(const QString &core_path, const QStringList &args) : QProcess() {
|
CoreProcess::CoreProcess(const QString &core_path, const QStringList &args) : QProcess() {
|
||||||
this->env = QProcessEnvironment::systemEnvironment().toStringList();
|
|
||||||
program = core_path;
|
program = core_path;
|
||||||
arguments = args;
|
arguments = args;
|
||||||
|
|
||||||
@ -88,13 +82,11 @@ namespace NekoGui_sys {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CoreProcess::Start() {
|
void CoreProcess::Start() {
|
||||||
show_stderr = false;
|
|
||||||
if (started) return;
|
if (started) return;
|
||||||
started = true;
|
started = true;
|
||||||
|
|
||||||
setEnvironment(env);
|
setEnvironment(QProcessEnvironment::systemEnvironment().toStringList());
|
||||||
start(program, arguments);
|
start(program, arguments);
|
||||||
write((NekoGui::dataStore->core_token + "\n").toUtf8());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CoreProcess::Restart() {
|
void CoreProcess::Restart() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user