Skip to content

Commit

Permalink
feat: 添加loading文字,更新翻译文件
Browse files Browse the repository at this point in the history
添加loading文字,更新翻译文件

Log: 添加loading文字,更新翻译文件
  • Loading branch information
RiskVirusPro committed Apr 26, 2022
1 parent 9093912 commit 0847967
Show file tree
Hide file tree
Showing 76 changed files with 449 additions and 1,676 deletions.
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ override_dh_auto_configure:
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_OFF" \
-DAPP_VERSION=$(DEB_VERSION_UPSTREAM) -DVERSION=$(DEB_VERSION_UPSTREAM) LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH)
rm -rf ~/.config/deepin/deepin-system-monitor/config.conf
16 changes: 8 additions & 8 deletions deepin-system-monitor-main/gui/process_page_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ static const char *appText = QT_TRANSLATE_NOOP("Process.Show.Mode", "Application
static const char *myProcText = QT_TRANSLATE_NOOP("Process.Show.Mode", "My processes");
// all process context mode text
static const char *allProcText = QT_TRANSLATE_NOOP("Process.Show.Mode", "All processes");
// process loading text
static const char *loadingText = QT_TRANSLATE_NOOP("Process.Loading", "Loading");

// constructor
ProcessPageWidget::ProcessPageWidget(DWidget *parent)
Expand Down Expand Up @@ -200,10 +202,15 @@ void ProcessPageWidget::initUI()
m_spinner = new DSpinner(this);
m_spinner->setFixedSize(32, 32);
m_spinner->setVisible(true);
m_spinner->start();
m_spinnerWidget = new QWidget(this);
m_loadingLabel = new DLabel(this);
m_loadingLabel->setText(DApplication::translate("Process.Laoding", loadingText));
m_loadingLabel->setFixedWidth(60);
QHBoxLayout *loadingLayout = new QHBoxLayout(this);
loadingLayout->addStretch();
loadingLayout->addWidget(m_spinner, Qt::AlignCenter);
loadingLayout->addWidget(m_loadingLabel, Qt::AlignCenter);
loadingLayout->addStretch();
m_spinnerWidget->setLayout(loadingLayout);
//loading 和 进程列表
m_loadingAndProcessTB = new DStackedWidget(this);
Expand Down Expand Up @@ -236,7 +243,6 @@ void ProcessPageWidget::initUI()
switch (index) {
case kFilterCurrentUser: {
//打开时也显示loading
m_spinner->start();
m_loadingAndProcessTB->setCurrentWidget(m_spinnerWidget);
// show my process view
m_myProcButton->setChecked(true);
Expand All @@ -248,7 +254,6 @@ void ProcessPageWidget::initUI()
} break;
case kNoFilter: {
//打开时也显示loading
m_spinner->start();
m_loadingAndProcessTB->setCurrentWidget(m_spinnerWidget);
// show all process view
m_allProcButton->setChecked(true);
Expand All @@ -260,7 +265,6 @@ void ProcessPageWidget::initUI()
} break;
default: {
//打开时也显示loading
m_spinner->start();
m_loadingAndProcessTB->setCurrentWidget(m_spinnerWidget);
// show my application view by default
m_appButton->setChecked(true);
Expand Down Expand Up @@ -399,7 +403,6 @@ void ProcessPageWidget::paintEvent(QPaintEvent *)

// paint frame backgroud with current themed background color
painter.fillPath(path, bgColor);

//当所有进程被按下,CPU性能较差或是系统进程过多时,延长显示loading的时间
if ((m_allProcButton->isChecked() || m_myProcButton->isChecked()) && (m_iallProcNum > PROCESS_DELAY_PAINTING_NUM || CPUPerformance == Low)) {
m_ipaintDelayTimes ++;
Expand Down Expand Up @@ -518,7 +521,6 @@ void ProcessPageWidget::onAllProcButtonClicked()
//若已选中,再次点击不会加载数据
if (m_procBtnCheckedType != ALL_PROCESSS) {
PERF_PRINT_BEGIN("POINT-04", QString("switch(%1->%2)").arg(m_procViewMode->text()).arg(DApplication::translate("Process.Show.Mode", allProcText)));
m_spinner->start();
m_loadingAndProcessTB->setCurrentWidget(m_spinnerWidget);
m_procViewMode->setText(DApplication::translate("Process.Show.Mode", allProcText));
m_procViewMode->adjustSize();
Expand All @@ -539,7 +541,6 @@ void ProcessPageWidget::onUserProcButtonClicked()
//若已选中,再次点击不会加载数据
if (m_procBtnCheckedType != USER_PROCESS) {
PERF_PRINT_BEGIN("POINT-04", QString("switch(%1->%2)").arg(m_procViewMode->text()).arg(DApplication::translate("Process.Show.Mode", myProcText)));
m_spinner->start();
m_loadingAndProcessTB->setCurrentWidget(m_spinnerWidget);
m_procViewMode->setText(DApplication::translate("Process.Show.Mode", myProcText));
m_procViewMode->adjustSize();
Expand All @@ -560,7 +561,6 @@ void ProcessPageWidget::onAppButtonClicked()
//若已选中,再次点击不会加载数据
if (m_procBtnCheckedType != MY_APPS) {
PERF_PRINT_BEGIN("POINT-04", QString("switch(%1->%2)").arg(m_procViewMode->text()).arg(DApplication::translate("Process.Show.Mode", appText)));
m_spinner->start();
m_loadingAndProcessTB->setCurrentWidget(m_spinnerWidget);
m_procViewMode->setText(DApplication::translate("Process.Show.Mode", appText));
m_procViewMode->adjustSize();
Expand Down
1 change: 1 addition & 0 deletions deepin-system-monitor-main/gui/process_page_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ private Q_SLOTS:

//loading spinner
DSpinner *m_spinner = nullptr;
DLabel *m_loadingLabel = nullptr;
QWidget *m_spinnerWidget = nullptr;

DStackedWidget *m_loadingAndProcessTB = nullptr;
Expand Down
3 changes: 2 additions & 1 deletion deepin-system-monitor-main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ int main(int argc, char *argv[])
Application::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
Application app(argc, argv);
app.setAutoActivateWindows(true);

//设置单例
DGuiApplicationHelper::setSingleInstanceInterval(-1);
if (DGuiApplicationHelper::setSingleInstance(QString("deepin-system-monitor"),
DGuiApplicationHelper::UserScope)) {
app.loadTranslator();
Expand Down
69 changes: 10 additions & 59 deletions deepin-system-monitor-main/translations/deepin-system-monitor_az.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS language="az" version="2.1">
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="az">
<context>
<name>App.About</name>
<message>
Expand All @@ -16,14 +16,6 @@
<source>Hide details</source>
<translation>Təfərrüatları gizlətmək</translation>
</message>
<message>
<source>Overall utilization</source>
<translation>Ümumi istifadə</translation>
</message>
<message>
<source>Individual utilization</source>
<translation>Fərdi istifadə</translation>
</message>
</context>
<context>
<name>BlockDevItemWidget</name>
Expand Down Expand Up @@ -505,13 +497,6 @@ Davam etmək istədiyinizə əminsiniz?</translation>
<translation>Sonlandırmaq</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<source>Settings</source>
<translation>Ayarlar</translation>
</message>
</context>
<context>
<name>MemStatViewWidget</name>
<message>
Expand Down Expand Up @@ -771,6 +756,13 @@ Davam etmək istədiyinizə əminsiniz?</translation>
<translation>Bütün proseslər</translation>
</message>
</context>
<context>
<name>Process.Loading</name>
<message>
<source>Loading</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>Process.Signal</name>
<message>
Expand Down Expand Up @@ -929,34 +921,6 @@ Davam etmək istədiyinizə əminsiniz?</translation>
<source>Not support</source>
<translation>Dəstəklənmir</translation>
</message>
<message>
<source>Settings</source>
<translation>Ayarlar</translation>
</message>
<message>
<source>System Protection</source>
<translation>Sistemin qorunması</translation>
</message>
<message>
<source>Show warnings when the usage exceeds the thresholds</source>
<translation>İstifadə, göstərilən həddi aşdıqda xəbərdarlıqları göstərmək</translation>
</message>
<message>
<source>Notifications</source>
<translation>Bildirişlər</translation>
</message>
<message>
<source>CPU warning threshold (%)</source>
<translation>MP (CPU) xəbərdarlığı həddi (%)</translation>
</message>
<message>
<source>Memory warning threshold (%)</source>
<translation>Yaddaşın xəbərdarlıq həddi (%)</translation>
</message>
<message>
<source>Warning interval (min)</source>
<translation>Xəbərdarlıq aralığı (dəq)</translation>
</message>
</context>
<context>
<name>Service.Action.Set.Startup.Mode</name>
Expand All @@ -977,10 +941,12 @@ Davam etmək istədiyinizə əminsiniz?</translation>
</message>
<message>
<source>OK</source>
<comment>button</comment>
<translation>OLDU</translation>
</message>
<message>
<source>Cancel</source>
<comment>button</comment>
<translation>İmtina</translation>
</message>
</context>
Expand Down Expand Up @@ -1050,21 +1016,6 @@ Davam etmək istədiyinizə əminsiniz?</translation>
<translation>Başladılma növü</translation>
</message>
</context>
<context>
<name>SystemProtectionSetting</name>
<message>
<source>Settings</source>
<translation>Ayarlar</translation>
</message>
<message>
<source>(Modifiable)</source>
<translation>(Dəyişdiriləbilən)</translation>
</message>
<message>
<source>Range: %1-%2</source>
<translation>Aralıq: %1-%2: </translation>
</message>
</context>
<context>
<name>Title.Bar.Context.Menu</name>
<message>
Expand Down
69 changes: 10 additions & 59 deletions deepin-system-monitor-main/translations/deepin-system-monitor_bo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS language="bo" version="2.1">
<?xml version="1.0" ?><!DOCTYPE TS><TS version="2.1" language="bo">
<context>
<name>App.About</name>
<message>
Expand All @@ -16,14 +16,6 @@
<source>Hide details</source>
<translation>ཞིབ་ཕྲའི་གནས་ཚུལ་ཡིབ་པ།</translation>
</message>
<message>
<source>Overall utilization</source>
<translation>སྤྱིའི་བེད་སྤྱོད་བྱེད་ཚད།</translation>
</message>
<message>
<source>Individual utilization</source>
<translation>སྒེར་གྱི་བེད་སྤྱོད་བྱེད་ཚད།</translation>
</message>
</context>
<context>
<name>BlockDevItemWidget</name>
Expand Down Expand Up @@ -505,13 +497,6 @@ Are you sure you want to continue?</source>
<translation>བརྒྱུད་རིམ་མཇུག་སྒྲིལ་བ།</translation>
</message>
</context>
<context>
<name>MainWindow</name>
<message>
<source>Settings</source>
<translation>སྒྲིག་འགོད།</translation>
</message>
</context>
<context>
<name>MemStatViewWidget</name>
<message>
Expand Down Expand Up @@ -771,6 +756,13 @@ Are you sure you want to continue?</source>
<translation>བརྒྱུད་རིམ་ཚང་མ།</translation>
</message>
</context>
<context>
<name>Process.Loading</name>
<message>
<source>Loading</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>Process.Signal</name>
<message>
Expand Down Expand Up @@ -929,34 +921,6 @@ Are you sure you want to continue?</source>
<source>Not support</source>
<translation>རྒྱབ་སྐྱོར་མེད་པ།</translation>
</message>
<message>
<source>Settings</source>
<translation>སྒྲིག་འགོད།</translation>
</message>
<message>
<source>System Protection</source>
<translation>རྒྱུད་ཁོངས་འགོག་སྲུང་།</translation>
</message>
<message>
<source>Show warnings when the usage exceeds the thresholds</source>
<translation>གྲངས་ཚད་གཤམ་གྱི་ཁྱབ་ཁོངས་ལས་མཐོ་བ་ཡོད་སྐབས་རང་འགུལ་ངང་ཉེན་བརྡ་གཏོང་བ།</translation>
</message>
<message>
<source>Notifications</source>
<translation>ཆ་འཕྲིན་བརྡ་ཐོ།</translation>
</message>
<message>
<source>CPU warning threshold (%)</source>
<translation>CPU (%)ཟིན་པ།</translation>
</message>
<message>
<source>Memory warning threshold (%)</source>
<translation>ནང་གསོག་ (%)ཟིན་པ།</translation>
</message>
<message>
<source>Warning interval (min)</source>
<translation>ཉེན་བརྡ་གཏོང་བའི་བར་ཐག(སྐར་མ)</translation>
</message>
</context>
<context>
<name>Service.Action.Set.Startup.Mode</name>
Expand All @@ -977,10 +941,12 @@ Are you sure you want to continue?</source>
</message>
<message>
<source>OK</source>
<comment>button</comment>
<translation>ཆོག</translation>
</message>
<message>
<source>Cancel</source>
<comment>button</comment>
<translation>འདོར་བ།</translation>
</message>
</context>
Expand Down Expand Up @@ -1050,21 +1016,6 @@ Are you sure you want to continue?</source>
<translation>འགོ་སློང་ཐབས།</translation>
</message>
</context>
<context>
<name>SystemProtectionSetting</name>
<message>
<source>Settings</source>
<translation>སྒྲིག་འགོད།</translation>
</message>
<message>
<source>(Modifiable)</source>
<translation>(གྲངས་ཚད་བཅོས་ཆོག)</translation>
</message>
<message>
<source>Range: %1-%2</source>
<translation>གྲངས་ཚད་ཀྱི་ཁྱབ་ཁོངས། %1-%2</translation>
</message>
</context>
<context>
<name>Title.Bar.Context.Menu</name>
<message>
Expand Down
Loading

0 comments on commit 0847967

Please sign in to comment.