Add cpu rate and idle rate

This commit is contained in:
李 翔 2018-01-26 18:20:43 +08:00
parent d0baa5f799
commit 1704f40b1e
24 changed files with 925 additions and 228 deletions

1
debian/changelog vendored
View File

@ -11,5 +11,6 @@ kylin-assistant (1.0.0-0ubuntu1) bionic; urgency=low
* Add Cpu.
* Add Network.
* Add memory rate.
* Add cpu rate and idle rate.
-- lixiang <lixiang@kylinos.cn> Thu, 21 Dec 2017 14:52:56 +0800

View File

@ -171,11 +171,18 @@ void CpuBallWidget::paintEvent(QPaintEvent *)
wavePainter.drawImage(static_cast<int>(m_xFrontOffset) - m_frontImage.width(), (100 - currentPercent)*this->width()/100, m_frontImage);
//Step3:矩形区域中圆球的外径
QRectF outRect = QRectF(0, 0, waveSize.width(), waveSize.height());
/*QRectF outRect = QRectF(0, 0, waveSize.width(), waveSize.height());
QPainterPath outBorderPath;
//QMargins定义了矩形的四个外边距量left,top,right和bottom描述围绕矩形的边框宽度
outBorderPath.addEllipse(outRect.marginsRemoved(QMarginsF(0.5, 0.5, 0.5, 0.5)));//marginsAdded:增长矩形的边距,扩大它
wavePainter.strokePath(outBorderPath, QPen(QColor("#0f84bc"), 1));//外边框 59aee2
wavePainter.strokePath(outBorderPath, QPen(QColor("#0f84bc"), 1));//外边框*/
//QGradient支持三种渐变画刷线性渐变(QLinearGradient)、辐射渐变(QRadialGradient)、角度渐变(QConicalGradient)
QRectF outRect = QRectF(0, 0, waveSize.width(), waveSize.height());
QConicalGradient conicalGradient(waveSize.width()/2, waveSize.height()/2, waveSize.width());//参数分别为中心坐标和初始角度
conicalGradient.setColorAt(0, QColor("#59aee2"));
conicalGradient.setColorAt(1.0, QColor("#0f84bc"));
wavePainter.setPen(QPen(QBrush(conicalGradient), 1));
wavePainter.drawEllipse(outRect.marginsRemoved(QMarginsF(0.5, 0.5, 0.5, 0.5)));
//Step4:占用率文字描述
QFont font = wavePainter.font();

View File

@ -23,40 +23,193 @@
#include <QApplication>
#include <QDebug>
#include <QVBoxLayout>
#include <QFile>
inline QString convertTimeToString(long seconds)
{
//test script: cat /proc/uptime| awk -F. '{run_days=$1 / 86400;run_hour=($1 % 86400)/3600;run_minute=($1 % 3600)/60;run_second=$1 % 60;printf("已运行:%d天%d时%d分%d秒",run_days,run_hour,run_minute,run_second)}'
int run_day = seconds / 86400;
int run_hour = (seconds % 86400)/3600;
int run_minute = (seconds % 3600)/60;
int run_second = seconds % 60;
QString hourStr;
QString minuteStr;
QString secondStr;
if (run_hour >1)
hourStr = QString(QObject::tr("%1hours")).arg(run_hour);
else
hourStr = QString(QObject::tr("%1hour")).arg(run_hour);
if (run_minute > 1)
minuteStr = QString(QObject::tr("%1minutes")).arg(run_minute);
else
minuteStr = QString(QObject::tr("%1minute")).arg(run_minute);
if (run_second > 1)
secondStr = QString(QObject::tr("%1seconds")).arg(run_second);
else
secondStr = QString(QObject::tr("%1second")).arg(run_second);
QString run_time;
if (run_day > 0) {
if (run_day == 1)
return QString("%1 %2 %3 %4").arg(QString(QObject::tr("%1day"))).arg(run_day).arg(hourStr).arg(minuteStr).arg(secondStr);
else
return QString("%1 %2 %3 %4").arg(QString(QObject::tr("%1days"))).arg(run_day).arg(hourStr).arg(minuteStr).arg(secondStr);
}
else {
return QString("%1 %2 %3").arg(hourStr).arg(minuteStr).arg(secondStr);
}
return run_time;
}
inline int getCoreCounts()
{
int cpuCounts = 0;
QFile file("/proc/cpuinfo");
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QString content = file.readLine().trimmed();
while (!content.isEmpty() && content.contains(QChar(':'))) {
const QStringList tokens = content.split(QChar(':'));
if (tokens.size() == 2) {
if (tokens[0] == "processor")
cpuCounts ++;
}
content = file.readLine().trimmed();
}
file.close();
}
if (cpuCounts == 0)
cpuCounts = 4;
return cpuCounts;
}
inline QString getIdelRate(unsigned long &runSeconds, unsigned long &idleSeconds)
{
int cpuNumber = getCoreCounts();
QString rate;
QFile file("/proc/uptime");
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QString content = file.readLine();
while (!content.isEmpty() && content.contains(" ")) {
QStringList tokens = content.split(" ");//content.split(QChar(' '))
QString runStr = tokens.at(0);//从系统启动到现在的时间(以秒为单位)
if (runStr.contains(QChar('.'))) {
QString senconds = runStr.split(QChar('.')).at(0);
runSeconds = senconds.toLong();
}
else
runSeconds = runStr.toLong();
QString idleStr = tokens.at(1);//系统空闲的时间(以秒为单位)
if (idleStr.contains(QChar('.'))) {
QString senconds = idleStr.split(QChar('.')).at(0);
idleSeconds = senconds.toLong();
}
else
idleSeconds = idleStr.toLong();
rate = QString::number((idleSeconds * 1.0) /(runSeconds *1.0 * cpuNumber) * 100, 'f', 0) + "%";
break;
}
file.close();
}
return rate;
}
inline long readUpdatetimeFile(bool isRunTime)
{
QFile file("/proc/uptime");
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QString result;
QString content = file.readLine();
while (!content.isEmpty() && content.contains(" ")) {
QStringList tokens = content.split(" ");//content.split(QChar(' '))
if (isRunTime) {
result = tokens.at(0);//从系统启动到现在的时间(以秒为单位)
}
else {
result = tokens.at(1);//系统空闲的时间(以秒为单位)
}
break;
//content = file.readLine();//continue read
}
file.close();
if (result.contains(QChar('.'))) {
QString senconds = result.split(QChar('.')).at(0);
return senconds.toLong();
}
else
return result.toLong();
}
return 0;
}
//系统平均负载
inline QString readLoadAvg()
{
/*cat /proc/loadavg
0.10 0.06 0.01 1/72 29632
31ID*/
return QString();
}
inline void readFile(const QString &fileName)
{
QFile file(fileName);
if (!file.open(QFile::ReadOnly)) {
qCritical() << QString("open %1 failed").arg(fileName);
return;
}
QByteArray content = file.readAll();
file.close();
QTextStream stream(&content, QIODevice::ReadOnly);
while (!stream.atEnd()) {
const QString aline = stream.readLine();
qDebug() << "aline="<<aline;
// const QStringList items = line.split(QChar(':'));
// if (items.size() == 2) {
// qDebug() << "items[0]="<<items[0]<<",items[1]="<<items[0];
// }
}
// while (!file.atEnd()) {
// QString line = file.readLine();
// QString trimmedLine = line.trimmed();
// qDebug() << "line="<<line;
// qDebug() << "trimmedLine="<<trimmedLine;
// if (line.isEmpty() || trimmedLine.isEmpty())
// continue;
// }
// file.close();
}
CpuRateWidget::CpuRateWidget(QWidget *parent) : QWidget(parent)
{
// this->setFixedSize(302, 140);
/*QVBoxLayout **/mainLayout = new QHBoxLayout(this);
mainLayout->setContentsMargins(0, 0, 0, 0);
m_layout = new QVBoxLayout(this);
m_layout->setContentsMargins(0, 0, 0, 0);
QWidget *w = new QWidget;
w->setFixedSize(300, 300);
m_widgetLayout = new QVBoxLayout(w);
m_widgetLayout->setContentsMargins(6, 0, 0, 0);
m_widgetLayout->setSpacing(0);
m_contentLayout = new QHBoxLayout(w);
m_contentLayout->setContentsMargins(0, 0, 0, 0);
m_contentLayout->setSpacing(50);
m_layout->addWidget(w, 0, Qt::AlignCenter);
m_title = new QLabel(tr("CPU"));
m_title->setAlignment(Qt::AlignLeft | Qt::AlignTop);
m_title->setStyleSheet("font-size: 22px; color:#303030");
initWidgets();
QFont font = m_title->font();
font.setPointSize(22);
font.setWeight(QFont::Light);
m_title->setFont(font);
m_cpuBall->startTimer();
m_cpuBall = new CpuBallWidget;
// m_cpuBall->setFixedSize(100, 100);
/*unsigned long runtime;
unsigned long idletime;
QString rate = getIdelRate(runtime, idletime);
qDebug() << "rate="<<rate;
qDebug() << convertTimeToString(runtime);
qDebug() << convertTimeToString(idletime);*/
m_widgetLayout->addWidget(m_title, 0, Qt::AlignLeft);
m_widgetLayout->addWidget(m_cpuBall, 0, Qt::AlignCenter);
mainLayout->addWidget(w, 1, Qt::AlignCenter);
// mainLayout->addWidget(m_title, 0, Qt::AlignLeft);
// mainLayout->addWidget(m_cpuBall, 0, Qt::AlignCenter);
/*sudo dmidecode -t processor
u32 len;
@ -66,25 +219,122 @@ CpuRateWidget::CpuRateWidget(QWidget *parent) : QWidget(parent)
len = size;
// dmi_table_decode(buf, len, num, ver, flags);
// dmi_decode(&h, ver);*/
m_cpuBall->startTimer();
}
CpuRateWidget::~CpuRateWidget()
{
delete m_title;
delete m_cpuRateTitle;
delete m_cpuRateText;
delete m_cpuIdleRateTitle;
delete m_cpuIdleRateText;
delete m_cpuRunTimeTitle;
delete m_cpuRunTimeText;
delete m_cpuIdleTimeTitle;
delete m_cpuIdleTimeText;
delete m_cpuBall;
QLayoutItem *child;
while ((child = m_widgetLayout->takeAt(0)) != 0) {
while ((child = m_labelLayout->takeAt(0)) != 0) {
if (child->widget())
child->widget()->deleteLater();
delete child;
}
delete mainLayout;
while ((child = m_contentLayout->takeAt(0)) != 0) {
if (child->widget())
child->widget()->deleteLater();
delete child;
}
delete m_layout;
}
void CpuRateWidget::initWidgets()
{
QWidget *w = new QWidget;
// w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
m_labelLayout = new QVBoxLayout(w);
m_labelLayout->setContentsMargins(0, 0, 0, 0);
m_labelLayout->setSpacing(0);
QLabel *m_title = new QLabel(tr("CPU"));
m_title->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
m_title->setStyleSheet("background:transparent;font-size:24px;color:#000000");
m_cpuRateTitle = new QLabel;
m_cpuRateTitle->setStyleSheet("QLabel{background:transparent;font-size:12px;color:#999999;}");
m_cpuRateTitle->setText(tr("Occupancy rate"));
m_cpuRateText = new QLabel;
m_cpuRateText->setStyleSheet("QLabel{background:transparent;font-size:20px;color:#000000;}");
m_cpuIdleRateTitle = new QLabel;
m_cpuIdleRateTitle->setStyleSheet("QLabel{background:transparent;font-size:12px;color:#999999;}");
m_cpuIdleRateTitle->setText(tr("Idle rate"));
m_cpuIdleRateText = new QLabel;
m_cpuIdleRateText->setStyleSheet("QLabel{background:transparent;font-size:20px;color:#000000;}");
m_cpuRunTimeTitle = new QLabel;
m_cpuRunTimeTitle->setStyleSheet("QLabel{background:transparent;font-size:12px;color:#999999;}");
m_cpuRunTimeTitle->setText(tr("The running time of system"));
m_cpuRunTimeText = new QLabel;
m_cpuRunTimeText->setStyleSheet("QLabel{background:transparent;font-size:20px;color:#000000;}");
m_cpuIdleTimeTitle = new QLabel;
m_cpuIdleTimeTitle->setStyleSheet("QLabel{background:transparent;font-size:12px;color:#999999;}");
m_cpuIdleTimeTitle->setText(tr("The idle time of system"));
m_cpuIdleTimeText = new QLabel;
m_cpuIdleTimeText->setStyleSheet("QLabel{background:transparent;font-size:20px;color:#000000;}");
QVBoxLayout *cpuRateLayout = new QVBoxLayout;
cpuRateLayout->setSpacing(10);
cpuRateLayout->addWidget(m_cpuRateTitle);
cpuRateLayout->addWidget(m_cpuRateText);
QVBoxLayout *cpuIdleRateLayout = new QVBoxLayout;
cpuIdleRateLayout->setSpacing(10);
cpuIdleRateLayout->addWidget(m_cpuIdleRateTitle);
cpuIdleRateLayout->addWidget(m_cpuIdleRateText);
QHBoxLayout *rateLayout = new QHBoxLayout;
rateLayout->setSpacing(30);
rateLayout->addLayout(cpuRateLayout);
rateLayout->addLayout(cpuIdleRateLayout);
QVBoxLayout *cpuRunTimeLayout = new QVBoxLayout;
cpuRunTimeLayout->setSpacing(10);
cpuRunTimeLayout->addWidget(m_cpuRunTimeTitle);
cpuRunTimeLayout->addWidget(m_cpuRunTimeText);
QVBoxLayout *cpuIdleTimeLayout = new QVBoxLayout;
cpuIdleTimeLayout->setSpacing(10);
cpuIdleTimeLayout->addWidget(m_cpuIdleTimeTitle);
cpuIdleTimeLayout->addWidget(m_cpuIdleTimeText);
m_labelLayout->setContentsMargins(0, 0, 0, 0);
m_labelLayout->setSpacing(10);
m_labelLayout->addWidget(m_title);
m_labelLayout->addLayout(rateLayout);
m_labelLayout->addLayout(cpuRunTimeLayout);
m_labelLayout->addLayout(cpuIdleTimeLayout);
m_contentLayout->addWidget(w, 1, Qt::AlignLeft);
m_cpuBall = new CpuBallWidget;
m_contentLayout->addWidget(m_cpuBall);
}
void CpuRateWidget::refreshData(double cpu)
{
m_cpuRateText->setText(QString::number(cpu, 'f', 1) + "%");
unsigned long runtime;
unsigned long idletime;
QString rate = getIdelRate(runtime, idletime);
m_cpuIdleRateText->setText(rate);
m_cpuRunTimeText->setText(convertTimeToString(runtime));
m_cpuIdleTimeText->setText(convertTimeToString(idletime));
}
void CpuRateWidget::onUpdateCpuPercent(double value)
{
this->refreshData(value);
m_cpuBall->updateCpuPercent(value);
}

View File

@ -35,17 +35,28 @@ public:
CpuRateWidget(QWidget *parent = 0);
~CpuRateWidget();
void refreshData(double cpu);
void startTimer();
void stopTimer();
void initWidgets();
public slots:
void onUpdateCpuPercent(double value);
private:
QLabel *m_title = nullptr;
QLabel *m_cpuRateTitle = nullptr;
QLabel *m_cpuRateText = nullptr;
QLabel *m_cpuIdleRateTitle = nullptr;
QLabel *m_cpuIdleRateText = nullptr;
QLabel *m_cpuRunTimeTitle = nullptr;
QLabel *m_cpuRunTimeText = nullptr;
QLabel *m_cpuIdleTimeTitle = nullptr;
QLabel *m_cpuIdleTimeText = nullptr;
CpuBallWidget *m_cpuBall = nullptr;
QVBoxLayout *m_widgetLayout = nullptr;
QHBoxLayout *mainLayout = nullptr;
QHBoxLayout *m_contentLayout = nullptr;
QVBoxLayout *m_labelLayout = nullptr;
QVBoxLayout *m_layout = nullptr;
};
#endif // CPURATEWIDGET_H

View File

@ -21,6 +21,9 @@
#include <QApplication>
#include <QVBoxLayout>
#include <QEvent>
#include <QDebug>
#include <QFileInfo>
#include "diskitemlist.h"
#include "diskitem.h"
#include "diskmodel.h"
@ -30,6 +33,8 @@
FileSystemDialog::FileSystemDialog(QWidget *parent)
:QWidget(parent)
,m_diskItemList(new DiskItemList)
,m_monitorFile("/home/lixiang/testwatcher/1.c")
// ,m_monitorFile("/etc/mtab")
{
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
setAcceptDrops(true);
@ -49,14 +54,19 @@ FileSystemDialog::FileSystemDialog(QWidget *parent)
m_diskModelList = new DiskModel;
connect(m_diskModelList, SIGNAL(oneDiskInfoAdded(DiskInfo*)), this, SLOT(addDiskInfoItem(DiskInfo*)));
connect(m_diskModelList, SIGNAL(oneDiskInfoRemoved(DiskInfo*)), this, SLOT(removeDiskInfoItemByDevName(DiskInfo*)));
m_fileSystemWorker = new FileSystemWorker(m_diskModelList);
m_fileSystemWorker = new FileSystemWorker(m_diskModelList);
m_fileSystemWorker->moveToThread(qApp->thread());
m_diskModelList->moveToThread(qApp->thread());
this->initFileSystemMonitor();
}
FileSystemDialog::~FileSystemDialog()
{
m_fileSystemMonitor->removePath(m_monitorFile);
delete m_fileSystemMonitor;
m_diskModelList->deleteLater();
m_fileSystemWorker->deleteLater();
@ -71,6 +81,28 @@ FileSystemDialog::~FileSystemDialog()
}
}
void FileSystemDialog::initFileSystemMonitor() {
/*int fd = inotify_init();
int wd = inotify_add_watch (fd, path, mask);
// int ret = inotify_rm_watch (fd, wd);*/
m_fileSystemMonitor = new QFileSystemWatcher(this);
// m_fileSystemMonitor->addPath(m_monitorFile);
QFileInfo info(m_monitorFile);
m_fileSystemMonitor->addPath(info.absoluteFilePath());
connect(m_fileSystemMonitor, SIGNAL(directoryChanged(QString)), this, SLOT(onDirectoryChanged(QString)));
connect(m_fileSystemMonitor, &QFileSystemWatcher::fileChanged, [=] (const QString &path) {
qDebug()<< "file path===================="<<path;
});
}
void FileSystemDialog::onDirectoryChanged(QString path)
{
qDebug()<< "dir path===================="<<path;
}
void FileSystemDialog::addDiskInfoItem(DiskInfo *info)
{
DiskItem *w = new DiskItem;

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QWidget>
#include <QFileSystemWatcher>
class DiskItemList;
class DiskModel;
@ -34,9 +34,12 @@ public:
explicit FileSystemDialog(QWidget* parent = 0);
~FileSystemDialog();
void initFileSystemMonitor();
public slots:
void addDiskInfoItem(DiskInfo *info);
void removeDiskInfoItemByDevName(DiskInfo *info);
void onDirectoryChanged(QString path);
private:
bool event(QEvent *event);
@ -45,5 +48,7 @@ private:
QVBoxLayout *m_centralLayout = nullptr;
DiskItemList *m_diskItemList;
DiskModel *m_diskModelList;
FileSystemWorker *m_fileSystemWorker;
FileSystemWorker *m_fileSystemWorker = nullptr;
QFileSystemWatcher *m_fileSystemMonitor = nullptr;
QString m_monitorFile;
};

View File

@ -104,13 +104,25 @@ DISK_INFO add_disk(const glibtop_mountentry *entry, gboolean show_all_fs)
//}
FileSystemWorker::FileSystemWorker(DiskModel *diskList, QObject *parent)
: QObject(parent),
m_diskModel(diskList)
: QObject(parent)
,m_diskModel(diskList)
{
onFileSystemListChanged();
// GVolumeMonitor * monitor;
// GVolumeMonitor * monitor;//GVolumeMonitor不是 thread-default-context aware因此不能在除了主线程中的其他地方使用????
// monitor = g_volume_monitor_get();
// g_signal_connect(monitor, "mount-added", G_CALLBACK(hello), NULL);
// GVolumeMonitor* monitor = g_volume_monitor_get();
// GList* mountDeviceList = g_volume_monitor_get_mounts(monitor);
// GList* it = NULL;
// for(it = mountDeviceList; it; it = it->next) {
// qDebug() << "mount device list:" << it->data;
// }
// GList* mountVolumeList = g_volume_monitor_get_volumes(monitor);
// for(it = mountVolumeList; it; it = it->next) {
// qDebug() << "mount volume list:" << it->data;
// }
}
void FileSystemWorker::onFileSystemListChanged()

View File

@ -68,7 +68,7 @@ MemoryCircle::~MemoryCircle()
}
void MemoryCircle::drawCircle(QPainter *painter, bool isSwap)
void MemoryCircle::drawCircle(QPainter &painter, bool isSwap)
{
//渐变效果设置
/*QRadialGradient circleGradient(center, circleRadius, center);
@ -83,17 +83,17 @@ void MemoryCircle::drawCircle(QPainter *painter, bool isSwap)
else
pen.setColor(QColor("#9528b4"));
pen.setWidth(1);
painter->setPen(pen);
// painter->setBrush(circleGradient);
painter->setBrush(QBrush(QColor("#ffffff")));
painter.setPen(pen);
// painter.setBrush(circleGradient);
painter.setBrush(QBrush(QColor("#ffffff")));
if (isSwap)
painter->drawEllipse(swapcenter, circleRadius, circleRadius);
painter.drawEllipse(swapcenter, circleRadius, circleRadius);
else
painter->drawEllipse(center, circleRadius, circleRadius);
painter.drawEllipse(center, circleRadius, circleRadius);
}
void MemoryCircle::drawColorPie(QPainter *painter, bool isSwap)
void MemoryCircle::drawColorPie(QPainter &painter, bool isSwap)
{
//内存矩形,绘制扇形需要的参数,圆在矩形内且与矩形相切
QPointF pieRectLeftTop(center.x()-circleRadius, center.y()-circleRadius);
@ -107,60 +107,57 @@ void MemoryCircle::drawColorPie(QPainter *painter, bool isSwap)
if (isSwap) {
if (mi.swappercent == 0)
painter->setPen(Qt::NoPen);
painter.setPen(Qt::NoPen);
else {
QPen pen;
pen.setColor(QColor("#fc7416"));
pen.setWidth(1);
painter->setPen(pen);
painter.setPen(pen);
}
painter->setBrush(QBrush(QColor("#fef5f1")));
painter.setBrush(QBrush(QColor("#fef5f1")));
float swapcurrentPie = - (360 * (mi.swappercent/100)); //负数顺时针
painter->drawPie(swappieRect, 90*16, swapcurrentPie*16);//绘制扇形90*16为初始12点钟位置
painter.drawPie(swappieRect, 90*16, swapcurrentPie*16);//绘制扇形90*16为初始12点钟位置
}
else {
if (mi.percent == 0)
painter->setPen(Qt::NoPen);
painter.setPen(Qt::NoPen);
else {
QPen pen;
pen.setColor(QColor("#9528b4"));
pen.setWidth(1);
painter->setPen(pen);
painter.setPen(pen);
}
painter->setBrush(QBrush(QColor("#f4e9f7")));
painter.setBrush(QBrush(QColor("#f4e9f7")));
float currentPie = - (360 * (mi.percent/100)); //负数顺时针0*16为3点钟位置
painter->drawPie(pieRect, 90*16, currentPie*16); //绘制扇形90*16为初始12点钟位置
painter.drawPie(pieRect, 90*16, currentPie*16); //绘制扇形90*16为初始12点钟位置
}
}
void MemoryCircle::drawText(QPainter *painter)
void MemoryCircle::drawTextInfo(QPainter &painter)
{
setFontSize(*painter, 20);
painter->setPen(QPen(QColor("#000000")));
painter->drawText(QRect(center.x()-circleRadius, center.y() + circleRadius + 10, circleRadius*2, 30), Qt::AlignCenter, tr("Memory"));
painter->drawText(QRect(swapcenter.x()-circleRadius, swapcenter.y() + circleRadius + 10, circleRadius*2, 30), Qt::AlignCenter, tr("Swap"));
setFontSize(painter, 20);
painter.setPen(QPen(QColor("#000000")));
painter.drawText(QRect(center.x()-circleRadius, center.y() + circleRadius + 10, circleRadius*2, 30), Qt::AlignCenter, tr("Memory"));
painter.drawText(QRect(swapcenter.x()-circleRadius, swapcenter.y() + circleRadius + 10, circleRadius*2, 30), Qt::AlignCenter, tr("Swap"));
//draw title
setFontSize(*painter, 12);
painter->setPen(QPen(QColor("#999999")));
painter->drawText(QRect(center.x()-circleRadius, center.y() + circleRadius + 40, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Used(Percent)"));
painter->drawText(QRect(swapcenter.x()-circleRadius, swapcenter.y() + circleRadius + 40, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Used(Percent)"));
painter->drawText(QRect(center.x()-circleRadius, center.y() + circleRadius + 85, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Total"));
painter->drawText(QRect(swapcenter.x()-circleRadius, swapcenter.y() + circleRadius + 85, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Total"));
setFontSize(painter, 12);
painter.setPen(QPen(QColor("#999999")));
painter.drawText(QRect(center.x()-circleRadius, center.y() + circleRadius + 40, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Used(Percent)"));
painter.drawText(QRect(swapcenter.x()-circleRadius, swapcenter.y() + circleRadius + 40, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Used(Percent)"));
painter.drawText(QRect(center.x()-circleRadius, center.y() + circleRadius + 100, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Total"));
painter.drawText(QRect(swapcenter.x()-circleRadius, swapcenter.y() + circleRadius + 100, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Total"));
//draw text data
setFontSize(*painter, 20);
QFontMetrics fm = painter->fontMetrics();
painter->setPen(QPen(QColor("#000000")));
setFontSize(painter, 20);
QFontMetrics fm = painter.fontMetrics();
painter.setPen(QPen(QColor("#000000")));
const QString memeryUsed = tr("%1(%2%)").arg(formatMemory(mi.user)).arg(QString::number(mi.percent, 'f', 1));
const QString swapUsed = tr("%1(%2%)").arg(formatMemory(mi.swapused)).arg(QString::number(mi.swappercent, 'f', 1));
painter->drawText(QRect(center.x()-circleRadius, center.y() + circleRadius + 60, fm.width(memeryUsed), 30), Qt::AlignLeft |Qt::AlignVCenter, memeryUsed);
painter->drawText(QRect(swapcenter.x()-circleRadius, swapcenter.y() + circleRadius + 60, fm.width(swapUsed), 30), Qt::AlignLeft |Qt::AlignVCenter, swapUsed);
painter->drawText(QRect(center.x()-circleRadius, center.y() + circleRadius + 105, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, formatMemory(mi.total));
painter->drawText(QRect(swapcenter.x()-circleRadius, swapcenter.y() + circleRadius + 105, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, formatMemory(mi.swaptotal));
const QString info = QString("%1/%2(%3%)").arg(formatMemory(mi.user)).arg(formatMemory(mi.total)).arg(QString::number(mi.percent, 'f', 1));
emit rebackMemoryInfo(info, mi.percent);
painter.drawText(QRect(center.x()-circleRadius, center.y() + circleRadius + 70, fm.width(memeryUsed), 30), Qt::AlignLeft |Qt::AlignVCenter, memeryUsed);
painter.drawText(QRect(swapcenter.x()-circleRadius, swapcenter.y() + circleRadius + 70, fm.width(swapUsed), 30), Qt::AlignLeft |Qt::AlignVCenter, swapUsed);
painter.drawText(QRect(center.x()-circleRadius, center.y() + circleRadius + 130, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, formatMemory(mi.total));
painter.drawText(QRect(swapcenter.x()-circleRadius, swapcenter.y() + circleRadius + 130, circleRadius*2, 30), Qt::AlignLeft |Qt::AlignVCenter, formatMemory(mi.swaptotal));
}
void MemoryCircle::onUpdateMemoryStatus()
@ -184,26 +181,25 @@ void MemoryCircle::onUpdateMemoryStatus()
mi.swapused = swap.used;
mi.swaptotal = swap.total;
repaint();
const QString info = QString("%1/%2(%3%)").arg(formatMemory(mi.user)).arg(formatMemory(mi.total)).arg(QString::number(mi.percent, 'f', 1));
emit rebackMemoryInfo(info, mi.percent);
repaint();//this->update();
}
void MemoryCircle::paintEvent(QPaintEvent *event)
{
QPainter painter;
painter.begin(this);
painter.setRenderHint(QPainter::Antialiasing, true);
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true);//反走样,绘制出来的线条会出现锯齿
//draw memory circle
drawCircle(&painter);
drawColorPie(&painter);
drawCircle(painter);
drawColorPie(painter);
//draw swap circle
drawCircle(&painter, true);
drawColorPie(&painter, true);
drawCircle(painter, true);
drawColorPie(painter, true);
painter.setRenderHint(QPainter::Antialiasing, false);
drawText(&painter);
painter.end();
drawTextInfo(painter);
}

View File

@ -31,9 +31,9 @@ public:
MemoryCircle(QWidget *parent = 0);
~MemoryCircle();
void drawCircle(QPainter *painter, bool isSwap = false);
void drawColorPie(QPainter *painter, bool isSwap = false);
void drawText(QPainter *painter);
void drawCircle(QPainter &painter, bool isSwap = false);
void drawColorPie(QPainter &painter, bool isSwap = false);
void drawTextInfo(QPainter &painter);
public slots:
void onUpdateMemoryStatus();

View File

@ -11,24 +11,22 @@ MemoryWidget::MemoryWidget(QWidget *parent)
mainLayout->setContentsMargins(0, 0, 0, 0);
QWidget *w = new QWidget;
w->setFixedSize(500, 400);
m_widgetLayout = new QVBoxLayout(w);
m_widgetLayout->setContentsMargins(6, 0, 0, 0);
m_widgetLayout->setContentsMargins(0, 0, 0, 0);
m_widgetLayout->setSpacing(0);
m_title = new QLabel(tr("Memory"));
m_title->setAlignment(Qt::AlignLeft | Qt::AlignTop);
m_title->setStyleSheet("font-size: 22px; color:#303030");
QFont font = m_title->font();
font.setPointSize(22);
m_title->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
m_title->setStyleSheet("background:transparent;font-size:24px;color:#000000");
/*QFont font = m_title->font();
font.setPointSize(24);
font.setWeight(QFont::Light);
m_title->setFont(font);
m_title->setFont(font);*/
m_memoryCircle = new MemoryCircle;
connect(m_memoryCircle, SIGNAL(rebackMemoryInfo(QString,double)), this, SIGNAL(rebackMemoryInfo(QString,double)));
m_widgetLayout->addWidget(m_title, 0, Qt::AlignTop);
m_widgetLayout->addWidget(m_title);
m_widgetLayout->addWidget(m_memoryCircle);
mainLayout->addWidget(w, 0, Qt::AlignCenter);

View File

@ -106,7 +106,7 @@ NetworkFlow::NetworkFlow(QWidget *parent) : QWidget(parent)
,m_downloadColor(QColor("#009944"))
,m_uploadColor(QColor("#e60012"))
{
setFixedSize(403, 240);
setFixedSize(403, 300);
receiveText = tr("Receive");
sendText = tr("Send");
@ -243,13 +243,13 @@ void NetworkFlow::paintEvent(QPaintEvent *)
painter.translate((rect().width() - m_pointsCount * m_pointSpace - 2) / 2 + 6, 80);//将坐标第原点移动到该点
painter.scale(1, -1);//将横坐标扩大1倍,将纵坐标缩小1倍
painter.setPen(QPen(this->m_downloadColor, 1));
painter.setBrush(QBrush());
painter.setBrush(QBrush());//painter.setBrush(QBrush(QColor("#f4f2f4")));
painter.drawPath(m_downloadPath);//绘制前面创建的path:m_downloadPath
//draw upload smoothcurve
painter.translate(0, -8);
painter.setPen(QPen(this->m_uploadColor, 1));
painter.setBrush(QBrush());
painter.setBrush(QBrush());//painter.setBrush(QBrush(QColor("#f4f2f4")));
painter.drawPath(m_uploadPath);
painter.restore();
@ -273,8 +273,8 @@ void NetworkFlow::paintEvent(QPaintEvent *)
painter.setPen(QPen(QColor("#999999")));
painter.drawText(QRect(gridX, gridHeight + 40, contentWidth, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Receiving"));
painter.drawText(QRect(gridX + contentWidth, gridHeight + 40, contentWidth, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Sending"));
painter.drawText(QRect(gridX, gridHeight + 95, contentWidth, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Total Received"));
painter.drawText(QRect(gridX + contentWidth, gridHeight + 95, contentWidth, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Total Sent"));
painter.drawText(QRect(gridX, gridHeight + 100, contentWidth, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Total Received"));
painter.drawText(QRect(gridX + contentWidth, gridHeight + 100, contentWidth, 30), Qt::AlignLeft |Qt::AlignVCenter, tr("Total Sent"));
//draw text data
setFontSize(painter, 20);
@ -284,8 +284,8 @@ void NetworkFlow::paintEvent(QPaintEvent *)
const QString downloadContent = formatNetwork(m_recvTotalBytes);//接收
const QString uploadRate = formatNetworkRate(m_sentRateBytes);
const QString uploadContent = formatNetwork(m_sentTotalBytes);
painter.drawText(QRect(gridX, gridHeight + 65, fms.width(downloadRate), 30), Qt::AlignLeft |Qt::AlignVCenter, downloadRate);
painter.drawText(QRect(gridX + contentWidth, gridHeight + 65, fms.width(uploadRate), 30), Qt::AlignLeft |Qt::AlignVCenter, uploadRate);
painter.drawText(QRect(gridX, gridHeight + 120, fms.width(downloadContent), 30), Qt::AlignLeft |Qt::AlignVCenter, downloadContent);
painter.drawText(QRect(gridX + contentWidth, gridHeight + 120, fms.width(uploadContent), 30), Qt::AlignLeft |Qt::AlignVCenter, uploadContent);
painter.drawText(QRect(gridX, gridHeight + 70, fms.width(downloadRate), 30), Qt::AlignLeft |Qt::AlignVCenter, downloadRate);
painter.drawText(QRect(gridX + contentWidth, gridHeight + 70, fms.width(uploadRate), 30), Qt::AlignLeft |Qt::AlignVCenter, uploadRate);
painter.drawText(QRect(gridX, gridHeight + 130, fms.width(downloadContent), 30), Qt::AlignLeft |Qt::AlignVCenter, downloadContent);
painter.drawText(QRect(gridX + contentWidth, gridHeight + 130, fms.width(uploadContent), 30), Qt::AlignLeft |Qt::AlignVCenter, uploadContent);
}

View File

@ -27,29 +27,25 @@
NetworkWidget::NetworkWidget(QWidget *parent) : QWidget(parent)
{
// setFixedSize(302, 200);
mainLayout = new QHBoxLayout(this);
mainLayout->setContentsMargins(0, 0, 0, 0);
QWidget *w = new QWidget;
w->setFixedSize(500, 400);
m_widgetLayout = new QVBoxLayout(w);
m_widgetLayout->setContentsMargins(6, 0, 0, 0);
m_widgetLayout->setSpacing(0);
m_title = new QLabel(tr("Network"));
m_title->setAlignment(Qt::AlignLeft | Qt::AlignTop);
m_title->setStyleSheet("font-size: 22px; color:#303030");
QFont font = m_title->font();
font.setPointSize(22);
m_title->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
m_title->setStyleSheet("background:transparent;font-size:24px;color:#000000");
/*QFont font = m_title->font();
font.setPointSize(24);
font.setWeight(QFont::Light);
m_title->setFont(font);
m_title->setFont(font);*/
m_networkFlow = new NetworkFlow;
m_widgetLayout->addWidget(m_title, 0, Qt::AlignTop);
m_widgetLayout->addWidget(m_title);
m_widgetLayout->addWidget(m_networkFlow);
mainLayout->addWidget(w, 0, Qt::AlignCenter);
@ -70,7 +66,15 @@ NetworkWidget::NetworkWidget(QWidget *parent) : QWidget(parent)
NetworkWidget::~NetworkWidget()
{
delete m_title;
delete m_networkFlow;
QLayoutItem *child;
while ((child = m_widgetLayout->takeAt(0)) != 0) {
if (child->widget())
child->widget()->deleteLater();
delete child;
}
delete mainLayout;
}
void NetworkWidget::setRadioButtonRowStatus()

View File

@ -34,10 +34,13 @@ ProcessCategory::ProcessCategory(int tabIndex, QWidget *parent)
activeProcessButton = new MyHoverButton(this);
activeProcessButton->setPicture(":/res/active_proc.png");
activeProcessButton->setToolTip(tr("Active Processes"));
userProcessButton = new MyHoverButton(this);
userProcessButton->setPicture(":/res/user_proc.png");
userProcessButton->setToolTip(tr("My Processes"));
allProcessButton = new MyHoverButton(this);
allProcessButton->setPicture(":/res/all_proc.png");
allProcessButton->setToolTip(tr("All Processes"));
if (activeIndex == 0) {
activeProcessButton->setChecked(true);

View File

@ -21,6 +21,8 @@
#include "resourcesindicator.h"
#include "networkindicator.h"
#include <QDebug>
ResourcesCategory::ResourcesCategory(int tabIndex, QWidget *parent)
: QWidget(parent)
,activeIndex(tabIndex)

View File

@ -1,3 +1,23 @@
/*
* Copyright (C) 2013 ~ 2018 National University of Defense Technology(NUDT) & Tianjin Kylin Ltd.
*
* Authors:
* Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "resourcesindicator.h"
#include <QMouseEvent>
@ -31,40 +51,11 @@ ResourcesIndicator::ResourcesIndicator(int flag, QWidget *parent)
m_borderColor = Qt::transparent;
}
setResourcesState(Normal);
/*m_layout = new QHBoxLayout(this);
m_layout->setContentsMargins(5,5,5,5);
QWidget *w = new QWidget;
m_rLayout = new QVBoxLayout(w);
m_rLayout->setContentsMargins(0, 0, 5, 0);
m_rLayout->setSpacing(5);
m_titleLabel = new QLabel;
m_titleLabel->setText("CPU");
m_titleLabel->setStyleSheet("QLabel{background-color:transparent;color:#ffffff; font-size:16px;text-align:left;}");
m_textLabel = new QLabel;
m_textLabel->setText("40% 1.8GHz");
m_textLabel->setStyleSheet("QLabel{background-color:transparent;color:#ffffff; font-size:12px;text-align:left;}");
m_rLayout->addWidget(m_titleLabel);
m_rLayout->addWidget(m_textLabel);
m_layout->addWidget(w, 1, Qt::AlignRight);*/
}
ResourcesIndicator::~ResourcesIndicator()
{
// delete m_titleLabel;
// delete m_textLabel;
// QLayoutItem *child;
// while ((child = m_rLayout->takeAt(0)) != 0) {
// if (child->widget())
// child->widget()->deleteLater();
// delete child;
// }
// delete m_layout;
}
void ResourcesIndicator::enterEvent(QEvent *event)
@ -180,6 +171,7 @@ void ResourcesIndicator::setTitle(const QString &title)
void ResourcesIndicator::updatePercentAndInfo(double percent, const QString &info)
{
this->m_currentPercent = static_cast<int>(percent);
this->m_info = info;
repaint();
@ -198,7 +190,6 @@ void ResourcesIndicator::paintEvent(QPaintEvent *event)
gradient.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0));
QBrush brush(gradient);*/
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true);
@ -242,40 +233,4 @@ void ResourcesIndicator::paintEvent(QPaintEvent *event)
painter.drawText(QRect(68, 30, 120, 20), Qt::AlignLeft | Qt::AlignVCenter, text);
QWidget::paintEvent(event);
/*QFrame::paintEvent(e);
QPainter p(this);
p.setRenderHint(QPainter::Antialiasing);
//border
QPainterPath path;
path.addRoundedRect(this->rect(), m_borderRadius, m_borderRadius);
QPen pen(m_outsideBorderColor, m_borderWidth);
p.setPen(pen);
p.drawPath(path);
QRect insideRect;
insideRect.setRect(this->rect().x() + m_borderWidth,
this->rect().y() + m_borderWidth,
this->rect().width() - m_borderWidth * 2,
this->rect().height() - m_borderWidth * 2);
QPainterPath lastpath;
lastpath.addRoundedRect(insideRect, m_borderRadius, m_borderRadius);
p.setClipPath(lastpath);
p.fillRect(0, 0, width(), height(), m_coverBrush);
p.end();*/
}

View File

@ -1,14 +1,30 @@
/*
* Copyright (C) 2013 ~ 2018 National University of Defense Technology(NUDT) & Tianjin Kylin Ltd.
*
* Authors:
* Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef RESOURCESINDICATOR_H
#define RESOURCESINDICATOR_H
#include <QObject>
#include <QWidget>
//#include <QLabel>
#include <QPixmap>
//class QVBoxLayout;
//class QHBoxLayout;
class ResourcesIndicator : public QWidget
{
Q_OBJECT
@ -53,10 +69,6 @@ private:
QColor m_outsideBorderColor;
QColor m_bgColor;
QColor m_borderColor;
// QLabel *m_titleLabel = nullptr;
// QLabel *m_textLabel = nullptr;
// QVBoxLayout *m_rLayout = nullptr;
// QHBoxLayout *m_layout = nullptr;
};
#endif // RESOURCESINDICATOR_H

View File

@ -15,6 +15,7 @@ TEMPLATE = lib
DESTDIR = $$_PRO_FILE_PWD_/../
CONFIG += plugin c++11 link_pkgconfig
PKGCONFIG += libgtop-2.0 libsystemd
#gio-2.0
target.path = $${PREFIX}/lib/kylin-assistant/plugins/
INSTALLS += target

View File

@ -1,5 +1,7 @@
QSplitter::handle{
background:lightgray;
/*background:lightgray;*/
/*background-color: qconicalgradient(cx:0.5, cy:0.5, angle:180, stop:0.49999 rgba(134, 198, 233, 255), stop:0.50001 rgba(206, 234, 248, 255));*/
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,stop:0 #f1f1f1, stop:1 #e0e0e0)
}
QLabel{
@ -789,3 +791,19 @@ MyTristateButton#UnMaxButton {
qproperty-hoverPic: url(:/res/tool/unmax_hover.png);
qproperty-pressPic: url(:/res/tool/unmax_press.png);
}
/*QPushButton#KylinButton {
border: 1px solid rgb(124, 124, 124);
background-color: qconicalgradient(cx:0.5, cy:0.5, angle:180, stop:0.49999 rgba(214, 214, 214, 255), stop:0.50001 rgba(236, 236, 236, 255));
border-radius:5px;
}
QPushButton#KylinButton:hover{
border: 1px solid #3C80B1;
background-color: qconicalgradient(cx:0.5, cy:0.5, angle:180, stop:0.49999 rgba(181, 225, 250, 255), stop:0.50001 rgba(222, 242, 251, 255));
border-radius:5px;
}
QPushButton#KylinButton:pressed{
border: 1px solid #5F92B2;
background-color: qconicalgradient(cx:0.5, cy:0.5, angle:180, stop:0.49999 rgba(134, 198, 233, 255), stop:0.50001 rgba(206, 234, 248, 255));
border-radius:5px;
}*/

View File

@ -534,10 +534,30 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>CpuRateWidget</name>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="40"/>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="258"/>
<source>CPU</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="264"/>
<source>Occupancy rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="270"/>
<source>Idle rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="276"/>
<source>The running time of system</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="282"/>
<source>The idle time of system</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyWidget</name>
@ -1379,7 +1399,7 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>MemoryWidget</name>
<message>
<location filename="../../plugins/systemmonitor/memorywidget.cpp" line="19"/>
<location filename="../../plugins/systemmonitor/memorywidget.cpp" line="18"/>
<source>Memory</source>
<translation type="unfinished"></translation>
</message>
@ -1529,7 +1549,7 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>NetworkWidget</name>
<message>
<location filename="../../plugins/systemmonitor/networkwidget.cpp" line="41"/>
<location filename="../../plugins/systemmonitor/networkwidget.cpp" line="38"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>
@ -1625,6 +1645,24 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProcessCategory</name>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="37"/>
<source>Active Processes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="40"/>
<source>My Processes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="43"/>
<source>All Processes</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProcessDialog</name>
<message>
@ -2603,6 +2641,46 @@ Are you sure to continue?</source>
<source>TiB/s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="41"/>
<source>%1hours</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="43"/>
<source>%1hour</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="45"/>
<source>%1minutes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="47"/>
<source>%1minute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="49"/>
<source>%1seconds</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="51"/>
<source>%1second</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="56"/>
<source>%1day</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="58"/>
<source>%1days</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QUIBO</name>
@ -2615,17 +2693,17 @@ Are you sure to continue?</source>
<context>
<name>ResourcesCategory</name>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="35"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="37"/>
<source>CPU</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="37"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="39"/>
<source>Memory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="39"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="41"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>

View File

@ -534,10 +534,30 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>CpuRateWidget</name>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="40"/>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="258"/>
<source>CPU</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="264"/>
<source>Occupancy rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="270"/>
<source>Idle rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="276"/>
<source>The running time of system</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="282"/>
<source>The idle time of system</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyWidget</name>
@ -1379,7 +1399,7 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>MemoryWidget</name>
<message>
<location filename="../../plugins/systemmonitor/memorywidget.cpp" line="19"/>
<location filename="../../plugins/systemmonitor/memorywidget.cpp" line="18"/>
<source>Memory</source>
<translation type="unfinished"></translation>
</message>
@ -1529,7 +1549,7 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>NetworkWidget</name>
<message>
<location filename="../../plugins/systemmonitor/networkwidget.cpp" line="41"/>
<location filename="../../plugins/systemmonitor/networkwidget.cpp" line="38"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>
@ -1625,6 +1645,24 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProcessCategory</name>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="37"/>
<source>Active Processes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="40"/>
<source>My Processes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="43"/>
<source>All Processes</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProcessDialog</name>
<message>
@ -2603,6 +2641,46 @@ Are you sure to continue?</source>
<source>TiB/s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="41"/>
<source>%1hours</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="43"/>
<source>%1hour</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="45"/>
<source>%1minutes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="47"/>
<source>%1minute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="49"/>
<source>%1seconds</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="51"/>
<source>%1second</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="56"/>
<source>%1day</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="58"/>
<source>%1days</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QUIBO</name>
@ -2615,17 +2693,17 @@ Are you sure to continue?</source>
<context>
<name>ResourcesCategory</name>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="35"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="37"/>
<source>CPU</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="37"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="39"/>
<source>Memory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="39"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="41"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>

View File

@ -534,10 +534,30 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>CpuRateWidget</name>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="40"/>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="258"/>
<source>CPU</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="264"/>
<source>Occupancy rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="270"/>
<source>Idle rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="276"/>
<source>The running time of system</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="282"/>
<source>The idle time of system</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyWidget</name>
@ -1379,7 +1399,7 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>MemoryWidget</name>
<message>
<location filename="../../plugins/systemmonitor/memorywidget.cpp" line="19"/>
<location filename="../../plugins/systemmonitor/memorywidget.cpp" line="18"/>
<source>Memory</source>
<translation type="unfinished"></translation>
</message>
@ -1529,7 +1549,7 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>NetworkWidget</name>
<message>
<location filename="../../plugins/systemmonitor/networkwidget.cpp" line="41"/>
<location filename="../../plugins/systemmonitor/networkwidget.cpp" line="38"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>
@ -1625,6 +1645,24 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProcessCategory</name>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="37"/>
<source>Active Processes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="40"/>
<source>My Processes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="43"/>
<source>All Processes</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProcessDialog</name>
<message>
@ -2603,6 +2641,46 @@ Are you sure to continue?</source>
<source>TiB/s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="41"/>
<source>%1hours</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="43"/>
<source>%1hour</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="45"/>
<source>%1minutes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="47"/>
<source>%1minute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="49"/>
<source>%1seconds</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="51"/>
<source>%1second</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="56"/>
<source>%1day</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="58"/>
<source>%1days</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QUIBO</name>
@ -2615,17 +2693,17 @@ Are you sure to continue?</source>
<context>
<name>ResourcesCategory</name>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="35"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="37"/>
<source>CPU</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="37"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="39"/>
<source>Memory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="39"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="41"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>

View File

@ -534,10 +534,30 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>CpuRateWidget</name>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="40"/>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="258"/>
<source>CPU</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="264"/>
<source>Occupancy rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="270"/>
<source>Idle rate</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="276"/>
<source>The running time of system</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="282"/>
<source>The idle time of system</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EnergyWidget</name>
@ -1379,7 +1399,7 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>MemoryWidget</name>
<message>
<location filename="../../plugins/systemmonitor/memorywidget.cpp" line="19"/>
<location filename="../../plugins/systemmonitor/memorywidget.cpp" line="18"/>
<source>Memory</source>
<translation type="unfinished"></translation>
</message>
@ -1529,7 +1549,7 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>NetworkWidget</name>
<message>
<location filename="../../plugins/systemmonitor/networkwidget.cpp" line="41"/>
<location filename="../../plugins/systemmonitor/networkwidget.cpp" line="38"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>
@ -1625,6 +1645,24 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProcessCategory</name>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="37"/>
<source>Active Processes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="40"/>
<source>My Processes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="43"/>
<source>All Processes</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ProcessDialog</name>
<message>
@ -2603,6 +2641,46 @@ Are you sure to continue?</source>
<source>TiB/s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="41"/>
<source>%1hours</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="43"/>
<source>%1hour</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="45"/>
<source>%1minutes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="47"/>
<source>%1minute</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="49"/>
<source>%1seconds</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="51"/>
<source>%1second</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="56"/>
<source>%1day</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="58"/>
<source>%1days</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QUIBO</name>
@ -2615,17 +2693,17 @@ Are you sure to continue?</source>
<context>
<name>ResourcesCategory</name>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="35"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="37"/>
<source>CPU</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="37"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="39"/>
<source>Memory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="39"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="41"/>
<source>Network</source>
<translation type="unfinished"></translation>
</message>

View File

@ -1198,10 +1198,30 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>CpuRateWidget</name>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="40"/>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="258"/>
<source>CPU</source>
<translation></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="264"/>
<source>Occupancy rate</source>
<translation></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="270"/>
<source>Idle rate</source>
<translation></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="276"/>
<source>The running time of system</source>
<translation></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="282"/>
<source>The idle time of system</source>
<translation></translation>
</message>
</context>
<context>
<name>CpuWidget</name>
@ -2148,7 +2168,7 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<translation type="vanished"> %1</translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/memorywidget.cpp" line="19"/>
<location filename="../../plugins/systemmonitor/memorywidget.cpp" line="18"/>
<source>Memory</source>
<translation></translation>
</message>
@ -2348,9 +2368,9 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<context>
<name>NetworkWidget</name>
<message>
<location filename="../../plugins/systemmonitor/networkwidget.cpp" line="41"/>
<location filename="../../plugins/systemmonitor/networkwidget.cpp" line="38"/>
<source>Network</source>
<translation type="unfinished"></translation>
<translation></translation>
</message>
</context>
<context>
@ -2455,6 +2475,24 @@ Kylin Team &lt;ubuntukylin-members@list.launchpad.net&gt;</source>
<translation></translation>
</message>
</context>
<context>
<name>ProcessCategory</name>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="37"/>
<source>Active Processes</source>
<translation></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="40"/>
<source>My Processes</source>
<translation></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/processcategory.cpp" line="43"/>
<source>All Processes</source>
<translation></translation>
</message>
</context>
<context>
<name>ProcessDialog</name>
<message>
@ -3483,6 +3521,46 @@ Are you sure to continue?</source>
<source>TiB/s</source>
<translation>TiB/</translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="41"/>
<source>%1hours</source>
<translation>%1</translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="43"/>
<source>%1hour</source>
<translation>%1</translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="45"/>
<source>%1minutes</source>
<translation>%1</translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="47"/>
<source>%1minute</source>
<translation>%1</translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="49"/>
<source>%1seconds</source>
<translation>%1</translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="51"/>
<source>%1second</source>
<translation>%1</translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="56"/>
<source>%1day</source>
<translation>%1</translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/cpuratewidget.cpp" line="58"/>
<source>%1days</source>
<translation>%1</translation>
</message>
</context>
<context>
<name>QUIBO</name>
@ -3495,17 +3573,17 @@ Are you sure to continue?</source>
<context>
<name>ResourcesCategory</name>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="35"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="37"/>
<source>CPU</source>
<translation></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="37"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="39"/>
<source>Memory</source>
<translation></translation>
</message>
<message>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="39"/>
<location filename="../../plugins/systemmonitor/resourcescategory.cpp" line="41"/>
<source>Network</source>
<translation></translation>
</message>