代码拉取完成,页面将自动刷新
From 4815b66c57916eaa17fa66d97211db1bc27eb411 Mon Sep 17 00:00:00 2001
From: leeffo <[email protected]>
Date: Thu, 7 Sep 2023 09:33:11 +0800
Subject: [PATCH] hide activate function
---
src/frame/CMakeLists.txt | 1 +
.../modules/systeminfo/systeminfomodel.cpp | 4 ++++
.../modules/systeminfo/systeminfomodel.h | 12 +++++++++++
.../modules/systeminfo/systeminfowork.cpp | 8 ++++++-
src/frame/modules/systeminfo/systeminfowork.h | 4 ++++
src/frame/modules/update/updatemodel.cpp | 4 ++++
src/frame/modules/update/updatemodel.h | 6 ++++++
src/frame/modules/update/updatework.cpp | 4 ++++
src/frame/modules/update/updatework.h | 4 ++++
.../modules/systeminfo/nativeinfowidget.cpp | 14 +++++++++++++
.../modules/systeminfo/nativeinfowidget.h | 6 ++++++
.../modules/systeminfo/systeminfomodule.cpp | 2 ++
.../modules/update/updatectrlwidget.cpp | 21 ++++++++++++++++++-
.../window/modules/update/updatectrlwidget.h | 6 ++++++
.../window/modules/update/updatemodule.cpp | 4 +++-
15 files changed, 97 insertions(+), 3 deletions(-)
diff --git a/src/frame/CMakeLists.txt b/src/frame/CMakeLists.txt
index a5c64d0..288ef7f 100644
--- a/src/frame/CMakeLists.txt
+++ b/src/frame/CMakeLists.txt
@@ -28,6 +28,7 @@ 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 4965879..3488577 100644
--- a/src/frame/modules/systeminfo/systeminfomodel.cpp
+++ b/src/frame/modules/systeminfo/systeminfomodel.cpp
@@ -39,7 +39,9 @@ SystemInfoModel::SystemInfoModel(QObject *parent)
, m_themeEnabled(false)
, m_updating(false)
, m_type(64)
+#ifndef DISABLE_ACTIVATOR
, m_licenseState(ActiveState::Unauthorized)
+#endif
{
}
@@ -206,6 +208,7 @@ void SystemInfoModel::setKernel(const QString &kernel)
kernelChanged(kernel);
}
+#ifndef DISABLE_ACTIVATOR
void SystemInfoModel::setLicenseState(ActiveState state)
{
if (m_licenseState != state) {
@@ -213,6 +216,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 401c76f..0c7006c 100644
--- a/src/frame/modules/systeminfo/systeminfomodel.h
+++ b/src/frame/modules/systeminfo/systeminfomodel.h
@@ -13,6 +13,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, //未授权
@@ -22,6 +23,7 @@ enum ActiveState {
TrialExpired, //试用期已过期
FreeLicenseAuthorized = 5 //商业免费授权
};
+#endif
class SystemInfoModel : public QObject
{
@@ -45,7 +47,9 @@ public:
QString kernel() const { return m_kernel;}
QString hostName() const { return m_hostName;}
+#ifndef DISABLE_ACTIVATOR
inline ActiveState licenseState() const { return m_licenseState; }
+#endif
bool bootDelay() const;
bool themeEnabled() const { return m_themeEnabled; }
@@ -70,7 +74,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
void hostNameChanged(const QString& hostName);
void setHostNameChanged(const QString& hostName);
void setHostNameError(const QString& error);
@@ -90,7 +96,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
void setHostName(const QString& hostName);
private:
@@ -112,12 +120,16 @@ private:
QString m_disk;
QString m_kernel;
QString m_hostName;
+#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 5b1ce99..e0465d2 100644
--- a/src/frame/modules/systeminfo/systeminfowork.cpp
+++ b/src/frame/modules/systeminfo/systeminfowork.cpp
@@ -90,12 +90,14 @@ SystemInfoWork::SystemInfoWork(SystemInfoModel *model, QObject *parent)
m_dbusGrubTheme->setSync(false, false);
m_dbusHostName->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);
@@ -139,7 +141,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());
@@ -320,6 +324,7 @@ void SystemInfoWork::setBackground(const QString &path)
#endif
}
+#ifndef DISABLE_ACTIVATOR
void SystemInfoWork::showActivatorDialog()
{
QDBusInterface activator("com.deepin.license.activator",
@@ -338,6 +343,7 @@ void SystemInfoWork::licenseStateChangeSlot()
QFuture<void> future = QtConcurrent::run(this, &SystemInfoWork::getLicenseState);
watcher->setFuture(future);
}
+#endif
void SystemInfoWork::getEntryTitles()
{
@@ -399,6 +405,7 @@ void SystemInfoWork::getLicenseState()
qDebug() << "authorize result:" << reply;
m_model->setLicenseState(reply);
}
+#endif
unsigned int SystemInfoWork::getLicenseAuthorizationProperty()
{
@@ -414,7 +421,6 @@ unsigned int SystemInfoWork::getLicenseAuthorizationProperty()
return licenseInfo.property("AuthorizationProperty").value<unsigned int>();
}
-#endif
}
}
diff --git a/src/frame/modules/systeminfo/systeminfowork.h b/src/frame/modules/systeminfo/systeminfowork.h
index 284a6a5..b9887f5 100644
--- a/src/frame/modules/systeminfo/systeminfowork.h
+++ b/src/frame/modules/systeminfo/systeminfowork.h
@@ -50,15 +50,19 @@ public Q_SLOTS:
void grubServerFinished();
void onBackgroundChanged();
void setBackground(const QString &path);
+#ifndef DISABLE_ACTIVATOR
void showActivatorDialog();
void licenseStateChangeSlot();
+#endif
void processChanged(QDBusMessage msg);
void onLicenseAuthorizationProperty(void);
private:
void getEntryTitles();
void getBackgroundFinished(QDBusPendingCallWatcher *w);
+#ifndef DISABLE_ACTIVATOR
void getLicenseState();
+#endif
unsigned int getLicenseAuthorizationProperty();
private:
diff --git a/src/frame/modules/update/updatemodel.cpp b/src/frame/modules/update/updatemodel.cpp
index a01e711..fe2c45b 100644
--- a/src/frame/modules/update/updatemodel.cpp
+++ b/src/frame/modules/update/updatemodel.cpp
@@ -64,7 +64,9 @@ UpdateModel::UpdateModel(QObject *parent)
, m_bRecoverRestoring(false)
, m_systemVersionInfo(QString())
, m_metaEnum(QMetaEnum::fromType<ModelUpdatesStatus>())
+#ifndef DISABLE_ACTIVATOR
, m_bSystemActivation(UiActiveState::Unknown)
+#endif
, m_lastCheckUpdateTime(QString())
, m_autoCheckUpdateCircle(0)
, m_testingChannelServer(QString())
@@ -411,6 +413,7 @@ void UpdateModel::setSystemVersionInfo(const QString &systemVersionInfo)
Q_EMIT systemVersionChanged(systemVersionInfo);
}
+#ifndef DISABLE_ACTIVATOR
void UpdateModel::setSystemActivation(const UiActiveState &systemactivation)
{
if (m_bSystemActivation == systemactivation) {
@@ -420,6 +423,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 6187b89..f4189fb 100644
--- a/src/frame/modules/update/updatemodel.h
+++ b/src/frame/modules/update/updatemodel.h
@@ -164,8 +164,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);
@@ -282,7 +284,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();
@@ -334,7 +338,9 @@ 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 ffda8a3..8a64560 100644
--- a/src/frame/modules/update/updatework.cpp
+++ b/src/frame/modules/update/updatework.cpp
@@ -221,6 +221,7 @@ void UpdateWorker::init()
#endif
}
+#ifndef DISABLE_ACTIVATOR
void UpdateWorker::licenseStateChangeSlot()
{
QFutureWatcher<void> *watcher = new QFutureWatcher<void>();
@@ -248,6 +249,7 @@ void UpdateWorker::getLicenseState()
qDebug() << "Authorization State:" << reply;
m_model->setSystemActivation(reply);
}
+#endif
void UpdateWorker::activate()
{
@@ -300,11 +302,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<QMap<QString, QStringList>> *packagesWatcher = new QFutureWatcher<QMap<QString, QStringList>>();
connect(packagesWatcher, &QFutureWatcher<QStringList>::finished, this, [ = ] {
diff --git a/src/frame/modules/update/updatework.h b/src/frame/modules/update/updatework.h
index 7610383..a34ef72 100644
--- a/src/frame/modules/update/updatework.h
+++ b/src/frame/modules/update/updatework.h
@@ -85,7 +85,9 @@ public:
void setOnBattery(bool onBattery);
void setBatteryPercentage(const BatteryPercentageInfo &info);
void setSystemBatteryPercentage(const double &value);
+#ifndef DISABLE_ACTIVATOR
void getLicenseState();
+#endif
void setSysUpdateDownloadJobName(const QString &sysUpdateDownloadJobName);
void setSafeUpdateDownloadJobName(const QString &safeUpdateDownloadJobName);
@@ -127,7 +129,9 @@ public Q_SLOTS:
void recoveryStartRestore();
void onRecoveryBackupFinshed(const QString &kind, const bool success, const QString &errMsg);
+#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 3ba9b1f..02fc1ca 100644
--- a/src/frame/window/modules/systeminfo/nativeinfowidget.cpp
+++ b/src/frame/window/modules/systeminfo/nativeinfowidget.cpp
@@ -84,7 +84,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);
@@ -195,6 +197,7 @@ void NativeInfoWidget::initWidget()
//~ child_page About This PC
m_type->setTitle(tr("Type") + ':');
+#ifndef DISABLE_ACTIVATOR
m_authorized = new TitleAuthorizedItem(frame);
//~ contents_path /systeminfo/About This PC
//~ child_page About This PC
@@ -208,6 +211,7 @@ void NativeInfoWidget::initWidget()
m_authorized->setVisable(true);
}*/
m_authorized->setVisable(true);
+#endif
m_kernel = new TitleValueItem(frame);
//~ contents_path /systeminfo/About This PC
@@ -227,7 +231,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);
@@ -240,9 +246,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);
@@ -273,13 +281,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::resizeEvent(QResizeEvent *event)
@@ -335,6 +347,7 @@ void NativeInfoWidget::setMemory(const QString &memory)
m_memory->setValue(memory);
}
+#ifndef DISABLE_ACTIVATOR
void NativeInfoWidget::setLicenseState(ActiveState state)
{
if (state == Authorized) {
@@ -363,6 +376,7 @@ void NativeInfoWidget::setLicenseState(ActiveState state)
m_authorized->setButtonText(tr("View"));
}
}
+#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 8dea9d7..699c2f4 100644
--- a/src/frame/window/modules/systeminfo/nativeinfowidget.h
+++ b/src/frame/window/modules/systeminfo/nativeinfowidget.h
@@ -63,7 +63,9 @@ 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
void onToolButtonButtonClicked();
void onFocusChanged(const bool onFocus);
@@ -74,7 +76,9 @@ public Q_SLOTS:
void onSetHostNameError(const QString &error);
Q_SIGNALS:
+#ifndef DISABLE_ACTIVATOR
void clickedActivator();
+#endif
protected:
void resizeEvent(QResizeEvent *event) override;
@@ -92,7 +96,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 ba7444a..3d4a4d4 100644
--- a/src/frame/window/modules/systeminfo/systeminfomodule.cpp
+++ b/src/frame/window/modules/systeminfo/systeminfomodule.cpp
@@ -254,7 +254,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 6285d73..db26368 100644
--- a/src/frame/window/modules/update/updatectrlwidget.cpp
+++ b/src/frame/window/modules/update/updatectrlwidget.cpp
@@ -51,9 +51,13 @@ UpdateCtrlWidget::UpdateCtrlWidget(UpdateModel *model, QWidget *parent)
, m_bRecoverBackingUp(false)
, m_bRecoverConfigValid(false)
, m_bRecoverRestoring(false)
+#ifndef DISABLE_ACTIVATOR
, m_activeState(UiActiveState::Unknown)
+#endif
, m_updateList(new ContentWidget(parent))
+#ifndef DISABLE_ACTIVATOR
, m_authorizationPrompt(new TipsLabel(parent))
+#endif
, m_isUpdateingAll(false)
, m_checkUpdateBtn(new QPushButton(parent))
, m_lastCheckTimeTip(new TipsLabel(parent))
@@ -94,11 +98,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_powerTip->setWordWrap(true);
m_powerTip->setAlignment(Qt::AlignHCenter);
@@ -290,7 +298,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::setStatus(const UpdatesStatus &status)
@@ -298,9 +308,11 @@ void UpdateCtrlWidget::setStatus(const UpdatesStatus &status)
m_status = status;
qDebug() << "UpdateCtrlWidget::setStatus " << status;
+#ifndef DISABLE_ACTIVATOR
if (m_model->systemActivation() == UiActiveState::Unauthorized || m_model->systemActivation() == UiActiveState::TrialExpired) {
m_status = NoAtive;
}
+#endif
Q_EMIT notifyUpdateState(m_status);
@@ -309,7 +321,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);
@@ -430,10 +444,12 @@ void UpdateCtrlWidget::setLowBattery(const bool &lowBattery)
{
if (m_status == UpdatesStatus::Updateing || m_status == UpdatesStatus::UpdatesAvailable) {
bool activation = false;
+#ifndef DISABLE_ACTIVATOR
const UiActiveState value = m_model->systemActivation();
if (UiActiveState::Authorized == value || UiActiveState::TrialAuthorized == value || UiActiveState::AuthorizedLapse == value) {
activation = true;
}
+#endif
if (lowBattery) {
m_powerTip->setText(tr("Your battery is lower than 50%, please plug in to continue"));
} else {
@@ -481,6 +497,7 @@ void UpdateCtrlWidget::setRecoverRestoring(const bool value)
}
}
+#ifndef DISABLE_ACTIVATOR
void UpdateCtrlWidget::setActiveState(const UiActiveState &activestate)
{
if (m_activeState != activestate) {
@@ -493,7 +510,7 @@ void UpdateCtrlWidget::setActiveState(const UiActiveState &activestate)
setStatus(m_model->status());
}
}
-
+#endif
void UpdateCtrlWidget::setModel(UpdateModel *model)
{
@@ -514,7 +531,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
connect(m_model, &UpdateModel::classityUpdateJobErrorChanged, this, &UpdateCtrlWidget::onClassityUpdateJonErrorChanged);
connect(m_model, &UpdateModel::systemUpdateInfoChanged, this, &UpdateCtrlWidget::setSystemUpdateInfo);
diff --git a/src/frame/window/modules/update/updatectrlwidget.h b/src/frame/window/modules/update/updatectrlwidget.h
index 99713c2..a4a9cb1 100644
--- a/src/frame/window/modules/update/updatectrlwidget.h
+++ b/src/frame/window/modules/update/updatectrlwidget.h
@@ -103,7 +103,9 @@ private:
void setRecoverConfigValid(const bool value);
void setRecoverRestoring(const bool value);
void setShowInfo(const UiActiveState value);
+#ifndef DISABLE_ACTIVATOR
void setActiveState(const UiActiveState &activestate);
+#endif
void showUpdateInfo();
void onChangeUpdatesAvailableStatus();
@@ -135,9 +137,13 @@ private:
bool m_bRecoverBackingUp;
bool m_bRecoverConfigValid;
bool m_bRecoverRestoring;
+#ifndef DISABLE_ACTIVATOR
UiActiveState m_activeState;
+#endif
dcc::ContentWidget *m_updateList;
+#ifndef DISABLE_ACTIVATOR
dcc::widgets::TipsLabel *m_authorizationPrompt;
+#endif
bool m_isUpdateingAll;
QPushButton *m_checkUpdateBtn;
diff --git a/src/frame/window/modules/update/updatemodule.cpp b/src/frame/window/modules/update/updatemodule.cpp
index 2de16ba..9bf5b9a 100644
--- a/src/frame/window/modules/update/updatemodule.cpp
+++ b/src/frame/window/modules/update/updatemodule.cpp
@@ -61,7 +61,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);
@@ -176,7 +178,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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。