!21 [sync] PR-20: 取消控制中心的授权显示
From: @openeuler-sync-bot Reviewed-by: @panchenbo Signed-off-by: @panchenbo
This commit is contained in:
commit
29546d3d36
587
0001-hide-authorized.patch
Normal file
587
0001-hide-authorized.patch
Normal file
@ -0,0 +1,587 @@
|
|||||||
|
From 6f75016b635f0bdd4867bcad46bdf618f4321a2c Mon Sep 17 00:00:00 2001
|
||||||
|
From: loong ci <loong_c@yeah.net>
|
||||||
|
Date: Thu, 4 Aug 2022 17:39:05 +0800
|
||||||
|
Subject: [PATCH] hide authorized
|
||||||
|
|
||||||
|
---
|
||||||
|
src/frame/CMakeLists.txt | 1 +
|
||||||
|
src/frame/modules/systeminfo/systeminfomodel.cpp | 4 ++++
|
||||||
|
src/frame/modules/systeminfo/systeminfomodel.h | 12 ++++++++++++
|
||||||
|
src/frame/modules/systeminfo/systeminfowork.cpp | 6 ++++++
|
||||||
|
src/frame/modules/systeminfo/systeminfowork.h | 4 ++++
|
||||||
|
src/frame/modules/update/updatemodel.cpp | 4 ++++
|
||||||
|
src/frame/modules/update/updatemodel.h | 7 +++++++
|
||||||
|
src/frame/modules/update/updatework.cpp | 4 ++++
|
||||||
|
src/frame/modules/update/updatework.h | 4 ++++
|
||||||
|
.../modules/systeminfo/nativeinfowidget.cpp | 14 ++++++++++++++
|
||||||
|
.../window/modules/systeminfo/nativeinfowidget.h | 6 ++++++
|
||||||
|
.../modules/systeminfo/systeminfomodule.cpp | 2 ++
|
||||||
|
.../window/modules/update/updatectrlwidget.cpp | 16 ++++++++++++++++
|
||||||
|
.../window/modules/update/updatectrlwidget.h | 2 ++
|
||||||
|
src/frame/window/modules/update/updatemodule.cpp | 6 +++++-
|
||||||
|
15 files changed, 91 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/frame/CMakeLists.txt b/src/frame/CMakeLists.txt
|
||||||
|
index d391e05..02cced1 100644
|
||||||
|
--- a/src/frame/CMakeLists.txt
|
||||||
|
+++ b/src/frame/CMakeLists.txt
|
||||||
|
@@ -30,6 +30,7 @@ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(DEFINED_LIST
|
||||||
|
+DISABLE_ACTIVATOR
|
||||||
|
DISABLE_OPACITY_ANIMATION
|
||||||
|
DISABLE_CLOUD_SYNC
|
||||||
|
DISABLE_SYS_UPDATE
|
||||||
|
diff --git a/src/frame/modules/systeminfo/systeminfomodel.cpp b/src/frame/modules/systeminfo/systeminfomodel.cpp
|
||||||
|
index af539b1..78ecebc 100644
|
||||||
|
--- a/src/frame/modules/systeminfo/systeminfomodel.cpp
|
||||||
|
+++ b/src/frame/modules/systeminfo/systeminfomodel.cpp
|
||||||
|
@@ -60,7 +60,9 @@ SystemInfoModel::SystemInfoModel(QObject *parent)
|
||||||
|
, m_themeEnabled(false)
|
||||||
|
, m_updating(false)
|
||||||
|
, m_type(64)
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
, m_licenseState(ActiveState::Unauthorized)
|
||||||
|
+#endif
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -218,6 +220,7 @@ void SystemInfoModel::setKernel(const QString &kernel)
|
||||||
|
kernelChanged(kernel);
|
||||||
|
}
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void SystemInfoModel::setLicenseState(ActiveState state)
|
||||||
|
{
|
||||||
|
if (m_licenseState != state) {
|
||||||
|
@@ -225,6 +228,7 @@ void SystemInfoModel::setLicenseState(ActiveState state)
|
||||||
|
Q_EMIT licenseStateChanged(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
diff --git a/src/frame/modules/systeminfo/systeminfomodel.h b/src/frame/modules/systeminfo/systeminfomodel.h
|
||||||
|
index 30a648e..84c17be 100644
|
||||||
|
--- a/src/frame/modules/systeminfo/systeminfomodel.h
|
||||||
|
+++ b/src/frame/modules/systeminfo/systeminfomodel.h
|
||||||
|
@@ -34,6 +34,7 @@ namespace systeminfo{
|
||||||
|
|
||||||
|
// !!! 不要用C++11的前置声明枚举类型,这里lupdate命令有个bug.具体见
|
||||||
|
// https://stackoverflow.com/questions/6504902/lupdate-error-qualifying-with-unknown-namespace-class
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
//授权状态
|
||||||
|
enum ActiveState {
|
||||||
|
Unauthorized = 0, //未授权
|
||||||
|
@@ -42,6 +43,7 @@ enum ActiveState {
|
||||||
|
TrialAuthorized, //试用期已授权
|
||||||
|
TrialExpired //试用期已过期
|
||||||
|
};
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
class SystemInfoModel : public QObject
|
||||||
|
{
|
||||||
|
@@ -64,7 +66,9 @@ public:
|
||||||
|
QString disk() const { return m_disk;}
|
||||||
|
QString kernel() const { return m_kernel;}
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
inline ActiveState licenseState() const { return m_licenseState; }
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
bool bootDelay() const;
|
||||||
|
bool themeEnabled() const { return m_themeEnabled; }
|
||||||
|
@@ -89,7 +93,9 @@ Q_SIGNALS:
|
||||||
|
void memoryChanged(const QString& memory);
|
||||||
|
void diskChanged(const QString& disk);
|
||||||
|
void kernelChanged(const QString& kernel);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void licenseStateChanged(ActiveState state);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
void setBootDelay(bool bootDelay);
|
||||||
|
@@ -106,7 +112,9 @@ public Q_SLOTS:
|
||||||
|
void setMemory(qulonglong totalMemory, qulonglong installedMemory);
|
||||||
|
void setDisk(qulonglong disk);
|
||||||
|
void setKernel(const QString &kernel);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void setLicenseState(ActiveState state);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool m_bootDelay;
|
||||||
|
@@ -126,12 +134,16 @@ private:
|
||||||
|
QString m_memory;
|
||||||
|
QString m_disk;
|
||||||
|
QString m_kernel;
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
ActiveState m_licenseState;
|
||||||
|
+#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
Q_DECLARE_METATYPE(dcc::systeminfo::ActiveState);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#endif // SYSTEMINFOMODEL_H
|
||||||
|
diff --git a/src/frame/modules/systeminfo/systeminfowork.cpp b/src/frame/modules/systeminfo/systeminfowork.cpp
|
||||||
|
index 39e9d11..d12c82a 100644
|
||||||
|
--- a/src/frame/modules/systeminfo/systeminfowork.cpp
|
||||||
|
+++ b/src/frame/modules/systeminfo/systeminfowork.cpp
|
||||||
|
@@ -98,12 +98,14 @@ SystemInfoWork::SystemInfoWork(SystemInfoModel *model, QObject *parent)
|
||||||
|
m_dbusGrub->setSync(false, false);
|
||||||
|
m_dbusGrubTheme->setSync(false, false);
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
if (DSysInfo::isDeepin()) {
|
||||||
|
QDBusConnection::systemBus().connect("com.deepin.license", "/com/deepin/license/Info",
|
||||||
|
"com.deepin.license.Info", "LicenseStateChange",
|
||||||
|
this, SLOT(licenseStateChangeSlot()));
|
||||||
|
licenseStateChangeSlot();
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
connect(m_dbusGrub, &GrubDbus::DefaultEntryChanged, m_model, &SystemInfoModel::setDefaultEntry);
|
||||||
|
connect(m_dbusGrub, &GrubDbus::EnableThemeChanged, m_model, &SystemInfoModel::setThemeEnabled);
|
||||||
|
@@ -136,7 +138,9 @@ SystemInfoWork::SystemInfoWork(SystemInfoModel *model, QObject *parent)
|
||||||
|
|
||||||
|
void SystemInfoWork::activate()
|
||||||
|
{
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
qRegisterMetaType<ActiveState>("ActiveState");
|
||||||
|
+#endif
|
||||||
|
m_model->setDistroID(m_systemInfoInter->distroID());
|
||||||
|
m_model->setDistroVer(m_systemInfoInter->distroVer());
|
||||||
|
m_model->setDisk(m_systemInfoInter->diskCap());
|
||||||
|
@@ -285,6 +289,7 @@ void SystemInfoWork::setBackground(const QString &path)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void SystemInfoWork::showActivatorDialog()
|
||||||
|
{
|
||||||
|
QDBusInterface activator("com.deepin.license.activator",
|
||||||
|
@@ -303,6 +308,7 @@ void SystemInfoWork::licenseStateChangeSlot()
|
||||||
|
QFuture<void> future = QtConcurrent::run(this, &SystemInfoWork::getLicenseState);
|
||||||
|
watcher->setFuture(future);
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
void SystemInfoWork::getEntryTitles()
|
||||||
|
{
|
||||||
|
diff --git a/src/frame/modules/systeminfo/systeminfowork.h b/src/frame/modules/systeminfo/systeminfowork.h
|
||||||
|
index f95b719..9a996be 100644
|
||||||
|
--- a/src/frame/modules/systeminfo/systeminfowork.h
|
||||||
|
+++ b/src/frame/modules/systeminfo/systeminfowork.h
|
||||||
|
@@ -62,14 +62,18 @@ public Q_SLOTS:
|
||||||
|
void grubServerFinished();
|
||||||
|
void onBackgroundChanged();
|
||||||
|
void setBackground(const QString &path);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void showActivatorDialog();
|
||||||
|
void licenseStateChangeSlot();
|
||||||
|
+#endif
|
||||||
|
void processChanged(QDBusMessage msg);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void getEntryTitles();
|
||||||
|
void getBackgroundFinished(QDBusPendingCallWatcher *w);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void getLicenseState();
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
SystemInfoModel* m_model;
|
||||||
|
diff --git a/src/frame/modules/update/updatemodel.cpp b/src/frame/modules/update/updatemodel.cpp
|
||||||
|
index 378f33d..4fcc591 100644
|
||||||
|
--- a/src/frame/modules/update/updatemodel.cpp
|
||||||
|
+++ b/src/frame/modules/update/updatemodel.cpp
|
||||||
|
@@ -69,7 +69,9 @@ UpdateModel::UpdateModel(QObject *parent)
|
||||||
|
, m_bRecoverRestoring(false)
|
||||||
|
, m_systemVersionInfo("")
|
||||||
|
, m_metaEnum(QMetaEnum::fromType<ModelUpdatesStatus>())
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
, m_bSystemActivation(UiActiveState::Unknown)
|
||||||
|
+#endif
|
||||||
|
, m_autoCheckUpdateCircle(0)
|
||||||
|
, m_isUpdatablePackages(false)
|
||||||
|
|
||||||
|
@@ -353,6 +355,7 @@ void UpdateModel::setSystemVersionInfo(const QString &systemVersionInfo)
|
||||||
|
Q_EMIT systemVersionChanged(systemVersionInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void UpdateModel::setSystemActivation(const UiActiveState &systemactivation)
|
||||||
|
{
|
||||||
|
if (m_bSystemActivation == systemactivation) {
|
||||||
|
@@ -362,6 +365,7 @@ void UpdateModel::setSystemActivation(const UiActiveState &systemactivation)
|
||||||
|
|
||||||
|
Q_EMIT systemActivationChanged(systemactivation);
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
void UpdateModel::isUpdatablePackages(bool isUpdatablePackages)
|
||||||
|
{
|
||||||
|
diff --git a/src/frame/modules/update/updatemodel.h b/src/frame/modules/update/updatemodel.h
|
||||||
|
index b268e09..76e7778 100644
|
||||||
|
--- a/src/frame/modules/update/updatemodel.h
|
||||||
|
+++ b/src/frame/modules/update/updatemodel.h
|
||||||
|
@@ -158,8 +158,10 @@ public:
|
||||||
|
|
||||||
|
bool getIsRecoveryBackingup(UpdatesStatus state) const;
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
inline UiActiveState systemActivation() const {return m_bSystemActivation;}
|
||||||
|
void setSystemActivation(const UiActiveState &systemactivation);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
inline bool getUpdatablePackages() const {return m_isUpdatablePackages;}
|
||||||
|
void isUpdatablePackages(bool isUpdatablePackages);
|
||||||
|
@@ -203,7 +205,9 @@ Q_SIGNALS:
|
||||||
|
void recoverConfigValidChanged(bool recoverConfigValid);
|
||||||
|
void recoverRestoringChanged(bool recoverRestoring);
|
||||||
|
void systemVersionChanged(QString version);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void systemActivationChanged(UiActiveState systemactivation);
|
||||||
|
+#endif
|
||||||
|
void beginCheckUpdate();
|
||||||
|
void updateCheckUpdateTime();
|
||||||
|
void updateHistoryAppInfos();
|
||||||
|
@@ -239,7 +243,10 @@ private:
|
||||||
|
bool m_bRecoverRestoring;
|
||||||
|
QString m_systemVersionInfo;
|
||||||
|
QMetaEnum m_metaEnum;
|
||||||
|
+
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
UiActiveState m_bSystemActivation;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
QString m_lastCheckUpdateTime; //上次检查更新时间
|
||||||
|
QList<AppUpdateInfo> m_historyAppInfos; //历史更新应用列表
|
||||||
|
diff --git a/src/frame/modules/update/updatework.cpp b/src/frame/modules/update/updatework.cpp
|
||||||
|
index 1f07732..d7a9573 100644
|
||||||
|
--- a/src/frame/modules/update/updatework.cpp
|
||||||
|
+++ b/src/frame/modules/update/updatework.cpp
|
||||||
|
@@ -200,6 +200,7 @@ void UpdateWorker::init() {
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void UpdateWorker::licenseStateChangeSlot()
|
||||||
|
{
|
||||||
|
QFutureWatcher<void> *watcher = new QFutureWatcher<void>();
|
||||||
|
@@ -227,6 +228,7 @@ void UpdateWorker::getLicenseState()
|
||||||
|
qDebug() << "Authorization State:" << reply;
|
||||||
|
m_model->setSystemActivation(reply);
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
void UpdateWorker::activate()
|
||||||
|
{
|
||||||
|
@@ -260,11 +262,13 @@ void UpdateWorker::activate()
|
||||||
|
refreshMirrors();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
licenseStateChangeSlot();
|
||||||
|
|
||||||
|
QDBusConnection::systemBus().connect("com.deepin.license", "/com/deepin/license/Info",
|
||||||
|
"com.deepin.license.Info", "LicenseStateChange",
|
||||||
|
this, SLOT(licenseStateChangeSlot()));
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
QFutureWatcher<QStringList> *packagesWatcher = new QFutureWatcher<QStringList>();
|
||||||
|
connect(packagesWatcher, &QFutureWatcher<QStringList>::finished, this, [=] {
|
||||||
|
diff --git a/src/frame/modules/update/updatework.h b/src/frame/modules/update/updatework.h
|
||||||
|
index 977091b..a100c28 100644
|
||||||
|
--- a/src/frame/modules/update/updatework.h
|
||||||
|
+++ b/src/frame/modules/update/updatework.h
|
||||||
|
@@ -72,7 +72,9 @@ public:
|
||||||
|
void setOnBattery(bool onBattery);
|
||||||
|
void setBatteryPercentage(const BatteryPercentageInfo &info);
|
||||||
|
void setSystemBatteryPercentage(const double &value);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void getLicenseState();
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void requestInit();
|
||||||
|
@@ -107,7 +109,9 @@ public Q_SLOTS:
|
||||||
|
void recoveryCanBackup();
|
||||||
|
void recoveryStartRestore();
|
||||||
|
void onNotifyDownloadInfoChanged();
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void licenseStateChangeSlot();
|
||||||
|
+#endif
|
||||||
|
void refreshHistoryAppsInfo();
|
||||||
|
void refreshLastTimeAndCheckCircle();
|
||||||
|
void setUpdateNotify(const bool notify);
|
||||||
|
diff --git a/src/frame/window/modules/systeminfo/nativeinfowidget.cpp b/src/frame/window/modules/systeminfo/nativeinfowidget.cpp
|
||||||
|
index e1c1fb7..82e5640 100644
|
||||||
|
--- a/src/frame/window/modules/systeminfo/nativeinfowidget.cpp
|
||||||
|
+++ b/src/frame/window/modules/systeminfo/nativeinfowidget.cpp
|
||||||
|
@@ -54,7 +54,9 @@ NativeInfoWidget::NativeInfoWidget(SystemInfoModel *model, QWidget *parent)
|
||||||
|
|
||||||
|
NativeInfoWidget::~NativeInfoWidget()
|
||||||
|
{
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
GSettingWatcher::instance()->erase("systeminfoNativeinfoAuthorized", m_authorized);
|
||||||
|
+#endif
|
||||||
|
GSettingWatcher::instance()->erase("systeminfoNativeinfoKernel", m_kernel);
|
||||||
|
GSettingWatcher::instance()->erase("systeminfoNativeinfoProcessor", m_processor);
|
||||||
|
GSettingWatcher::instance()->erase("systeminfoNativeinfoMemory", m_memory);
|
||||||
|
@@ -104,6 +106,7 @@ void NativeInfoWidget::initWidget()
|
||||||
|
//~ contents_path /systeminfo/About This PC
|
||||||
|
m_type->setTitle(tr("Type:"));
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
m_authorized = new TitleAuthorizedItem(frame);
|
||||||
|
m_authorized->setTitle(tr("Authorization") + ':');
|
||||||
|
m_authorized->setValue(tr("To be activated"));
|
||||||
|
@@ -114,6 +117,7 @@ void NativeInfoWidget::initWidget()
|
||||||
|
} else {
|
||||||
|
m_authorized->setVisable(true);
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
m_kernel = new TitleValueItem(frame);
|
||||||
|
//~ contents_path /systeminfo/About This PC
|
||||||
|
@@ -130,7 +134,9 @@ void NativeInfoWidget::initWidget()
|
||||||
|
m_memory->setTitle(tr("Memory:"));
|
||||||
|
m_memory->setValue(m_model->memory());
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
GSettingWatcher::instance()->bind("systeminfoNativeinfoAuthorized", m_authorized);
|
||||||
|
+#endif
|
||||||
|
GSettingWatcher::instance()->bind("systeminfoNativeinfoKernel", m_kernel);
|
||||||
|
GSettingWatcher::instance()->bind("systeminfoNativeinfoProcessor", m_processor);
|
||||||
|
GSettingWatcher::instance()->bind("systeminfoNativeinfoMemory", m_memory);
|
||||||
|
@@ -143,9 +149,11 @@ void NativeInfoWidget::initWidget()
|
||||||
|
}
|
||||||
|
infoGroup->appendItem(m_version, SettingsGroup::ItemBackground);
|
||||||
|
infoGroup->appendItem(m_type);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
if (!DSysInfo::isCommunityEdition())
|
||||||
|
infoGroup->appendItem(m_authorized);
|
||||||
|
m_authorized->setVisible(!DSysInfo::isCommunityEdition());
|
||||||
|
+#endif
|
||||||
|
infoGroup->appendItem(m_kernel);
|
||||||
|
infoGroup->appendItem(m_processor);
|
||||||
|
infoGroup->appendItem(m_memory);
|
||||||
|
@@ -175,13 +183,17 @@ void NativeInfoWidget::initWidget()
|
||||||
|
connect(m_model, &SystemInfoModel::processorChanged, this, &NativeInfoWidget::setProcessor);
|
||||||
|
connect(m_model, &SystemInfoModel::memoryChanged, this, &NativeInfoWidget::setMemory);
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
//传递button的点击信号
|
||||||
|
connect(m_authorized, &TitleAuthorizedItem::clicked, this, &NativeInfoWidget::clickedActivator);
|
||||||
|
connect(m_model, &SystemInfoModel::licenseStateChanged, this, &NativeInfoWidget::setLicenseState);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
setType(m_model->type());
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
setLicenseState(m_model->licenseState());
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void NativeInfoWidget::setProductName(const QString &edition)
|
||||||
|
@@ -214,6 +226,7 @@ void NativeInfoWidget::setMemory(const QString &memory)
|
||||||
|
m_memory->setValue(memory);
|
||||||
|
}
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void NativeInfoWidget::setLicenseState(ActiveState state)
|
||||||
|
{
|
||||||
|
if (state == Authorized) {
|
||||||
|
@@ -238,6 +251,7 @@ void NativeInfoWidget::setLicenseState(ActiveState state)
|
||||||
|
m_authorized->setButtonText(tr("Activate"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
const QString NativeInfoWidget::systemCopyright() const
|
||||||
|
{
|
||||||
|
diff --git a/src/frame/window/modules/systeminfo/nativeinfowidget.h b/src/frame/window/modules/systeminfo/nativeinfowidget.h
|
||||||
|
index cca4b19..50e1555 100644
|
||||||
|
--- a/src/frame/window/modules/systeminfo/nativeinfowidget.h
|
||||||
|
+++ b/src/frame/window/modules/systeminfo/nativeinfowidget.h
|
||||||
|
@@ -58,10 +58,14 @@ public Q_SLOTS:
|
||||||
|
void setType(const QString &type);
|
||||||
|
void setProcessor(const QString &processor);
|
||||||
|
void setMemory(const QString &memory);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void setLicenseState(dcc::systeminfo::ActiveState state);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
void clickedActivator();
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
private:
|
||||||
|
dcc::systeminfo::SystemInfoModel *m_model;
|
||||||
|
@@ -70,7 +74,9 @@ private:
|
||||||
|
dcc::widgets::TitleValueItem *m_versionNumber;
|
||||||
|
dcc::widgets::TitleValueItem *m_version;
|
||||||
|
dcc::widgets::TitleValueItem *m_type;
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
dcc::widgets::TitleAuthorizedItem *m_authorized;
|
||||||
|
+#endif
|
||||||
|
dcc::widgets::TitleValueItem *m_kernel;
|
||||||
|
dcc::widgets::TitleValueItem *m_processor;
|
||||||
|
dcc::widgets::TitleValueItem *m_memory;
|
||||||
|
diff --git a/src/frame/window/modules/systeminfo/systeminfomodule.cpp b/src/frame/window/modules/systeminfo/systeminfomodule.cpp
|
||||||
|
index 05fac20..563a3ee 100644
|
||||||
|
--- a/src/frame/window/modules/systeminfo/systeminfomodule.cpp
|
||||||
|
+++ b/src/frame/window/modules/systeminfo/systeminfomodule.cpp
|
||||||
|
@@ -129,7 +129,9 @@ void SystemInfoModule::onShowAboutNativePage()
|
||||||
|
m_frameProxy->pushWidget(this, w);
|
||||||
|
w->setVisible(true);
|
||||||
|
//showActivatorDialog
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
connect(w, &NativeInfoWidget::clickedActivator, m_work, &SystemInfoWork::showActivatorDialog);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void SystemInfoModule::onVersionProtocolPage()
|
||||||
|
diff --git a/src/frame/window/modules/update/updatectrlwidget.cpp b/src/frame/window/modules/update/updatectrlwidget.cpp
|
||||||
|
index 7f294e5..ed39906 100644
|
||||||
|
--- a/src/frame/window/modules/update/updatectrlwidget.cpp
|
||||||
|
+++ b/src/frame/window/modules/update/updatectrlwidget.cpp
|
||||||
|
@@ -65,7 +65,9 @@ UpdateCtrlWidget::UpdateCtrlWidget(UpdateModel *model, QWidget *parent)
|
||||||
|
, m_bRecoverRestoring(false)
|
||||||
|
, m_activeState(UiActiveState::Unknown)
|
||||||
|
, m_updateList(new ContentWidget)
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
, m_authorizationPrompt(new TipsLabel)
|
||||||
|
+#endif
|
||||||
|
, m_checkUpdateBtn(new QPushButton)
|
||||||
|
, m_lastCheckTimeTip(new TipsLabel)
|
||||||
|
{
|
||||||
|
@@ -81,11 +83,15 @@ UpdateCtrlWidget::UpdateCtrlWidget(UpdateModel *model, QWidget *parent)
|
||||||
|
m_fullProcess->setVisible(false);
|
||||||
|
m_fullProcess->setProcessValue(100);
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
m_authorizationPrompt->setText(tr("Your system is not authorized, please activate first"));
|
||||||
|
m_authorizationPrompt->setAlignment(Qt::AlignHCenter);
|
||||||
|
m_authorizationPrompt->setVisible(false);
|
||||||
|
+#endif
|
||||||
|
fullProcesslayout->addWidget(m_fullProcess);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
fullProcesslayout->addWidget(m_authorizationPrompt);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
m_summaryGroup->setVisible(true);
|
||||||
|
|
||||||
|
@@ -167,7 +173,9 @@ void UpdateCtrlWidget::setShowInfo(const UiActiveState value)
|
||||||
|
}
|
||||||
|
|
||||||
|
m_fullProcess->setEnabled(activation);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
m_authorizationPrompt->setVisible(UpdatesStatus::UpdatesAvailable == m_model->status() && !activation);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateCtrlWidget::loadAppList(const QList<AppUpdateInfo> &infos)
|
||||||
|
@@ -248,9 +256,11 @@ void UpdateCtrlWidget::setStatus(const UpdatesStatus &status)
|
||||||
|
{
|
||||||
|
m_status = status;
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
if (m_model->systemActivation() == UiActiveState::Unauthorized || m_model->systemActivation() == UiActiveState::TrialExpired) {
|
||||||
|
m_status = NoAtive;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
Q_EMIT notifyUpdateState(m_status);
|
||||||
|
|
||||||
|
@@ -259,7 +269,9 @@ void UpdateCtrlWidget::setStatus(const UpdatesStatus &status)
|
||||||
|
m_resultItem->setVisible(false);
|
||||||
|
m_progress->setVisible(false);
|
||||||
|
m_fullProcess->setVisible(false);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
m_authorizationPrompt->setVisible(false);
|
||||||
|
+#endif
|
||||||
|
m_updateList->setVisible(false);
|
||||||
|
m_upgradeWarningGroup->setVisible(false);
|
||||||
|
m_reminderTip->setVisible(false);
|
||||||
|
@@ -307,7 +319,9 @@ void UpdateCtrlWidget::setStatus(const UpdatesStatus &status)
|
||||||
|
m_fullProcess->setMessage(tr("Download and install updates"));
|
||||||
|
setDownloadInfo(m_model->downloadInfo());
|
||||||
|
setLowBattery(m_model->lowBattery());
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
setShowInfo(m_model->systemActivation());
|
||||||
|
+#endif
|
||||||
|
break;
|
||||||
|
case UpdatesStatus::Downloading:
|
||||||
|
m_progress->setVisible(true);
|
||||||
|
@@ -512,7 +526,9 @@ void UpdateCtrlWidget::setModel(UpdateModel *model)
|
||||||
|
connect(m_model, &UpdateModel::recoverBackingUpChanged, this, &UpdateCtrlWidget::setRecoverBackingUp);
|
||||||
|
connect(m_model, &UpdateModel::recoverConfigValidChanged, this, &UpdateCtrlWidget::setRecoverConfigValid);
|
||||||
|
connect(m_model, &UpdateModel::recoverRestoringChanged, this, &UpdateCtrlWidget::setRecoverRestoring);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
connect(m_model, &UpdateModel::systemActivationChanged, this, &UpdateCtrlWidget::setActiveState);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
|
||||||
|
setUpdateProgress(m_model->updateProgress());
|
||||||
|
diff --git a/src/frame/window/modules/update/updatectrlwidget.h b/src/frame/window/modules/update/updatectrlwidget.h
|
||||||
|
index f54ee46..c9bb1ac 100644
|
||||||
|
--- a/src/frame/window/modules/update/updatectrlwidget.h
|
||||||
|
+++ b/src/frame/window/modules/update/updatectrlwidget.h
|
||||||
|
@@ -109,7 +109,9 @@ private:
|
||||||
|
bool m_bRecoverRestoring;
|
||||||
|
UiActiveState m_activeState;
|
||||||
|
dcc::ContentWidget *m_updateList;
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
dcc::widgets::TipsLabel *m_authorizationPrompt;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
QPushButton *m_checkUpdateBtn;
|
||||||
|
dcc::widgets::TipsLabel *m_lastCheckTimeTip;
|
||||||
|
diff --git a/src/frame/window/modules/update/updatemodule.cpp b/src/frame/window/modules/update/updatemodule.cpp
|
||||||
|
index e8b5a86..b545a7b 100644
|
||||||
|
--- a/src/frame/window/modules/update/updatemodule.cpp
|
||||||
|
+++ b/src/frame/window/modules/update/updatemodule.cpp
|
||||||
|
@@ -79,7 +79,9 @@ void UpdateModule::preInitialize(bool sync, FrameProxyInterface::PushType pushty
|
||||||
|
|
||||||
|
connect(m_work.get(), &UpdateWorker::requestInit, m_work.get(), &UpdateWorker::init);
|
||||||
|
connect(m_work.get(), &UpdateWorker::requestActive, m_work.get(), &UpdateWorker::activate);
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
connect(m_work.get(), &UpdateWorker::requestRefreshLicenseState, m_work.get(), &UpdateWorker::licenseStateChangeSlot);
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#ifndef DISABLE_SYS_UPDATE_MIRRORS
|
||||||
|
connect(m_work.get(), &UpdateWorker::requestRefreshMirrors, m_work.get(), &UpdateWorker::refreshMirrors);
|
||||||
|
@@ -157,9 +159,11 @@ void UpdateModule::active()
|
||||||
|
|
||||||
|
Q_EMIT m_work->requestRefreshLicenseState();
|
||||||
|
|
||||||
|
+#ifndef DISABLE_ACTIVATOR
|
||||||
|
if (m_model->systemActivation() == UiActiveState::Authorized || m_model->systemActivation() == UiActiveState::TrialAuthorized || m_model->systemActivation() == UiActiveState::AuthorizedLapse) {
|
||||||
|
m_updateWidget->setSystemVersion(m_model->systemVersionInfo());
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
m_updateWidget->setModel(m_model, m_work.get());
|
||||||
|
|
||||||
|
connect(m_updateWidget, &UpdateWidget::pushMirrorsView, this, [=]() {
|
||||||
|
@@ -193,7 +197,7 @@ void UpdateModule::active()
|
||||||
|
m_updateWidget->setSystemVersion(m_model->systemVersionInfo());
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
- mainWidget->setSystemVersion(m_model->systemVersionInfo());
|
||||||
|
+ m_updateWidget->setSystemVersion(m_model->systemVersionInfo());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_frameProxy->pushWidget(this, m_updateWidget);
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
%define specrelease 1%{?dist}
|
%define specrelease 1%{?dist}
|
||||||
%if 0%{?openeuler}
|
%if 0%{?openeuler}
|
||||||
%define specrelease 2
|
%define specrelease 3
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Name: dde-control-center
|
Name: dde-control-center
|
||||||
@ -10,6 +10,7 @@ Summary: New control center for Linux Deepin
|
|||||||
License: GPLv3
|
License: GPLv3
|
||||||
URL: https://github.com/linuxdeepin/%{name}
|
URL: https://github.com/linuxdeepin/%{name}
|
||||||
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: 0001-hide-authorized.patch
|
||||||
|
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
BuildRequires: desktop-file-utils
|
BuildRequires: desktop-file-utils
|
||||||
@ -57,12 +58,14 @@ Summary: %{summary}
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version}
|
%setup -q -n %{name}-%{version}
|
||||||
|
%patch0 -p1
|
||||||
sed -i 's|lrelease|lrelease-qt5|' translate_generation.sh
|
sed -i 's|lrelease|lrelease-qt5|' translate_generation.sh
|
||||||
sed -i -E '/add_compile_definitions/d' CMakeLists.txt
|
sed -i -E '/add_compile_definitions/d' CMakeLists.txt
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%cmake . -DDCC_DISABLE_GRUB=YES \
|
%cmake . -DDCC_DISABLE_GRUB=YES \
|
||||||
-DDISABLE_SYS_UPDATE=YES
|
-DDISABLE_SYS_UPDATE=YES \
|
||||||
|
-DDISABLE_ACTIVATOR=YES
|
||||||
%make_build
|
%make_build
|
||||||
|
|
||||||
%post
|
%post
|
||||||
@ -106,6 +109,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop ||:
|
|||||||
%{_libdir}/cmake/DdeControlCenter/
|
%{_libdir}/cmake/DdeControlCenter/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Aug 05 2022 liweiganga <liweiganga@uniontech.com> - 5.4.43.27-3
|
||||||
|
- hide authorized
|
||||||
|
|
||||||
* Tue Aug 02 2022 liweiganga <liweiganga@unionttech.com> - 5.4.43.27-2
|
* Tue Aug 02 2022 liweiganga <liweiganga@unionttech.com> - 5.4.43.27-2
|
||||||
- Remove installation dependencies
|
- Remove installation dependencies
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user