minor improvements

This commit is contained in:
Nova 2025-03-20 15:02:03 +03:30
parent 0d2f073069
commit c83d3c7506
4 changed files with 4 additions and 18 deletions

View File

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

View File

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

View File

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

View File

@ -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() {