diff --git a/0001-feat-root.patch b/0001-feat-root.patch new file mode 100644 index 0000000000000000000000000000000000000000..2feb9d3e064774714e2a47b06c4a4ed0a1f7c7c3 --- /dev/null +++ b/0001-feat-root.patch @@ -0,0 +1,31 @@ +From 427b261b78aedd9f04f690e20e773bbc9fd60432 Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Sun, 23 Apr 2023 10:14:14 +0800 +Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=A7=E5=88=B6=E4=B8=AD=E5=BF=83roo?= + =?UTF-8?q?t=E7=94=A8=E6=88=B7=E6=97=A0=E6=B3=95=E4=BF=AE=E6=94=B9?= + =?UTF-8?q?=E5=85=B6=E4=BB=96=E7=94=A8=E6=88=B7=E7=9A=84=E5=AF=86=E7=A0=81?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + src/frame/modules/accounts/accountsworker.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/frame/modules/accounts/accountsworker.cpp b/src/frame/modules/accounts/accountsworker.cpp +index b57ad5d..a0654e1 100644 +--- a/src/frame/modules/accounts/accountsworker.cpp ++++ b/src/frame/modules/accounts/accountsworker.cpp +@@ -532,7 +532,8 @@ void AccountsWorker::deleteUserIcon(User *user, const QString &iconPath) + + void AccountsWorker::addUser(const QString &userPath) + { +- if (userPath.contains("User0", Qt::CaseInsensitive) || m_userModel->contains(userPath)) ++ //服务器版本需要root用户信息及相关流程 ++ if ((!IsServerSystem && userPath.contains("User0", Qt::CaseInsensitive)) || m_userModel->contains(userPath)) + return; + AccountsUser *userInter = new AccountsUser(AccountsService, userPath, QDBusConnection::systemBus(), this); + userInter->setSync(false); +-- +2.20.1 + diff --git a/0002-dde-control-center-delete-keyboard-wayland.patch b/0002-dde-control-center-delete-keyboard-wayland.patch new file mode 100644 index 0000000000000000000000000000000000000000..3a75bd49b630b23ffa82eb2e6808d4953378a002 --- /dev/null +++ b/0002-dde-control-center-delete-keyboard-wayland.patch @@ -0,0 +1,1461 @@ +From a582d95e0c13d758e36d6045198f42a567a270fb Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Thu, 29 Dec 2022 15:42:49 +0800 +Subject: [PATCH] delete keyboard wayland + +--- + src/frame/CMakeLists.txt | 17 +- + src/frame/modules/keyboard/customedit.cpp | 75 +----- + src/frame/modules/keyboard/customedit.h | 9 - + src/frame/modules/keyboard/keyboardwork.cpp | 8 +- + src/frame/modules/keyboard/keyboardwork.h | 1 - + .../modules/keyboard/shortcutcontent.cpp | 85 +----- + src/frame/modules/keyboard/shortcutcontent.h | 10 - + src/frame/modules/keyboard/shortcutitem.cpp | 1 - + src/frame/modules/keyboard/shortcutmodel.cpp | 33 +-- + src/frame/modules/keyboard/shortcutmodel.h | 1 - + .../authentication/biologicalbasedialog.h | 2 +- + .../authentication/faceiddetailwidget.cpp | 2 +- + .../window/modules/keyboard/customcontent.cpp | 73 ------ + .../window/modules/keyboard/customcontent.h | 7 - + .../modules/keyboard/keyboardmodule.cpp | 18 +- + .../keyboard/shortcutsettingwidget.cpp | 78 +----- + .../modules/keyboard/shortcutsettingwidget.h | 7 - + ...wayland-keyboard-grab-v1-client-protocol.h | 248 ------------------ + ...yland-xwayland-keyboard-grab-v1-protocol.c | 60 ----- + .../window/modules/keyboard/waylandgrab.cpp | 79 ------ + .../window/modules/keyboard/waylandgrab.h | 45 ---- + src/frame/window/utils.h | 12 - + tests/dde-control-center/CMakeLists.txt | 12 +- + 23 files changed, 19 insertions(+), 864 deletions(-) + delete mode 100644 src/frame/window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-client-protocol.h + delete mode 100644 src/frame/window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-protocol.c + delete mode 100644 src/frame/window/modules/keyboard/waylandgrab.cpp + delete mode 100644 src/frame/window/modules/keyboard/waylandgrab.h + +diff --git a/src/frame/CMakeLists.txt b/src/frame/CMakeLists.txt +index a5c64d0..223eeb7 100644 +--- a/src/frame/CMakeLists.txt ++++ b/src/frame/CMakeLists.txt +@@ -22,6 +22,9 @@ endif() + + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") + ++# disable qt keywords, cause gio have signals member; ++ADD_DEFINITIONS(-DQT_NO_KEYWORDS) ++ + if (DEFINED ENABLE_MIEEE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mieee") + endif() +@@ -406,9 +409,6 @@ set(KEYBOARD_FILES + window/modules/keyboard/systemlanguagesettingwidget.cpp + window/modules/keyboard/shortcutsettingwidget.cpp + window/modules/keyboard/systemlanguagewidget.cpp +- window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-protocol.c +- window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-client-protocol.h +- window/modules/keyboard/waylandgrab.cpp + ) + + # load mouse +@@ -598,15 +598,12 @@ find_package(Qt5 COMPONENTS + DBus + Multimedia + Svg +- WaylandClient + REQUIRED) + if(${Qt5_VERSION} VERSION_GREATER "5.15.1") + find_package(Qt5 COMPONENTS + XkbCommonSupport + REQUIRED) + endif() +-find_package(KF5Wayland QUIET) +-pkg_check_modules(WaylandClient REQUIRED wayland-client) + pkg_check_modules(XCB_EWMH REQUIRED xcb-ewmh x11 xext xkbcommon) + pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus) + pkg_check_modules(QGSettings REQUIRED gsettings-qt) +@@ -624,7 +621,6 @@ set(Qt_LIBS + Qt5::Widgets + Qt5::X11Extras + Qt5::Multimedia +- Qt5::WaylandClient + ) + + set(DEEPIN_PW_CHECK libdeepin_pw_check.so) +@@ -730,7 +726,6 @@ target_include_directories(dccwidgets PUBLIC + ${CMAKE_SOURCE_DIR}/include + ${DtkWidget_INCLUDE_DIRS} + ${Qt5Gui_PRIVATE_INCLUDE_DIRS} +- ${Qt5WaylandClient_PRIVATE_INCLUDE_DIRS} + ${WaylandClient_INCLUDE_DIRS} + ${XCB_EWMH_INCLUDE_DIRS} + ) +@@ -745,9 +740,6 @@ target_link_libraries(dccwidgets PRIVATE + ${DtkWidget_LIBRARIES} + ${Qt5Widgets_LIBRARIES} + ${Qt5Svg_LIBRARIES} +- KF5::WaylandClient +- Qt5::WaylandClient +- ${WaylandClient_LIBRARIES} + ) + + +@@ -782,9 +774,6 @@ target_link_libraries(${BIN_NAME} PRIVATE + crypt + ${LIBS} + PolkitQt5-1::Agent +- KF5::WaylandClient +- Qt5::WaylandClient +- ${WaylandClient_LIBRARIES} + ) + # bin + install(TARGETS ${BIN_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) +diff --git a/src/frame/modules/keyboard/customedit.cpp b/src/frame/modules/keyboard/customedit.cpp +index fe5b6ad..99347a9 100644 +--- a/src/frame/modules/keyboard/customedit.cpp ++++ b/src/frame/modules/keyboard/customedit.cpp +@@ -5,19 +5,15 @@ + #include "customedit.h" + #include "widgets/translucentframe.h" + #include "customitem.h" +-#include "window/modules/keyboard/waylandgrab.h" +-#include "window/utils.h" + + #include + #include + #include + #include +-#include + + #include + + DWIDGET_USE_NAMESPACE +-using namespace DCC_NAMESPACE; + + keyboard::CustomEdit::CustomEdit(ShortcutModel *model, QWidget *parent): + ContentWidget(parent), +@@ -27,12 +23,8 @@ keyboard::CustomEdit::CustomEdit(ShortcutModel *model, QWidget *parent): + m_command(new LineEditWidget), + m_short(new CustomItem(this)), + m_tip(new QLabel), +- m_conflict(nullptr), +- m_waylandGrab(nullptr) ++ m_conflict(nullptr) + { +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- m_waylandGrab = new WaylandGrab(this->topLevelWidget()); +- } + m_tip->setVisible(false); + m_tip->setWordWrap(true); + +@@ -204,68 +196,3 @@ void keyboard::CustomEdit::onUpdateKey() + { + Q_EMIT requestUpdateKey(nullptr); + } +- +-void keyboard::CustomEdit::onGrab(ShortcutInfo *info) +-{ +- if (m_waylandGrab) +- m_waylandGrab->onGrab(info); +-} +- +-void keyboard::CustomEdit::keyPressEvent(QKeyEvent *e) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm()) { +- return; +- } +- m_waylandGrab->setKeyValue(WaylandkeyMap[e->key()]); +- QString lastKey = m_waylandGrab->getLastKey(); +- QString keyValue = m_waylandGrab->getKeyValue(); +- +- m_waylandGrab->setRecordState(true); +- keyEvent(true, m_waylandGrab->getRecordState() ? lastKey + keyValue : keyValue); +- if (e->key() == Qt::Key_Control || e->key() == Qt::Key_Alt +- || e->key() == Qt::Key_Shift || e->key() == Qt::Key_Super_L || e->key() == Qt::Key_Super_R) { +- lastKey += ("<" + keyValue.remove(keyValue.indexOf("_"), 2) + ">"); +- m_waylandGrab->setLastKey(lastKey); +- } +- QWidget::keyPressEvent(e); +-} +- +-void keyboard::CustomEdit::keyReleaseEvent(QKeyEvent *e) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm() || !m_waylandGrab->getRecordState()) { +- return; +- } +- QString lastKey = m_waylandGrab->getLastKey(); +- const QString keyValue = m_waylandGrab->getKeyValue(); +- if (!lastKey.isEmpty()) { +- if (WaylandkeyMap[Qt::Key_Control] == keyValue +- || WaylandkeyMap[Qt::Key_Alt] == keyValue || WaylandkeyMap[Qt::Key_Shift] == keyValue) { +- keyEvent(false, ""); +- } else if (WaylandkeyMap[Qt::Key_Super_L] == keyValue || WaylandkeyMap[Qt::Key_Super_R] == keyValue) { +- keyEvent(false, "Super_L"); +- } else { +- keyEvent(false, lastKey + keyValue); +- } +- } else { +- keyEvent(false, ""); +- } +- m_waylandGrab->setLastKey(""); +- m_waylandGrab->setRecordState(false); +- m_waylandGrab->onUnGrab(); +- QWidget::keyReleaseEvent(e); +-} +- +-void keyboard::CustomEdit::mousePressEvent(QMouseEvent *e) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm()) { +- return; +- } +- setFocus(); +- if (!m_waylandGrab->getRecordState()) { +- m_waylandGrab->onUnGrab(); +- } +- QWidget::mousePressEvent(e); +-} +diff --git a/src/frame/modules/keyboard/customedit.h b/src/frame/modules/keyboard/customedit.h +index cceeb3b..bfc5ac6 100644 +--- a/src/frame/modules/keyboard/customedit.h ++++ b/src/frame/modules/keyboard/customedit.h +@@ -16,8 +16,6 @@ + using namespace dcc; + using namespace dcc::widgets; + +-class WaylandGrab; +- + namespace dcc { + namespace keyboard{ + struct ShortcutInfo; +@@ -37,12 +35,6 @@ Q_SIGNALS: + public Q_SLOTS: + void setBottomTip(ShortcutInfo *conflict); + void keyEvent(bool press, const QString &shortcut); +- void onGrab(ShortcutInfo *info); +- +-protected: +- void keyPressEvent(QKeyEvent *e) override; +- void keyReleaseEvent(QKeyEvent *e) override; +- void mousePressEvent(QMouseEvent *e) override; + + private Q_SLOTS: + void onOpenFile(); +@@ -58,7 +50,6 @@ private: + ShortcutInfo *m_info; + QLabel *m_tip; + ShortcutInfo *m_conflict; +- WaylandGrab *m_waylandGrab; + }; + } + } +diff --git a/src/frame/modules/keyboard/keyboardwork.cpp b/src/frame/modules/keyboard/keyboardwork.cpp +index 1f66cf7..b4f8723 100644 +--- a/src/frame/modules/keyboard/keyboardwork.cpp ++++ b/src/frame/modules/keyboard/keyboardwork.cpp +@@ -10,7 +10,6 @@ + #include + #include + #include +-#include + + namespace dcc { + namespace keyboard{ +@@ -605,11 +604,8 @@ void KeyboardWorker::updateKey(ShortcutInfo *info) + { + if (m_shortcutModel) + m_shortcutModel->setCurrentInfo(info); +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- Q_EMIT stareGrab(info); +- } else { +- m_keybindInter->SelectKeystroke(); +- } ++ ++ m_keybindInter->SelectKeystroke(); + } + + void KeyboardWorker::cleanShortcutSlef(const QString &id, const int type, const QString &shortcut) +diff --git a/src/frame/modules/keyboard/keyboardwork.h b/src/frame/modules/keyboard/keyboardwork.h +index d5b1add..f04b1fe 100644 +--- a/src/frame/modules/keyboard/keyboardwork.h ++++ b/src/frame/modules/keyboard/keyboardwork.h +@@ -83,7 +83,6 @@ Q_SIGNALS: + // 快捷键恢复默认完成 + void onResetFinished(); + +- void stareGrab(ShortcutInfo *info); + + public Q_SLOTS: + #ifndef DCC_DISABLE_LANGUAGE +diff --git a/src/frame/modules/keyboard/shortcutcontent.cpp b/src/frame/modules/keyboard/shortcutcontent.cpp +index c3f5129..815b15d 100644 +--- a/src/frame/modules/keyboard/shortcutcontent.cpp ++++ b/src/frame/modules/keyboard/shortcutcontent.cpp +@@ -9,15 +9,10 @@ + #include "keyboardcontrol.h" + #include "widgets/translucentframe.h" + #include "keyboardmodel.h" +-#include "window/modules/keyboard/waylandgrab.h" +-#include "window/utils.h" + + #include +-#include + #include + +-using namespace DCC_NAMESPACE; +- + namespace dcc { + namespace keyboard { + ShortcutContent::ShortcutContent(ShortcutModel *model, QWidget *parent) +@@ -26,11 +21,7 @@ ShortcutContent::ShortcutContent(ShortcutModel *model, QWidget *parent) + , m_conflict(nullptr) + , m_shortcutItem(new ShortcutItem) + , m_buttonTuple(new ButtonTuple(ButtonTuple::Save)) +- , m_waylandGrab(nullptr) + { +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- m_waylandGrab = new WaylandGrab(this->topLevelWidget()); +- } + TranslucentFrame *widget = new TranslucentFrame(); + setContentsMargins(10, 10, 10, 10); + QVBoxLayout *layout = new QVBoxLayout(); +@@ -117,17 +108,12 @@ void ShortcutContent::setShortcut(const QString &shortcut) + m_shortcutItem->setShortcut(shortcut); + } + +-void ShortcutContent::setConflictShortcut(const QString &shortcut) +-{ +- m_conflictShortcut = shortcut; +-} +- + void ShortcutContent::keyEvent(bool press, const QString &shortcut) + { + if (!press) { + + if (shortcut.isEmpty()) { +- setBottomTip(m_shortcut == m_conflictShortcut ? m_conflict : nullptr); ++ setBottomTip(m_info); + m_shortcutItem->setShortcut(m_shortcut); + return; + } +@@ -145,12 +131,9 @@ void ShortcutContent::keyEvent(bool press, const QString &shortcut) + if (info && info != m_info && info->accels != m_info->accels) { + m_shortcutItem->setShortcut(info->accels); + setBottomTip(info); +- setConflictShortcut(shortcut); + return; + } +- } + +- if (!shortcut.isEmpty()) { + setBottomTip(nullptr); + m_shortcutItem->setShortcut(shortcut); + } +@@ -175,71 +158,5 @@ void ShortcutContent::onUpdateKey() + Q_EMIT requestUpdateKey(nullptr); + } + +-void ShortcutContent::onGrab(ShortcutInfo *info) +-{ +- if (m_waylandGrab) +- m_waylandGrab->onGrab(info); +-} +- +-void ShortcutContent::keyPressEvent(QKeyEvent *ke) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm()) { +- return; +- } +- unsigned int keKey = static_cast(ke->key()); +- m_waylandGrab->setKeyValue(WaylandkeyMap[keKey]); +- QString lastKey = m_waylandGrab->getLastKey(); +- QString keyValue = m_waylandGrab->getKeyValue(); +- +- m_waylandGrab->setRecordState(true); +- keyEvent(true, m_waylandGrab->getRecordState() ? lastKey + keyValue : keyValue); +- if (keKey == Qt::Key_Control || keKey == Qt::Key_Alt +- || keKey == Qt::Key_Shift || keKey == Qt::Key_Super_L || keKey == Qt::Key_Super_R) { +- lastKey += ("<" + keyValue.remove(keyValue.indexOf("_"), 2) + ">"); +- m_waylandGrab->setLastKey(lastKey); +- } +- return QWidget::keyPressEvent(ke); +-} +- +-void ShortcutContent::keyReleaseEvent(QKeyEvent *ke) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm()|| !m_waylandGrab->getRecordState()) { +- return; +- } +- QString lastKey = m_waylandGrab->getLastKey(); +- QString keyValue = m_waylandGrab->getKeyValue(); +- if (!lastKey.isEmpty()) { +- if (WaylandkeyMap[Qt::Key_Control] == keyValue +- || WaylandkeyMap[Qt::Key_Alt] == keyValue || WaylandkeyMap[Qt::Key_Shift] == keyValue) { +- keyEvent(false, ""); +- } else if (WaylandkeyMap[Qt::Key_Super_L] == keyValue || WaylandkeyMap[Qt::Key_Super_R] == keyValue) { +- keyEvent(false, "Super_L"); +- } else { +- keyEvent(false, lastKey + keyValue); +- } +- } else { +- keyEvent(false, ""); +- } +- m_waylandGrab->setLastKey(""); +- m_waylandGrab->setRecordState(false); +- m_waylandGrab->onUnGrab(); +- return QWidget::keyReleaseEvent(ke); +-} +- +-void ShortcutContent::mousePressEvent(QMouseEvent *e) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm()) { +- return; +- } +- setFocus(); +- if (!m_waylandGrab->getRecordState()) { +- m_waylandGrab->onUnGrab(); +- } +- QWidget::mousePressEvent(e); +-} +- + } + } +diff --git a/src/frame/modules/keyboard/shortcutcontent.h b/src/frame/modules/keyboard/shortcutcontent.h +index 5e31eb8..f1138a1 100644 +--- a/src/frame/modules/keyboard/shortcutcontent.h ++++ b/src/frame/modules/keyboard/shortcutcontent.h +@@ -14,7 +14,6 @@ + #include "widgets/buttontuple.h" + + using namespace dcc; +-class WaylandGrab; + + namespace dcc { + namespace keyboard{ +@@ -31,7 +30,6 @@ public: + void setBottomTip(ShortcutInfo *conflict); + void setInfo(ShortcutInfo *info); + void setShortcut(const QString &shortcut); +- void setConflictShortcut(const QString &shortcut); + + Q_SIGNALS: + void requestUpdateKey(ShortcutInfo *conflict); +@@ -42,12 +40,6 @@ public Q_SLOTS: + void keyEvent(bool press, const QString &shortcut); + void onReplace(); + void onUpdateKey(); +- void onGrab(ShortcutInfo *info); +- +-protected: +- void keyPressEvent(QKeyEvent *ke) override; +- void keyReleaseEvent(QKeyEvent *ke) override; +- void mousePressEvent(QMouseEvent *e) override; + + private: + ShortcutModel *m_model; +@@ -58,8 +50,6 @@ private: + dcc::widgets::ButtonTuple *m_buttonTuple; + TitleButtonItem* m_item; + QString m_shortcut; +- QString m_conflictShortcut; +- WaylandGrab *m_waylandGrab; + }; + } + } +diff --git a/src/frame/modules/keyboard/shortcutitem.cpp b/src/frame/modules/keyboard/shortcutitem.cpp +index facb5d2..1a75eff 100644 +--- a/src/frame/modules/keyboard/shortcutitem.cpp ++++ b/src/frame/modules/keyboard/shortcutitem.cpp +@@ -128,7 +128,6 @@ void ShortcutItem::setShortcut(const QString &shortcut) + accels = accels.replace("Control", "Ctrl"); + + m_key->setTextList(accels.split("-")); +- m_key->setFocus(); + QTimer::singleShot(0, this, &ShortcutItem::updateTitleSize); + } + +diff --git a/src/frame/modules/keyboard/shortcutmodel.cpp b/src/frame/modules/keyboard/shortcutmodel.cpp +index 44c33d8..df1112f 100644 +--- a/src/frame/modules/keyboard/shortcutmodel.cpp ++++ b/src/frame/modules/keyboard/shortcutmodel.cpp +@@ -303,12 +303,8 @@ void ShortcutModel::setCurrentInfo(ShortcutInfo *currentInfo) + + ShortcutInfo *ShortcutModel::getInfo(const QString &shortcut) + { +- QString newShortcut = shortcut; +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- newShortcut = parseKeystroke(newShortcut); +- } + auto res = std::find_if(m_infos.begin(), m_infos.end(), [ = ] (const ShortcutInfo *info)->bool{ +- return !QString::compare(info->accels, newShortcut, Qt::CaseInsensitive); //判断是否相等,相等则返回0 ++ return !QString::compare(info->accels, shortcut, Qt::CaseInsensitive); //判断是否相等,相等则返回0 + }); + + if (res != m_infos.end()) { +@@ -318,33 +314,6 @@ ShortcutInfo *ShortcutModel::getInfo(const QString &shortcut) + return nullptr; + } + +-QString ShortcutModel::parseKeystroke(QString& shortcut) +-{ +- // 如L转换后为L +- QStringList keys = shortcut.replace(">", ">,").split(","); +- keys.removeAll(""); +- QString sortArr[5]; +- foreach (const QString& key, keys) { +- if (key.contains("Shift")) { +- sortArr[0] = key; +- } else if (key.contains("Control")) { +- sortArr[1] = key; +- } else if (key.contains("Alt")) { +- sortArr[2] = key; +- } else if (key.contains("Super")) { +- sortArr[3] = key; +- } else { +- sortArr[4] = key; +- } +- } +- QString newShort; +- for (const QString& key : sortArr) { +- if (!key.isEmpty()) { +- newShort += key; +- } +- } +- return newShort; +-} + + void ShortcutModel::setSearchResult(const QString &searchResult) + { +diff --git a/src/frame/modules/keyboard/shortcutmodel.h b/src/frame/modules/keyboard/shortcutmodel.h +index 0e67f1f..537ec4d 100644 +--- a/src/frame/modules/keyboard/shortcutmodel.h ++++ b/src/frame/modules/keyboard/shortcutmodel.h +@@ -78,7 +78,6 @@ public: + ShortcutInfo *getInfo(const QString &shortcut); + void setSearchResult(const QString &searchResult); + bool getWindowSwitch(); +- QString parseKeystroke(QString& shortcuts); + + Q_SIGNALS: + void listChanged(QList, InfoType); +diff --git a/src/frame/window/modules/authentication/biologicalbasedialog.h b/src/frame/window/modules/authentication/biologicalbasedialog.h +index 77c28fd..7f25e05 100644 +--- a/src/frame/window/modules/authentication/biologicalbasedialog.h ++++ b/src/frame/window/modules/authentication/biologicalbasedialog.h +@@ -24,7 +24,7 @@ public: + explicit BiologicalBaseDialog(QWidget *parent = nullptr); + ~BiologicalBaseDialog(); + +-public slots: ++public Q_SLOTS: + void onShowDisclaimer(); + void onAcceptDisclaimer(bool accept); + +diff --git a/src/frame/window/modules/authentication/faceiddetailwidget.cpp b/src/frame/window/modules/authentication/faceiddetailwidget.cpp +index cc32719..2dd32eb 100644 +--- a/src/frame/window/modules/authentication/faceiddetailwidget.cpp ++++ b/src/frame/window/modules/authentication/faceiddetailwidget.cpp +@@ -43,7 +43,7 @@ FaceidDetailWidget::FaceidDetailWidget(dcc::authentication::CharaMangerModel *mo + + FaceidDetailWidget::~FaceidDetailWidget() + { +- emit requestStopEnroll(); ++ Q_EMIT requestStopEnroll(); + } + + void FaceidDetailWidget::initFaceidShow() +diff --git a/src/frame/window/modules/keyboard/customcontent.cpp b/src/frame/window/modules/keyboard/customcontent.cpp +index 0fd17e1..d36c02c 100644 +--- a/src/frame/window/modules/keyboard/customcontent.cpp ++++ b/src/frame/window/modules/keyboard/customcontent.cpp +@@ -12,8 +12,6 @@ + #include "widgets/buttontuple.h" + #include "widgets/lineeditwidget.h" + #include "widgets/settingsgroup.h" +-#include "window/utils.h" +-#include "waylandgrab.h" + + #include + +@@ -24,7 +22,6 @@ + #include + #include + #include +-#include + + DWIDGET_USE_NAMESPACE + +@@ -38,12 +35,7 @@ CustomContent::CustomContent(ShortcutModel *model, QWidget *parent) + , m_conflict(nullptr) + , m_model(model) + , m_buttonTuple(new ButtonTuple(ButtonTuple::Save)) +- , m_waylandGrab(nullptr) + { +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- m_waylandGrab = new WaylandGrab(this->parent()); +- } +- + QVBoxLayout *mainLayout = new QVBoxLayout(); + mainLayout->setContentsMargins(10, 35, 10, 0); + //~ contents_path /keyboard/Shortcuts/Add Custom Shortcut +@@ -207,68 +199,3 @@ void CustomContent::updateKey() + { + Q_EMIT requestUpdateKey(nullptr); + } +- +-void CustomContent::onGrab(ShortcutInfo *info) +-{ +- if (m_waylandGrab) +- m_waylandGrab->onGrab(info); +-} +- +-void CustomContent::keyPressEvent(QKeyEvent *ke) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm()) { +- return; +- } +- m_waylandGrab->setKeyValue(WaylandkeyMap[ke->key()]); +- QString lastKey = m_waylandGrab->getLastKey(); +- QString keyValue = m_waylandGrab->getKeyValue(); +- +- m_waylandGrab->setRecordState(true); +- keyEvent(true, m_waylandGrab->getRecordState() ? lastKey + keyValue : keyValue); +- if (ke->key() == Qt::Key_Control || ke->key() == Qt::Key_Alt +- || ke->key() == Qt::Key_Shift || ke->key() == Qt::Key_Super_L || ke->key() == Qt::Key_Super_R) { +- lastKey += ("<" + keyValue.remove(keyValue.indexOf("_"), 2) + ">"); +- m_waylandGrab->setLastKey(lastKey); +- } +- return QWidget::keyPressEvent(ke); +-} +- +-void CustomContent::keyReleaseEvent(QKeyEvent *ke) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm() || !m_waylandGrab->getRecordState()) { +- return; +- } +- QString lastKey = m_waylandGrab->getLastKey(); +- QString keyValue = m_waylandGrab->getKeyValue(); +- if (!lastKey.isEmpty()) { +- if (WaylandkeyMap[Qt::Key_Control] == keyValue +- || WaylandkeyMap[Qt::Key_Alt] == keyValue || WaylandkeyMap[Qt::Key_Shift] == keyValue) { +- keyEvent(false, ""); +- } else if (WaylandkeyMap[Qt::Key_Super_L] == keyValue || WaylandkeyMap[Qt::Key_Super_R] == keyValue) { +- keyEvent(false, "Super_L"); +- } else { +- keyEvent(false, lastKey + keyValue); +- } +- } else { +- keyEvent(false, ""); +- } +- m_waylandGrab->setLastKey(""); +- m_waylandGrab->setRecordState(false); +- m_waylandGrab->onUnGrab(); +- return QWidget::keyReleaseEvent(ke); +-} +- +-void CustomContent::mousePressEvent(QMouseEvent *e) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm()) { +- return; +- } +- setFocus(); +- if (!m_waylandGrab->getRecordState()) { +- m_waylandGrab->onUnGrab(); +- } +- QWidget::mousePressEvent(e); +-} +\ No newline at end of file +diff --git a/src/frame/window/modules/keyboard/customcontent.h b/src/frame/window/modules/keyboard/customcontent.h +index adfa6ab..076cc6f 100644 +--- a/src/frame/window/modules/keyboard/customcontent.h ++++ b/src/frame/window/modules/keyboard/customcontent.h +@@ -51,12 +51,6 @@ public Q_SLOTS: + void keyEvent(bool press, const QString &shortcut); + void updateKey(); + +- void onGrab(dcc::keyboard::ShortcutInfo *info); +- +-protected: +- void keyPressEvent(QKeyEvent *ke) override; +- void keyReleaseEvent(QKeyEvent *ke) override; +- void mousePressEvent(QMouseEvent *e) override; + + private: + dcc::keyboard::KeyboardWorker *m_work; +@@ -68,7 +62,6 @@ private: + dcc::keyboard::ShortcutModel *m_model; + dcc::widgets::ButtonTuple *m_buttonTuple; + +- WaylandGrab *m_waylandGrab; + }; + } + } +diff --git a/src/frame/window/modules/keyboard/keyboardmodule.cpp b/src/frame/window/modules/keyboard/keyboardmodule.cpp +index 12e8d74..463c627 100644 +--- a/src/frame/window/modules/keyboard/keyboardmodule.cpp ++++ b/src/frame/window/modules/keyboard/keyboardmodule.cpp +@@ -20,7 +20,6 @@ + #include "modules/keyboard/shortcutcontent.h" + #include "window/mainwindow.h" + +-#include + + using namespace dcc; + using namespace dcc::keyboard; +@@ -352,7 +351,7 @@ void KeyboardModule::onAddLocale(const QModelIndex &index) + void KeyboardModule::showShortCutSetting() + { + m_work->refreshShortcut(); +- m_shortcutSettingWidget = new ShortCutSettingWidget(m_shortcutModel, m_pMainWindow); ++ m_shortcutSettingWidget = new ShortCutSettingWidget(m_shortcutModel); + GSettingWatcher::instance()->bind("keyboardShortcut", m_shortcutSettingWidget); // 使用GSettings来控制显示状态 + m_shortcutSettingWidget->setVisible(false); + connect(m_shortcutSettingWidget, &ShortCutSettingWidget::customShortcut, this, &KeyboardModule::onPushCustomShortcut); +@@ -368,9 +367,6 @@ void KeyboardModule::showShortCutSetting() + connect(m_work, &KeyboardWorker::searchChangd, m_shortcutSettingWidget, &ShortCutSettingWidget::onSearchInfo); + connect(m_work, &KeyboardWorker::onResetFinished, m_shortcutSettingWidget, &ShortCutSettingWidget::onResetFinished); + +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- connect(m_work, &KeyboardWorker::stareGrab, m_shortcutSettingWidget, &ShortCutSettingWidget::onGrab); +- } + + m_frameProxy->pushWidget(this, m_shortcutSettingWidget); + m_shortcutSettingWidget->setVisible(GSettingWatcher::instance()->getStatus("keyboardShortcut") != "Hidden"); +@@ -393,7 +389,7 @@ void KeyboardModule::onPushSystemLanguageSetting() + + void KeyboardModule::onPushCustomShortcut() + { +- m_customContent = new CustomContent(m_shortcutModel, m_pMainWindow); ++ m_customContent = new CustomContent(m_shortcutModel); + m_customContent->setVisible(false); + m_customContent->setAccessibleName(tr("Custom Shortcut")); + connect(m_customContent, &CustomContent::requestUpdateKey, m_work, &KeyboardWorker::updateKey); +@@ -401,9 +397,6 @@ void KeyboardModule::onPushCustomShortcut() + connect(m_customContent, &CustomContent::requestForceSubs, m_work, &KeyboardWorker::onDisableShortcut); + connect(m_customContent, &CustomContent::back, this, &KeyboardModule::showShortCutSetting); + +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- connect(m_work, &KeyboardWorker::stareGrab, m_customContent, &CustomContent::onGrab); +- } + + m_frameProxy->pushWidget(this, m_customContent); + m_customContent->setVisible(true); +@@ -419,13 +412,9 @@ void KeyboardModule::onPushConflict(ShortcutInfo *info, const QString &shortcut) + connect(m_scContent, &ShortcutContent::requestUpdateKey, m_work, &KeyboardWorker::updateKey); + connect(m_scContent, &ShortcutContent::requestDisableShortcut, m_work, &KeyboardWorker::onDisableShortcut); + connect(m_scContent, &ShortcutContent::back, this, &KeyboardModule::showShortCutSetting); +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- connect(m_work, &KeyboardWorker::stareGrab, m_scContent, &ShortcutContent::onGrab); +- } + + m_scContent->setInfo(info); + m_scContent->setShortcut(shortcut); +- m_scContent->setConflictShortcut(shortcut); + m_scContent->setBottomTip(m_shortcutModel->getInfo(shortcut)); + + m_frameProxy->pushWidget(this, m_scContent); +@@ -446,9 +435,6 @@ void KeyboardModule::onShortcutEdit(ShortcutInfo *info) + connect(m_customEdit, &CustomEdit::requestSaveShortcut, head, &SettingsHead::toCancel); + connect(m_customEdit, &CustomEdit::requestSaveShortcut, m_work, &KeyboardWorker::modifyCustomShortcut); + connect(m_customEdit, &CustomEdit::back, this, &KeyboardModule::showShortCutSetting); +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- connect(m_work, &KeyboardWorker::stareGrab, m_customEdit, &CustomEdit::onGrab); +- } + + m_frameProxy->pushWidget(this, m_customEdit); + m_customEdit->setVisible(true); +diff --git a/src/frame/window/modules/keyboard/shortcutsettingwidget.cpp b/src/frame/window/modules/keyboard/shortcutsettingwidget.cpp +index 8b7024e..44989b0 100644 +--- a/src/frame/window/modules/keyboard/shortcutsettingwidget.cpp ++++ b/src/frame/window/modules/keyboard/shortcutsettingwidget.cpp +@@ -12,12 +12,10 @@ + #include "widgets/settingsgroup.h" + #include "widgets/searchinput.h" + #include "window/gsettingwatcher.h" +-#include "waylandgrab.h" + + #include + + #include +-#include + + using namespace DCC_NAMESPACE; + using namespace DCC_NAMESPACE::keyboard; +@@ -29,12 +27,7 @@ ShortCutSettingWidget::ShortCutSettingWidget(ShortcutModel *model, QWidget *pare + , m_workspaceGroup(nullptr) + , m_assistiveToolsGroup(nullptr) + , m_model(model) +- , m_waylandGrab(nullptr) + { +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- m_waylandGrab = new WaylandGrab(this->parent()); +- } +- + setAccessibleName("ShortCutSettingWidget"); + m_searchDelayTimer = new QTimer(this); + m_searchDelayTimer->setInterval(300); +@@ -242,12 +235,12 @@ void ShortCutSettingWidget::addShortcut(QList list, ShortcutMode + ShortcutItem *item = new ShortcutItem(); + item->setAccessibleName(info->name); + connect(item, &ShortcutItem::requestUpdateKey, this, &ShortCutSettingWidget::requestUpdateKey); +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- connect(item, &ShortcutItem::waylandEditKeyFinshed, this, [ this ]{ +- if(m_waylandGrab && !m_waylandGrab->getRecordState()) +- m_waylandGrab->onUnGrab(); +- }); +- } ++ //if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { ++ // connect(item, &ShortcutItem::waylandEditKeyFinshed, this, [ this ]{ ++ // if(m_waylandGrab && !m_waylandGrab->getRecordState()) ++ // m_waylandGrab->onUnGrab(); ++ // }); ++ //} + item->setShortcutInfo(info); + item->setTitle(info->name); + info->item = item; +@@ -444,11 +437,6 @@ void ShortCutSettingWidget::onSearchStringFinish(const QList sear + + ShortcutItem *item = new ShortcutItem; + connect(item, &ShortcutItem::requestUpdateKey, this, &ShortCutSettingWidget::requestUpdateKey); +- if (QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive)) { +- connect(this, &ShortCutSettingWidget::changed, [ & ] { +- onSearchTextChanged(m_searchText); +- }); +- } + item->setShortcutInfo(list[i]); + item->setTitle(list[i]->name); + item->setFixedHeight(36); +@@ -536,57 +524,3 @@ void ShortCutSettingWidget::onResetFinished() + { + m_bIsResting = false; + } +- +-void ShortCutSettingWidget::onGrab(ShortcutInfo *info) +-{ +- if (m_waylandGrab) +- m_waylandGrab->onGrab(info); +-} +- +-void ShortCutSettingWidget::keyPressEvent(QKeyEvent *ke) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm()) { +- return; +- } +- unsigned int keKey = static_cast(ke->key()); +- m_waylandGrab->setKeyValue(WaylandkeyMap[keKey]); +- QString lastKey = m_waylandGrab->getLastKey(); +- QString keyValue = m_waylandGrab->getKeyValue(); +- +- m_waylandGrab->setRecordState(true); +- onKeyEvent(true, m_waylandGrab->getRecordState() ? lastKey + keyValue : keyValue); +- if (keKey == Qt::Key_Control || keKey == Qt::Key_Alt +- || keKey == Qt::Key_Shift || keKey == Qt::Key_Super_L || keKey == Qt::Key_Super_R) { +- lastKey += ("<" + keyValue.remove(keyValue.indexOf("_"), 2) + ">"); +- m_waylandGrab->setLastKey(lastKey); +- } +- QWidget::keyPressEvent(ke); +-} +- +-void ShortCutSettingWidget::keyReleaseEvent(QKeyEvent *ke) +-{ +- if (!QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive) +- || !m_waylandGrab || !m_waylandGrab->getZxgm() || !m_waylandGrab->getRecordState()) { +- return; +- } +- QString lastKey = m_waylandGrab->getLastKey(); +- QString keyValue = m_waylandGrab->getKeyValue(); +- if (!lastKey.isEmpty()) { +- if (WaylandkeyMap[Qt::Key_Control] == keyValue +- || WaylandkeyMap[Qt::Key_Alt] == keyValue || WaylandkeyMap[Qt::Key_Shift] == keyValue) { +- onKeyEvent(false, ""); +- } else if (WaylandkeyMap[Qt::Key_Super_L] == keyValue || WaylandkeyMap[Qt::Key_Super_R] == keyValue) { +- onKeyEvent(false, "Super_L"); +- } else { +- onKeyEvent(false, lastKey + keyValue); +- } +- } else { +- onKeyEvent(false, ""); +- } +- m_waylandGrab->setLastKey(""); +- m_waylandGrab->setRecordState(false); +- Q_EMIT changed(m_waylandGrab->getInfo()->id, m_waylandGrab->getInfo()->type); +- m_waylandGrab->onUnGrab(); +- QWidget::keyReleaseEvent(ke); +-} +diff --git a/src/frame/window/modules/keyboard/shortcutsettingwidget.h b/src/frame/window/modules/keyboard/shortcutsettingwidget.h +index d9941f5..d8ced0a 100644 +--- a/src/frame/window/modules/keyboard/shortcutsettingwidget.h ++++ b/src/frame/window/modules/keyboard/shortcutsettingwidget.h +@@ -61,7 +61,6 @@ Q_SIGNALS: + void requestReset(); + void requestSearch(const QString &key); + +- void changed(const QString &in0, int in1); + + public Q_SLOTS: + void onSearchTextChanged(const QString &text); +@@ -75,11 +74,6 @@ public Q_SLOTS: + void onKeyEvent(bool press, const QString &shortcut); + void onResetFinished(); + +- void onGrab(dcc::keyboard::ShortcutInfo *info); +- +-protected: +- void keyPressEvent(QKeyEvent *ke) override; +- void keyReleaseEvent(QKeyEvent *ke) override; + + private: + QWidget *m_searchWidget; +@@ -115,7 +109,6 @@ private: + QStringList m_assistiveToolsIdList; + QStringList m_workspaceIdList; + +- WaylandGrab *m_waylandGrab; + }; + } + } +diff --git a/src/frame/window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-client-protocol.h b/src/frame/window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-client-protocol.h +deleted file mode 100644 +index 1da9fdc..0000000 +--- a/src/frame/window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-client-protocol.h ++++ /dev/null +@@ -1,248 +0,0 @@ +-/* Generated by wayland-scanner 1.16.0 */ +- +-#ifndef XWAYLAND_KEYBOARD_GRAB_UNSTABLE_V1_CLIENT_PROTOCOL_H +-#define XWAYLAND_KEYBOARD_GRAB_UNSTABLE_V1_CLIENT_PROTOCOL_H +- +-#include +-#include +-#include "wayland-client.h" +- +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-/** +- * @page page_xwayland_keyboard_grab_unstable_v1 The xwayland_keyboard_grab_unstable_v1 protocol +- * Protocol for grabbing the keyboard from Xwayland +- * +- * @section page_desc_xwayland_keyboard_grab_unstable_v1 Description +- * +- * This protocol is application-specific to meet the needs of the X11 +- * protocol through Xwayland. It provides a way for Xwayland to request +- * all keyboard events to be forwarded to a surface even when the +- * surface does not have keyboard focus. +- * +- * In the X11 protocol, a client may request an "active grab" on the +- * keyboard. On success, all key events are reported only to the +- * grabbing X11 client. For details, see XGrabKeyboard(3). +- * +- * The core Wayland protocol does not have a notion of an active +- * keyboard grab. When running in Xwayland, X11 applications may +- * acquire an active grab inside Xwayland but that cannot be translated +- * to the Wayland compositor who may set the input focus to some other +- * surface. In doing so, it breaks the X11 client assumption that all +- * key events are reported to the grabbing client. +- * +- * This protocol specifies a way for Xwayland to request all keyboard +- * be directed to the given surface. The protocol does not guarantee +- * that the compositor will honor this request and it does not +- * prescribe user interfaces on how to handle the respond. For example, +- * a compositor may inform the user that all key events are now +- * forwarded to the given client surface, or it may ask the user for +- * permission to do so. +- * +- * Compositors are required to restrict access to this application +- * specific protocol to Xwayland alone. +- * +- * Warning! The protocol described in this file is experimental and +- * backward incompatible changes may be made. Backward compatible +- * changes may be added together with the corresponding interface +- * version bump. +- * Backward incompatible changes are done by bumping the version +- * number in the protocol and interface names and resetting the +- * interface version. Once the protocol is to be declared stable, +- * the 'z' prefix and the version number in the protocol and +- * interface names are removed and the interface version number is +- * reset. +- * +- * @section page_ifaces_xwayland_keyboard_grab_unstable_v1 Interfaces +- * - @subpage page_iface_zwp_xwayland_keyboard_grab_manager_v1 - context object for keyboard grab manager +- * - @subpage page_iface_zwp_xwayland_keyboard_grab_v1 - interface for grabbing the keyboard +- * @section page_copyright_xwayland_keyboard_grab_unstable_v1 Copyright +- *
+- *
+- * Copyright © 2017 Red Hat Inc.
+- *
+- * Permission is hereby granted, free of charge, to any person obtaining a
+- * copy of this software and associated documentation files (the "Software"),
+- * to deal in the Software without restriction, including without limitation
+- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+- * and/or sell copies of the Software, and to permit persons to whom the
+- * Software is furnished to do so, subject to the following conditions:
+- *
+- * The above copyright notice and this permission notice (including the next
+- * paragraph) shall be included in all copies or substantial portions of the
+- * Software.
+- *
+- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+- * DEALINGS IN THE SOFTWARE.
+- * 
+- */ +-struct wl_seat; +-struct wl_surface; +-struct zwp_xwayland_keyboard_grab_manager_v1; +-struct zwp_xwayland_keyboard_grab_v1; +- +-/** +- * @page page_iface_zwp_xwayland_keyboard_grab_manager_v1 zwp_xwayland_keyboard_grab_manager_v1 +- * @section page_iface_zwp_xwayland_keyboard_grab_manager_v1_desc Description +- * +- * A global interface used for grabbing the keyboard. +- * @section page_iface_zwp_xwayland_keyboard_grab_manager_v1_api API +- * See @ref iface_zwp_xwayland_keyboard_grab_manager_v1. +- */ +-/** +- * @defgroup iface_zwp_xwayland_keyboard_grab_manager_v1 The zwp_xwayland_keyboard_grab_manager_v1 interface +- * +- * A global interface used for grabbing the keyboard. +- */ +-extern const struct wl_interface zwp_xwayland_keyboard_grab_manager_v1_interface; +-/** +- * @page page_iface_zwp_xwayland_keyboard_grab_v1 zwp_xwayland_keyboard_grab_v1 +- * @section page_iface_zwp_xwayland_keyboard_grab_v1_desc Description +- * +- * A global interface used for grabbing the keyboard. +- * @section page_iface_zwp_xwayland_keyboard_grab_v1_api API +- * See @ref iface_zwp_xwayland_keyboard_grab_v1. +- */ +-/** +- * @defgroup iface_zwp_xwayland_keyboard_grab_v1 The zwp_xwayland_keyboard_grab_v1 interface +- * +- * A global interface used for grabbing the keyboard. +- */ +-extern const struct wl_interface zwp_xwayland_keyboard_grab_v1_interface; +- +-#define ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_DESTROY 0 +-#define ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_GRAB_KEYBOARD 1 +- +- +-/** +- * @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1 +- */ +-#define ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_DESTROY_SINCE_VERSION 1 +-/** +- * @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1 +- */ +-#define ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_GRAB_KEYBOARD_SINCE_VERSION 1 +- +-/** @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1 */ +-static inline void +-zwp_xwayland_keyboard_grab_manager_v1_set_user_data(struct zwp_xwayland_keyboard_grab_manager_v1 *zwp_xwayland_keyboard_grab_manager_v1, void *user_data) +-{ +- wl_proxy_set_user_data((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1, user_data); +-} +- +-/** @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1 */ +-static inline void * +-zwp_xwayland_keyboard_grab_manager_v1_get_user_data(struct zwp_xwayland_keyboard_grab_manager_v1 *zwp_xwayland_keyboard_grab_manager_v1) +-{ +- return wl_proxy_get_user_data((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1); +-} +- +-static inline uint32_t +-zwp_xwayland_keyboard_grab_manager_v1_get_version(struct zwp_xwayland_keyboard_grab_manager_v1 *zwp_xwayland_keyboard_grab_manager_v1) +-{ +- return wl_proxy_get_version((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1); +-} +- +-/** +- * @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1 +- * +- * Destroy the keyboard grab manager. +- */ +-static inline void +-zwp_xwayland_keyboard_grab_manager_v1_destroy(struct zwp_xwayland_keyboard_grab_manager_v1 *zwp_xwayland_keyboard_grab_manager_v1) +-{ +- wl_proxy_marshal((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1, +- ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_DESTROY); +- +- wl_proxy_destroy((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1); +-} +- +-/** +- * @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1 +- * +- * The grab_keyboard request asks for a grab of the keyboard, forcing +- * the keyboard focus for the given seat upon the given surface. +- * +- * The protocol provides no guarantee that the grab is ever satisfied, +- * and does not require the compositor to send an error if the grab +- * cannot ever be satisfied. It is thus possible to request a keyboard +- * grab that will never be effective. +- * +- * The protocol: +- * +- * * does not guarantee that the grab itself is applied for a surface, +- * the grab request may be silently ignored by the compositor, +- * * does not guarantee that any events are sent to this client even +- * if the grab is applied to a surface, +- * * does not guarantee that events sent to this client are exhaustive, +- * a compositor may filter some events for its own consumption, +- * * does not guarantee that events sent to this client are continuous, +- * a compositor may change and reroute keyboard events while the grab +- * is nominally active. +- */ +-static inline struct zwp_xwayland_keyboard_grab_v1 * +-zwp_xwayland_keyboard_grab_manager_v1_grab_keyboard(struct zwp_xwayland_keyboard_grab_manager_v1 *zwp_xwayland_keyboard_grab_manager_v1, struct wl_surface *surface, struct wl_seat *seat) +-{ +- struct wl_proxy *id; +- +- id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1, +- ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_GRAB_KEYBOARD, &zwp_xwayland_keyboard_grab_v1_interface, NULL, surface, seat); +- +- return (struct zwp_xwayland_keyboard_grab_v1 *) id; +-} +- +-#define ZWP_XWAYLAND_KEYBOARD_GRAB_V1_DESTROY 0 +- +- +-/** +- * @ingroup iface_zwp_xwayland_keyboard_grab_v1 +- */ +-#define ZWP_XWAYLAND_KEYBOARD_GRAB_V1_DESTROY_SINCE_VERSION 1 +- +-/** @ingroup iface_zwp_xwayland_keyboard_grab_v1 */ +-static inline void +-zwp_xwayland_keyboard_grab_v1_set_user_data(struct zwp_xwayland_keyboard_grab_v1 *zwp_xwayland_keyboard_grab_v1, void *user_data) +-{ +- wl_proxy_set_user_data((struct wl_proxy *) zwp_xwayland_keyboard_grab_v1, user_data); +-} +- +-/** @ingroup iface_zwp_xwayland_keyboard_grab_v1 */ +-static inline void * +-zwp_xwayland_keyboard_grab_v1_get_user_data(struct zwp_xwayland_keyboard_grab_v1 *zwp_xwayland_keyboard_grab_v1) +-{ +- return wl_proxy_get_user_data((struct wl_proxy *) zwp_xwayland_keyboard_grab_v1); +-} +- +-static inline uint32_t +-zwp_xwayland_keyboard_grab_v1_get_version(struct zwp_xwayland_keyboard_grab_v1 *zwp_xwayland_keyboard_grab_v1) +-{ +- return wl_proxy_get_version((struct wl_proxy *) zwp_xwayland_keyboard_grab_v1); +-} +- +-/** +- * @ingroup iface_zwp_xwayland_keyboard_grab_v1 +- * +- * Destroy the grabbed keyboard object. If applicable, the compositor +- * will ungrab the keyboard. +- */ +-static inline void +-zwp_xwayland_keyboard_grab_v1_destroy(struct zwp_xwayland_keyboard_grab_v1 *zwp_xwayland_keyboard_grab_v1) +-{ +- wl_proxy_marshal((struct wl_proxy *) zwp_xwayland_keyboard_grab_v1, +- ZWP_XWAYLAND_KEYBOARD_GRAB_V1_DESTROY); +- +- wl_proxy_destroy((struct wl_proxy *) zwp_xwayland_keyboard_grab_v1); +-} +- +-#ifdef __cplusplus +-} +-#endif +- +-#endif +diff --git a/src/frame/window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-protocol.c b/src/frame/window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-protocol.c +deleted file mode 100644 +index 1947d41..0000000 +--- a/src/frame/window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-protocol.c ++++ /dev/null +@@ -1,60 +0,0 @@ +-/* Generated by wayland-scanner 1.16.0 */ +- +-/* +- * Copyright © 2017 Red Hat Inc. +- * +- * Permission is hereby granted, free of charge, to any person obtaining a +- * copy of this software and associated documentation files (the "Software"), +- * to deal in the Software without restriction, including without limitation +- * the rights to use, copy, modify, merge, publish, distribute, sublicense, +- * and/or sell copies of the Software, and to permit persons to whom the +- * Software is furnished to do so, subject to the following conditions: +- * +- * The above copyright notice and this permission notice (including the next +- * paragraph) shall be included in all copies or substantial portions of the +- * Software. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +- * DEALINGS IN THE SOFTWARE. +- */ +- +-#include +-#include +-#include "wayland-util.h" +- +-extern const struct wl_interface wl_seat_interface; +-extern const struct wl_interface wl_surface_interface; +-extern const struct wl_interface zwp_xwayland_keyboard_grab_v1_interface; +- +-static const struct wl_interface *types[] = { +- &zwp_xwayland_keyboard_grab_v1_interface, +- &wl_surface_interface, +- &wl_seat_interface, +-}; +- +-static const struct wl_message zwp_xwayland_keyboard_grab_manager_v1_requests[] = { +- { "destroy", "", types + 0 }, +- { "grab_keyboard", "noo", types + 0 }, +-}; +- +-WL_EXPORT const struct wl_interface zwp_xwayland_keyboard_grab_manager_v1_interface = { +- "zwp_xwayland_keyboard_grab_manager_v1", 1, +- 2, zwp_xwayland_keyboard_grab_manager_v1_requests, +- 0, NULL, +-}; +- +-static const struct wl_message zwp_xwayland_keyboard_grab_v1_requests[] = { +- { "destroy", "", types + 0 }, +-}; +- +-WL_EXPORT const struct wl_interface zwp_xwayland_keyboard_grab_v1_interface = { +- "zwp_xwayland_keyboard_grab_v1", 1, +- 1, zwp_xwayland_keyboard_grab_v1_requests, +- 0, NULL, +-}; +- +diff --git a/src/frame/window/modules/keyboard/waylandgrab.cpp b/src/frame/window/modules/keyboard/waylandgrab.cpp +deleted file mode 100644 +index 5b2f6fb..0000000 +--- a/src/frame/window/modules/keyboard/waylandgrab.cpp ++++ /dev/null +@@ -1,79 +0,0 @@ +-// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +-// +-// SPDX-License-Identifier: LGPL-3.0-or-later +- +-#include "waylandgrab.h" +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-using namespace dcc::keyboard; +- +-static struct zwp_xwayland_keyboard_grab_manager_v1* xkgm = nullptr; +- +-void MyRegistryListener(void *data, +- struct wl_registry *registry, +- uint32_t id, +- const QString &interface, +- uint32_t version) +-{ +- Q_UNUSED(data); +- Q_UNUSED(version); +- if(interface == QLatin1String("zwp_xwayland_keyboard_grab_manager_v1")){ +- xkgm = static_cast(wl_registry_bind( +- registry,id,&zwp_xwayland_keyboard_grab_manager_v1_interface,version)); +- } +-} +- +-WaylandGrab::WaylandGrab(QObject *parent) +- : QObject(parent) +- , m_zxgm(nullptr) +- , m_info(nullptr) +- , m_record(false) +- , m_lastKey("") +- , m_keyValue("") +-{ +- dynamic_cast(parent)->createWinId(); +- QtWaylandClient::QWaylandWindow* waylandwindow = static_cast(dynamic_cast(parent)->windowHandle()->handle()); +- QtWaylandClient::QWaylandIntegration * waylandIntergration = static_cast( +- QGuiApplicationPrivate::platformIntegration()); +- m_wlSurface = waylandwindow->wlSurface(); +- m_wlSeat = waylandIntergration->display()->currentInputDevice()->wl_seat(); +- waylandIntergration->display()->addRegistryListener(MyRegistryListener, nullptr); +-} +- +-WaylandGrab::~WaylandGrab() +-{ +- if (m_zxgm) { +- zwp_xwayland_keyboard_grab_v1_destroy(m_zxgm); +- m_zxgm = nullptr; +- } +- if (xkgm) { +- zwp_xwayland_keyboard_grab_manager_v1_destroy(xkgm); +- xkgm = nullptr; +- } +-} +- +-void WaylandGrab::onGrab(ShortcutInfo *info) +-{ +- m_info = info; +- m_zxgm = zwp_xwayland_keyboard_grab_manager_v1_grab_keyboard(xkgm, m_wlSurface, m_wlSeat); +-} +- +-void WaylandGrab::onUnGrab() +-{ +- if (m_zxgm) { +- zwp_xwayland_keyboard_grab_v1_destroy(m_zxgm); +- m_zxgm = nullptr; +- } +- +-} +\ No newline at end of file +diff --git a/src/frame/window/modules/keyboard/waylandgrab.h b/src/frame/window/modules/keyboard/waylandgrab.h +deleted file mode 100644 +index 30876fb..0000000 +--- a/src/frame/window/modules/keyboard/waylandgrab.h ++++ /dev/null +@@ -1,45 +0,0 @@ +-// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd. +-// +-// SPDX-License-Identifier: LGPL-3.0-or-later +- +-#ifndef WAYLANDGRAB_H +-#define WAYLANDGRAB_H +- +-#include "wayland-xwayland-keyboard-grab-v1-client-protocol.h" +-#include "modules/keyboard/shortcutmodel.h" +- +-class WaylandGrab : public QObject +-{ +- Q_OBJECT +-public: +- explicit WaylandGrab(QObject *parent = nullptr); +- ~WaylandGrab(); +- +-private: +- QString m_lastKey, m_keyValue; +- bool m_record; +- dcc::keyboard::ShortcutInfo *m_info; +- +- struct ::wl_seat* m_wlSeat; +- struct ::wl_surface* m_wlSurface; +- struct zwp_xwayland_keyboard_grab_v1 *m_zxgm; +- +-public: +- QString getLastKey() { return m_lastKey; } +- QString getKeyValue() { return m_keyValue; } +- bool getRecordState() { return m_record; } +- void setLastKey(QString key) { m_lastKey = key; } +- void setKeyValue(QString key) { m_keyValue = key; } +- void setRecordState(bool state) { m_record = state; } +- dcc::keyboard::ShortcutInfo *getInfo() { return m_info; } +- struct zwp_xwayland_keyboard_grab_v1 *getZxgm() { return m_zxgm; } +- +-public Q_SLOTS: +- void onGrab(dcc::keyboard::ShortcutInfo *info); +- void onUnGrab(); +-}; +- +- +- +- +-#endif // WAYLANDGRAB_Hs +\ No newline at end of file +diff --git a/src/frame/window/utils.h b/src/frame/window/utils.h +index 5cc5309..4c49439 100644 +--- a/src/frame/window/utils.h ++++ b/src/frame/window/utils.h +@@ -62,18 +62,6 @@ const bool DisableDeveloperMode = { + false + #endif + }; +-const QMap WaylandkeyMap = { {Qt::Key_A, "A"}, {Qt::Key_B, "B"}, {Qt::Key_C, "C"}, {Qt::Key_D, "D"}, {Qt::Key_E, "E"}, +- {Qt::Key_F, "F"}, {Qt::Key_G, "G"}, {Qt::Key_H, "H"}, {Qt::Key_I, "I"}, {Qt::Key_J, "J"}, {Qt::Key_K, "K"}, {Qt::Key_L, "L"}, {Qt::Key_M, "M"}, +- {Qt::Key_N, "N"}, {Qt::Key_O, "O"}, {Qt::Key_P, "P"}, {Qt::Key_Q, "Q"}, {Qt::Key_R, "R"}, {Qt::Key_S, "S"}, {Qt::Key_T, "T"}, {Qt::Key_U, "U"}, +- {Qt::Key_V, "V"}, {Qt::Key_W, "W"}, {Qt::Key_X, "X"}, {Qt::Key_Y, "Y"}, {Qt::Key_Z, "Z"}, {Qt::Key_Escape, "Escape"}, {Qt::Key_Tab, "Tab"}, +- {Qt::Key_Backtab, "Tab"}, {Qt::Key_Backspace, "Backspace"}, {Qt::Key_Return, "Return"}, {Qt::Key_Enter, "Enter"}, {Qt::Key_Insert, "Insert"}, +- {Qt::Key_Delete, "Delete"}, {Qt::Key_Pause, "Pause"}, {Qt::Key_Print, "Print"}, {Qt::Key_SysReq, "SysReq"}, {Qt::Key_Clear, "Clear"}, {Qt::Key_Home, "Home"}, +- {Qt::Key_End, "End"}, {Qt::Key_Left, "←"}, {Qt::Key_Up, "↑"}, {Qt::Key_Right, "→"}, {Qt::Key_Down, "↓"}, {Qt::Key_PageUp, "PageUp"}, +- {Qt::Key_PageDown, "PageDown"}, {Qt::Key_Shift, "Shift_L"}, {Qt::Key_Control, "Control_L"}, {Qt::Key_Super_L, "Super_L"}, {Qt::Key_Super_R, "Super_R"}, {Qt::Key_Alt, "Alt_L"}, +- {Qt::Key_CapsLock, "CapLock"}, {Qt::Key_NumLock, "NumLock"}, {Qt::Key_ScrollLock, "ScrollLock"}, {Qt::Key_F1, "F1"}, {Qt::Key_F2, "F2"}, {Qt::Key_F3, "F3"}, +- {Qt::Key_F4, "F4"}, {Qt::Key_F5, "F5"}, {Qt::Key_F6, "F6"}, {Qt::Key_F7, "F7"}, {Qt::Key_F8, "F8"}, {Qt::Key_F9, "F9"}, +- {Qt::Key_F10, "F10"}, {Qt::Key_F11, "F11"}, {Qt::Key_F12, "F12"}, {Qt::Key_Space, "Space"}, {Qt::Key_AsciiTilde, "~"} +-}; + + struct ListSubItem { + ListSubItem(); +diff --git a/tests/dde-control-center/CMakeLists.txt b/tests/dde-control-center/CMakeLists.txt +index 6ad2b77..3e8c998 100644 +--- a/tests/dde-control-center/CMakeLists.txt ++++ b/tests/dde-control-center/CMakeLists.txt +@@ -143,9 +143,6 @@ file(GLOB_RECURSE KEYBOARD_Tasks_SRCS + ../../src/frame/window/modules/keyboard/systemlanguagewidget.cpp + ../../src/frame/window/modules/keyboard/systemlanguagesettingwidget.cpp + ../../src/frame/window/modules/keyboard/shortcutsettingwidget.cpp +- ../../src/frame/window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-client-protocol.h +- ../../src/frame/window/modules/keyboard/wayland-xwayland-keyboard-grab-v1-protocol.c +- ../../src/frame/window/modules/keyboard/waylandgrab.cpp + ../../src/frame/modules/keyboard/keyboardmodel.cpp + ../../src/frame/modules/keyboard/indexmodel.cpp + ../../src/frame/modules/keyboard/shortcutmodel.cpp +@@ -163,10 +160,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -lgcov") + + # 查找依赖库 + find_package(PkgConfig REQUIRED) +-find_package(Qt5 COMPONENTS Widgets Test DBus WaylandClient REQUIRED Concurrent Svg) ++find_package(Qt5 COMPONENTS Widgets Test DBus REQUIRED Concurrent Svg) + find_package(DtkWidget REQUIRED) + find_package(GTest REQUIRED) +-find_package(KF5Wayland QUIET) + + pkg_check_modules(QGSettings REQUIRED gsettings-qt) + pkg_check_modules(DFrameworkDBus REQUIRED dframeworkdbus) +@@ -318,8 +314,6 @@ target_link_libraries(${SYSTEMINFO_NAME} PRIVATE + -lpthread + ) + +-find_package(PkgConfig REQUIRED) +-pkg_check_modules(WaylandClient REQUIRED wayland-client) + + # 键盘模块链接库 + target_link_libraries(${KEYBOARD_NAME} PRIVATE +@@ -334,9 +328,6 @@ target_link_libraries(${KEYBOARD_NAME} PRIVATE + ${DtkWidget_LIBRARIES} + ${GTEST_LIBRARIES} + -lpthread +- KF5::WaylandClient +- Qt5::WaylandClient +- ${WaylandClient_LIBRARIES} + ) + + # 系统信息模块引用头文件 +@@ -355,7 +346,6 @@ target_include_directories(${KEYBOARD_NAME} PUBLIC + ${QGSettings_INCLUDE_DIRS} + ${Qt5Gui_PRIVATE_INCLUDE_DIRS} + ${DFrameworkDBus_INCLUDE_DIRS} +- ${Qt5WaylandClient_PRIVATE_INCLUDE_DIRS} + ) + + add_custom_target(check +-- +2.20.1 + diff --git a/0003-bugfix-for-no-check-newpassword-at-modifypwd.patch b/0003-bugfix-for-no-check-newpassword-at-modifypwd.patch deleted file mode 100644 index 315338c453e3ef8a7bb42c1cb59e980c2079283f..0000000000000000000000000000000000000000 --- a/0003-bugfix-for-no-check-newpassword-at-modifypwd.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 53dfbe39bdc60a54a7f6cd03fb4f4687c7c5d6ac Mon Sep 17 00:00:00 2001 -From: desert-sailor -Date: Tue, 11 Apr 2023 10:51:39 +0800 -Subject: [PATCH] [PATCH] bugfix for issue:I6QIOR modify passwd no check - newpassword - ---- - .../window/modules/accounts/modifypasswdpage.cpp | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - -diff --git a/src/frame/window/modules/accounts/modifypasswdpage.cpp b/src/frame/window/modules/accounts/modifypasswdpage.cpp -index ff33149..e2f9d77 100644 ---- a/src/frame/window/modules/accounts/modifypasswdpage.cpp -+++ b/src/frame/window/modules/accounts/modifypasswdpage.cpp -@@ -157,6 +157,20 @@ void ModifyPasswdPage::clickSaveBtn() - { - //校验输入密码 - if (judgeTextEmpty(m_oldPasswordEdit)) return; -+ if (judgeTextEmpty(m_newPasswordEdit)) return; -+ -+ if (m_newPasswordEdit->lineEdit()->text() == m_oldPasswordEdit->lineEdit()->text() ) { -+ m_newPasswordEdit->setAlert(true); -+ m_newPasswordEdit->showAlertMessage(tr("New password should differ from the current one"), m_oldPasswordEdit, 2000); -+ return; -+ } -+ -+ if (judgeTextEmpty(m_repeatPasswordEdit)) return; -+ if (m_newPasswordEdit->lineEdit()->text() != m_repeatPasswordEdit->lineEdit()->text()) { -+ m_repeatPasswordEdit->setAlert(true); -+ m_repeatPasswordEdit->showAlertMessage(tr("Passwords do not match"), m_repeatPasswordEdit, 2000); -+ return; -+ } - - Q_EMIT requestChangePassword(m_curUser, m_oldPasswordEdit->lineEdit()->text(), m_newPasswordEdit->lineEdit()->text(), m_repeatPasswordEdit->lineEdit()->text()); - } --- -2.33.0 - diff --git a/0003-dde-control-center-uos-open-activate-button-for-1050.patch b/0003-dde-control-center-uos-open-activate-button-for-1050.patch new file mode 100644 index 0000000000000000000000000000000000000000..f4fe3b11f443ec6a4fc800d9cb7e134f3083e472 --- /dev/null +++ b/0003-dde-control-center-uos-open-activate-button-for-1050.patch @@ -0,0 +1,31 @@ +From 8186e031531b6e09e2c633c57d632a73786c6953 Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Wed, 4 Jan 2023 13:27:37 +0800 +Subject: [PATCH] dde-control-center uos open activate button for 1050a + +--- + src/frame/window/modules/systeminfo/nativeinfowidget.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/frame/window/modules/systeminfo/nativeinfowidget.cpp b/src/frame/window/modules/systeminfo/nativeinfowidget.cpp +index 754edd9..7c6c1b5 100644 +--- a/src/frame/window/modules/systeminfo/nativeinfowidget.cpp ++++ b/src/frame/window/modules/systeminfo/nativeinfowidget.cpp +@@ -202,11 +202,12 @@ void NativeInfoWidget::initWidget() + m_authorized->setValue(tr("To be activated")); + m_authorized->setValueForegroundRole(QColor(255, 0, 0)); + m_authorized->setButtonText(tr("Activate")); +- if (DSysInfo::uosEditionType() == DSysInfo::UosEnterpriseC) { ++ /*if (DSysInfo::uosEditionType() == DSysInfo::UosEnterpriseC) { + m_authorized->setVisable(false); + } else { + m_authorized->setVisable(true); +- } ++ }*/ ++ m_authorized->setVisable(true); + + m_kernel = new TitleValueItem(frame); + //~ contents_path /systeminfo/About This PC +-- +2.20.1 + diff --git a/0004-dde-control-center-disable-windowmoveswitch.patch b/0004-dde-control-center-disable-windowmoveswitch.patch new file mode 100644 index 0000000000000000000000000000000000000000..0a27d90390a785c0ec8780b168a42e3614265ae4 --- /dev/null +++ b/0004-dde-control-center-disable-windowmoveswitch.patch @@ -0,0 +1,50 @@ +From 263559ccfd3615ed1f7f733456f73c54ef364101 Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Wed, 1 Feb 2023 13:40:57 +0800 +Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=B3=E9=97=AD=E7=AA=97=E5=8F=A3?= + =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E6=97=B6=E5=90=AF=E7=94=A8=E9=80=8F=E6=98=8E?= + =?UTF-8?q?=E7=89=B9=E6=95=88?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + .../window/modules/personalization/personalizationgeneral.cpp | 2 ++ + .../window/modules/personalization/personalizationgeneral.h | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/src/frame/window/modules/personalization/personalizationgeneral.cpp b/src/frame/window/modules/personalization/personalizationgeneral.cpp +index 13e7b65..137c165 100644 +--- a/src/frame/window/modules/personalization/personalizationgeneral.cpp ++++ b/src/frame/window/modules/personalization/personalizationgeneral.cpp +@@ -493,11 +493,13 @@ void PersonalizationGeneral::paintEvent(QPaintEvent *event) + } + } + ++#if 0 + void PersonalizationGeneral::resizeEvent(QResizeEvent *event) + { + m_windowMovedLabel->setText(QFontMetrics(m_windowMovedLabel->font()).elidedText(m_displayData, Qt::ElideRight, event->size().width() >= 430 ? 500 : 280)); + QWidget::resizeEvent(event); + } ++#endif + + void PersonalizationGeneral::updateActiveColors(RoundColorWidget *selectedWidget) + { +diff --git a/src/frame/window/modules/personalization/personalizationgeneral.h b/src/frame/window/modules/personalization/personalizationgeneral.h +index b4856bb..00809fa 100644 +--- a/src/frame/window/modules/personalization/personalizationgeneral.h ++++ b/src/frame/window/modules/personalization/personalizationgeneral.h +@@ -76,7 +76,9 @@ public: + + protected: + void paintEvent(QPaintEvent *event); ++#if 0 + void resizeEvent(QResizeEvent *event) override; ++#endif + + private: + void updateActiveColors(RoundColorWidget *selectedWidget); +-- +2.20.1 + diff --git a/0005-dde-control-center-feat-add-setVersion.patch b/0005-dde-control-center-feat-add-setVersion.patch new file mode 100644 index 0000000000000000000000000000000000000000..211117a3efee482376ae65a1592d5cdffd2075c4 --- /dev/null +++ b/0005-dde-control-center-feat-add-setVersion.patch @@ -0,0 +1,24 @@ +From d59f4e1bb7972884eff879f7be6810b2b3310c85 Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Thu, 2 Feb 2023 16:38:14 +0800 +Subject: [PATCH] feat: add setVersion + +--- + src/frame/modules/systeminfo/systeminfowork.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/frame/modules/systeminfo/systeminfowork.cpp b/src/frame/modules/systeminfo/systeminfowork.cpp +index 20b280c..5b1ce99 100644 +--- a/src/frame/modules/systeminfo/systeminfowork.cpp ++++ b/src/frame/modules/systeminfo/systeminfowork.cpp +@@ -167,6 +167,7 @@ void SystemInfoWork::activate() + version = QString("%1 %2").arg(DSysInfo::productVersion()) + .arg(DSysInfo::productTypeString()); + } ++ m_model->setVersion(version); + m_model->setType(QSysInfo::WordSize); + + if (m_systemInfo->isValid()) { +-- +2.20.1 + diff --git a/0005-fix-hide-commoninfo-and-end-user-license-agreement.patch b/0006-hide-commonifo-and-end-user-license-agreement.patch similarity index 79% rename from 0005-fix-hide-commoninfo-and-end-user-license-agreement.patch rename to 0006-hide-commonifo-and-end-user-license-agreement.patch index 28ba3fb83b13e96c774a4000dac03c4f85564e2a..22b576e4c8e3e95b9d54ebd930a7f811eb0266ed 100644 --- a/0005-fix-hide-commoninfo-and-end-user-license-agreement.patch +++ b/0006-hide-commonifo-and-end-user-license-agreement.patch @@ -1,14 +1,14 @@ -From 80e9d14a6f529fd3bccd0dd90fafb7b4fb82bb0b Mon Sep 17 00:00:00 2001 -From: leeffo -Date: Thu, 8 Jun 2023 14:27:41 +0800 -Subject: [PATCH 2/2] fix: hide commoninfo and end-user-license-agreement +From 1834aef3bac001345dc6fdf2629022088746f69b Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Wed, 2 Aug 2023 10:37:41 +0800 +Subject: [PATCH] hide commonifo and end-user-license-agreement --- com.deepin.dde.control-center.gschema.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.deepin.dde.control-center.gschema.xml b/com.deepin.dde.control-center.gschema.xml -index 5b2a70f..6b330d2 100644 +index b18fa11..784db01 100644 --- a/com.deepin.dde.control-center.gschema.xml +++ b/com.deepin.dde.control-center.gschema.xml @@ -39,7 +39,7 @@ @@ -20,7 +20,7 @@ index 5b2a70f..6b330d2 100644 The module to display -@@ -720,7 +720,7 @@ +@@ -748,7 +748,7 @@ default is true diff --git a/0007-dde-control-center-uos-add-Free-license.patch b/0007-dde-control-center-uos-add-Free-license.patch new file mode 100644 index 0000000000000000000000000000000000000000..bcac6a392edc87376b289bf27774fdfd98b957e6 --- /dev/null +++ b/0007-dde-control-center-uos-add-Free-license.patch @@ -0,0 +1,129 @@ +From 778442f97f0af8631980f4dc75ee264c448b8d6e Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Thu, 16 Feb 2023 14:48:33 +0800 +Subject: [PATCH] dde-control-center uos add Free license + +--- + include/widgets/utils.h | 3 ++- + src/frame/modules/systeminfo/systeminfomodel.h | 3 ++- + src/frame/window/modules/systeminfo/nativeinfowidget.cpp | 4 ++++ + translations/dde-control-center_zh_CN.ts | 7 ++++++- + translations/dde-control-center_zh_HK.ts | 7 ++++++- + translations/dde-control-center_zh_TW.ts | 7 ++++++- + 6 files changed, 26 insertions(+), 5 deletions(-) + +diff --git a/include/widgets/utils.h b/include/widgets/utils.h +index 1387ada..45debcc 100644 +--- a/include/widgets/utils.h ++++ b/include/widgets/utils.h +@@ -39,7 +39,8 @@ enum UiActiveState { + Authorized, //已授权 + AuthorizedLapse, //授权失效 + TrialAuthorized, //试用期已授权 +- TrialExpired //试用期已过期 ++ TrialExpired, //试用期已过期 ++ FreeLicenseAuthorized = 5 //商业免费授权 + }; + + inline bool isFileExist(const QString &path){ +diff --git a/src/frame/modules/systeminfo/systeminfomodel.h b/src/frame/modules/systeminfo/systeminfomodel.h +index 8cdb1fa..401c76f 100644 +--- a/src/frame/modules/systeminfo/systeminfomodel.h ++++ b/src/frame/modules/systeminfo/systeminfomodel.h +@@ -19,7 +19,8 @@ enum ActiveState { + Authorized, //已授权 + AuthorizedLapse, //授权失效 + TrialAuthorized, //试用期已授权 +- TrialExpired //试用期已过期 ++ TrialExpired, //试用期已过期 ++ FreeLicenseAuthorized = 5 //商业免费授权 + }; + + class SystemInfoModel : public QObject +diff --git a/src/frame/window/modules/systeminfo/nativeinfowidget.cpp b/src/frame/window/modules/systeminfo/nativeinfowidget.cpp +index 7c6c1b5..771bb57 100644 +--- a/src/frame/window/modules/systeminfo/nativeinfowidget.cpp ++++ b/src/frame/window/modules/systeminfo/nativeinfowidget.cpp +@@ -357,6 +357,10 @@ void NativeInfoWidget::setLicenseState(ActiveState state) + m_authorized->setValue(tr("Trial expired")); + m_authorized->setValueForegroundRole(QColor(255, 87, 54)); + m_authorized->setButtonText(tr("Activate")); ++ } else if (state == FreeLicenseAuthorized) { ++ m_authorized->setValue(tr("Free license")); ++ m_authorized->setValueForegroundRole(QColor(21, 187, 24)); ++ m_authorized->setButtonText(tr("View")); + } + } + +diff --git a/translations/dde-control-center_zh_CN.ts b/translations/dde-control-center_zh_CN.ts +index 2ce90ac..3d5e66b 100644 +--- a/translations/dde-control-center_zh_CN.ts ++++ b/translations/dde-control-center_zh_CN.ts +@@ -4511,6 +4511,11 @@ + Activate + 激活 + ++ ++ ++ Free license ++ 免费授权 ++ + + + Kernel +@@ -6488,4 +6493,4 @@ UnionTech Software is committed to research and improve the security, accuracy a + 控制中心提供操作系统的所有设置选项。 + + +- +\ No newline at end of file ++ +diff --git a/translations/dde-control-center_zh_HK.ts b/translations/dde-control-center_zh_HK.ts +index 9ba8c3a..2adaccd 100644 +--- a/translations/dde-control-center_zh_HK.ts ++++ b/translations/dde-control-center_zh_HK.ts +@@ -4511,6 +4511,11 @@ + Activate + 啟用 + ++ ++ ++ Free license ++ 免費授權 ++ + + + Kernel +@@ -6488,4 +6493,4 @@ UnionTech Software is committed to research and improve the security, accuracy a + 控制中心提供操作系統的所有設置選項。 + + +- +\ No newline at end of file ++ +diff --git a/translations/dde-control-center_zh_TW.ts b/translations/dde-control-center_zh_TW.ts +index 23f6817..de875ec 100644 +--- a/translations/dde-control-center_zh_TW.ts ++++ b/translations/dde-control-center_zh_TW.ts +@@ -4511,6 +4511,11 @@ + Activate + 啟用 + ++ ++ ++ Free license ++ 免費授權 ++ + + + Kernel +@@ -6488,4 +6493,4 @@ UnionTech Software is committed to research and improve the security, accuracy a + 《控制中心》提供系統設定選項。 + + +- +\ No newline at end of file ++ +-- +2.20.1 + diff --git a/0008-dde-control-center-feat-hidden-power-press-powerbtn.patch b/0008-dde-control-center-feat-hidden-power-press-powerbtn.patch new file mode 100644 index 0000000000000000000000000000000000000000..f00964b65f0c71d21031d7c6c7a5ad5ee65da7f0 --- /dev/null +++ b/0008-dde-control-center-feat-hidden-power-press-powerbtn.patch @@ -0,0 +1,25 @@ +From 9f8b031614a9c29a57dd0ad97ef672453c9e4442 Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Wed, 1 Mar 2023 14:19:19 +0800 +Subject: [PATCH] feat: hidden power-press-powerbtn + +--- + com.deepin.dde.control-center.gschema.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/com.deepin.dde.control-center.gschema.xml b/com.deepin.dde.control-center.gschema.xml +index c6e1d49..58bd4c1 100644 +--- a/com.deepin.dde.control-center.gschema.xml ++++ b/com.deepin.dde.control-center.gschema.xml +@@ -212,7 +212,7 @@ + default is Enabled + + +- 'Enabled' ++ 'Hidden' + change power press powerbtn status + default is Enabled + +-- +2.20.1 + diff --git a/0004-fix.patch b/0009-dde-control-center-feat-modify-copyright-read-current-year.patch similarity index 41% rename from 0004-fix.patch rename to 0009-dde-control-center-feat-modify-copyright-read-current-year.patch index 88448d1f74eaef54d9e73940ae8a2836f4ddd8dc..73a7e9d7a6737d2f44f84c73927c656aeb7d23f2 100644 --- a/0004-fix.patch +++ b/0009-dde-control-center-feat-modify-copyright-read-current-year.patch @@ -1,45 +1,17 @@ -From 232b34bc0ae1e2fb3ea258d9e33a04fcbcf793b6 Mon Sep 17 00:00:00 2001 +From 77e3cdac535359ec5e6f013702653675ab448d80 Mon Sep 17 00:00:00 2001 From: leeffo -Date: Thu, 8 Jun 2023 14:26:53 +0800 -Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F?= - =?UTF-8?q?=E7=89=88=E6=9C=AC=E8=8E=B7=E5=8F=96=E9=94=99=E8=AF=AF=E5=90=8E?= - =?UTF-8?q?=E6=8E=A7=E5=88=B6=E4=B8=AD=E5=BF=83=E8=BF=9B=E5=85=A5=E7=B3=BB?= - =?UTF-8?q?=E7=BB=9F=E4=BF=A1=E6=81=AF=E5=B4=A9=E6=BA=83=E9=97=AE=E9=A2=98?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit +Date: Wed, 8 Mar 2023 11:21:10 +0800 +Subject: [PATCH] feat: modify copyright read current year --- - .../window/modules/systeminfo/nativeinfowidget.cpp | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) + src/frame/window/modules/systeminfo/nativeinfowidget.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frame/window/modules/systeminfo/nativeinfowidget.cpp b/src/frame/window/modules/systeminfo/nativeinfowidget.cpp -index d7db8d6..7bfdfc8 100644 +index 771bb57..3ba9b1f 100644 --- a/src/frame/window/modules/systeminfo/nativeinfowidget.cpp +++ b/src/frame/window/modules/systeminfo/nativeinfowidget.cpp -@@ -85,6 +85,12 @@ NativeInfoWidget::NativeInfoWidget(SystemInfoModel *model, QWidget *parent) - , m_mainLayout(new QVBoxLayout(this)) - , m_hostNameLayout(new QHBoxLayout(this)) - , m_hostNameSettingItem(new SettingsItem(this)) -+ , m_hostNameTitleLabel(nullptr) -+ , m_hostNameLabel(nullptr) -+ , m_hostNameBtn(nullptr) -+ , m_hostNameLineEdit(nullptr) -+ , m_productName(nullptr) -+ , m_versionNumber(nullptr) - , isContensServers(false) - { - initWidget(); -@@ -304,7 +310,7 @@ void NativeInfoWidget::resizeEvent(QResizeEvent *event) - { - ContentWidget::resizeEvent(event); - -- if(m_hostNameLineEdit->isAlert()) { -+ if(m_hostNameLineEdit && m_hostNameLineEdit->isAlert()) { - m_hostNameLineEdit->hideAlertMessage(); - m_hostNameLineEdit->showAlertMessage(m_alertMessage,this); - } -@@ -374,9 +380,9 @@ const QString NativeInfoWidget::systemCopyright() const +@@ -371,9 +371,9 @@ const QString NativeInfoWidget::systemCopyright() const if (oem_copyright.isEmpty()) { if (DSysInfo::isCommunityEdition()) diff --git a/0010-fix-Array-out-of-bounds-causes-crash-handling.patch b/0010-fix-Array-out-of-bounds-causes-crash-handling.patch new file mode 100644 index 0000000000000000000000000000000000000000..b911809e28168a24cb9e809841b7301f0c8c4bc3 --- /dev/null +++ b/0010-fix-Array-out-of-bounds-causes-crash-handling.patch @@ -0,0 +1,25 @@ +From d9f1a109f90f61dd917ad3ddce5894580086340e Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Mon, 12 Jun 2023 15:45:47 +0800 +Subject: [PATCH] fix: Array out of bounds causes crash handling + +--- + src/frame/window/modules/systeminfo/systeminfowidget.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/frame/window/modules/systeminfo/systeminfowidget.cpp b/src/frame/window/modules/systeminfo/systeminfowidget.cpp +index 6313841..0f06271 100644 +--- a/src/frame/window/modules/systeminfo/systeminfowidget.cpp ++++ b/src/frame/window/modules/systeminfo/systeminfowidget.cpp +@@ -89,7 +89,7 @@ void SystemInfoWidget::initData() + if (IsServerSystem) { + connect(GSettingWatcher::instance(), + &GSettingWatcher::requestShowSecondMenu, this, [this](int row) { +- if (m_itemList[row].gsettingsName == "editionLicense") { ++ if (m_itemList.size() > row && m_itemList[row].gsettingsName == "editionLicense") { + m_listView->setRowHidden(row, true); + } + }); +-- +2.20.1 + diff --git a/0002-hide-authorized.patch b/0011-hide-activate-function.patch similarity index 75% rename from 0002-hide-authorized.patch rename to 0011-hide-activate-function.patch index d425d19e1e15e3a4f7589ed8002a5a2fb7e8b382..c6a2e668fef359b040adf2b36c9d2a39ab375d57 100644 --- a/0002-hide-authorized.patch +++ b/0011-hide-activate-function.patch @@ -1,30 +1,32 @@ -From cf9e61a42436a5eeea0aeccd702a477aa8ca3d9a Mon Sep 17 00:00:00 2001 -From: leeffo -Date: Tue, 23 Aug 2022 16:33:21 +0800 -Subject: [PATCH] hide authorized +From 4815b66c57916eaa17fa66d97211db1bc27eb411 Mon Sep 17 00:00:00 2001 +From: leeffo +Date: Thu, 7 Sep 2023 09:33:11 +0800 +Subject: [PATCH] hide activate function + --- src/frame/CMakeLists.txt | 1 + - .../modules/systeminfo/systeminfomodel.cpp | 5 ++++- - .../modules/systeminfo/systeminfomodel.h | 12 ++++++++++ - .../modules/systeminfo/systeminfowork.cpp | 6 +++++ + .../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/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/nativeinfowidget.cpp | 14 +++++++++++++ + .../modules/systeminfo/nativeinfowidget.h | 6 ++++++ .../modules/systeminfo/systeminfomodule.cpp | 2 ++ - .../modules/update/updatectrlwidget.cpp | 22 +++++++++++++++++++ - .../window/modules/update/updatectrlwidget.h | 6 +++++ - .../window/modules/update/updatemodule.cpp | 6 ++++- - 15 files changed, 100 insertions(+), 2 deletions(-) + .../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 319ca1d..9b7638b 100644 +index a5c64d0..288ef7f 100644 --- a/src/frame/CMakeLists.txt +++ b/src/frame/CMakeLists.txt -@@ -30,6 +30,7 @@ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - endif () +@@ -28,6 +28,7 @@ endif() + set(DEFINED_LIST +DISABLE_ACTIVATOR @@ -32,10 +34,10 @@ index 319ca1d..9b7638b 100644 DISABLE_CLOUD_SYNC DISABLE_SYS_UPDATE diff --git a/src/frame/modules/systeminfo/systeminfomodel.cpp b/src/frame/modules/systeminfo/systeminfomodel.cpp -index c890183..20da279 100644 +index 4965879..3488577 100644 --- a/src/frame/modules/systeminfo/systeminfomodel.cpp +++ b/src/frame/modules/systeminfo/systeminfomodel.cpp -@@ -60,7 +60,9 @@ SystemInfoModel::SystemInfoModel(QObject *parent) +@@ -39,7 +39,9 @@ SystemInfoModel::SystemInfoModel(QObject *parent) , m_themeEnabled(false) , m_updating(false) , m_type(64) @@ -45,7 +47,7 @@ index c890183..20da279 100644 { } -@@ -227,6 +229,7 @@ void SystemInfoModel::setKernel(const QString &kernel) +@@ -206,6 +208,7 @@ void SystemInfoModel::setKernel(const QString &kernel) kernelChanged(kernel); } @@ -53,19 +55,19 @@ index c890183..20da279 100644 void SystemInfoModel::setLicenseState(ActiveState state) { if (m_licenseState != state) { -@@ -234,6 +237,6 @@ void SystemInfoModel::setLicenseState(ActiveState 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 7ae81e0..ce4dfb9 100644 +index 401c76f..0c7006c 100644 --- a/src/frame/modules/systeminfo/systeminfomodel.h +++ b/src/frame/modules/systeminfo/systeminfomodel.h -@@ -34,6 +34,7 @@ namespace systeminfo{ +@@ -13,6 +13,7 @@ namespace systeminfo{ // !!! 不要用C++11的前置声明枚举类型,这里lupdate命令有个bug.具体见 // https://stackoverflow.com/questions/6504902/lupdate-error-qualifying-with-unknown-namespace-class @@ -73,15 +75,15 @@ index 7ae81e0..ce4dfb9 100644 //授权状态 enum ActiveState { Unauthorized = 0, //未授权 -@@ -42,6 +43,7 @@ enum ActiveState { - TrialAuthorized, //试用期已授权 - TrialExpired //试用期已过期 +@@ -22,6 +23,7 @@ enum ActiveState { + TrialExpired, //试用期已过期 + FreeLicenseAuthorized = 5 //商业免费授权 }; +#endif class SystemInfoModel : public QObject { -@@ -65,7 +67,9 @@ public: +@@ -45,7 +47,9 @@ public: QString kernel() const { return m_kernel;} QString hostName() const { return m_hostName;} @@ -91,7 +93,7 @@ index 7ae81e0..ce4dfb9 100644 bool bootDelay() const; bool themeEnabled() const { return m_themeEnabled; } -@@ -90,7 +94,9 @@ Q_SIGNALS: +@@ -70,7 +74,9 @@ Q_SIGNALS: void memoryChanged(const QString& memory); void diskChanged(const QString& disk); void kernelChanged(const QString& kernel); @@ -101,7 +103,7 @@ index 7ae81e0..ce4dfb9 100644 void hostNameChanged(const QString& hostName); void setHostNameChanged(const QString& hostName); void setHostNameError(const QString& error); -@@ -110,7 +116,9 @@ public Q_SLOTS: +@@ -90,7 +96,9 @@ public Q_SLOTS: void setMemory(qulonglong totalMemory, qulonglong installedMemory); void setDisk(qulonglong disk); void setKernel(const QString &kernel); @@ -111,7 +113,7 @@ index 7ae81e0..ce4dfb9 100644 void setHostName(const QString& hostName); private: -@@ -132,12 +140,16 @@ private: +@@ -112,12 +120,16 @@ private: QString m_disk; QString m_kernel; QString m_hostName; @@ -129,10 +131,10 @@ index 7ae81e0..ce4dfb9 100644 #endif // SYSTEMINFOMODEL_H diff --git a/src/frame/modules/systeminfo/systeminfowork.cpp b/src/frame/modules/systeminfo/systeminfowork.cpp -index 4173622..a688706 100644 +index 5b1ce99..e0465d2 100644 --- a/src/frame/modules/systeminfo/systeminfowork.cpp +++ b/src/frame/modules/systeminfo/systeminfowork.cpp -@@ -111,12 +111,14 @@ SystemInfoWork::SystemInfoWork(SystemInfoModel *model, QObject *parent) +@@ -90,12 +90,14 @@ SystemInfoWork::SystemInfoWork(SystemInfoModel *model, QObject *parent) m_dbusGrubTheme->setSync(false, false); m_dbusHostName->setSync(false, false); @@ -147,7 +149,7 @@ index 4173622..a688706 100644 connect(m_dbusGrub, &GrubDbus::DefaultEntryChanged, m_model, &SystemInfoModel::setDefaultEntry); connect(m_dbusGrub, &GrubDbus::EnableThemeChanged, m_model, &SystemInfoModel::setThemeEnabled); -@@ -160,7 +162,9 @@ SystemInfoWork::SystemInfoWork(SystemInfoModel *model, QObject *parent) +@@ -139,7 +141,9 @@ SystemInfoWork::SystemInfoWork(SystemInfoModel *model, QObject *parent) void SystemInfoWork::activate() { @@ -157,15 +159,15 @@ index 4173622..a688706 100644 m_model->setDistroID(m_systemInfoInter->distroID()); m_model->setDistroVer(m_systemInfoInter->distroVer()); m_model->setDisk(m_systemInfoInter->diskCap()); -@@ -309,6 +313,7 @@ void SystemInfoWork::setBackground(const QString &path) - }); +@@ -320,6 +324,7 @@ void SystemInfoWork::setBackground(const QString &path) + #endif } +#ifndef DISABLE_ACTIVATOR void SystemInfoWork::showActivatorDialog() { QDBusInterface activator("com.deepin.license.activator", -@@ -327,6 +332,7 @@ void SystemInfoWork::licenseStateChangeSlot() +@@ -338,6 +343,7 @@ void SystemInfoWork::licenseStateChangeSlot() QFuture future = QtConcurrent::run(this, &SystemInfoWork::getLicenseState); watcher->setFuture(future); } @@ -173,11 +175,27 @@ index 4173622..a688706 100644 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(); + } +-#endif + + } + } diff --git a/src/frame/modules/systeminfo/systeminfowork.h b/src/frame/modules/systeminfo/systeminfowork.h -index f092cdf..e3466f0 100644 +index 284a6a5..b9887f5 100644 --- a/src/frame/modules/systeminfo/systeminfowork.h +++ b/src/frame/modules/systeminfo/systeminfowork.h -@@ -64,14 +64,18 @@ public Q_SLOTS: +@@ -50,15 +50,19 @@ public Q_SLOTS: void grubServerFinished(); void onBackgroundChanged(); void setBackground(const QString &path); @@ -186,6 +204,7 @@ index f092cdf..e3466f0 100644 void licenseStateChangeSlot(); +#endif void processChanged(QDBusMessage msg); + void onLicenseAuthorizationProperty(void); private: void getEntryTitles(); @@ -193,24 +212,24 @@ index f092cdf..e3466f0 100644 +#ifndef DISABLE_ACTIVATOR void getLicenseState(); +#endif + unsigned int getLicenseAuthorizationProperty(); private: - SystemInfoModel* m_model; diff --git a/src/frame/modules/update/updatemodel.cpp b/src/frame/modules/update/updatemodel.cpp -index 378f33d..4fcc591 100644 +index a01e711..fe2c45b 100644 --- a/src/frame/modules/update/updatemodel.cpp +++ b/src/frame/modules/update/updatemodel.cpp -@@ -69,7 +69,9 @@ UpdateModel::UpdateModel(QObject *parent) +@@ -64,7 +64,9 @@ UpdateModel::UpdateModel(QObject *parent) , m_bRecoverRestoring(false) - , m_systemVersionInfo("") + , m_systemVersionInfo(QString()) , m_metaEnum(QMetaEnum::fromType()) +#ifndef DISABLE_ACTIVATOR , m_bSystemActivation(UiActiveState::Unknown) +#endif + , m_lastCheckUpdateTime(QString()) , m_autoCheckUpdateCircle(0) - , m_isUpdatablePackages(false) - -@@ -353,6 +355,7 @@ void UpdateModel::setSystemVersionInfo(const QString &systemVersionInfo) + , m_testingChannelServer(QString()) +@@ -411,6 +413,7 @@ void UpdateModel::setSystemVersionInfo(const QString &systemVersionInfo) Q_EMIT systemVersionChanged(systemVersionInfo); } @@ -218,7 +237,7 @@ index 378f33d..4fcc591 100644 void UpdateModel::setSystemActivation(const UiActiveState &systemactivation) { if (m_bSystemActivation == systemactivation) { -@@ -362,6 +365,7 @@ void UpdateModel::setSystemActivation(const UiActiveState &systemactivation) +@@ -420,6 +423,7 @@ void UpdateModel::setSystemActivation(const UiActiveState &systemactivation) Q_EMIT systemActivationChanged(systemactivation); } @@ -227,10 +246,10 @@ index 378f33d..4fcc591 100644 void UpdateModel::isUpdatablePackages(bool isUpdatablePackages) { diff --git a/src/frame/modules/update/updatemodel.h b/src/frame/modules/update/updatemodel.h -index b268e09..036292c 100644 +index 6187b89..f4189fb 100644 --- a/src/frame/modules/update/updatemodel.h +++ b/src/frame/modules/update/updatemodel.h -@@ -158,8 +158,10 @@ public: +@@ -164,8 +164,10 @@ public: bool getIsRecoveryBackingup(UpdatesStatus state) const; @@ -241,7 +260,7 @@ index b268e09..036292c 100644 inline bool getUpdatablePackages() const {return m_isUpdatablePackages;} void isUpdatablePackages(bool isUpdatablePackages); -@@ -203,7 +205,9 @@ Q_SIGNALS: +@@ -282,7 +284,9 @@ Q_SIGNALS: void recoverConfigValidChanged(bool recoverConfigValid); void recoverRestoringChanged(bool recoverRestoring); void systemVersionChanged(QString version); @@ -251,7 +270,7 @@ index b268e09..036292c 100644 void beginCheckUpdate(); void updateCheckUpdateTime(); void updateHistoryAppInfos(); -@@ -239,7 +243,9 @@ private: +@@ -334,7 +338,9 @@ private: bool m_bRecoverRestoring; QString m_systemVersionInfo; QMetaEnum m_metaEnum; @@ -262,10 +281,10 @@ index b268e09..036292c 100644 QString m_lastCheckUpdateTime; //上次检查更新时间 QList m_historyAppInfos; //历史更新应用列表 diff --git a/src/frame/modules/update/updatework.cpp b/src/frame/modules/update/updatework.cpp -index 01e9a3f..71d889d 100644 +index ffda8a3..8a64560 100644 --- a/src/frame/modules/update/updatework.cpp +++ b/src/frame/modules/update/updatework.cpp -@@ -199,6 +199,7 @@ void UpdateWorker::init() { +@@ -221,6 +221,7 @@ void UpdateWorker::init() #endif } @@ -273,7 +292,7 @@ index 01e9a3f..71d889d 100644 void UpdateWorker::licenseStateChangeSlot() { QFutureWatcher *watcher = new QFutureWatcher(); -@@ -226,6 +227,7 @@ void UpdateWorker::getLicenseState() +@@ -248,6 +249,7 @@ void UpdateWorker::getLicenseState() qDebug() << "Authorization State:" << reply; m_model->setSystemActivation(reply); } @@ -281,7 +300,7 @@ index 01e9a3f..71d889d 100644 void UpdateWorker::activate() { -@@ -260,11 +262,13 @@ void UpdateWorker::activate() +@@ -300,11 +302,13 @@ void UpdateWorker::activate() refreshMirrors(); #endif @@ -293,13 +312,13 @@ index 01e9a3f..71d889d 100644 this, SLOT(licenseStateChangeSlot())); +#endif - QFutureWatcher *packagesWatcher = new QFutureWatcher(); - connect(packagesWatcher, &QFutureWatcher::finished, this, [=] { + QFutureWatcher> *packagesWatcher = new QFutureWatcher>(); + connect(packagesWatcher, &QFutureWatcher::finished, this, [ = ] { diff --git a/src/frame/modules/update/updatework.h b/src/frame/modules/update/updatework.h -index 66cfbdb..4e4a65a 100644 +index 7610383..a34ef72 100644 --- a/src/frame/modules/update/updatework.h +++ b/src/frame/modules/update/updatework.h -@@ -72,7 +72,9 @@ public: +@@ -85,7 +85,9 @@ public: void setOnBattery(bool onBattery); void setBatteryPercentage(const BatteryPercentageInfo &info); void setSystemBatteryPercentage(const double &value); @@ -307,12 +326,12 @@ index 66cfbdb..4e4a65a 100644 void getLicenseState(); +#endif - Q_SIGNALS: - void requestInit(); -@@ -107,7 +109,9 @@ public Q_SLOTS: - void recoveryCanBackup(); + void setSysUpdateDownloadJobName(const QString &sysUpdateDownloadJobName); + void setSafeUpdateDownloadJobName(const QString &safeUpdateDownloadJobName); +@@ -127,7 +129,9 @@ public Q_SLOTS: void recoveryStartRestore(); - void onNotifyDownloadInfoChanged(); + void onRecoveryBackupFinshed(const QString &kind, const bool success, const QString &errMsg); + +#ifndef DISABLE_ACTIVATOR void licenseStateChangeSlot(); +#endif @@ -320,10 +339,10 @@ index 66cfbdb..4e4a65a 100644 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 184b2be..d7db8d6 100644 +index 3ba9b1f..02fc1ca 100644 --- a/src/frame/window/modules/systeminfo/nativeinfowidget.cpp +++ b/src/frame/window/modules/systeminfo/nativeinfowidget.cpp -@@ -92,7 +92,9 @@ NativeInfoWidget::NativeInfoWidget(SystemInfoModel *model, QWidget *parent) +@@ -84,7 +84,9 @@ NativeInfoWidget::NativeInfoWidget(SystemInfoModel *model, QWidget *parent) NativeInfoWidget::~NativeInfoWidget() { @@ -333,24 +352,24 @@ index 184b2be..d7db8d6 100644 GSettingWatcher::instance()->erase("systeminfoNativeinfoKernel", m_kernel); GSettingWatcher::instance()->erase("systeminfoNativeinfoProcessor", m_processor); GSettingWatcher::instance()->erase("systeminfoNativeinfoMemory", m_memory); -@@ -202,6 +204,7 @@ void NativeInfoWidget::initWidget() +@@ -195,6 +197,7 @@ void NativeInfoWidget::initWidget() //~ child_page About This PC - m_type->setTitle(tr("Type:")); + m_type->setTitle(tr("Type") + ':'); +#ifndef DISABLE_ACTIVATOR m_authorized = new TitleAuthorizedItem(frame); //~ contents_path /systeminfo/About This PC //~ child_page About This PC -@@ -214,6 +217,7 @@ void NativeInfoWidget::initWidget() - } else { +@@ -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 -@@ -233,7 +237,9 @@ void NativeInfoWidget::initWidget() - m_memory->setTitle(tr("Memory:")); +@@ -227,7 +231,9 @@ void NativeInfoWidget::initWidget() + m_memory->setTitle(tr("Memory") + ':'); m_memory->setValue(m_model->memory()); +#ifndef DISABLE_ACTIVATOR @@ -359,7 +378,7 @@ index 184b2be..d7db8d6 100644 GSettingWatcher::instance()->bind("systeminfoNativeinfoKernel", m_kernel); GSettingWatcher::instance()->bind("systeminfoNativeinfoProcessor", m_processor); GSettingWatcher::instance()->bind("systeminfoNativeinfoMemory", m_memory); -@@ -246,9 +252,11 @@ void NativeInfoWidget::initWidget() +@@ -240,9 +246,11 @@ void NativeInfoWidget::initWidget() } infoGroup->appendItem(m_version, SettingsGroup::ItemBackground); infoGroup->appendItem(m_type); @@ -371,7 +390,7 @@ index 184b2be..d7db8d6 100644 infoGroup->appendItem(m_kernel); infoGroup->appendItem(m_processor); infoGroup->appendItem(m_memory); -@@ -279,13 +287,17 @@ void NativeInfoWidget::initWidget() +@@ -273,13 +281,17 @@ void NativeInfoWidget::initWidget() connect(m_model, &SystemInfoModel::processorChanged, this, &NativeInfoWidget::setProcessor); connect(m_model, &SystemInfoModel::memoryChanged, this, &NativeInfoWidget::setMemory); @@ -389,7 +408,7 @@ index 184b2be..d7db8d6 100644 } void NativeInfoWidget::resizeEvent(QResizeEvent *event) -@@ -328,6 +340,7 @@ void NativeInfoWidget::setMemory(const QString &memory) +@@ -335,6 +347,7 @@ void NativeInfoWidget::setMemory(const QString &memory) m_memory->setValue(memory); } @@ -397,8 +416,8 @@ index 184b2be..d7db8d6 100644 void NativeInfoWidget::setLicenseState(ActiveState state) { if (state == Authorized) { -@@ -352,6 +365,7 @@ void NativeInfoWidget::setLicenseState(ActiveState state) - m_authorized->setButtonText(tr("Activate")); +@@ -363,6 +376,7 @@ void NativeInfoWidget::setLicenseState(ActiveState state) + m_authorized->setButtonText(tr("View")); } } +#endif @@ -406,10 +425,10 @@ index 184b2be..d7db8d6 100644 const QString NativeInfoWidget::systemCopyright() const { diff --git a/src/frame/window/modules/systeminfo/nativeinfowidget.h b/src/frame/window/modules/systeminfo/nativeinfowidget.h -index 1849793..93e24ef 100644 +index 8dea9d7..699c2f4 100644 --- a/src/frame/window/modules/systeminfo/nativeinfowidget.h +++ b/src/frame/window/modules/systeminfo/nativeinfowidget.h -@@ -79,7 +79,9 @@ public Q_SLOTS: +@@ -63,7 +63,9 @@ public Q_SLOTS: void setType(const QString &type); void setProcessor(const QString &processor); void setMemory(const QString &memory); @@ -419,7 +438,7 @@ index 1849793..93e24ef 100644 void onToolButtonButtonClicked(); void onFocusChanged(const bool onFocus); -@@ -90,7 +92,9 @@ public Q_SLOTS: +@@ -74,7 +76,9 @@ public Q_SLOTS: void onSetHostNameError(const QString &error); Q_SIGNALS: @@ -429,7 +448,7 @@ index 1849793..93e24ef 100644 protected: void resizeEvent(QResizeEvent *event) override; -@@ -108,7 +112,9 @@ private: +@@ -92,7 +96,9 @@ private: dcc::widgets::TitleValueItem *m_versionNumber; dcc::widgets::TitleValueItem *m_version; dcc::widgets::TitleValueItem *m_type; @@ -440,10 +459,10 @@ index 1849793..93e24ef 100644 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 +index ba7444a..3d4a4d4 100644 --- a/src/frame/window/modules/systeminfo/systeminfomodule.cpp +++ b/src/frame/window/modules/systeminfo/systeminfomodule.cpp -@@ -129,7 +129,9 @@ void SystemInfoModule::onShowAboutNativePage() +@@ -254,7 +254,9 @@ void SystemInfoModule::onShowAboutNativePage() m_frameProxy->pushWidget(this, w); w->setVisible(true); //showActivatorDialog @@ -454,24 +473,24 @@ index 05fac20..563a3ee 100644 void SystemInfoModule::onVersionProtocolPage() diff --git a/src/frame/window/modules/update/updatectrlwidget.cpp b/src/frame/window/modules/update/updatectrlwidget.cpp -index 158d6c4..415e89c 100644 +index 6285d73..db26368 100644 --- a/src/frame/window/modules/update/updatectrlwidget.cpp +++ b/src/frame/window/modules/update/updatectrlwidget.cpp -@@ -63,9 +63,13 @@ UpdateCtrlWidget::UpdateCtrlWidget(UpdateModel *model, QWidget *parent) +@@ -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) + , m_updateList(new ContentWidget(parent)) +#ifndef DISABLE_ACTIVATOR - , m_authorizationPrompt(new TipsLabel) + , m_authorizationPrompt(new TipsLabel(parent)) +#endif - , m_checkUpdateBtn(new QPushButton) - , m_lastCheckTimeTip(new TipsLabel) - { -@@ -85,11 +89,15 @@ UpdateCtrlWidget::UpdateCtrlWidget(UpdateModel *model, QWidget *parent) + , 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); @@ -485,9 +504,9 @@ index 158d6c4..415e89c 100644 fullProcesslayout->addWidget(m_authorizationPrompt); +#endif - m_summaryGroup->setVisible(true); - -@@ -172,7 +180,9 @@ void UpdateCtrlWidget::setShowInfo(const UiActiveState value) + m_powerTip->setWordWrap(true); + m_powerTip->setAlignment(Qt::AlignHCenter); +@@ -290,7 +298,9 @@ void UpdateCtrlWidget::setShowInfo(const UiActiveState value) } m_fullProcess->setEnabled(activation); @@ -496,11 +515,11 @@ index 158d6c4..415e89c 100644 +#endif } - void UpdateCtrlWidget::loadAppList(const QList &infos) -@@ -253,9 +263,11 @@ void UpdateCtrlWidget::setStatus(const UpdatesStatus &status) - { + 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; @@ -509,7 +528,7 @@ index 158d6c4..415e89c 100644 Q_EMIT notifyUpdateState(m_status); -@@ -264,7 +276,9 @@ void UpdateCtrlWidget::setStatus(const UpdatesStatus &status) +@@ -309,7 +321,9 @@ void UpdateCtrlWidget::setStatus(const UpdatesStatus &status) m_resultItem->setVisible(false); m_progress->setVisible(false); m_fullProcess->setVisible(false); @@ -519,19 +538,9 @@ index 158d6c4..415e89c 100644 m_updateList->setVisible(false); m_upgradeWarningGroup->setVisible(false); m_reminderTip->setVisible(false); -@@ -312,7 +326,9 @@ void UpdateCtrlWidget::setStatus(const UpdatesStatus &status) - //~ child_page Updates - m_fullProcess->setMessage(tr("Download and install updates")); - setDownloadInfo(m_model->downloadInfo()); -+#ifndef DISABLE_ACTIVATOR - setShowInfo(m_model->systemActivation()); -+#endif - setLowBattery(m_model->lowBattery()); - break; - case UpdatesStatus::Downloading: -@@ -457,10 +473,12 @@ void UpdateCtrlWidget::setLowBattery(const bool &lowBattery) +@@ -430,10 +444,12 @@ void UpdateCtrlWidget::setLowBattery(const bool &lowBattery) { - if (m_status == UpdatesStatus::Downloaded || m_status == UpdatesStatus::UpdatesAvailable) { + if (m_status == UpdatesStatus::Updateing || m_status == UpdatesStatus::UpdatesAvailable) { bool activation = false; +#ifndef DISABLE_ACTIVATOR const UiActiveState value = m_model->systemActivation(); @@ -542,7 +551,7 @@ index 158d6c4..415e89c 100644 if (lowBattery) { m_powerTip->setText(tr("Your battery is lower than 50%, please plug in to continue")); } else { -@@ -502,6 +520,7 @@ void UpdateCtrlWidget::setRecoverRestoring(const bool value) +@@ -481,6 +497,7 @@ void UpdateCtrlWidget::setRecoverRestoring(const bool value) } } @@ -550,39 +559,40 @@ index 158d6c4..415e89c 100644 void UpdateCtrlWidget::setActiveState(const UiActiveState &activestate) { if (m_activeState != activestate) { -@@ -515,6 +534,7 @@ void UpdateCtrlWidget::setActiveState(const UiActiveState &activestate) +@@ -493,7 +510,7 @@ void UpdateCtrlWidget::setActiveState(const UiActiveState &activestate) + setStatus(m_model->status()); } - } +- +#endif void UpdateCtrlWidget::setModel(UpdateModel *model) { -@@ -528,7 +548,9 @@ 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); - - setUpdateProgress(m_model->updateProgress()); + 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 f54ee46..0e219f9 100644 +index 99713c2..a4a9cb1 100644 --- a/src/frame/window/modules/update/updatectrlwidget.h +++ b/src/frame/window/modules/update/updatectrlwidget.h -@@ -86,7 +86,9 @@ private: +@@ -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(); - private: - dcc::update::UpdateModel *m_model; -@@ -107,9 +109,13 @@ private: + void onChangeUpdatesAvailableStatus(); +@@ -135,9 +137,13 @@ private: bool m_bRecoverBackingUp; bool m_bRecoverConfigValid; bool m_bRecoverRestoring; @@ -593,14 +603,14 @@ index f54ee46..0e219f9 100644 +#ifndef DISABLE_ACTIVATOR dcc::widgets::TipsLabel *m_authorizationPrompt; +#endif + bool m_isUpdateingAll; 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 ef5529b..e84f643 100644 +index 2de16ba..9bf5b9a 100644 --- a/src/frame/window/modules/update/updatemodule.cpp +++ b/src/frame/window/modules/update/updatemodule.cpp -@@ -77,7 +77,9 @@ void UpdateModule::preInitialize(bool sync, FrameProxyInterface::PushType pushty +@@ -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); @@ -610,19 +620,7 @@ index ef5529b..e84f643 100644 #ifndef DISABLE_SYS_UPDATE_MIRRORS connect(m_work.get(), &UpdateWorker::requestRefreshMirrors, m_work.get(), &UpdateWorker::refreshMirrors); -@@ -150,9 +152,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, [=]() { -@@ -186,7 +190,7 @@ void UpdateModule::active() +@@ -176,7 +178,7 @@ void UpdateModule::active() m_updateWidget->setSystemVersion(m_model->systemVersionInfo()); } #else diff --git a/dde-control-center-5.4.85.4.tar.gz b/dde-control-center-5.4.85.4.tar.gz deleted file mode 100644 index 903a08786bb4c21820f6f6b276be71119d552880..0000000000000000000000000000000000000000 Binary files a/dde-control-center-5.4.85.4.tar.gz and /dev/null differ diff --git a/dde-control-center-5.5.182.tar.gz b/dde-control-center-5.5.182.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..28663ee94e4bbe1d657e7fc2d137b649e8db8f17 Binary files /dev/null and b/dde-control-center-5.5.182.tar.gz differ diff --git a/dde-control-center.spec b/dde-control-center.spec index 3c3abbae95a84b5f4a9007c9c06df33a6626cf9d..a0dd60111c490d22c27c2daeea193ecd7807fbc0 100644 --- a/dde-control-center.spec +++ b/dde-control-center.spec @@ -1,27 +1,47 @@ -%define specrelease 3%{?dist} -%if 0%{?openeuler} -%define specrelease 3 -%endif - Name: dde-control-center -Version: 5.4.85.4 -Release: %{specrelease} +Version: 5.5.182 +Release: 7 Summary: New control center for Linux Deepin License: GPLv3 -URL: https://github.com/linuxdeepin/%{name} -Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz -Patch0: 0002-hide-authorized.patch -Patch1: 0001-dde-control-center-uos-fix-modify-eulerServerEnduserAgreement_new-path.patch -Patch2: 0003-bugfix-for-no-check-newpassword-at-modifypwd.patch -Patch3: 0004-fix.patch -Patch4: 0005-fix-hide-commoninfo-and-end-user-license-agreement.patch +URL: https://github.com/linuxdeepin/dde-coptrol-center +Source0: %{name}-%{version}.tar.gz + +#add by uos +Patch0001: 0001-dde-control-center-uos-fix-modify-eulerServerEnduserAgreement_new-path.patch +# activate butten +Patch0003: 0003-dde-control-center-uos-open-activate-button-for-1050.patch +# disable windowmoveswitch +Patch0004: 0004-dde-control-center-disable-windowmoveswitch.patch +# add setVersion +Patch0005: 0005-dde-control-center-feat-add-setVersion.patch +# uelc hide commoninfo +Patch0006: 0006-hide-commonifo-and-end-user-license-agreement.patch +# add Free-license +Patch0007: 0007-dde-control-center-uos-add-Free-license.patch +# hidden power-press-powerbtn +Patch0008: 0008-dde-control-center-feat-hidden-power-press-powerbtn.patch +# modify copyright read current year +Patch0009: 0009-dde-control-center-feat-modify-copyright-read-current-year.patch +Patch0010: 0001-feat-root.patch +# pms 204145 +Patch0011: 0010-fix-Array-out-of-bounds-causes-crash-handling.patch +# hide activate +Patch0012: 0011-hide-activate-function.patch +#end + +#Patch0: 0002-hide-authorized.patch +#Patch1: 0001-dde-control-center-uos-fix-modify-eulerServerEnduserAgreement_new-path.patch +#Patch2: 0003-bugfix-for-no-check-newpassword-at-modifypwd.patch +#Patch3: 0004-fix.patch +#Patch4: 0005-fix-hide-commoninfo-and-end-user-license-agreement.patch BuildRequires: gcc-c++ BuildRequires: desktop-file-utils BuildRequires: dde-dock-devel -BuildRequires: pkgconfig(dde-network-utils) +BuildRequires: dde-network-core-devel BuildRequires: dtkwidget-devel -BuildRequires: dtkgui-devel dtkcore-devel +BuildRequires: dtkgui-devel +BuildRequires: dtkcore-devel BuildRequires: dde-qt-dbus-factory-devel BuildRequires: pkgconfig(gsettings-qt) BuildRequires: pkgconfig(geoip) @@ -40,14 +60,25 @@ BuildRequires: gmock-devel BuildRequires: polkit-qt5-1-devel BuildRequires: deepin-pw-check BuildRequires: deepin-pw-check-devel +BuildRequires: pkgconfig(wayland-client) +BuildRequires: kf5-kwayland-devel +BuildRequires: qt5-qtbase-static +BuildRequires: libxkbcommon-devel +BuildRequires: pkgconfig(wayland-client) +BuildRequires: kf5-kwayland-devel +BuildRequires: qt5-qtbase-static +BuildRequires: libxkbcommon-devel +BuildRequires: dareader-devel +BuildRequires: qt5-qtbase-private-devel + Requires: dde-account-faces Requires: dde-api Requires: dde-daemon Requires: dde-qt5integration -Requires: dde-network-utils +Requires: dde-network-core Requires: startdde Requires: dde-server-industry-config -#Requires: deepin-pw-check +Requires: deepin-pw-check Requires: cracklib Recommends: NetworkManager-l2tp @@ -62,18 +93,30 @@ Summary: %{summary} %prep %setup -q -n %{name}-%{version} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 +%patch0001 -p1 +%patch0003 -p1 +%patch0004 -p1 +%patch0005 -p1 +%patch0006 -p1 +%patch0007 -p1 +%patch0008 -p1 +%patch0009 -p1 +%patch0010 -p1 +%patch0011 -p1 +%patch0012 -p1 + sed -i 's|lrelease|lrelease-qt5|' translate_generation.sh sed -i -E '/add_compile_definitions/d' CMakeLists.txt %build %cmake . -DDCC_DISABLE_GRUB=YES \ + -DDISABLE_AUTHENTICATION=YES \ + -DDISABLE_ACCOUNT=YES \ -DDISABLE_SYS_UPDATE=YES \ - -DDISABLE_ACTIVATOR=YES + -DDISABLE_SYS_UPDATE_SOURCE_CHECK=YES \ + -DDISABLE_SYS_UPDATE_MIRRORS=YES \ + -DDISABLE_ACTIVATOR=YES \ + -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} %make_build %post @@ -91,8 +134,8 @@ mkdir -p %{buildroot}%{_libdir}/%{name}/plugins # https://github.com/linuxdeepin/dde-control-center/issues/115 # And we disabled SYS_UPDATE, so reboot-reminder-dialog is useless. #rm %{buildroot}%{_bindir}/reboot-reminder-dialog -mkdir -p %{buildroot}/usr/lib64/cmake/DdeControlCenter -mv %{buildroot}/cmake/DdeControlCenter/DdeControlCenterConfig.cmake %{buildroot}/usr/lib64/cmake/DdeControlCenter +#mkdir -p %{buildroot}/usr/lib64/cmake/DdeControlCenter +#mv %{buildroot}/cmake/DdeControlCenter/DdeControlCenterConfig.cmake %{buildroot}/usr/lib64/cmake/DdeControlCenter mv %{buildroot}/usr/lib/libdccwidgets.so %{buildroot}%{_libdir}/ install -Dm644 com.deepin.controlcenter.addomain.policy %{buildroot}%{_datadir}/polkit-1/actions/ @@ -104,19 +147,40 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop ||: %files %doc README.md %license LICENSE -%{_sysconfdir}/ %{_bindir}/abrecovery %{_bindir}/dde-control-center %{_bindir}/dde-control-center-wapper %{_datadir}/ %{_libdir}/libdccwidgets.so -#/etc/xdg/autostart/deepin-ab-recovery.desktop +%{_sysconfdir}/xdg/autostart/deepin-ab-recovery.desktop +%{_prefix}/lib/dde-grand-search-daemon/ %files devel %{_includedir}/dde-control-center %{_libdir}/cmake/DdeControlCenter/ %changelog +* Wed Dec 06 2023 liuzhilin - 5.5.182-7 +- update BR + +* Tue Dec 05 2023 liuzhilin - 5.5.182-6 +- fix build BR + +* Wed Sep 06 2023 leeffo - 5.5.182-5 +- disable activate button + +* Tue Aug 29 2023 yangxianzhao - 5.5.182-4 +- Update BR + +* Tue Aug 29 2023 yangxianzhao - 5.5.182-3 +- Modify BR for build on qt5-qtbase-5.15.10 + +* Fri Aug 18 2023 leeffo - 5.5.182-2 +- update BR + +* Wed Aug 02 2023 leeffo - 5.5.182-1 +- upgrade to version 5.5.182 + * Thu Jun 08 2023 lee - 5.4.85.4-3 - fix: control-center core and hide commoninfo