From 9c4097314c5e50eca8042ec8b846a0eb53e1f171 Mon Sep 17 00:00:00 2001
From: peijiankang <peijiankang@kylinos.cn>
Date: Wed, 21 Jun 2023 16:59:26 +0800
Subject: [PATCH] add information for about

---
 plugins/system/about/about.cpp | 115 +++++++++++++++++++++++--------
 plugins/system/about/about.h   |   2 +
 shell/res/i18n/zh_CN.ts        | 122 +++++++++++++++++++++------------
 3 files changed, 165 insertions(+), 74 deletions(-)

diff --git a/plugins/system/about/about.cpp b/plugins/system/about/about.cpp
index 3d474fa..4d6af71 100644
--- a/plugins/system/about/about.cpp
+++ b/plugins/system/about/about.cpp
@@ -470,6 +470,15 @@ void About::initUI(QWidget *widget)
     QString currentyear("2023");
     mTipLabel = new FixLabel(QString(tr("Copyright © 2009-%1 KylinSoft. All rights reserved.")).arg(currentyear) , Aboutwidget);
     mTipLabel->setContentsMargins(16 , 0 , 0 , 0);
+    
+    if(!Utils::getCommunity().compare("kylin", Qt::CaseSensitive)){//kylin
+        mKindLabel = new FixLabel(QString(tr("Kind reminder: If you have any questions, please consult sales\n"
+                                             "Consultation hotline: 400-089-1870")), Aboutwidget);
+        mKindLabel->setContentsMargins(16 , 0 , 0 , 0);
+
+        mWebLabel = new FixLabel(QString(tr("Company website: https://www.kylinos.cn")), Aboutwidget);
+        mWebLabel->setContentsMargins(16 , 0 , 0 , 0);
+    }
 
     mBtnFrame = new QFrame(Aboutwidget);
     mBtnFrame->setMinimumSize(QSize(550, 0));
@@ -543,7 +552,13 @@ void About::initUI(QWidget *widget)
 
     AboutLayout->addWidget(mInformationFrame);
     AboutLayout->addWidget(mActivationFrame);
-    AboutLayout->addWidget(mTipLabel);
+    if(!Utils::getCommunity().compare("kylin", Qt::CaseSensitive)){//kylin
+        AboutLayout->addWidget(mKindLabel);
+        AboutLayout->addWidget(mTipLabel);
+        AboutLayout->addWidget(mWebLabel);
+    }else{
+        AboutLayout->addWidget(mTipLabel);
+    }
     item = new QSpacerItem(10 , 32);
     AboutLayout->addSpacerItem(item);
 //    AboutLayout->addSpacing(32);
@@ -683,36 +698,74 @@ void About::setupSerialComponent()
     if (trial_dateReply.type() == QDBusMessage::ReplyMessage) {
         trial_dateRes = trial_dateReply.arguments().at(0).toString();
     }
-    mSequenceLabel_2->setText(serial);
-    mSequenceLabel_2->setStyleSheet("color : #2FB3E8");
-    if(Utils::getCommunity().compare("kylin", Qt::CaseSensitive)){
+    if(Utils::getCommunity().compare("kylin", Qt::CaseSensitive)){//社区
+        mSequenceLabel_2->setText(serial);
+        mSequenceLabel_2->setStyleSheet("color : #2FB3E8");
         if (serial.isEmpty())
             mActivationBtn->hide();
-    }
-    if (status == 0) {  //未激活  激活或未激活应通过status判断
-         if (!trial_dateRes.isEmpty()) {  //试用期
-            mStatusLabel_2->setText(tr("Inactivated"));
-            mStatusLabel_2->setStyleSheet("color : red ");
-            mTimeLabel_1->setText(tr("Trial expiration time"));
-            mTimeLabel_2->setText(trial_dateRes);
-            mActivationBtn->setText(tr("Active"));
-            activestatus = false;
-        } else {
-             mTimeLabel_1->hide();
-             mTimeLabel_2->hide();
-             mStatusLabel_2->setText(tr("Inactivated"));
-             mStatusLabel_2->setStyleSheet("color : red ");
-             mActivationBtn->setText(tr("Active"));
-         }
-    }  else {    //已激活
-        mActivationBtn->hide();
-        mTrialLabel->hide();
-        mAndLabel->hide();
-        mStatusLabel_2->setStyleSheet("");
-        mStatusLabel_2->setText(tr("Activated"));
-        mTimeLabel_2->setText(dateRes);
-        mActivationBtn->setText(tr("Extend"));
-        mActivationBtn->show();
+        if (status == 0) {  //未激活  激活或未激活应通过status判断
+             if (!trial_dateRes.isEmpty()) {  //试用期
+                mStatusLabel_2->setText(tr("Inactivated"));
+                mStatusLabel_2->setStyleSheet("color : red ");
+                mTimeLabel_1->setText(tr("Trial expiration time"));
+                mTimeLabel_2->setText(trial_dateRes);
+                mActivationBtn->setText(tr("Active"));
+                activestatus = false;
+            } else {
+                 mTimeLabel_1->hide();
+                 mTimeLabel_2->hide();
+                 mStatusLabel_2->setText(tr("Inactivated"));
+                 mStatusLabel_2->setStyleSheet("color : red ");
+                 mActivationBtn->setText(tr("Active"));
+             }
+        }  else {    //已激活
+            mActivationBtn->hide();
+            mTrialLabel->hide();
+            mAndLabel->hide();
+            mStatusLabel_2->setStyleSheet("");
+            mStatusLabel_2->setText(tr("Activated"));
+            mTimeLabel_2->setText(dateRes);
+            mActivationBtn->setText(tr("Extend"));
+            mActivationBtn->show();
+        }
+    }else{//kylin
+        if (status == 0) {  //未激活  激活或未激活应通过status判断
+             if (!trial_dateRes.isEmpty()) {  //试用期
+                mStatusLabel_2->setText(tr("Inactivated"));
+                mStatusLabel_2->setStyleSheet("color : red ");
+                mTimeLabel_1->setText(tr("Trial expiration time"));
+                mTimeLabel_2->setText(trial_dateRes);
+                mActivationBtn->setText(tr("Active"));
+                activestatus = false;
+            } else {
+                 mStatusLabel_2->setText(tr("Inactivated"));
+                 mStatusLabel_2->setStyleSheet("color : red ");
+                 mTimeLabel_1->setText(tr("Trial expiration time"));
+                 mTimeLabel_2->setText(tr("Unknow"));
+                 mActivationBtn->setText(tr("Active"));
+             }
+        }  else {    //已激活
+            mActivationBtn->hide();
+            mTrialLabel->hide();
+            mAndLabel->hide();
+            mStatusLabel_2->setStyleSheet("");
+            mStatusLabel_2->setText(tr("Activated"));
+            mTimeLabel_1->setText(tr("Service expiration time"));
+            mTimeLabel_2->setText(dateRes);
+            mActivationBtn->setText(tr("Extend"));
+            mActivationBtn->show();
+        }
+        if (serial.isEmpty()){
+            mTimeLabel_1->hide();
+            mTimeLabel_2->hide();
+            mSequenceLabel_2->setText(tr("Unknow"));
+            mSequenceLabel_2->setStyleSheet("color : #2FB3E8");
+	}else{
+            mTimeLabel_1->show();
+            mTimeLabel_2->show();
+            mSequenceLabel_2->setText(serial);
+            mSequenceLabel_2->setStyleSheet("color : #2FB3E8");
+	}
     }
     connect(mActivationBtn, &QPushButton::clicked, this, &About::runActiveWindow);
 }
@@ -995,6 +1048,10 @@ void About::setupSystemVersion()
         mAgreeLabel->hide();
         mActivationFrame->hide();
         mTipLabel->hide();
+        if(!Utils::getCommunity().compare("kylin", Qt::CaseSensitive)){//kylin
+            mKindLabel->hide();
+            mWebLabel->hide();
+	}
         mTrialLabel->hide();
     }
 
diff --git a/plugins/system/about/about.h b/plugins/system/about/about.h
index c2571ac..c2d44a3 100644
--- a/plugins/system/about/about.h
+++ b/plugins/system/about/about.h
@@ -169,7 +169,9 @@ private:
     QLabel *mHpLabel;
     FixLabel *mEducateIconLabel;
     QLabel *mEducateLabel;
+    FixLabel *mKindLabel;
     FixLabel *mTipLabel;
+    FixLabel *mWebLabel;
 
 
 
diff --git a/shell/res/i18n/zh_CN.ts b/shell/res/i18n/zh_CN.ts
index db8f2f2..8d6b862 100644
--- a/shell/res/i18n/zh_CN.ts
+++ b/shell/res/i18n/zh_CN.ts
@@ -4,94 +4,106 @@
 <context>
     <name>About</name>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="564"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="581"/>
         <source>System Summary</source>
         <translation>系统概述</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="565"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="582"/>
         <source>Support</source>
         <translation>支持</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="206"/>
-        <location filename="../../../plugins/system/about/about.cpp" line="566"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="208"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="583"/>
         <source>Version Number</source>
         <translation>版本号</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="627"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="644"/>
         <source>Status</source>
         <translation>系统状态</translation>
         <extra-contents_path>/About/Status</extra-contents_path>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="629"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="646"/>
         <source>DateRes</source>
         <translation>服务到期时间</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="569"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="586"/>
         <source>Wechat code scanning obtains HP professional technical support</source>
         <translation>微信扫码获得HP专业技术支持</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="268"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="270"/>
         <source>HostName</source>
         <translation>计算机名</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="570"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="587"/>
         <source>See more about Kylin Tianqi edu platform</source>
         <translation>查看麒麟天启教育平台更多信息</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="479"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="490"/>
         <source>&lt;&lt;Protocol&gt;&gt;</source>
         <translation>《试用免责协议》</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="226"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="228"/>
         <source>InterVersion</source>
         <translation>内部版本</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="409"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="411"/>
         <source>Privacy and agreement</source>
         <translation>隐私和协议</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="419"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="421"/>
         <source>Send optional diagnostic data</source>
         <translation>发送可选诊断数据</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="421"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="423"/>
         <source>By sending us diagnostic data, improve the system experience and solve your problems faster</source>
         <translation>通过向我们发送诊断数据，提升系统体验以及更快的解决你的问题</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="469"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="475"/>
+        <source>Kind reminder: If you have any questions, please consult sales
+Consultation hotline: 400-089-1870</source>
+        <translation>温馨提示：如有问题请咨询销售
+咨询电话：400-089-1870</translation>
+    </message>
+    <message>
+        <location filename="../../../plugins/system/about/about.cpp" line="471"/>
         <source>Copyright © 2009-%1 KylinSoft. All rights reserved.</source>
         <translation>版权所有 © 2009-%1 麒麟软件 保留所有权利。</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="480"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="479"/>
+        <source>Company website: https://www.kylinos.cn</source>
+        <translation>公司网站：https://www.kylinos.cn</translation>
+    </message>
+    <message>
+        <location filename="../../../plugins/system/about/about.cpp" line="491"/>
         <source>and</source>
         <translation>和</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="481"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="492"/>
         <source>&lt;&lt;Privacy&gt;&gt;</source>
         <translation>《用户隐私协议》</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="591"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="608"/>
         <source>Learn more HP user manual&gt;&gt;</source>
         <translation>了解更多 Hp用户手册&gt;&gt;</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="601"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="618"/>
         <source>See user manual&gt;&gt;</source>
         <translation>查看用户手册</translation>
     </message>
@@ -100,34 +112,48 @@
         <translation type="vanished">未激活(试用期)</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="692"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="710"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="736"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="743"/>
         <source>Trial expiration time</source>
         <translation>试用到期时间</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="1040"/>
-        <location filename="../../../plugins/system/about/about.cpp" line="1279"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="744"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="761"/>
+        <source>Unknow</source>
+        <translation>未知</translation>
+    </message>
+    <message>
+        <location filename="../../../plugins/system/about/about.cpp" line="1102"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="1341"/>
         <source>expired</source>
         <translation>已过期</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="710"/>
-        <location filename="../../../plugins/system/about/about.cpp" line="1044"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="753"/>
+        <source>Service expiration time</source>
+        <translation>服务到期时间</translation>
+    </message>
+    <message>
+        <location filename="../../../plugins/system/about/about.cpp" line="728"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="755"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="1111"/>
         <source>Extend</source>
         <translation>延长服务</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="1236"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="1303"/>
         <source>The system needs to be restarted to set the HostName, whether to reboot</source>
         <translation>计算机名已被修改，需要重启系统才可正常使用。建议立即重启系统！</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="1237"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="1304"/>
         <source>Reboot Now</source>
         <translation>立即重启</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="1238"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="1305"/>
         <source>Reboot Later</source>
         <translation>稍后重启</translation>
     </message>
@@ -140,9 +166,9 @@
         <translation type="vanished">延长服务</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="947"/>
-        <location filename="../../../plugins/system/about/about.cpp" line="956"/>
-        <location filename="../../../plugins/system/about/about.cpp" line="1405"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="1010"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="1019"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="1472"/>
         <source>avaliable</source>
         <translation>可用</translation>
     </message>
@@ -159,7 +185,7 @@
         <translation type="vanished">版权所有2009-2021@kylinos保留所有权利</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="615"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="632"/>
         <source>Version</source>
         <translation>版本名称</translation>
         <extra-contents_path>/About/version</extra-contents_path>
@@ -177,37 +203,37 @@
         <translation type="vanished">版权所有 © 2009-2021 麒麟软件 保留所有权利。</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="617"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="634"/>
         <source>Kernel</source>
         <translation>内核</translation>
         <extra-contents_path>/About/Kernel</extra-contents_path>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="619"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="636"/>
         <source>CPU</source>
         <translation>CPU</translation>
         <extra-contents_path>/About/CPU</extra-contents_path>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="621"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="638"/>
         <source>Memory</source>
         <translation>内存</translation>
         <extra-contents_path>/About/Memory</extra-contents_path>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="567"/>
-        <location filename="../../../plugins/system/about/about.cpp" line="954"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="584"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="1017"/>
         <source>Disk</source>
         <translation>硬盘</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="623"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="640"/>
         <source>Desktop</source>
         <translation>桌面</translation>
         <extra-contents_path>/About/Desktop</extra-contents_path>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="625"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="642"/>
         <source>User</source>
         <translation>用户名</translation>
         <extra-contents_path>/About/User</extra-contents_path>
@@ -221,7 +247,7 @@
         <translation type="vanished">有效期</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="628"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="645"/>
         <source>Serial</source>
         <translation>序列号</translation>
     </message>
@@ -234,8 +260,10 @@
         <translation type="vanished">序列号</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="694"/>
-        <location filename="../../../plugins/system/about/about.cpp" line="701"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="712"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="719"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="738"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="745"/>
         <source>Active</source>
         <translation>激活</translation>
     </message>
@@ -252,7 +280,7 @@
         <translation type="vanished">关于</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="55"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="57"/>
         <source>About</source>
         <translation>关于</translation>
     </message>
@@ -269,13 +297,16 @@
         <translation type="vanished">可用</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="690"/>
-        <location filename="../../../plugins/system/about/about.cpp" line="699"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="708"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="717"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="734"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="741"/>
         <source>Inactivated</source>
         <translation>未激活</translation>
     </message>
     <message>
-        <location filename="../../../plugins/system/about/about.cpp" line="708"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="726"/>
+        <location filename="../../../plugins/system/about/about.cpp" line="752"/>
         <source>Activated</source>
         <translation>已激活</translation>
     </message>
@@ -418,6 +449,7 @@
     <name>AddBtn</name>
     <message>
         <location filename="../../../libukcc/widgets/AddBtn/addbtn.cpp" line="20"/>
+        <location filename="../../component/AddBtn/addbtn.cpp" line="20"/>
         <source>Add</source>
         <translation>添加</translation>
     </message>
-- 
2.33.0

