mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
remember latency
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "fmt/includes.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QColor>
|
||||
|
||||
namespace NekoRay {
|
||||
|
||||
@@ -99,6 +100,7 @@ namespace NekoRay {
|
||||
_add(new configItem("type", &type, itemType::string));
|
||||
_add(new configItem("id", &id, itemType::integer));
|
||||
_add(new configItem("gid", &gid, itemType::integer));
|
||||
_add(new configItem("yc", &latency, itemType::integer));
|
||||
|
||||
// 可以不关联 bean,只加载 ProxyEntity 的信息
|
||||
if (bean != nullptr) {
|
||||
@@ -119,6 +121,22 @@ namespace NekoRay {
|
||||
}
|
||||
}
|
||||
|
||||
QColor ProxyEntity::DisplayLatencyColor() const {
|
||||
if (latency < 0) {
|
||||
return Qt::red;
|
||||
} else if (latency > 0) {
|
||||
if (latency < 100) {
|
||||
return Qt::darkGreen;
|
||||
} else if (latency < 200) {
|
||||
return Qt::darkYellow;
|
||||
} else {
|
||||
return Qt::darkRed;
|
||||
}
|
||||
} else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
// Profile
|
||||
|
||||
int ProfileManager::NewProfileID() const {
|
||||
|
||||
Reference in New Issue
Block a user