diff --git a/0001-feat-accessibleName-updates-accessiblename.patch b/0001-feat-accessibleName-updates-accessiblename.patch deleted file mode 100644 index 5ab50e8892ced559b1cdaeb3bd695662192b84ee..0000000000000000000000000000000000000000 --- a/0001-feat-accessibleName-updates-accessiblename.patch +++ /dev/null @@ -1,1867 +0,0 @@ -From 46fe23801dc879e36e49c3296e60d6ee7ea23a31 Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Thu, 25 Aug 2022 16:38:12 +0800 -Subject: [PATCH] feat(accessibleName): updates accessiblename -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 部分组件更新可访问名称,支持自动化测试 ---- - .../kiran-module-widget.cpp | 1 + - .../advance-settings-page/advance-settings.ui | 15 +++++++ - .../auth-manager-page/auth-manager-page.ui | 6 +++ - .../face-enroll-dialog/face-enroll-dialog.ui | 12 ++++++ - .../fingerprint-enroll-dialog.ui | 12 ++++++ - .../create-user-page/create-user-page.ui | 24 +++++++++++ - .../password-expiration-policy-page.ui | 30 ++++++++++++-- - .../select-avatar-page/select-avatar-page.cpp | 4 ++ - .../pages/user-info-page/user-info-page.ui | 15 +++++++ - plugins/account/src/widgets/hover-tips.h | 2 - - .../src/common/setting-brief-widget.cpp | 1 + - plugins/appearance/src/pages/font/fonts.ui | 18 ++++++++ - plugins/appearance/src/pages/theme/themes.cpp | 1 + - .../src/pages/wallpaper/wallpaper.ui | 6 +++ - .../display/src/kiran-display-config-item.cpp | 1 + - .../src/kiran-display-configuration-panel.cpp | 3 +- - .../src/kiran-display-configuration-panel.ui | 15 +++++++ - .../src/kiran-display-configuration.ui | 41 ++++++++++++++++++- - plugins/keybinding/src/shortcut-item.cpp | 1 + - plugins/keybinding/src/shortcut.cpp | 4 ++ - plugins/keybinding/src/shortcut.ui | 35 +++++++++++++++- - .../src/pages/general/general-page.ui | 12 ++++++ - .../keyboard/src/pages/layout/layout-page.ui | 6 +++ - plugins/mouse/src/mouse-page.ui | 12 ++++++ - plugins/mouse/src/touchpad-page.ui | 24 +++++++++++ - .../battery-settings-page.cpp | 1 + - .../battery-settings/battery-settings-page.ui | 27 ++++++++++-- - .../general-settings-page.cpp | 1 + - .../general-settings/general-settings-page.ui | 24 ++++++++++- - .../power-settings/power-settings-page.ui | 18 ++++++-- - plugins/system/src/kylinsec-logo.cpp | 1 + - .../hardware-information.ui | 6 +++ - .../change-host-name-widget.ui | 9 ++++ - .../system-information/license-agreement.ui | 13 +++++- - .../system-information/system-information.ui | 24 +++++++++++ - .../date-time-settings/date-time-settings.ui | 6 +++ - .../display-format-settings.cpp | 1 + - .../display-format-settings.ui | 18 ++++++-- - .../timezone-settings/time-zone-settings.ui | 6 +++ - .../src/timezone/kiran-time-zone-list.cpp | 4 +- - .../timedate/src/timezone/kiran-time-zone.cpp | 1 + - plugins/timedate/src/widgets/date-spinbox.h | 12 ++++-- - plugins/timedate/src/widgets/kiran-clock.cpp | 1 + - .../src/widgets/kiran-date-picker-widget.cpp | 1 + - .../src/widgets/kiran-time-picker-widget.cpp | 1 + - .../timedate/src/widgets/scroll-picker.cpp | 1 + - src/category-widget.cpp | 3 ++ - src/panel-window.cpp | 1 + - 48 files changed, 455 insertions(+), 26 deletions(-) - -diff --git a/lib/common-widgets/kiran-module-widget/kiran-module-widget.cpp b/lib/common-widgets/kiran-module-widget/kiran-module-widget.cpp -index 77df10b..d455b46 100644 ---- a/lib/common-widgets/kiran-module-widget/kiran-module-widget.cpp -+++ b/lib/common-widgets/kiran-module-widget/kiran-module-widget.cpp -@@ -101,6 +101,7 @@ void KiranModuleWidget::setPlugins(const PluginHelperPtrList &plugins) - } - item->setData(ROLE_PLUGIN_HELPER_INDEX, i); - item->setData(ROLE_SUBITEM_ID, subItem.id); -+ item->setData(Qt::AccessibleTextRole,QString("ControlPanelSubItem::%1").arg(subItem.name)); - ui->list_subItems->addItem(item); - } - } -diff --git a/plugins/account/src/pages/advance-settings-page/advance-settings.ui b/plugins/account/src/pages/advance-settings-page/advance-settings.ui -index b417305..89c984f 100644 ---- a/plugins/account/src/pages/advance-settings-page/advance-settings.ui -+++ b/plugins/account/src/pages/advance-settings-page/advance-settings.ui -@@ -71,6 +71,9 @@ - - Qt::NoContextMenu - -+ -+ EditLoginShell -+ - - - -@@ -140,6 +143,9 @@ - - Qt::NoContextMenu - -+ -+ EditSpecifyUserID -+ - - - -@@ -200,6 +206,9 @@ - - Qt::NoContextMenu - -+ -+ EditSpecifyUserHome -+ - - - -@@ -258,6 +267,9 @@ - 40 - - -+ -+ ButtonConfirm -+ - - confirm - -@@ -299,6 +311,9 @@ - 40 - - -+ -+ ButtonCancel -+ - - cancel - -diff --git a/plugins/account/src/pages/auth-manager-page/auth-manager-page.ui b/plugins/account/src/pages/auth-manager-page/auth-manager-page.ui -index 7843c86..3d48d4a 100644 ---- a/plugins/account/src/pages/auth-manager-page/auth-manager-page.ui -+++ b/plugins/account/src/pages/auth-manager-page/auth-manager-page.ui -@@ -210,6 +210,9 @@ - 40 - - -+ -+ ButtonSave -+ - - save - -@@ -251,6 +254,9 @@ - 40 - - -+ -+ ButtonReturn -+ - - return - -diff --git a/plugins/account/src/pages/biometric-enroll-dialog/face-enroll-dialog/face-enroll-dialog.ui b/plugins/account/src/pages/biometric-enroll-dialog/face-enroll-dialog/face-enroll-dialog.ui -index 8010528..97666a6 100644 ---- a/plugins/account/src/pages/biometric-enroll-dialog/face-enroll-dialog/face-enroll-dialog.ui -+++ b/plugins/account/src/pages/biometric-enroll-dialog/face-enroll-dialog/face-enroll-dialog.ui -@@ -47,6 +47,9 @@ - 274 - - -+ -+ EnrollProgressBar -+ - - - -@@ -59,6 +62,9 @@ - - - -+ -+ LabelEnrollTips -+ - - balabalalbala... - -@@ -120,6 +126,9 @@ - 40 - - -+ -+ ButtonSave -+ - - save - -@@ -158,6 +167,9 @@ - 40 - - -+ -+ ButtonCancel -+ - - cancel - -diff --git a/plugins/account/src/pages/biometric-enroll-dialog/fingerprint-enroll-dialog/fingerprint-enroll-dialog.ui b/plugins/account/src/pages/biometric-enroll-dialog/fingerprint-enroll-dialog/fingerprint-enroll-dialog.ui -index 7c2c441..cd2d807 100644 ---- a/plugins/account/src/pages/biometric-enroll-dialog/fingerprint-enroll-dialog/fingerprint-enroll-dialog.ui -+++ b/plugins/account/src/pages/biometric-enroll-dialog/fingerprint-enroll-dialog/fingerprint-enroll-dialog.ui -@@ -47,6 +47,9 @@ - 260 - - -+ -+ EnrollProgressBar -+ - - - -@@ -66,6 +69,9 @@ - 0 - - -+ -+ EnrollTips -+ - - balabalalbala... - -@@ -130,6 +136,9 @@ - 40 - - -+ -+ ButtonSave -+ - - save - -@@ -168,6 +177,9 @@ - 40 - - -+ -+ ButtonCancel -+ - - cancel - -diff --git a/plugins/account/src/pages/create-user-page/create-user-page.ui b/plugins/account/src/pages/create-user-page/create-user-page.ui -index cccb479..7e6024f 100644 ---- a/plugins/account/src/pages/create-user-page/create-user-page.ui -+++ b/plugins/account/src/pages/create-user-page/create-user-page.ui -@@ -70,6 +70,9 @@ - 150 - - -+ -+ UserAvatarWidget -+ - - - -@@ -129,6 +132,9 @@ - - Qt::NoContextMenu - -+ -+ EditUserName -+ - - - -@@ -172,6 +178,9 @@ - 36 - - -+ -+ ComboUserType -+ - - - -@@ -221,6 +230,9 @@ - 36 - - -+ -+ EditPasswd -+ - - - -@@ -270,6 +282,9 @@ - 36 - - -+ -+ EditPasswdConfirm -+ - - - -@@ -287,6 +302,9 @@ - - - -+ -+ ButtonAdvanceSetting -+ - - true - -@@ -385,6 +403,9 @@ - 60 - - -+ -+ ButtonConfirm -+ - - Confirm - -@@ -432,6 +453,9 @@ - 60 - - -+ -+ ButtonCancel -+ - - Cancel - -diff --git a/plugins/account/src/pages/passwd-expiration-policy/password-expiration-policy-page.ui b/plugins/account/src/pages/passwd-expiration-policy/password-expiration-policy-page.ui -index 6f0241e..284b1ff 100644 ---- a/plugins/account/src/pages/passwd-expiration-policy/password-expiration-policy-page.ui -+++ b/plugins/account/src/pages/passwd-expiration-policy/password-expiration-policy-page.ui -@@ -63,6 +63,9 @@ - - - -+ -+ SpinBoxUserExpires -+ - - yyyy-MM-dd - -@@ -104,6 +107,9 @@ - - - -+ -+ LabelLastPasswdChange -+ - - 1990-01-01 - -@@ -144,7 +150,11 @@ - - - -- -+ -+ -+ SpinBoxMaximumValidDays -+ -+ - - - -@@ -181,7 +191,11 @@ - - - -- -+ -+ -+ SpinBoxPromptBeforeExpiration -+ -+ - - - -@@ -218,7 +232,11 @@ - - - -- -+ -+ -+ SpinBoxPasswdInactiveTime -+ -+ - - - -@@ -276,6 +294,9 @@ - 40 - - -+ -+ ButtonSave -+ - - save - -@@ -317,6 +338,9 @@ - 40 - - -+ -+ ButtonReturn -+ - - return - -diff --git a/plugins/account/src/pages/select-avatar-page/select-avatar-page.cpp b/plugins/account/src/pages/select-avatar-page/select-avatar-page.cpp -index 229595a..4fd6d24 100644 ---- a/plugins/account/src/pages/select-avatar-page/select-avatar-page.cpp -+++ b/plugins/account/src/pages/select-avatar-page/select-avatar-page.cpp -@@ -143,6 +143,7 @@ void SelectAvatarPage::initUI() - - btn = new QPushButton(this); - btn->setObjectName("btn_confirm"); -+ btn->setAccessibleName("ButtonConfirm"); - btn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - btn->setFixedSize(110, 40); - btn->setText(tr("Confirm")); -@@ -156,6 +157,7 @@ void SelectAvatarPage::initUI() - - btn = new QPushButton(this); - btn->setObjectName("btn_return"); -+ btn->setAccessibleName("ButtonReturn"); - btn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - btn->setFixedSize(110, 40); - btn->setText(tr("Return")); -@@ -168,6 +170,7 @@ void SelectAvatarPage::initUI() - - loadAvatar(); - m_addButton = addAvatar(":/kcp-account/images/create-user-avatar.png", AVATAR_ADD, false); -+ m_addButton->setAccessibleName("ButtonAddAvatar"); - connect(m_addButton, &AvatarItemButton::clicked, [this]() - { - //1.选择图片 -@@ -221,6 +224,7 @@ AvatarItemButton *SelectAvatarPage::addAvatar(const QString &iconPath, AvatarTyp - } - btn->setIcon(iconPath); - btn->setFixedSize(80, 80); -+ btn->setAccessibleName(QString("AvatarItemButton::%1").arg(iconPath)); - if (type != AVATAR_ADD) - { - btn->setCheckable(true); -diff --git a/plugins/account/src/pages/user-info-page/user-info-page.ui b/plugins/account/src/pages/user-info-page/user-info-page.ui -index 4499cfa..b0c9cbe 100644 ---- a/plugins/account/src/pages/user-info-page/user-info-page.ui -+++ b/plugins/account/src/pages/user-info-page/user-info-page.ui -@@ -619,6 +619,9 @@ - 40 - - -+ -+ EditCurrentPasswd -+ - - - -@@ -669,6 +672,9 @@ - 40 - - -+ -+ EditNewPasswd -+ - - - -@@ -718,6 +724,9 @@ - 40 - - -+ -+ EditNewPasswdAgain -+ - - - -@@ -776,6 +785,9 @@ - 40 - - -+ -+ EditPasswdSave -+ - - Save - -@@ -817,6 +829,9 @@ - 40 - - -+ -+ EditPasswdCancel -+ - - Cancel - -diff --git a/plugins/account/src/widgets/hover-tips.h b/plugins/account/src/widgets/hover-tips.h -index 60a8c3a..733f65f 100644 ---- a/plugins/account/src/widgets/hover-tips.h -+++ b/plugins/account/src/widgets/hover-tips.h -@@ -45,9 +45,7 @@ public: - ~HoverTips(); - - void setTimeout(quint32 ms); -- - void setIcon(HoverTipsTypeEnum typeEnum, const QString &icon); -- - void show(HoverTipsTypeEnum typeEnum, const QString &msg); - void hide(); - -diff --git a/plugins/appearance/src/common/setting-brief-widget.cpp b/plugins/appearance/src/common/setting-brief-widget.cpp -index d5d1114..ebffec0 100644 ---- a/plugins/appearance/src/common/setting-brief-widget.cpp -+++ b/plugins/appearance/src/common/setting-brief-widget.cpp -@@ -28,6 +28,7 @@ using namespace Kiran; - SettingBriefWidget::SettingBriefWidget(QString title, int type, QWidget *parent) : QWidget(parent), - ui(new Ui::SettingBriefWidget) - { -+ setAccessibleName("SettingBriefWidget"); - ui->setupUi(this); - initUI(title); - setAttribute(Qt::WA_Hover); -diff --git a/plugins/appearance/src/pages/font/fonts.ui b/plugins/appearance/src/pages/font/fonts.ui -index 66a939b..5871048 100644 ---- a/plugins/appearance/src/pages/font/fonts.ui -+++ b/plugins/appearance/src/pages/font/fonts.ui -@@ -96,6 +96,9 @@ - 40 - - -+ -+ ComboAppFontName -+ - - 10 - -@@ -118,6 +121,9 @@ - 40 - - -+ -+ ComboAppFontSize -+ - - 5 - -@@ -172,6 +178,9 @@ - 40 - - -+ -+ ComboTitleFontName -+ - - - -@@ -188,6 +197,9 @@ - 40 - - -+ -+ ComboTitleFontSize -+ - - 5 - -@@ -242,6 +254,9 @@ - 40 - - -+ -+ ComboMonospaceFontName -+ - - - -@@ -258,6 +273,9 @@ - 40 - - -+ -+ ComboMonospaceFontSize -+ - - 5 - -diff --git a/plugins/appearance/src/pages/theme/themes.cpp b/plugins/appearance/src/pages/theme/themes.cpp -index 6e18872..7899399 100644 ---- a/plugins/appearance/src/pages/theme/themes.cpp -+++ b/plugins/appearance/src/pages/theme/themes.cpp -@@ -293,6 +293,7 @@ void Themes::createThemeWidget() - for (int i = 0; i < SETTING_THEME_NUM; i++) - { - ThemeWidget *themeWidget = new ThemeWidget(m_themesName.at(i), m_currentTheme, this); -+ themeWidget->setAccessibleName(QString("ThemeWidget::%1").arg(m_themesName.at(i))); - if (m_themesName.at(i) == m_currentTheme) - m_themeWidgetGroup->setCurrentWidget(themeWidget); - -diff --git a/plugins/appearance/src/pages/wallpaper/wallpaper.ui b/plugins/appearance/src/pages/wallpaper/wallpaper.ui -index 3d0aaea..01a04c3 100644 ---- a/plugins/appearance/src/pages/wallpaper/wallpaper.ui -+++ b/plugins/appearance/src/pages/wallpaper/wallpaper.ui -@@ -85,6 +85,9 @@ - 112 - - -+ -+ FrameLockScreenPreview -+ - - - 0 -@@ -112,6 +115,9 @@ - 112 - - -+ -+ FrameDesktopPreivew -+ - - - 0 -diff --git a/plugins/display/src/kiran-display-config-item.cpp b/plugins/display/src/kiran-display-config-item.cpp -index a3e89f1..bf279c8 100644 ---- a/plugins/display/src/kiran-display-config-item.cpp -+++ b/plugins/display/src/kiran-display-config-item.cpp -@@ -19,6 +19,7 @@ - KiranDisplayConfigItem::KiranDisplayConfigItem(QWidget *parent) : QPushButton(parent), m_mousePress(false), m_mouseDrag(false), - m_statusType(QEvent::None), m_enabled(true), m_anchorByBtn(NULL), m_rotateDrect(DISPLAY_ROTATION_0), m_displayReflectType(DISPLAY_REFLECT_NORMAL) - { -+ setAccessibleName("KiranDisplayConfigItem"); - setCheckable(true); - setAttribute(Qt::WA_Hover,true); - installEventFilter(this); -diff --git a/plugins/display/src/kiran-display-configuration-panel.cpp b/plugins/display/src/kiran-display-configuration-panel.cpp -index 1fc84a6..a80b531 100644 ---- a/plugins/display/src/kiran-display-configuration-panel.cpp -+++ b/plugins/display/src/kiran-display-configuration-panel.cpp -@@ -32,7 +32,8 @@ KiranDisplayConfigurationPanel::KiranDisplayConfigurationPanel(QWidget *parent) - ui(new Ui::KiranDisplayConfigurationPanel) - { - ui->setupUi(this); -- -+ setAccessibleName("KiranDisplayConfigurationPanel"); -+ - ui->pushButton_left->setThemeIcon(QPixmap(":/kcp-display/images/rotation-left.svg"),PALETTE_DARK); - ui->pushButton_right->setThemeIcon(QPixmap(":/kcp-display/images/rotation-right.svg"),PALETTE_DARK); - ui->pushButton_horizontal->setThemeIcon(QPixmap(":/kcp-display/images/flip-h.svg"),PALETTE_DARK); -diff --git a/plugins/display/src/kiran-display-configuration-panel.ui b/plugins/display/src/kiran-display-configuration-panel.ui -index 85d2162..c5829a0 100644 ---- a/plugins/display/src/kiran-display-configuration-panel.ui -+++ b/plugins/display/src/kiran-display-configuration-panel.ui -@@ -121,6 +121,9 @@ - - Rotate left 90 degrees - -+ -+ ButtonLeft -+ - - - -@@ -152,6 +155,9 @@ - - Rotate right 90 degrees - -+ -+ ButtonRight -+ - - - -@@ -183,6 +189,9 @@ - - Turn left and right - -+ -+ ButtonHorizontal -+ - - - -@@ -217,6 +226,9 @@ - - upside down - -+ -+ ButtonVertical -+ - - - -@@ -251,6 +263,9 @@ - - Identification display - -+ -+ ButtonIdentifying -+ - - - -diff --git a/plugins/display/src/kiran-display-configuration.ui b/plugins/display/src/kiran-display-configuration.ui -index f9cae01..c54875b 100644 ---- a/plugins/display/src/kiran-display-configuration.ui -+++ b/plugins/display/src/kiran-display-configuration.ui -@@ -88,6 +88,9 @@ - 30 - - -+ -+ ButtonCopyDisplay -+ - - - QPushButton { -@@ -137,6 +140,9 @@ QPushButton { - 30 - - -+ -+ ButtonExtendedDisplay -+ - - - QPushButton { -@@ -235,7 +241,7 @@ QPushButton { - - - -- 1 -+ 0 - - - -@@ -280,6 +286,9 @@ QPushButton { - 36 - - -+ -+ ComboResolutionRatio -+ - - - -@@ -313,6 +322,9 @@ QPushButton { - 36 - - -+ -+ ComboRefreshRate -+ - - - -@@ -343,6 +355,9 @@ QPushButton { - 36 - - -+ -+ ComboZoomRate -+ - - - Automatic -@@ -413,6 +428,9 @@ QPushButton { - 40 - - -+ -+ ButtonApply -+ - - - -@@ -435,6 +453,9 @@ QPushButton { - 40 - - -+ -+ ButtonClose -+ - - - -@@ -583,6 +604,9 @@ QPushButton { - 0 - - -+ -+ SwitchExtraPrimary -+ - - - -@@ -621,6 +645,9 @@ QPushButton { - 36 - - -+ -+ ComboExtraResolutionRatio -+ - - - -@@ -654,6 +681,9 @@ QPushButton { - 36 - - -+ -+ ComboExtraRefreshRate -+ - - - -@@ -684,6 +714,9 @@ QPushButton { - 36 - - -+ -+ ComboExtraZoomRate -+ - - - Automatic -@@ -751,6 +784,9 @@ QPushButton { - 40 - - -+ -+ ButtonExtraApply -+ - - - -@@ -773,6 +809,9 @@ QPushButton { - 40 - - -+ -+ ButtonExtraCancel -+ - - - -diff --git a/plugins/keybinding/src/shortcut-item.cpp b/plugins/keybinding/src/shortcut-item.cpp -index 4441106..64c99e5 100644 ---- a/plugins/keybinding/src/shortcut-item.cpp -+++ b/plugins/keybinding/src/shortcut-item.cpp -@@ -27,6 +27,7 @@ ShortcutItem::ShortcutItem(int type, ShortcutInfoPtr shortcutInfo, QWidget *pare - ui(new Ui::ShortcutItem) - { - ui->setupUi(this); -+ setAccessibleName("ShortcutItem"); - m_shortcutInfo = shortcutInfo; - m_type = type; - -diff --git a/plugins/keybinding/src/shortcut.cpp b/plugins/keybinding/src/shortcut.cpp -index 3298fea..6723c2e 100644 ---- a/plugins/keybinding/src/shortcut.cpp -+++ b/plugins/keybinding/src/shortcut.cpp -@@ -101,6 +101,7 @@ void Shortcut::initUI() - QHBoxLayout *hLayoutCustomApp = new QHBoxLayout(ui->lineEdit_custom_app); - m_btnCustomApp = new QToolButton; - m_btnCustomApp->setObjectName("btn_custom_app"); -+ m_btnCustomApp->setAccessibleName("ButtonAddCustomApp"); - m_btnCustomApp->setText(tr("Add")); - m_btnCustomApp->setFixedSize(56, 30); - m_btnCustomApp->setCursor(Qt::PointingHandCursor); -@@ -112,6 +113,7 @@ void Shortcut::initUI() - QHBoxLayout *hLayoutModifyApp = new QHBoxLayout(ui->lineEdit_modify_app); - m_btnModifyApp = new QToolButton; - m_btnModifyApp->setObjectName("btn_modify_app"); -+ m_btnModifyApp->setAccessibleName("ButtonModifyApp"); - m_btnModifyApp->setText(tr("Add")); - m_btnModifyApp->setFixedSize(56, 30); - m_btnModifyApp->setCursor(Qt::PointingHandCursor); -@@ -122,12 +124,14 @@ void Shortcut::initUI() - - m_lECustomKey = new CustomLineEdit; - m_lECustomKey->setPlaceholderText(tr("Please press the new shortcut key")); -+ m_lECustomKey->setAccessibleName("EditCustomPressNewShotcut"); - m_lECustomKey->installEventFilter(this); - ui->vlayout_custom_key->addWidget(m_lECustomKey); - connect(m_lECustomKey, &CustomLineEdit::inputKeyCodes, this, &Shortcut::handleInputKeycode); - - m_lEModifyKey = new CustomLineEdit; - m_lEModifyKey->setPlaceholderText(tr("Please press the new shortcut key")); -+ m_lEModifyKey->setAccessibleName("EditPressNewShotcut"); - m_lEModifyKey->installEventFilter(this); - ui->vlayout_modify_key->addWidget(m_lEModifyKey); - connect(m_lEModifyKey, &CustomLineEdit::inputKeyCodes, this, &Shortcut::handleInputKeycode); -diff --git a/plugins/keybinding/src/shortcut.ui b/plugins/keybinding/src/shortcut.ui -index 680a20c..8c971de 100644 ---- a/plugins/keybinding/src/shortcut.ui -+++ b/plugins/keybinding/src/shortcut.ui -@@ -32,7 +32,7 @@ - - - -- 0 -+ 2 - - - -@@ -74,6 +74,9 @@ - - Qt::ClickFocus - -+ -+ EditSearch -+ - - - -@@ -336,6 +339,9 @@ - 40 - - -+ -+ ButtonAddShortcut -+ - - Add - -@@ -371,6 +377,9 @@ - 40 - - -+ -+ ButtonReset -+ - - Reset - -@@ -436,6 +445,9 @@ - 40 - - -+ -+ EditCustomShortcutName -+ - - - -@@ -466,6 +478,9 @@ - 40 - - -+ -+ EditShortcutApp -+ - - - -@@ -529,6 +544,9 @@ - 40 - - -+ -+ ButtonAdd -+ - - Add - -@@ -564,6 +582,9 @@ - 40 - - -+ -+ ButtonCancel -+ - - Cancel - -@@ -629,6 +650,9 @@ - 40 - - -+ -+ EditShortcutName -+ - - - -@@ -672,6 +696,9 @@ - 40 - - -+ -+ EditShortcutApp -+ - - - -@@ -736,6 +763,9 @@ - 40 - - -+ -+ ButtonSave -+ - - Save - -@@ -771,6 +801,9 @@ - 40 - - -+ -+ ButtonReturn -+ - - return - -diff --git a/plugins/keyboard/src/pages/general/general-page.ui b/plugins/keyboard/src/pages/general/general-page.ui -index 3667b24..2edfe8c 100644 ---- a/plugins/keyboard/src/pages/general/general-page.ui -+++ b/plugins/keyboard/src/pages/general/general-page.ui -@@ -63,6 +63,9 @@ - - - -+ -+ SwitchRepeatKey -+ - - - -@@ -101,6 +104,9 @@ - - - -+ -+ SliderRepeatDelay -+ - - 100 - -@@ -182,6 +188,9 @@ - - - -+ -+ SliderRepeatInterval -+ - - 0 - -@@ -261,6 +270,9 @@ - 40 - - -+ -+ EditTestRepeatKey -+ - - - -diff --git a/plugins/keyboard/src/pages/layout/layout-page.ui b/plugins/keyboard/src/pages/layout/layout-page.ui -index f69bead..2aa6857 100644 ---- a/plugins/keyboard/src/pages/layout/layout-page.ui -+++ b/plugins/keyboard/src/pages/layout/layout-page.ui -@@ -293,6 +293,9 @@ - 40 - - -+ -+ ButtonAddLayout -+ - - Addition - -@@ -334,6 +337,9 @@ - 40 - - -+ -+ ButtonReturn -+ - - Return - -diff --git a/plugins/mouse/src/mouse-page.ui b/plugins/mouse/src/mouse-page.ui -index bb364b8..ac241bf 100644 ---- a/plugins/mouse/src/mouse-page.ui -+++ b/plugins/mouse/src/mouse-page.ui -@@ -99,6 +99,9 @@ - 36 - - -+ -+ ComboSelectMouseHand -+ - - - -@@ -126,6 +129,9 @@ - - - -+ -+ SliderMouseMotionAcceleration -+ - - 0 - -@@ -226,6 +232,9 @@ - - - -+ -+ SwitchMouseNatturalScroll -+ - - - -@@ -276,6 +285,9 @@ - - - -+ -+ SwitchMiddleEmulation -+ - - - -diff --git a/plugins/mouse/src/touchpad-page.ui b/plugins/mouse/src/touchpad-page.ui -index e80d703..e1c5c82 100644 ---- a/plugins/mouse/src/touchpad-page.ui -+++ b/plugins/mouse/src/touchpad-page.ui -@@ -102,6 +102,9 @@ - - - -+ -+ SwitchTouchPadEnable -+ - - - -@@ -149,6 +152,9 @@ - 36 - - -+ -+ ComboTouchPadHand -+ - - - -@@ -201,6 +207,9 @@ - - - -+ -+ SliderTouchPadMotionAcceleration -+ - - 50 - -@@ -291,6 +300,9 @@ - 36 - - -+ -+ ComboClickMethod -+ - - - -@@ -335,6 +347,9 @@ - 36 - - -+ -+ ComboScrollMethod -+ - - - -@@ -380,6 +395,9 @@ - - - -+ -+ ComboNaturalScroll -+ - - - -@@ -428,6 +446,9 @@ - - - -+ -+ SwitchTypingEnable -+ - - - -@@ -476,6 +497,9 @@ - - - -+ -+ SwtichTapToClick -+ - - - -diff --git a/plugins/power/src/pages/battery-settings/battery-settings-page.cpp b/plugins/power/src/pages/battery-settings/battery-settings-page.cpp -index 222d9bb..05832f6 100644 ---- a/plugins/power/src/pages/battery-settings/battery-settings-page.cpp -+++ b/plugins/power/src/pages/battery-settings/battery-settings-page.cpp -@@ -96,6 +96,7 @@ void BatterySettingsPage::initUI() - - ///空闲时减少屏幕亮度 - m_reduceBrightnessSwitch = new KiranSwitchButton(this); -+ m_reduceBrightnessSwitch->setAccessibleName("SwitchReduceBrightness"); - ui->layout_reduceBrightness->insertWidget(ui->layout_reduceBrightness->count(), m_reduceBrightnessSwitch); - } - -diff --git a/plugins/power/src/pages/battery-settings/battery-settings-page.ui b/plugins/power/src/pages/battery-settings/battery-settings-page.ui -index 76d758e..3fcfefe 100644 ---- a/plugins/power/src/pages/battery-settings/battery-settings-page.ui -+++ b/plugins/power/src/pages/battery-settings/battery-settings-page.ui -@@ -55,10 +55,18 @@ - 10 - - -- -+ -+ -+ ComboIdleTime -+ -+ - - -- -+ -+ -+ ComboIdleAction -+ -+ - - - -@@ -72,6 +80,9 @@ - - - -+ -+ -+ - - When the battery is lit up, it will be executed - -@@ -88,7 +99,11 @@ - 10 - - -- -+ -+ -+ ComboLowBatteryAction -+ -+ - - - -@@ -118,7 +133,11 @@ - 10 - - -- -+ -+ -+ ComboMonitorTurnOffIdleTime -+ -+ - - - -diff --git a/plugins/power/src/pages/general-settings/general-settings-page.cpp b/plugins/power/src/pages/general-settings/general-settings-page.cpp -index 2a7ae13..60823cd 100644 ---- a/plugins/power/src/pages/general-settings/general-settings-page.cpp -+++ b/plugins/power/src/pages/general-settings/general-settings-page.cpp -@@ -162,6 +162,7 @@ void GeneralSettingsPage::initUI() - - //空闲时是否锁定屏幕及屏保 - m_btn_lockScreen = new KiranSwitchButton(this); -+ m_btn_lockScreen->setAccessibleName("ButtonIdleLockScreen"); - ui->layout_sliderLabel->addWidget(m_btn_lockScreen); - - //NOTE: 根据#48515缺陷单所做修改,隐藏挂起按钮相关配置项,后续若有需要再进行打开 -diff --git a/plugins/power/src/pages/general-settings/general-settings-page.ui b/plugins/power/src/pages/general-settings/general-settings-page.ui -index 0ab1909..5ed9536 100644 ---- a/plugins/power/src/pages/general-settings/general-settings-page.ui -+++ b/plugins/power/src/pages/general-settings/general-settings-page.ui -@@ -49,7 +49,11 @@ - 10 - - -- -+ -+ -+ ComboPowerButtonAction -+ -+ - - - -@@ -73,7 +77,11 @@ - 10 - - -- -+ -+ -+ ComboSuspendAction -+ -+ - - - -@@ -137,6 +145,9 @@ - 40 - - -+ -+ ComboCloseLidAction -+ - - - -@@ -183,6 +194,9 @@ - - - -+ -+ SliderDisplayBrightness -+ - - Qt::Horizontal - -@@ -197,6 +211,9 @@ - - - -+ -+ -+ - - Regard computer as idle after - -@@ -243,6 +260,9 @@ - - - -+ -+ SliderComputerIdleTime -+ - - Qt::Horizontal - -diff --git a/plugins/power/src/pages/power-settings/power-settings-page.ui b/plugins/power/src/pages/power-settings/power-settings-page.ui -index bf411a5..af0e1e1 100644 ---- a/plugins/power/src/pages/power-settings/power-settings-page.ui -+++ b/plugins/power/src/pages/power-settings/power-settings-page.ui -@@ -55,10 +55,18 @@ - 10 - - -- -+ -+ -+ ComboIdleTime -+ -+ - - -- -+ -+ -+ ComboIdleAction -+ -+ - - - -@@ -88,7 +96,11 @@ - 10 - - -- -+ -+ -+ ComboMonitorTrunOffIdleTime -+ -+ - - - -diff --git a/plugins/system/src/kylinsec-logo.cpp b/plugins/system/src/kylinsec-logo.cpp -index 8178fd5..a5e09f0 100644 ---- a/plugins/system/src/kylinsec-logo.cpp -+++ b/plugins/system/src/kylinsec-logo.cpp -@@ -11,6 +11,7 @@ - - KylinsecLogo::KylinsecLogo(QWidget *parent) - { -+ setAccessibleName("KylinsecLogo"); - } - - KylinsecLogo::~KylinsecLogo() -diff --git a/plugins/system/src/pages/hardware-information/hardware-information.ui b/plugins/system/src/pages/hardware-information/hardware-information.ui -index 51eaec5..23da897 100644 ---- a/plugins/system/src/pages/hardware-information/hardware-information.ui -+++ b/plugins/system/src/pages/hardware-information/hardware-information.ui -@@ -145,6 +145,9 @@ - - - -+ -+ LabelCpuInfo -+ - - TextLabel - -@@ -205,6 +208,9 @@ - - - -+ -+ LabelMemoryInfo -+ - - TextLabel - -diff --git a/plugins/system/src/pages/system-information/change-host-name-widget.ui b/plugins/system/src/pages/system-information/change-host-name-widget.ui -index a677bbc..a98cf16 100644 ---- a/plugins/system/src/pages/system-information/change-host-name-widget.ui -+++ b/plugins/system/src/pages/system-information/change-host-name-widget.ui -@@ -113,6 +113,9 @@ - 40 - - -+ -+ EditHostName -+ - - - -@@ -163,6 +166,9 @@ - 40 - - -+ -+ ButtonSaveHostName -+ - - Save - -@@ -198,6 +204,9 @@ - 40 - - -+ -+ ButtonCancelChangeHostName -+ - - Cancel - -diff --git a/plugins/system/src/pages/system-information/license-agreement.ui b/plugins/system/src/pages/system-information/license-agreement.ui -index 727cc85..66ea1a0 100644 ---- a/plugins/system/src/pages/system-information/license-agreement.ui -+++ b/plugins/system/src/pages/system-information/license-agreement.ui -@@ -66,6 +66,9 @@ - Noto Sans CJK SC - - -+ -+ BrowserLicense -+ - - QFrame::NoFrame - -@@ -76,8 +79,8 @@ - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> - p, li { white-space: pre-wrap; } --</style></head><body style=" font-family:'Noto Sans CJK SC'; font-size:10pt; font-weight:400; font-style:normal;"> --<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;"><br /></p></body></html> -+</style></head><body style=" font-family:'Noto Sans CJK SC'; font-size:9pt; font-weight:400; font-style:normal;"> -+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> - - - -@@ -119,6 +122,9 @@ p, li { white-space: pre-wrap; } - 40 - - -+ -+ ButtonExportLicense -+ - - Export - -@@ -160,6 +166,9 @@ p, li { white-space: pre-wrap; } - 40 - - -+ -+ ButtonCloseLicense -+ - - Close - -diff --git a/plugins/system/src/pages/system-information/system-information.ui b/plugins/system/src/pages/system-information/system-information.ui -index 5beafd2..ff2ce51 100644 ---- a/plugins/system/src/pages/system-information/system-information.ui -+++ b/plugins/system/src/pages/system-information/system-information.ui -@@ -145,6 +145,9 @@ - - - -+ -+ -+ - - Host Name: - -@@ -165,6 +168,9 @@ - - - -+ -+ LabelHostName -+ - - TextLabel - -@@ -196,6 +202,9 @@ - 28 - - -+ -+ ButtonChangeHostName -+ - - Change - -@@ -256,6 +265,9 @@ - - - -+ -+ LabelSystemVersion -+ - - TextLabel - -@@ -331,6 +343,9 @@ - - - -+ -+ LabelKernelVersion -+ - - TextLabel - -@@ -394,6 +409,9 @@ - - - -+ -+ LabelSystemArch -+ - - TextLabel - -@@ -469,6 +487,9 @@ - 28 - - -+ -+ ButtonShowEULA -+ - - Show - -@@ -541,6 +562,9 @@ - 28 - - -+ -+ ButtonShowVersionLicense -+ - - Show - -diff --git a/plugins/timedate/src/pages/date-time-settings/date-time-settings.ui b/plugins/timedate/src/pages/date-time-settings/date-time-settings.ui -index 9baa147..210b99d 100644 ---- a/plugins/timedate/src/pages/date-time-settings/date-time-settings.ui -+++ b/plugins/timedate/src/pages/date-time-settings/date-time-settings.ui -@@ -148,6 +148,9 @@ - 40 - - -+ -+ ButtonSave -+ - - save - -@@ -189,6 +192,9 @@ - 40 - - -+ -+ ButtonReset -+ - - reset - -diff --git a/plugins/timedate/src/pages/display-format-settings/display-format-settings.cpp b/plugins/timedate/src/pages/display-format-settings/display-format-settings.cpp -index c96f330..7a3beef 100644 ---- a/plugins/timedate/src/pages/display-format-settings/display-format-settings.cpp -+++ b/plugins/timedate/src/pages/display-format-settings/display-format-settings.cpp -@@ -37,6 +37,7 @@ void DisplayFormatSettings::init() - KiranTimeDateGlobalData* globalData = KiranTimeDateGlobalData::instance(); - - m_showSecondSwitch = new KiranSwitchButton(this); -+ m_showSecondSwitch->setAccessibleName("SwitchShowSeconds"); - ui->layout_timeSeconds->addWidget(m_showSecondSwitch); - - /* ComboBox填充数据 */ -diff --git a/plugins/timedate/src/pages/display-format-settings/display-format-settings.ui b/plugins/timedate/src/pages/display-format-settings/display-format-settings.ui -index 0435982..6e53f4b 100644 ---- a/plugins/timedate/src/pages/display-format-settings/display-format-settings.ui -+++ b/plugins/timedate/src/pages/display-format-settings/display-format-settings.ui -@@ -50,7 +50,11 @@ - - - -- -+ -+ -+ ComboLongDateDisplayFormat -+ -+ - - - -@@ -73,7 +77,11 @@ - - - -- -+ -+ -+ ComboShortDateDisplayFormat -+ -+ - - - -@@ -93,7 +101,11 @@ - - - -- -+ -+ -+ ComboTimeFormat -+ -+ - - - -diff --git a/plugins/timedate/src/pages/timezone-settings/time-zone-settings.ui b/plugins/timedate/src/pages/timezone-settings/time-zone-settings.ui -index dea9ec4..691c28c 100644 ---- a/plugins/timedate/src/pages/timezone-settings/time-zone-settings.ui -+++ b/plugins/timedate/src/pages/timezone-settings/time-zone-settings.ui -@@ -112,6 +112,9 @@ - 40 - - -+ -+ ButtonSave -+ - - save - -@@ -153,6 +156,9 @@ - 40 - - -+ -+ ButtonReturn -+ - - reset - -diff --git a/plugins/timedate/src/timezone/kiran-time-zone-list.cpp b/plugins/timedate/src/timezone/kiran-time-zone-list.cpp -index b2a2a46..5e016ae 100644 ---- a/plugins/timedate/src/timezone/kiran-time-zone-list.cpp -+++ b/plugins/timedate/src/timezone/kiran-time-zone-list.cpp -@@ -30,7 +30,7 @@ KiranTimeZoneList::KiranTimeZoneList(QWidget *parent) : - m_timeoutSearchTaskID(0) - { - ui->setupUi(this); -- -+ setAccessibleName("TimeZoneList"); - setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed); - } - -@@ -53,6 +53,7 @@ bool KiranTimeZoneList::initAllTimeZone() - iter!=globalData->allTimeZoneListEndIter(); - iter++){ - item = new KiranTimeZoneItem(*iter,ui->timezone); -+ item->setAccessibleName(QString("TimeZone::%1").arg(iter->zone_city)); - if(iter->zone_id==m_seletedZoneID){ - item->setisSelected(true); - } -@@ -115,6 +116,7 @@ void KiranTimeZoneList::search() - iter++){ - if(iter->zone_city.contains(m_keyword) ){ - item = new KiranTimeZoneItem(*iter,ui->filter_timezone); -+ item->setAccessibleName(QString("FilterTimeZone::%1").arg(iter->zone_city)); - item->setHeightLightKeyword(m_keyword); - if(iter->zone_id==m_seletedZoneID){ - item->setisSelected(true); -diff --git a/plugins/timedate/src/timezone/kiran-time-zone.cpp b/plugins/timedate/src/timezone/kiran-time-zone.cpp -index 29b630f..0bf7365 100644 ---- a/plugins/timedate/src/timezone/kiran-time-zone.cpp -+++ b/plugins/timedate/src/timezone/kiran-time-zone.cpp -@@ -36,6 +36,7 @@ KiranTimeZone::KiranTimeZone(QWidget *parent) : - { - ui->setupUi(this); - setAttribute(Qt::WA_TranslucentBackground); -+ setAccessibleName("TimeZoneWidget"); - ui->edit_search->installEventFilter(this); - initUI();; - } -diff --git a/plugins/timedate/src/widgets/date-spinbox.h b/plugins/timedate/src/widgets/date-spinbox.h -index 3dcd3b8..d50c7a4 100644 ---- a/plugins/timedate/src/widgets/date-spinbox.h -+++ b/plugins/timedate/src/widgets/date-spinbox.h -@@ -10,7 +10,9 @@ class YearSpinBox:public QSpinBox - { - Q_OBJECT - public: -- explicit YearSpinBox(QWidget* parent=nullptr):QSpinBox(parent){} -+ explicit YearSpinBox(QWidget* parent=nullptr):QSpinBox(parent){ -+ setAccessibleName("SpinBoxYear"); -+ } - ~YearSpinBox(){} - protected: - virtual QString textFromValue(int val) const Q_DECL_OVERRIDE{ -@@ -24,7 +26,9 @@ class MonthSpinBox:public QSpinBox - { - Q_OBJECT - public: -- explicit MonthSpinBox(QWidget* parent=nullptr):QSpinBox(parent){} -+ explicit MonthSpinBox(QWidget* parent=nullptr):QSpinBox(parent){ -+ setAccessibleName("SpinBoxMonth"); -+ } - ~MonthSpinBox(){} - protected: - virtual QString textFromValue(int val) const Q_DECL_OVERRIDE{ -@@ -38,7 +42,9 @@ class DaySpinBox:public QSpinBox - { - Q_OBJECT - public: -- explicit DaySpinBox(QWidget* parent=nullptr):QSpinBox(parent){} -+ explicit DaySpinBox(QWidget* parent=nullptr):QSpinBox(parent){ -+ setAccessibleName("SpinBoxDay"); -+ } - ~DaySpinBox(){} - protected: - virtual QString textFromValue(int val) const Q_DECL_OVERRIDE{ -diff --git a/plugins/timedate/src/widgets/kiran-clock.cpp b/plugins/timedate/src/widgets/kiran-clock.cpp -index dc2917a..55b3202 100644 ---- a/plugins/timedate/src/widgets/kiran-clock.cpp -+++ b/plugins/timedate/src/widgets/kiran-clock.cpp -@@ -18,6 +18,7 @@ KiranClock::KiranClock(QWidget *parent) - { - loadPixmap(); - initShadow(); -+ setAccessibleName("Clock"); - m_updateTimerID = startTimer(1000); - } - -diff --git a/plugins/timedate/src/widgets/kiran-date-picker-widget.cpp b/plugins/timedate/src/widgets/kiran-date-picker-widget.cpp -index 4b3ea8f..b42f0ec 100644 ---- a/plugins/timedate/src/widgets/kiran-date-picker-widget.cpp -+++ b/plugins/timedate/src/widgets/kiran-date-picker-widget.cpp -@@ -7,6 +7,7 @@ KiranDatePickerWidget::KiranDatePickerWidget(QWidget *parent) : - { - ui->setupUi(this); - initUI(); -+ setAccessibleName("DatePicker"); - } - - KiranDatePickerWidget::~KiranDatePickerWidget() -diff --git a/plugins/timedate/src/widgets/kiran-time-picker-widget.cpp b/plugins/timedate/src/widgets/kiran-time-picker-widget.cpp -index 09b158c..b75e99a 100644 ---- a/plugins/timedate/src/widgets/kiran-time-picker-widget.cpp -+++ b/plugins/timedate/src/widgets/kiran-time-picker-widget.cpp -@@ -17,6 +17,7 @@ KiranTimePickerWidget::KiranTimePickerWidget(QWidget *parent) : - { - ui->setupUi(this); - initUI(); -+ setAccessibleName("TimePicker"); - } - - KiranTimePickerWidget::KiranTimePickerWidget(KiranTimePickerWidget::TimePickerType type, QWidget *parent) : -diff --git a/plugins/timedate/src/widgets/scroll-picker.cpp b/plugins/timedate/src/widgets/scroll-picker.cpp -index ed091f5..a1728be 100644 ---- a/plugins/timedate/src/widgets/scroll-picker.cpp -+++ b/plugins/timedate/src/widgets/scroll-picker.cpp -@@ -30,6 +30,7 @@ ScrollPicker::ScrollPicker(QWidget *parent) - m_hoverIncreaseFont(3) - { - setAttribute(Qt::WA_Hover); -+ setAccessibleName("ScrollPicker"); - init(); - } - -diff --git a/src/category-widget.cpp b/src/category-widget.cpp -index 4a0580e..8decac4 100644 ---- a/src/category-widget.cpp -+++ b/src/category-widget.cpp -@@ -31,6 +31,8 @@ CategoryWidget::~CategoryWidget() - - void CategoryWidget::init() - { -+ setAccessibleName("ControlPanelCategory"); -+ - //初始化阴影 - QColor shadowColor(0,0,0,255*0.9); - m_dropShadowEffect = new QGraphicsDropShadowEffect(this); -@@ -152,6 +154,7 @@ void CategoryWidget::loadCategories() - auto category = categories.at(i); - auto categoryInfo = category->getCategoryDesktopInfo(); - auto categoryItem = new CategoryItem(); -+ categoryItem->setAccessibleName(QString("ControlPanelCategory::%1").arg(categoryInfo.categoryName)); - categoryItem->setText(categoryInfo.name); - categoryItem->setIcon(QIcon(categoryInfo.icon)); - categoryItem->setFixedHeight(50); -diff --git a/src/panel-window.cpp b/src/panel-window.cpp -index bb31f65..fbb0a6e 100644 ---- a/src/panel-window.cpp -+++ b/src/panel-window.cpp -@@ -51,6 +51,7 @@ void PanelWindow::initUI() - - //添加搜索框 - auto *searchBox = new SearchEdit(this); -+ searchBox->setAccessibleName("ControlPanelSearchEdit"); - searchBox->setFixedSize(352, 30); - getTitlebarCustomLayout()->addWidget(searchBox); - setTitlebarCustomLayoutAlignHCenter(true); --- -2.33.0 - diff --git a/0001-feature-audio-network-Add-labels-to-volume-and-netwo.patch b/0001-feature-audio-network-Add-labels-to-volume-and-netwo.patch deleted file mode 100644 index 81b87d924f7504823047fe4f791e8afaa73e9183..0000000000000000000000000000000000000000 --- a/0001-feature-audio-network-Add-labels-to-volume-and-netwo.patch +++ /dev/null @@ -1,1227 +0,0 @@ -From eb1a31d64642b5b0ec8adc609763a33e4a25b414 Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Thu, 25 Aug 2022 19:21:48 +0800 -Subject: [PATCH 1/2] feature(audio&network):Add labels to volume and network - plugins to support automated testing -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 音量和网络插件添加标签,以支持自动化测试 ---- - plugins/audio/src/plugin/input-page.ui | 6 ++++ - plugins/audio/src/plugin/output-page.ui | 9 +++++ - plugins/network/src/connection-itemwidget.cpp | 31 ++++++++-------- - plugins/network/src/connection-lists.cpp | 8 +++-- - plugins/network/src/connection-show-page.cpp | 1 + - plugins/network/src/connection-show-page.ui | 3 ++ - plugins/network/src/plugin/details-page.ui | 3 ++ - .../network/src/plugin/manager/manager.cpp | 18 ++++------ - .../src/plugin/manager/vpn-manager.cpp | 8 ++--- - .../network/src/plugin/manager/vpn-manager.ui | 7 ++-- - .../src/plugin/manager/wired-manager.ui | 6 ++++ - .../setting-widget/connection-name-widget.cpp | 1 + - .../setting-widget/connection-name-widget.ui | 3 ++ - .../disconnect-and-delete-button.ui | 11 +++++- - .../plugin/setting-widget/ethernet-widget.cpp | 1 + - .../plugin/setting-widget/ethernet-widget.ui | 9 +++++ - .../src/plugin/setting-widget/ipv4-widget.ui | 20 ++++++++++- - .../src/plugin/setting-widget/ipv6-widget.ui | 20 ++++++++++- - .../setting-widget/text-input-dialog.cpp | 35 ++++++++++--------- - .../plugin/setting-widget/vpn/vpn-ipsec.cpp | 17 +++++---- - .../plugin/setting-widget/vpn/vpn-ipsec.ui | 15 ++++++++ - .../plugin/setting-widget/vpn/vpn-ipvx.cpp | 13 +++---- - .../src/plugin/setting-widget/vpn/vpn-ipvx.ui | 9 +++++ - .../src/plugin/setting-widget/vpn/vpn-ppp.cpp | 4 +++ - .../src/plugin/setting-widget/vpn/vpn-ppp.ui | 3 ++ - .../plugin/setting-widget/vpn/vpn-widget.ui | 18 ++++++++++ - .../wireless-security-widget.ui | 12 +++++++ - .../plugin/setting-widget/wireless-widget.cpp | 17 ++++----- - .../plugin/setting-widget/wireless-widget.ui | 9 +++++ - 29 files changed, 239 insertions(+), 78 deletions(-) - -diff --git a/plugins/audio/src/plugin/input-page.ui b/plugins/audio/src/plugin/input-page.ui -index 386e573..c291ef0 100644 ---- a/plugins/audio/src/plugin/input-page.ui -+++ b/plugins/audio/src/plugin/input-page.ui -@@ -62,6 +62,9 @@ - 36 - - -+ -+ ComboBoxInputDevices -+ - - - -@@ -127,6 +130,9 @@ - - Qt::NoFocus - -+ -+ SliderVolumeSetting -+ - - Qt::Horizontal - -diff --git a/plugins/audio/src/plugin/output-page.ui b/plugins/audio/src/plugin/output-page.ui -index 3451ea9..529d386 100644 ---- a/plugins/audio/src/plugin/output-page.ui -+++ b/plugins/audio/src/plugin/output-page.ui -@@ -80,6 +80,9 @@ - 36 - - -+ -+ ComboBoxOutputDevices -+ - - - -@@ -169,6 +172,9 @@ - - Qt::NoFocus - -+ -+ SlilderVolumeSetting -+ - - Qt::Horizontal - -@@ -236,6 +242,9 @@ - - Qt::NoFocus - -+ -+ SliderVolumeBalance -+ - - Qt::Horizontal - -diff --git a/plugins/network/src/connection-itemwidget.cpp b/plugins/network/src/connection-itemwidget.cpp -index f16e76c..93d69d7 100644 ---- a/plugins/network/src/connection-itemwidget.cpp -+++ b/plugins/network/src/connection-itemwidget.cpp -@@ -14,14 +14,14 @@ - - #include "connection-itemwidget.h" - #include -+#include -+#include - #include - #include --#include - #include "animation-loading-label.h" --#include - - // 使用默认析构函数,父对象被释放时,会释放子对象 --ConnectionItemWidget::ConnectionItemWidget( QWidget* parent) : KiranFrame(parent) -+ConnectionItemWidget::ConnectionItemWidget(QWidget* parent) : KiranFrame(parent) - { - initUI(); - } -@@ -32,7 +32,7 @@ void ConnectionItemWidget::initUI() - initPluginItemWidget(); - setDrawBroder(false); - setAttribute(Qt::WA_Hover); -- connect(Kiran::StylePalette::instance(),&Kiran::StylePalette::themeChanged,this,&ConnectionItemWidget::handleThemeChanged); -+ connect(Kiran::StylePalette::instance(), &Kiran::StylePalette::themeChanged, this, &ConnectionItemWidget::handleThemeChanged); - connect(m_editButton, &QPushButton::clicked, this, &ConnectionItemWidget::editButtonClicked); - } - -@@ -47,10 +47,10 @@ void ConnectionItemWidget::initPluginItemWidget() - m_connectionTypeIcon->setVisible(false); - m_activatedLabel->setVisible(false); - --// auto pixmap = QApplication::style()->standardPixmap(QStyle::SP_ArrowRight); -+ // auto pixmap = QApplication::style()->standardPixmap(QStyle::SP_ArrowRight); - m_editButton->setIcon(trayIconColorSwitch(":/kcp-network-images/details-info.svg")); -- m_editButton->setIconSize(QSize(16,16)); -- m_editButton->setFixedSize(30,36); -+ m_editButton->setIconSize(QSize(16, 16)); -+ m_editButton->setFixedSize(30, 36); - m_editButton->setFlat(true); - - m_horizonLayout->addWidget(m_connectionTypeIcon); -@@ -61,10 +61,10 @@ void ConnectionItemWidget::initPluginItemWidget() - m_horizonLayout->setMargin(0); - - this->setLayout(m_horizonLayout); -- this->setContentsMargins(10,0,3,0); -+ this->setContentsMargins(10, 0, 3, 0); - } - --//TODO:名称过长进行缩略 -+// TODO:名称过长进行缩略 - void ConnectionItemWidget::setName(const QString& name) - { - QString nameStr = name; -@@ -75,6 +75,7 @@ void ConnectionItemWidget::setName(const QString& name) - // } - // KLOG_DEBUG() << "elidedText:" << nameStr; - m_connectionName->setText(nameStr); -+ m_editButton->setAccessibleName(QString("ButtonEditConnectionName::%1").arg(nameStr)); - } - - QString ConnectionItemWidget::getName() -@@ -82,7 +83,7 @@ QString ConnectionItemWidget::getName() - return m_connectionName->text(); - } - --//TODO:其他状态信息的显示,以及优化 -+// TODO:其他状态信息的显示,以及优化 - void ConnectionItemWidget::activatedStatus() - { - QPixmap pixmap(":/kcp-network-images/correct.png"); -@@ -164,7 +165,7 @@ void ConnectionItemWidget::setOtherNetworkIcon() - - void ConnectionItemWidget::handleThemeChanged(Kiran::PaletteType paletteType) - { -- if(m_connectionTypeIcon->pixmap() != nullptr) -+ if (m_connectionTypeIcon->pixmap() != nullptr) - { - QImage image = m_connectionTypeIcon->pixmap()->toImage(); - image.invertPixels(QImage::InvertRgb); -@@ -174,12 +175,12 @@ void ConnectionItemWidget::handleThemeChanged(Kiran::PaletteType paletteType) - m_editButton->setIcon(trayIconColorSwitch(":/kcp-network-images/details-info.svg")); - } - --QPixmap ConnectionItemWidget::trayIconColorSwitch(const QString &iconPath) -+QPixmap ConnectionItemWidget::trayIconColorSwitch(const QString& iconPath) - { -- //icon原本为浅色 -+ // icon原本为浅色 - QIcon icon(iconPath); -- QPixmap pixmap = icon.pixmap(16,16); -- if( Kiran::StylePalette::instance()->paletteType() != Kiran::PALETTE_DARK ) -+ QPixmap pixmap = icon.pixmap(16, 16); -+ if (Kiran::StylePalette::instance()->paletteType() != Kiran::PALETTE_DARK) - { - QImage image = pixmap.toImage(); - image.invertPixels(QImage::InvertRgb); -diff --git a/plugins/network/src/connection-lists.cpp b/plugins/network/src/connection-lists.cpp -index d1453b5..0552d6a 100644 ---- a/plugins/network/src/connection-lists.cpp -+++ b/plugins/network/src/connection-lists.cpp -@@ -97,7 +97,7 @@ void ConnectionLists::handleConnectionItemClicked(QListWidgetItem* item) - - QWidget* widget = this->itemWidget(item); - TrayItemWidget* trayItemWidget = qobject_cast(widget); -- -+ - if (isWireless) - { - // Note:signalStrength == -1 对应连接隐藏网络 -@@ -249,6 +249,8 @@ void ConnectionLists::addConnectionToLists(Connection::Ptr ptr, const QString& d - var.setValue(connectionInfo); - // item中保存connection的相关信息 - item->setData(Qt::UserRole, var); -+ item->setData(Qt::AccessibleTextRole, QString("WiredConnectionItem::%1").arg(connectionInfo.id)); -+ - if (m_itemShowType == ITEM_WIDGET_TYPE_PLUGIN) - { - this->setItemWidget(item, connectionItemWidget); -@@ -411,6 +413,7 @@ void ConnectionLists::addWirelessNetworkToLists(WirelessNetwork::Ptr network, co - QVariant var; - var.setValue(connectionInfo); - item->setData(Qt::UserRole, var); -+ item->setData(Qt::AccessibleTextRole, QString("WirelessConnectionItem::%1").arg(connectionInfo.id)); - this->addItem(item); - - if (m_itemShowType == ITEM_WIDGET_TYPE_PLUGIN) -@@ -467,6 +470,7 @@ void ConnectionLists::showOtherWirelessItem() - QVariant var; - var.setValue(connectionInfo); - item->setData(Qt::UserRole, var); -+ item->setData(Qt::AccessibleTextRole, QString("ShowOtherWireless")); - this->addItem(item); - - if (m_itemShowType == ITEM_WIDGET_TYPE_PLUGIN) -@@ -668,7 +672,7 @@ void ConnectionLists::showInputPasswordWidgetOfItem(QListWidgetItem* item) - QWidget* widget = itemWidget(item); - TrayItemWidget* trayItemWidget = qobject_cast(widget); - trayItemWidget->showInputPasswordWidget(); -- connect(trayItemWidget, &TrayItemWidget::sendPassword, this, &ConnectionLists::handleSendPassword,Qt::UniqueConnection); -+ connect(trayItemWidget, &TrayItemWidget::sendPassword, this, &ConnectionLists::handleSendPassword, Qt::UniqueConnection); - } - - void ConnectionLists::handleSendPassword(const QString& password) -diff --git a/plugins/network/src/connection-show-page.cpp b/plugins/network/src/connection-show-page.cpp -index ae50b06..805e738 100644 ---- a/plugins/network/src/connection-show-page.cpp -+++ b/plugins/network/src/connection-show-page.cpp -@@ -55,6 +55,7 @@ void ConnectionShowPage::initUI() - { - // switchButton Checked 默认为false - m_switchButton = new KiranSwitchButton(this); -+ m_switchButton->setAccessibleName(QString("SwitchEnableWireless")); - initSwitchButton(); - - ui->titleLayout->addWidget(m_switchButton); -diff --git a/plugins/network/src/connection-show-page.ui b/plugins/network/src/connection-show-page.ui -index 4127d90..0a30a7f 100644 ---- a/plugins/network/src/connection-show-page.ui -+++ b/plugins/network/src/connection-show-page.ui -@@ -114,6 +114,9 @@ - - - -+ -+ ButtonCreateConnection -+ - - - -diff --git a/plugins/network/src/plugin/details-page.ui b/plugins/network/src/plugin/details-page.ui -index a35b99b..f8bc657 100644 ---- a/plugins/network/src/plugin/details-page.ui -+++ b/plugins/network/src/plugin/details-page.ui -@@ -136,6 +136,9 @@ - 36 - - -+ -+ ComboBoxDetailsSelectConnection -+ - - - -diff --git a/plugins/network/src/plugin/manager/manager.cpp b/plugins/network/src/plugin/manager/manager.cpp -index ff89bd1..a1799a2 100644 ---- a/plugins/network/src/plugin/manager/manager.cpp -+++ b/plugins/network/src/plugin/manager/manager.cpp -@@ -31,17 +31,14 @@ Manager::~Manager() - void Manager::initNotifierConnection() - { - //该信号并不能判断连接是否真正Connected/Activated,只能判断一个连接被加入到激活容器中 -- connect(notifier(), &Notifier::activeConnectionAdded, this, &Manager::handleActiveConnectionAdded,Qt::UniqueConnection); -- connect(notifier(), &Notifier::activeConnectionRemoved, this, &Manager::handleActiveConnectionRemoved,Qt::UniqueConnection); -+ connect(notifier(), &Notifier::activeConnectionAdded, this, &Manager::handleActiveConnectionAdded, Qt::UniqueConnection); -+ connect(notifier(), &Notifier::activeConnectionRemoved, this, &Manager::handleActiveConnectionRemoved, Qt::UniqueConnection); - - //连接Wired时触发,而连接VPN时没有触发该信号,暂时不使用该信号 -- // connect(notifier(), &Notifier::statusChanged, [=](NetworkManager::Status status) { -- // KLOG_DEBUG() << "NetworkManager::Status:" << status; -- // -- // }); -+ // connect(notifier(), &Notifier::statusChanged, this, [this](NetworkManager::Status status) {}); - -- connect(settingsNotifier(), &SettingsNotifier::connectionAdded, this, &Manager::handleNotifierConnectionAdded,Qt::UniqueConnection); -- connect(settingsNotifier(), &SettingsNotifier::connectionRemoved, this,&Manager::handleNotifierConnectionRemoved,Qt::UniqueConnection); -+ connect(settingsNotifier(), &SettingsNotifier::connectionAdded, this, &Manager::handleNotifierConnectionAdded, Qt::UniqueConnection); -+ connect(settingsNotifier(), &SettingsNotifier::connectionRemoved, this, &Manager::handleNotifierConnectionRemoved, Qt::UniqueConnection); - } - - void Manager::refreshConnectionLists() -@@ -71,7 +68,7 @@ void Manager::handleActiveConnectionRemoved(const QString &activepath) - - void Manager::handleActiveConnectionStateChanged(ActiveConnection::State state) - { -- auto activeConnection = qobject_cast(sender()); -+ auto activeConnection = qobject_cast(sender()); - QString path = activeConnection->path(); - switch (state) - { -@@ -106,7 +103,6 @@ void Manager::handleStateDeactivated(const QString &deactivatedPath) - { - } - --//XXX:可以优化 - void Manager::getDeviceList(Device::Type deviceType) - { - const Device::List deviceList = networkInterfaces(); -@@ -126,10 +122,8 @@ void Manager::getDeviceList(Device::Type deviceType) - - void Manager::handleStateActivating(const QString &activatedPath) - { -- - } - - void Manager::handleDeviceStateChanged(NetworkManager::Device::State newstate, NetworkManager::Device::State oldstate, NetworkManager::Device::StateChangeReason reason) - { -- - } -\ No newline at end of file -diff --git a/plugins/network/src/plugin/manager/vpn-manager.cpp b/plugins/network/src/plugin/manager/vpn-manager.cpp -index e4aecaf..8573610 100644 ---- a/plugins/network/src/plugin/manager/vpn-manager.cpp -+++ b/plugins/network/src/plugin/manager/vpn-manager.cpp -@@ -55,7 +55,7 @@ void VpnManager::initUI() - // XXX:是否使用模板提升通用性 - void VpnManager::initConnection() - { -- connect(ui->connectionShowPage, &ConnectionShowPage::requestCreatConnection, [=]() -+ connect(ui->connectionShowPage, &ConnectionShowPage::requestCreatConnection, this, [this]() - { - //默认创建vpn类型:L2TP - ui->vpnTypeWidget->setVisible(true); -@@ -71,7 +71,7 @@ void VpnManager::initConnection() - connect(ui->connectionShowPage, &ConnectionShowPage::requestEditConnection, this, &VpnManager::handleRequestEditConnection); - connect(ui->connectionShowPage, &ConnectionShowPage::requestActivateCurrentItemConnection, this, &VpnManager::handleRequestActivateConnection); - -- connect(ui->vpnType, QOverload::of(&QComboBox::currentIndexChanged), [=](int index) -+ connect(ui->vpnType, QOverload::of(&QComboBox::currentIndexChanged), this, [this](int index) - { - VpnType type = ui->vpnType->currentData().value(); - ui->vpnTypeStacked->setCurrentIndex(type); -@@ -91,7 +91,7 @@ void VpnManager::initConnection() - connect(ui->l2tpSetting, &VpnL2tpSetting::returnPreviousPage, this, &VpnManager::handleReturnPreviousPage); - connect(ui->pptpSetting, &VpnPptpSetting::returnPreviousPage, this, &VpnManager::handleReturnPreviousPage); - -- connect(ui->saveButton, &QPushButton::clicked, [=]() -+ connect(ui->saveButton, &QPushButton::clicked, this, [this]() - { - int index = ui->vpnTypeStacked->currentIndex(); - switch (index) -@@ -114,7 +114,7 @@ void VpnManager::initConnection() - break; - } }); - -- connect(ui->connectionShowPage, &ConnectionShowPage::connectionUpdated, [=](const QString &path) -+ connect(ui->connectionShowPage, &ConnectionShowPage::connectionUpdated, this, [this](const QString &path) - { - KLOG_DEBUG() << "Connection::updated:" << path; - //移除后再加载进来以更新信息 -diff --git a/plugins/network/src/plugin/manager/vpn-manager.ui b/plugins/network/src/plugin/manager/vpn-manager.ui -index ab3b35c..dce65fa 100644 ---- a/plugins/network/src/plugin/manager/vpn-manager.ui -+++ b/plugins/network/src/plugin/manager/vpn-manager.ui -@@ -13,6 +13,9 @@ - - VpnManager - -+ -+ VpnManager -+ - - - 0 -@@ -83,8 +86,8 @@ - - 0 - 0 -- 658 -- 754 -+ 153 -+ 115 - - - -diff --git a/plugins/network/src/plugin/manager/wired-manager.ui b/plugins/network/src/plugin/manager/wired-manager.ui -index 7f466c4..8e1903c 100644 ---- a/plugins/network/src/plugin/manager/wired-manager.ui -+++ b/plugins/network/src/plugin/manager/wired-manager.ui -@@ -148,6 +148,9 @@ - 40 - - -+ -+ ButtonSave -+ - - Save - -@@ -189,6 +192,9 @@ - 40 - - -+ -+ ButtonReturn -+ - - Return - -diff --git a/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp b/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp -index 5ee8b62..4495fb5 100644 ---- a/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp -+++ b/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp -@@ -36,6 +36,7 @@ ConnectionNameWidget::~ConnectionNameWidget() - void ConnectionNameWidget::initUI() - { - m_autoConnection = new KiranSwitchButton(this); -+ m_autoConnection->setAccessibleName(QString("SwitchAutoConnection")); - ui->autoConnectionLayout->addWidget(m_autoConnection); - m_autoConnection->setChecked(true); - ui->connectionName->setPlaceholderText(tr("Required")); -diff --git a/plugins/network/src/plugin/setting-widget/connection-name-widget.ui b/plugins/network/src/plugin/setting-widget/connection-name-widget.ui -index 731ed4a..4ec4382 100644 ---- a/plugins/network/src/plugin/setting-widget/connection-name-widget.ui -+++ b/plugins/network/src/plugin/setting-widget/connection-name-widget.ui -@@ -73,6 +73,9 @@ - 36 - - -+ -+ EditConnectionName -+ - - - -diff --git a/plugins/network/src/plugin/setting-widget/disconnect-and-delete-button.ui b/plugins/network/src/plugin/setting-widget/disconnect-and-delete-button.ui -index a323c78..6da5078 100644 ---- a/plugins/network/src/plugin/setting-widget/disconnect-and-delete-button.ui -+++ b/plugins/network/src/plugin/setting-widget/disconnect-and-delete-button.ui -@@ -7,7 +7,7 @@ - 0 - 0 - 357 -- 94 -+ 138 - - - -@@ -31,6 +31,9 @@ - - - -+ -+ ButtonDisconnect -+ - - Disconnect - -@@ -38,6 +41,9 @@ - - - -+ -+ ButtonDelete -+ - - Delete - -@@ -45,6 +51,9 @@ - - - -+ -+ ButtonIgnore -+ - - Ignore - -diff --git a/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp b/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp -index ae43125..c4f82e5 100644 ---- a/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp -+++ b/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp -@@ -36,6 +36,7 @@ EthernetWidget::~EthernetWidget() - void EthernetWidget::initUI() - { - m_mtuButton = new KiranSwitchButton(this); -+ m_mtuButton->setAccessibleName(QString("SwitchMTUButton")); - ui->mtuLayout->addWidget(m_mtuButton); - ui->customMTU->setVisible(false); - ui->customMTU->setMinimum(0); -diff --git a/plugins/network/src/plugin/setting-widget/ethernet-widget.ui b/plugins/network/src/plugin/setting-widget/ethernet-widget.ui -index cdbada3..14ee375 100644 ---- a/plugins/network/src/plugin/setting-widget/ethernet-widget.ui -+++ b/plugins/network/src/plugin/setting-widget/ethernet-widget.ui -@@ -55,6 +55,9 @@ - 36 - - -+ -+ ComboBoxDeviceMac -+ - - - -@@ -88,6 +91,9 @@ - 36 - - -+ -+ EditDeviceMac -+ - - - -@@ -141,6 +147,9 @@ - 36 - - -+ -+ SpinBoxCustomMTU -+ - - - -diff --git a/plugins/network/src/plugin/setting-widget/ipv4-widget.ui b/plugins/network/src/plugin/setting-widget/ipv4-widget.ui -index 1469281..026e26d 100644 ---- a/plugins/network/src/plugin/setting-widget/ipv4-widget.ui -+++ b/plugins/network/src/plugin/setting-widget/ipv4-widget.ui -@@ -7,7 +7,7 @@ - 0 - 0 - 706 -- 493 -+ 498 - - - -@@ -52,6 +52,9 @@ - 36 - - -+ -+ ComboBoxIpv4Method -+ - - - -@@ -100,6 +103,9 @@ - 36 - - -+ -+ EditIpv4Address -+ - - - -@@ -130,6 +136,9 @@ - 36 - - -+ -+ EditIpv4Netmask -+ - - - -@@ -160,6 +169,9 @@ - 36 - - -+ -+ EditIpv4Gateway -+ - - - -@@ -193,6 +205,9 @@ - 36 - - -+ -+ EditIpv4PreferredDNS -+ - - - -@@ -223,6 +238,9 @@ - 36 - - -+ -+ EditIpv4AlternateDNS -+ - - - -diff --git a/plugins/network/src/plugin/setting-widget/ipv6-widget.ui b/plugins/network/src/plugin/setting-widget/ipv6-widget.ui -index 88e89a0..fe0cf1e 100644 ---- a/plugins/network/src/plugin/setting-widget/ipv6-widget.ui -+++ b/plugins/network/src/plugin/setting-widget/ipv6-widget.ui -@@ -7,7 +7,7 @@ - 0 - 0 - 616 -- 481 -+ 510 - - - -@@ -55,6 +55,9 @@ - 36 - - -+ -+ ComboBoxIpv6Method -+ - - - -@@ -103,6 +106,9 @@ - 36 - - -+ -+ EditIpv6Address -+ - - - -@@ -133,6 +139,9 @@ - 36 - - -+ -+ SpinBoxIpv6Prefix -+ - - - -@@ -163,6 +172,9 @@ - 36 - - -+ -+ EditIpv6Gateway -+ - - - -@@ -196,6 +208,9 @@ - 36 - - -+ -+ EditIpv6PreferredDNS -+ - - - -@@ -226,6 +241,9 @@ - 36 - - -+ -+ EditIpv6AlternateDNS -+ - - - -diff --git a/plugins/network/src/plugin/setting-widget/text-input-dialog.cpp b/plugins/network/src/plugin/setting-widget/text-input-dialog.cpp -index 942d42f..74f3782 100644 ---- a/plugins/network/src/plugin/setting-widget/text-input-dialog.cpp -+++ b/plugins/network/src/plugin/setting-widget/text-input-dialog.cpp -@@ -12,8 +12,8 @@ - * Author: luoqing - */ - --#include - #include "text-input-dialog.h" -+#include - - TextInputDialog::TextInputDialog(QWidget *parent) : KiranMessageBox(parent) - { -@@ -34,38 +34,39 @@ void TextInputDialog::init() - void TextInputDialog::initUI() - { - m_lineEdit = new QLineEdit(this); -- addWidgetToDialog(m_lineEdit,Qt::AlignVCenter); -- m_lineEdit->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); -+ addWidgetToDialog(m_lineEdit, Qt::AlignVCenter); -+ m_lineEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - - setTitle(tr("Tips")); --// setText(tr("Please input password")); -+ // setText(tr("Please input password")); - -- m_confirmButton = new QPushButton(tr("Yes")); -+ m_confirmButton = new QPushButton(tr("Yes")); - m_cancelButton = new QPushButton(tr("Cancel")); -- addButton(m_confirmButton,QDialogButtonBox::AcceptRole); -- addButton(m_cancelButton,QDialogButtonBox::RejectRole); --} -+ m_confirmButton->setAccessibleName(QString("ButtonConfirm")); -+ m_cancelButton->setAccessibleName(QString("ButtonCancel")); -+ addButton(m_confirmButton, QDialogButtonBox::AcceptRole); -+ addButton(m_cancelButton, QDialogButtonBox::RejectRole); -+} - - void TextInputDialog::initConnection() - { -- connect(m_lineEdit,&QLineEdit::textEdited,[=](){ -+ connect(m_lineEdit, &QLineEdit::textEdited, [=]() -+ { - if(m_lineEdit->text().isEmpty()) - m_confirmButton->setEnabled(false); - else -- m_confirmButton->setEnabled(true); -- }); -+ m_confirmButton->setEnabled(true); }); - -- connect(m_confirmButton,&QPushButton::clicked,[=](){ -+ connect(m_confirmButton, &QPushButton::clicked, [=]() -+ { - if(m_lineEdit->echoMode() == QLineEdit::Password) - emit password(m_lineEdit->text()); - else - emit ssid(m_lineEdit->text()); -- this->close(); -- }); -+ this->close(); }); - -- connect(m_cancelButton,&QPushButton::clicked,[=](){ -- this->close(); -- }); -+ connect(m_cancelButton, &QPushButton::clicked, [=]() -+ { this->close(); }); - } - - void TextInputDialog::setlineEditEchoMode(QLineEdit::EchoMode echoMode) -diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.cpp b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.cpp -index 85a1ecc..d51d9d5 100644 ---- a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.cpp -+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.cpp -@@ -13,9 +13,9 @@ - */ - - #include "vpn-ipsec.h" --#include "ui_vpn-ipsec.h" - #include - #include -+#include "ui_vpn-ipsec.h" - using namespace NetworkManager; - - VpnIPsec::VpnIPsec(QWidget *parent) : QWidget(parent), ui(new Ui::VpnIPsec) -@@ -33,6 +33,7 @@ VpnIPsec::~VpnIPsec() - void VpnIPsec::initUI() - { - m_enableIPsec = new KiranSwitchButton(this); -+ m_enableIPsec->setAccessibleName(QString("SwitchEnableIPsec")); - ui->enableIPsecLayout->addWidget(m_enableIPsec); - m_enableIPsec->setChecked(false); - ui->IPsecWidget->setVisible(false); -@@ -40,9 +41,8 @@ void VpnIPsec::initUI() - - void VpnIPsec::initConnection() - { -- connect(m_enableIPsec,&QAbstractButton::toggled,[=](bool checked){ -- ui->IPsecWidget->setVisible(checked); -- }); -+ connect(m_enableIPsec, &QAbstractButton::toggled, [=](bool checked) -+ { ui->IPsecWidget->setVisible(checked); }); - } - - void VpnIPsec::setVpnSetting(const VpnSetting::Ptr &vpnSetting) -@@ -54,14 +54,17 @@ void VpnIPsec::saveSettings() - { - m_dataMap = m_vpnSetting->data(); - -- if (m_enableIPsec->isChecked()) { -+ if (m_enableIPsec->isChecked()) -+ { - m_dataMap.insert("ipsec-enabled", "yes"); - m_dataMap.insert("ipsec-group-name", ui->groupName->text()); - m_dataMap.insert("ipsec-gateway-id", ui->groupId->text()); - m_dataMap.insert("ipsec-psk", ui->preSharedKey->text()); - m_dataMap.insert("ipsec-ike", ui->ipsecIKE->text()); - m_dataMap.insert("ipsec-esp", ui->ipsecESP->text()); -- } else { -+ } -+ else -+ { - m_dataMap.remove("ipsec-enabled"); - m_dataMap.remove("ipsec-group-name"); - m_dataMap.remove("ipsec-gateway-id"); -@@ -77,7 +80,7 @@ void VpnIPsec::saveSettings() - - void VpnIPsec::showSettings() - { -- if(m_vpnSetting != nullptr) -+ if (m_vpnSetting != nullptr) - { - NMStringMap dataMap = m_vpnSetting->data(); - m_enableIPsec->setChecked(dataMap.value("ipsec-enabled") == "yes"); -diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.ui b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.ui -index 6f0e8d6..a789a33 100644 ---- a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.ui -+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipsec.ui -@@ -103,6 +103,9 @@ - 36 - - -+ -+ EditGroupName -+ - - - -@@ -133,6 +136,9 @@ - 36 - - -+ -+ EditGroupId -+ - - - -@@ -163,6 +169,9 @@ - 36 - - -+ -+ EditPreSharedKey -+ - - - -@@ -193,6 +202,9 @@ - 36 - - -+ -+ EditIpsecIKE -+ - - - -@@ -223,6 +235,9 @@ - 36 - - -+ -+ EditIpsecESP -+ - - - -diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipvx.cpp b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipvx.cpp -index 1cc1eee..6e2a76e 100644 ---- a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipvx.cpp -+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipvx.cpp -@@ -13,8 +13,8 @@ - */ - #include "vpn-ipvx.h" - #include --#include "ui_vpn-ipvx.h" - #include -+#include "ui_vpn-ipvx.h" - using namespace NetworkManager; - - Q_DECLARE_METATYPE(NetworkManager::Ipv4Setting::ConfigMethod) -@@ -36,6 +36,7 @@ void VpnIpvx::initUI() - ui->ipv4Method->addItem(tr("Auto"), Ipv4Setting::ConfigMethod::Automatic); - - m_neverDefault = new KiranSwitchButton(this); -+ m_neverDefault->setAccessibleName(QString("SwitchOnlyAppliedInCorrespondingResources")); - ui->neverDefaultLayout->addWidget(m_neverDefault); - } - -@@ -65,11 +66,11 @@ void VpnIpvx::saveSettings() - m_ipv4Setting->setNeverDefault(m_neverDefault->isChecked()); - - QList ipv4DNS; -- if(!ui->ipv4PreferredDNS->text().isEmpty()) -+ if (!ui->ipv4PreferredDNS->text().isEmpty()) - { - ipv4DNS << QHostAddress(ui->ipv4PreferredDNS->text()); - } -- if(!ui->ipv4AlternateDNS->text().isEmpty()) -+ if (!ui->ipv4AlternateDNS->text().isEmpty()) - { - ipv4DNS << QHostAddress(ui->ipv4AlternateDNS->text()); - } -@@ -79,15 +80,15 @@ void VpnIpvx::saveSettings() - - void VpnIpvx::showSeittngs() - { -- if(m_ipv4Setting != nullptr) -+ if (m_ipv4Setting != nullptr) - { -- if(m_ipv4Setting->method() == Ipv4Setting::ConfigMethod::Automatic) -+ if (m_ipv4Setting->method() == Ipv4Setting::ConfigMethod::Automatic) - { - int ipv4MethodIndex = ui->ipv4Method->findData(Ipv4Setting::ConfigMethod::Automatic); - ui->ipv4Method->setCurrentIndex(ipv4MethodIndex); - } - else -- {//预留 -+ { //预留 - } - m_neverDefault->setChecked(m_ipv4Setting->neverDefault()); - -diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipvx.ui b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipvx.ui -index 4d39fba..f9a0929 100644 ---- a/plugins/network/src/plugin/setting-widget/vpn/vpn-ipvx.ui -+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-ipvx.ui -@@ -52,6 +52,9 @@ - 36 - - -+ -+ ComboBoxVPNIpv4Method -+ - - - -@@ -109,6 +112,9 @@ - 36 - - -+ -+ EditVPNIpv4PreferredDNS -+ - - - -@@ -142,6 +148,9 @@ - 36 - - -+ -+ EditIpv4AlternateDNS -+ - - - -diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.cpp b/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.cpp -index 383d3e4..7f3192e 100644 ---- a/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.cpp -+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.cpp -@@ -33,7 +33,10 @@ VpnPpp::~VpnPpp() - void VpnPpp::initUI() - { - m_useMPPE = new KiranSwitchButton(this); -+ m_useMPPE->setAccessibleName(QString("SwitchUseMPPE")); - m_statefulMPPE = new KiranSwitchButton(this); -+ m_statefulMPPE->setAccessibleName(QString("SwitchStatefulMPPE")); -+ - ui->useMPPELayout->addWidget(m_useMPPE); - ui->statefulMPPELayout->addWidget(m_statefulMPPE); - -@@ -61,6 +64,7 @@ void VpnPpp::initOptionsButton(const QStringList &supportOptions) - QLabel *strLabel = new QLabel(str, this); - KiranSwitchButton *switchButton = new KiranSwitchButton(this); - switchButton->setProperty("option", option); -+ switchButton->setAccessibleName(str); - m_optionsButtonMap[option] = switchButton; - - QHBoxLayout *horizontalLayout = new QHBoxLayout(); -diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.ui b/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.ui -index 41ee8b9..f0f6088 100644 ---- a/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.ui -+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.ui -@@ -106,6 +106,9 @@ - 36 - - -+ -+ ComboBoxMppeSecurity -+ - - - -diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.ui b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.ui -index ff5939d..e9c9298 100644 ---- a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.ui -+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.ui -@@ -61,6 +61,9 @@ - 36 - - -+ -+ EditVPNGateway -+ - - - -@@ -97,6 +100,9 @@ - 36 - - -+ -+ EditVPNUserName -+ - - - -@@ -130,6 +136,9 @@ - - Qt::WheelFocus - -+ -+ ComboBoxVPNPasswordOptions -+ - - - -@@ -175,10 +184,16 @@ - 36 - - -+ -+ EditVPNPassword -+ - - - - -+ -+ ButtonPasswordVisual -+ - - PushButton - -@@ -212,6 +227,9 @@ - 36 - - -+ -+ EditNTDomain -+ - - - -diff --git a/plugins/network/src/plugin/setting-widget/wireless-security-widget.ui b/plugins/network/src/plugin/setting-widget/wireless-security-widget.ui -index a3c03aa..398c8ec 100644 ---- a/plugins/network/src/plugin/setting-widget/wireless-security-widget.ui -+++ b/plugins/network/src/plugin/setting-widget/wireless-security-widget.ui -@@ -55,6 +55,9 @@ - 36 - - -+ -+ ComboBoxWirelessSecurityOption -+ - - - -@@ -104,6 +107,9 @@ - 36 - - -+ -+ ComboBoxWirelessPasswordOption -+ - - - -@@ -149,10 +155,16 @@ - 36 - - -+ -+ EditWirelessPassword -+ - - - - -+ -+ ButtonWirelessPasswordVisual -+ - - PushButton - -diff --git a/plugins/network/src/plugin/setting-widget/wireless-widget.cpp b/plugins/network/src/plugin/setting-widget/wireless-widget.cpp -index dac2faa..5ac525c 100644 ---- a/plugins/network/src/plugin/setting-widget/wireless-widget.cpp -+++ b/plugins/network/src/plugin/setting-widget/wireless-widget.cpp -@@ -13,11 +13,11 @@ - */ - - #include "wireless-widget.h" --#include "ui_wireless-widget.h" --#include "kiran-switch-button.h" -+#include - #include - #include --#include -+#include "kiran-switch-button.h" -+#include "ui_wireless-widget.h" - using namespace NetworkManager; - - WirelessWidget::WirelessWidget(QWidget *parent) : QWidget(parent), ui(new Ui::WirelessWidget) -@@ -37,11 +37,12 @@ void WirelessWidget::initUI() - ui->ssidEdit->setPlaceholderText(tr("Required")); - ui->ssidEdit->setEnabled(false); - m_mtuButton = new KiranSwitchButton(this); -+ m_mtuButton->setAccessibleName(QString("ButtonWirelessMTU")); - ui->mtuLayout->addWidget(m_mtuButton); - ui->customMTU->setVisible(false); - ui->customMTU->setMinimum(0); - ui->customMTU->setMaximum(10000); -- //UserData设为空"",为了匹配不指定设备的情况 -+ // UserData设为空"",为了匹配不指定设备的情况 - ui->deviceMac->addItem(tr("No device specified"), ""); - initMacComboBox(); - } -@@ -59,7 +60,7 @@ void WirelessWidget::setWirelessSetting(const WirelessSetting::Ptr &wirelessSett - //区分连接隐藏网络和已存在网络的Setting - void WirelessWidget::saveSettings() - { -- if(m_wirelessSetting != nullptr) -+ if (m_wirelessSetting != nullptr) - { - QString macAddress = ui->deviceMac->currentData().toString(); - KLOG_DEBUG() << "macAddress:" << macAddress; -@@ -70,7 +71,7 @@ void WirelessWidget::saveSettings() - - void WirelessWidget::showSettings() - { -- if(m_wirelessSetting != nullptr) -+ if (m_wirelessSetting != nullptr) - { - QString deviceMac = m_wirelessSetting->macAddress().toHex(':').toUpper(); - quint32 mtu = m_wirelessSetting->mtu(); -@@ -90,7 +91,6 @@ void WirelessWidget::showSettings() - - void WirelessWidget::setOtherWirelessSetting() - { -- - } - - void WirelessWidget::resetSettings() -@@ -101,7 +101,6 @@ void WirelessWidget::resetSettings() - ui->customMTU->setVisible(false); - } - -- - void WirelessWidget::clearPtr() - { - m_wirelessSetting.clear(); -@@ -116,7 +115,6 @@ void WirelessWidget::handleCustomMTUChanged(bool checked) - ui->customMTU->setVisible(checked); - } - -- - void WirelessWidget::initMacComboBox() - { - const Device::List deviceList = networkInterfaces(); -@@ -136,4 +134,3 @@ void WirelessWidget::initMacComboBox() - } - } - } -- -diff --git a/plugins/network/src/plugin/setting-widget/wireless-widget.ui b/plugins/network/src/plugin/setting-widget/wireless-widget.ui -index 350c245..e83f2fa 100644 ---- a/plugins/network/src/plugin/setting-widget/wireless-widget.ui -+++ b/plugins/network/src/plugin/setting-widget/wireless-widget.ui -@@ -55,6 +55,9 @@ - 36 - - -+ -+ EditSsid -+ - - - -@@ -88,6 +91,9 @@ - 36 - - -+ -+ ComboBoxWirelessMacAddress -+ - - - -@@ -135,6 +141,9 @@ - 36 - - -+ -+ SpinBoxWirelessCustomMTU -+ - - - --- -2.33.0 - diff --git a/0001-feature-network-Add-the-conf-file-to-overwrite-the-o.patch b/0001-feature-network-Add-the-conf-file-to-overwrite-the-o.patch deleted file mode 100644 index 2df586c4e9c8ce081b70a163d63e8c69698b8416..0000000000000000000000000000000000000000 --- a/0001-feature-network-Add-the-conf-file-to-overwrite-the-o.patch +++ /dev/null @@ -1,59 +0,0 @@ -From ebd20e32e3f0c0944aebdad0cd5a347694b033e4 Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Fri, 12 Aug 2022 17:27:50 +0800 -Subject: [PATCH 1/7] feature(network):Add the conf file to overwrite the - original configuration of NetworkManager -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 添加conf文件以覆盖NetworkManager原先的配置 ---- - plugins/network/CMakeLists.txt | 4 ++++ - plugins/network/data/00-server.conf.in | 18 ++++++++++++++++++ - 2 files changed, 22 insertions(+) - create mode 100644 plugins/network/data/00-server.conf.in - -diff --git a/plugins/network/CMakeLists.txt b/plugins/network/CMakeLists.txt -index 0bdf4f8..02dbe3a 100644 ---- a/plugins/network/CMakeLists.txt -+++ b/plugins/network/CMakeLists.txt -@@ -115,6 +115,10 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kiran-network-status-icon.desktop DEST - SET(link_source ${PLUGIN_DESKTOP_INSTALL_DIR}/${TARGET_NAME}.desktop) - SET(link_target ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}-link.desktop) - -+set(NETWORK_SERVER_CONF /etc/NetworkManager/conf.d) -+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/00-server.conf.in ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf @ONLY) -+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf DESTINATION ${NETWORK_SERVER_CONF}/) -+ - #安装插件和二进制文件 - install(TARGETS ${TARGET_NAME} DESTINATION ${PLUGIN_LIBS_INSTALL_DIR}/) - install(TARGETS ${TRAY_PROCESS} DESTINATION ${INSTALL_BINDIR}) -diff --git a/plugins/network/data/00-server.conf.in b/plugins/network/data/00-server.conf.in -new file mode 100644 -index 0000000..e3202b8 ---- /dev/null -+++ b/plugins/network/data/00-server.conf.in -@@ -0,0 +1,18 @@ -+# This configuration file changes NetworkManager's behavior to -+# what's expected on "traditional UNIX server" type deployments. -+# -+# See "man NetworkManager.conf" for more information about these -+# and other keys. -+ -+#NetworkManager会先读取/etc/NetworkManager/NetworkManager.conf,然后是/usr/lib/NetworkManager/conf.d/下的配置 -+#最后读取/etc/NetworkManager/conf.d,后读取的文件将覆盖先读取的同名文件配置 -+#在/etc/NetworkManager/conf.d目录添加该文件,用以覆盖/usr/lib/NetworkManager/conf.d下的同名文件的配置 -+#https://gitee.com/src-openeuler/kiran-desktop/issues/I5I0AA -+[main] -+# Do not do automatic (DHCP/SLAAC) configuration on ethernet devices -+# with no other matching connections. -+no-auto-default=* -+ -+# Ignore the carrier (cable plugged in) state when attempting to -+# activate static-IP connections. -+#ignore-carrier=* -\ No newline at end of file --- -2.33.0 - diff --git a/0001-fix-battery-idle-remove-invalid-idle-shutdown-displa.patch b/0001-fix-battery-idle-remove-invalid-idle-shutdown-displa.patch deleted file mode 100644 index 4b01a29e1558f40146ae21a0381e4668ca9d0ab3..0000000000000000000000000000000000000000 --- a/0001-fix-battery-idle-remove-invalid-idle-shutdown-displa.patch +++ /dev/null @@ -1,30 +0,0 @@ -From bbc782ebca691f8a93d2f17c3fb8b2f0bf87ae9d Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Thu, 18 Aug 2022 20:31:25 +0800 -Subject: [PATCH 1/2] fix(battery idle): remove invalid idle shutdown display - option -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 移除掉无效的空闲关闭显示器选项 -Closes #I5M336 ---- - .../power/src/pages/battery-settings/battery-settings-page.cpp | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/plugins/power/src/pages/battery-settings/battery-settings-page.cpp b/plugins/power/src/pages/battery-settings/battery-settings-page.cpp -index 3dd50af..222d9bb 100644 ---- a/plugins/power/src/pages/battery-settings/battery-settings-page.cpp -+++ b/plugins/power/src/pages/battery-settings/battery-settings-page.cpp -@@ -65,7 +65,6 @@ void BatterySettingsPage::initUI() - ///计算机空闲进行的操作 - // clang-format off - QMap computerIdleActionsMap = { -- {tr("Display Off"), POWER_ACTION_DISPLAY_OFF}, - {tr("Suspend"), POWER_ACTION_COMPUTER_SUSPEND}, - {tr("Shutdown"), POWER_ACTION_COMPUTER_SHUTDOWN}, - {tr("Hibernate"), POWER_ACTION_COMPUTER_HIBERNATE}, --- -2.36.1 - diff --git a/0001-fix-netwowrk-fix-not-searching-the-wireless-network-.patch b/0001-fix-netwowrk-fix-not-searching-the-wireless-network-.patch deleted file mode 100644 index acee25af965e153b072eda13c23074efc8bd3fe6..0000000000000000000000000000000000000000 --- a/0001-fix-netwowrk-fix-not-searching-the-wireless-network-.patch +++ /dev/null @@ -1,240 +0,0 @@ -From 5f9c85d57d40c7aa9e045c0ba796c29069c525a1 Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Mon, 1 Aug 2022 16:48:00 +0800 -Subject: [PATCH] fix(netwowrk):fix not searching the wireless network for a - long time after the WiFi connection is successful -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 修复wifi连接成功后长时间不搜索无线网络 - -Close #I5IPVO ---- - .../src/plugin/cpanel-network-widget.cpp | 34 ++++++++++++++++--- - .../src/plugin/cpanel-network-widget.h | 1 + - .../src/plugin/manager/wireless-manager.cpp | 2 +- - .../disconnect-and-delete-button.cpp | 12 ++++--- - .../plugin/setting-widget/wireless-widget.cpp | 2 -- - plugins/network/src/tray/network-tray.cpp | 17 ++++++++++ - .../network/src/tray/wireless-tray-widget.cpp | 29 ++++++++++++++-- - 7 files changed, 83 insertions(+), 14 deletions(-) - -diff --git a/plugins/network/src/plugin/cpanel-network-widget.cpp b/plugins/network/src/plugin/cpanel-network-widget.cpp -index cf0f147..daf3c33 100644 ---- a/plugins/network/src/plugin/cpanel-network-widget.cpp -+++ b/plugins/network/src/plugin/cpanel-network-widget.cpp -@@ -46,9 +46,9 @@ void CPanelNetworkWidget::init() - { - initPage(); - initConnect(); -- - } - -+//TODO:增加sidebarItem与设备的对应关系 - void CPanelNetworkWidget::initPage() - { - getAvailableDeviceList(); -@@ -218,10 +218,7 @@ void CPanelNetworkWidget::initConnect() - - connect(notifier(), &Notifier::deviceRemoved, this, &CPanelNetworkWidget::handleDeviceRemoved); - -- connect(ui->sidebar, &QListWidget::itemClicked, [this](QListWidgetItem *item) -- { -- ui->stackedWidget->setCurrentIndex(item->data(Qt::UserRole).toInt()); -- }); -+ connect(ui->sidebar, &QListWidget::itemClicked, this,&CPanelNetworkWidget::handleSideBarItemClicked); - - connect(Kiran::StylePalette::instance(), &Kiran::StylePalette::themeChanged, this, &CPanelNetworkWidget::handleThemeChanged); - } -@@ -282,3 +279,30 @@ void CPanelNetworkWidget::handleThemeChanged(Kiran::PaletteType paletteType) - ui->sidebar->item(i)->setIcon(pixmap); - } - } -+ -+void CPanelNetworkWidget::handleSideBarItemClicked(QListWidgetItem *item) -+{ -+ ui->stackedWidget->setCurrentIndex(item->data(Qt::UserRole).toInt()); -+ -+ QString itemText = item->text(); -+ KLOG_DEBUG() << "item clicked:" << item->text(); -+ if(itemText.contains(tr("Wireless Network"))) -+ { -+ KLOG_DEBUG() << "item clicked wireless"; -+ for (auto device : m_wirelessDeviceList) -+ { -+ WirelessDevice::Ptr wirelessDevice = qobject_cast(device); -+ QDBusPendingReply<> replyRequestScan = wirelessDevice->requestScan(); -+ -+ replyRequestScan.waitForFinished(); -+ if (replyRequestScan.isError()) -+ { -+ KLOG_DEBUG() << "wireless Device name:" << wirelessDevice->interfaceName() << " requestScan error:" << replyRequestScan.error(); -+ } -+ else -+ { -+ KLOG_DEBUG() << "wireless Device name:" << wirelessDevice->interfaceName() << " requestScan reply:" << replyRequestScan.reply(); -+ } -+ } -+ } -+} -\ No newline at end of file -diff --git a/plugins/network/src/plugin/cpanel-network-widget.h b/plugins/network/src/plugin/cpanel-network-widget.h -index bb7d74e..112cab8 100644 ---- a/plugins/network/src/plugin/cpanel-network-widget.h -+++ b/plugins/network/src/plugin/cpanel-network-widget.h -@@ -50,6 +50,7 @@ public slots: - void handleDeviceAdded(const QString &devicePath); - void handleDeviceRemoved(const QString &devicePath); - void handleThemeChanged(Kiran::PaletteType paletteType); -+ void handleSideBarItemClicked(QListWidgetItem *item); - - signals: - void subItemsChanged(); -diff --git a/plugins/network/src/plugin/manager/wireless-manager.cpp b/plugins/network/src/plugin/manager/wireless-manager.cpp -index 9f004d3..7c2eabb 100644 ---- a/plugins/network/src/plugin/manager/wireless-manager.cpp -+++ b/plugins/network/src/plugin/manager/wireless-manager.cpp -@@ -207,7 +207,7 @@ void WirelessManager::handleActiveConnectionAdded(const QString &path) - } - } - --//断开网络时,会自动rescan搜索无线网络 -+//断开网络时,会自动触发rescan搜索无线网络 - void WirelessManager::handleActiveConnectionRemoved(const QString &path) - { - ui->connectionShowPage->handleActiveStateDeactivated(path); -diff --git a/plugins/network/src/plugin/setting-widget/disconnect-and-delete-button.cpp b/plugins/network/src/plugin/setting-widget/disconnect-and-delete-button.cpp -index 75719a5..0833e9b 100644 ---- a/plugins/network/src/plugin/setting-widget/disconnect-and-delete-button.cpp -+++ b/plugins/network/src/plugin/setting-widget/disconnect-and-delete-button.cpp -@@ -59,12 +59,16 @@ void DisconnectAndDeleteButton::initButton(SettingConnectionStatus connectionSta - break; - } - m_activeConnectionPath = activeConnectionPath; -+ - auto activeConnectionPtr = NetworkManager::findActiveConnection(m_activeConnectionPath); -- ConnectionSettings::ConnectionType connectionType = activeConnectionPtr->connection()->settings()->connectionType(); -- if (connectionType == ConnectionSettings::Wireless) -+ if(activeConnectionPtr != nullptr) - { -- ui->deleteButton->setVisible(false); -- ui->ignoreButton->setVisible(true); -+ ConnectionSettings::ConnectionType connectionType = activeConnectionPtr->connection()->settings()->connectionType(); -+ if (connectionType == ConnectionSettings::Wireless) -+ { -+ ui->deleteButton->setVisible(false); -+ ui->ignoreButton->setVisible(true); -+ } - } - } - -diff --git a/plugins/network/src/plugin/setting-widget/wireless-widget.cpp b/plugins/network/src/plugin/setting-widget/wireless-widget.cpp -index d04cf51..dac2faa 100644 ---- a/plugins/network/src/plugin/setting-widget/wireless-widget.cpp -+++ b/plugins/network/src/plugin/setting-widget/wireless-widget.cpp -@@ -49,8 +49,6 @@ void WirelessWidget::initUI() - void WirelessWidget::initConnection() - { - connect(m_mtuButton, &QAbstractButton::toggled, this, &WirelessWidget::handleCustomMTUChanged); -- connect(notifier(),&Notifier::deviceAdded,[=](){initMacComboBox();}); -- connect(notifier(),&Notifier::deviceRemoved,[=](){initMacComboBox();}); - } - - void WirelessWidget::setWirelessSetting(const WirelessSetting::Ptr &wirelessSetting) -diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp -index 800c819..5aeb35d 100644 ---- a/plugins/network/src/tray/network-tray.cpp -+++ b/plugins/network/src/tray/network-tray.cpp -@@ -206,6 +206,7 @@ void NetworkTray::getAvailableDeviceList() - } - } - -+// Note:点击托盘显示页面的同时,让所有无线设备扫描一次网络 - void NetworkTray::handleTrayClicked(QSystemTrayIcon::ActivationReason reason) - { - switch (reason) -@@ -216,6 +217,22 @@ void NetworkTray::handleTrayClicked(QSystemTrayIcon::ActivationReason reason) - default: - break; - } -+ -+ for (auto device : m_wirelessDeviceList) -+ { -+ WirelessDevice::Ptr wirelessDevice = qobject_cast(device); -+ QDBusPendingReply<> replyRequestScan = wirelessDevice->requestScan(); -+ -+ replyRequestScan.waitForFinished(); -+ if (replyRequestScan.isError()) -+ { -+ KLOG_DEBUG() << "wireless Device name:" << wirelessDevice->interfaceName() << " requestScan error:" << replyRequestScan.error(); -+ } -+ else -+ { -+ KLOG_DEBUG() << "wireless Device name:" << wirelessDevice->interfaceName() << " requestScan reply:" << replyRequestScan.reply(); -+ } -+ } - } - - void NetworkTray::handleNetworkSettingClicked() -diff --git a/plugins/network/src/tray/wireless-tray-widget.cpp b/plugins/network/src/tray/wireless-tray-widget.cpp -index a9dd141..2a480b1 100644 ---- a/plugins/network/src/tray/wireless-tray-widget.cpp -+++ b/plugins/network/src/tray/wireless-tray-widget.cpp -@@ -164,7 +164,7 @@ void WirelessTrayWidget::activateWirelessConnection(const QString &connectionPat - StatusNotification::connectitonFailedNotify(connectionPath); - } - else -- KLOG_DEBUG() << "reply.reply():" << reply.reply(); -+ KLOG_DEBUG() << "reply.reply():" << reply.reply(); - } - } - -@@ -322,11 +322,23 @@ void WirelessTrayWidget::handleStateActivating(const QString &activatedPath) - if (item != nullptr) - m_connectionLists->updateItemActivatingStatus(item); - } -+ -+ QDBusPendingReply<> replyRequestScan = m_wirelessDevice->requestScan(); -+ replyRequestScan.waitForFinished(); -+ KLOG_DEBUG() << "State Activating requestScan"; -+ if (replyRequestScan.isError()) -+ { -+ KLOG_DEBUG() << "State Activating requestScan error:" << replyRequestScan.error(); -+ } -+ else -+ { -+ KLOG_DEBUG() << "State Activating requestScan reply:" << replyRequestScan.reply(); -+ } - } - - void WirelessTrayWidget::handleStateActivated(const QString &activatedPath) - { -- KLOG_DEBUG() << "Wireless handleStateActivated"; -+ KLOG_DEBUG() << "Wireless State: Activated"; - ActiveConnection::Ptr activeConnection = findActiveConnection(activatedPath); - if (activeConnection.isNull()) - return; -@@ -341,6 +353,19 @@ void WirelessTrayWidget::handleStateActivated(const QString &activatedPath) - StatusNotification::ActiveConnectionActivatedNotify(connectionInfo); - m_connectionLists->sortItems(); - m_connectionLists->update(); -+ -+ //连接成功后手动rescan -+ QDBusPendingReply<> replyRequestScan = m_wirelessDevice->requestScan(); -+ replyRequestScan.waitForFinished(); -+ KLOG_DEBUG() << "--------------------------StateActivated requestScan"; -+ if (replyRequestScan.isError()) -+ { -+ KLOG_DEBUG() << "StateActivated requestScan error:" << replyRequestScan.error(); -+ } -+ else -+ { -+ KLOG_DEBUG() << "StateActivated requestScan reply:" << replyRequestScan.reply(); -+ } - } - } - --- -2.33.0 - diff --git a/0001-fix-search-when-the-relevant-setting-interface-canno.patch b/0001-fix-search-when-the-relevant-setting-interface-canno.patch deleted file mode 100644 index 73c61f164ce41f10c000f30659a3283f6d74b77d..0000000000000000000000000000000000000000 --- a/0001-fix-search-when-the-relevant-setting-interface-canno.patch +++ /dev/null @@ -1,106 +0,0 @@ -From fb79eb15820419ee346148abd7ce1a52d83becaf Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Wed, 10 Aug 2022 14:42:05 +0800 -Subject: [PATCH 1/2] fix(search): when the relevant setting interface cannot - be searched, a prompt will be added -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 当未能搜索到相关设置界面时加入提示。修改跳转逻辑,不通过补全直接输入并回车也可以触发跳转功能 - -Closes #I5H192 ---- - src/search-edit/search-edit.cpp | 30 +++++++++++++++++++++-- - translations/kiran-control-panel.zh_CN.ts | 13 ++++++++++ - 2 files changed, 41 insertions(+), 2 deletions(-) - -diff --git a/src/search-edit/search-edit.cpp b/src/search-edit/search-edit.cpp -index a4b9d9e..5ffcfb6 100644 ---- a/src/search-edit/search-edit.cpp -+++ b/src/search-edit/search-edit.cpp -@@ -21,12 +21,14 @@ - #include - #include - #include -+#include - #include - #include - #include - #include - #include - #include -+#include - - SearchEdit::SearchEdit(QWidget *parent) - : KiranSearchBox(parent) -@@ -53,17 +55,41 @@ void SearchEdit::init() - m_completer->installEventFilter(this); - - setCompleter(m_completer); -- - // clang-format off - connect(m_completer, QOverload::of(&QCompleter::activated), [this](const QModelIndex &index) { - if( !index.isValid() ) -+ { - return ; -- -+ } - QString categoryID,subItemID; - auto filterModel = m_completer->completionModel(); - categoryID = filterModel->data(index,SearchModel::roleCategoryID).toString(); - subItemID = filterModel->data(index,SearchModel::roleSubItemID).toString(); - emit requestJumpTo(categoryID,subItemID); -+ QTimer::singleShot(0,this,&QLineEdit::clear); -+ }); -+ connect(this,&QLineEdit::returnPressed,[this](){ -+ QString searchkey = text(); -+ if( searchkey.isEmpty() ) -+ { -+ return; -+ } -+ -+ auto items = m_searchModel->findItems(searchkey); -+ if( items.isEmpty() ) -+ { -+ auto clickedButton = KiranMessageBox::message(this,tr("Info"),tr("Failed to find related items, please re-enter!"),KiranMessageBox::Ok|KiranMessageBox::No); -+ if( clickedButton == KiranMessageBox::Ok ) -+ clear(); -+ return; -+ } -+ -+ auto item = items.at(0); -+ auto categoryID = item->data(SearchModel::roleCategoryID).toString(); -+ auto subItemID = item->data(SearchModel::roleSubItemID).toString(); -+ clear(); -+ -+ emit requestJumpTo(categoryID,subItemID); - }); - // clang-format on - } -\ No newline at end of file -diff --git a/translations/kiran-control-panel.zh_CN.ts b/translations/kiran-control-panel.zh_CN.ts -index 4da29a1..8e4a4a0 100644 ---- a/translations/kiran-control-panel.zh_CN.ts -+++ b/translations/kiran-control-panel.zh_CN.ts -@@ -30,4 +30,17 @@ - 控制面板 - - -+ -+ SearchEdit -+ -+ -+ Info -+ 提示 -+ -+ -+ -+ Failed to find related items, please re-enter! -+ 未能搜索到相关项,请重新输入! -+ -+ - --- -2.33.0 - diff --git a/0001-fix-system-buttons-on-the-system-information-page-ar.patch b/0001-fix-system-buttons-on-the-system-information-page-ar.patch deleted file mode 100644 index 529cbaf21973d865d8beca1d01ec0ac9ad202789..0000000000000000000000000000000000000000 --- a/0001-fix-system-buttons-on-the-system-information-page-ar.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 7dda81e40d5e5e18b0138d93b8b5c1785e45040b Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Wed, 3 Aug 2022 11:36:32 +0800 -Subject: [PATCH 1/2] fix(system): buttons on the system information page are - not fully displayed -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 系统信息页面按钮为了避免显示不全恢复之前的大小 - -Closes #I5H229 ---- - .../pages/system-information/system-information.ui | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/plugins/system/src/pages/system-information/system-information.ui b/plugins/system/src/pages/system-information/system-information.ui -index a930da2..5beafd2 100644 ---- a/plugins/system/src/pages/system-information/system-information.ui -+++ b/plugins/system/src/pages/system-information/system-information.ui -@@ -187,13 +187,13 @@ - - - 56 -- 24 -+ 28 - - - - - 56 -- 24 -+ 28 - - - -@@ -460,13 +460,13 @@ - - - 56 -- 24 -+ 28 - - - - - 56 -- 24 -+ 28 - - - -@@ -532,13 +532,13 @@ - - - 56 -- 24 -+ 28 - - - - - 56 -- 24 -+ 28 - - - --- -2.33.0 - diff --git a/0001-refactor-account-move-some-account-management-contro.patch b/0001-refactor-account-move-some-account-management-contro.patch deleted file mode 100644 index 4413c74306f3a04d58f2dd85c46e4712b3f33e37..0000000000000000000000000000000000000000 --- a/0001-refactor-account-move-some-account-management-contro.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 029565d290011d2e4593ff5b5dd4c0c705c964ef Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Fri, 2 Sep 2022 09:43:37 +0800 -Subject: [PATCH] refactor(account): move some account management controls to - common component library -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 移动部分账户管理组件库至共用组件库 ---- - lib/common-widgets/CMakeLists.txt | 3 ++- - .../widgets => lib/common-widgets/hover-tips}/hover-tips.cpp | 0 - .../widgets => lib/common-widgets/hover-tips}/hover-tips.h | 0 - .../widgets => lib/common-widgets/kiran-tips}/kiran-tips.cpp | 0 - .../widgets => lib/common-widgets/kiran-tips}/kiran-tips.h | 0 - .../widgets => lib/common-widgets/kiran-tips}/kiran-tips.ui | 0 - .../lineedit-with-checkicon}/lineedit-with-checkicon.cpp | 2 +- - .../lineedit-with-checkicon}/lineedit-with-checkicon.h | 0 - plugins/account/CMakeLists.txt | 1 + - .../src/pages/advance-settings-page/advance-settings.cpp | 2 +- - .../account/src/pages/create-user-page/create-user-page.cpp | 2 +- - .../account/src/pages/create-user-page/create-user-page.ui | 2 +- - plugins/account/src/pages/user-info-page/user-info-page.cpp | 2 +- - plugins/account/src/pages/user-info-page/user-info-page.h | 2 +- - plugins/account/src/pages/user-info-page/user-info-page.ui | 2 +- - resources/control-panel-resources.qrc | 4 ++-- - 16 files changed, 12 insertions(+), 10 deletions(-) - rename {plugins/account/src/widgets => lib/common-widgets/hover-tips}/hover-tips.cpp (100%) - rename {plugins/account/src/widgets => lib/common-widgets/hover-tips}/hover-tips.h (100%) - rename {plugins/account/src/widgets => lib/common-widgets/kiran-tips}/kiran-tips.cpp (100%) - rename {plugins/account/src/widgets => lib/common-widgets/kiran-tips}/kiran-tips.h (100%) - rename {plugins/account/src/widgets => lib/common-widgets/kiran-tips}/kiran-tips.ui (100%) - rename {plugins/account/src/widgets => lib/common-widgets/lineedit-with-checkicon}/lineedit-with-checkicon.cpp (95%) - rename {plugins/account/src/widgets => lib/common-widgets/lineedit-with-checkicon}/lineedit-with-checkicon.h (100%) - -diff --git a/lib/common-widgets/CMakeLists.txt b/lib/common-widgets/CMakeLists.txt -index b713ea1..2b92f1f 100644 ---- a/lib/common-widgets/CMakeLists.txt -+++ b/lib/common-widgets/CMakeLists.txt -@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.2) - - set (TARGET_NAME common-widgets) - --find_package(Qt5 COMPONENTS Core Widgets LinguistTools) -+find_package(Qt5 COMPONENTS Core Widgets LinguistTools Svg) - pkg_search_module(KLOG_QT5 REQUIRED klog-qt5) - pkg_search_module(KIRAN_WIDGETS_QT5 REQUIRED kiranwidgets-qt5) - pkg_search_module(KIRAN_STYLE_HELPER REQUIRED kiran-style-helper) -@@ -27,6 +27,7 @@ target_include_directories(${TARGET_NAME} PRIVATE - target_link_libraries(${TARGET_NAME} - Qt5::Core - Qt5::Widgets -+ Qt5::Svg - plugin-info - ${KIRAN_WIDGETS_QT5_LIBRARIES} - ${KIRAN_STYLE_HELPER_LIBRARIES}) -\ No newline at end of file -diff --git a/plugins/account/src/widgets/hover-tips.cpp b/lib/common-widgets/hover-tips/hover-tips.cpp -similarity index 100% -rename from plugins/account/src/widgets/hover-tips.cpp -rename to lib/common-widgets/hover-tips/hover-tips.cpp -diff --git a/plugins/account/src/widgets/hover-tips.h b/lib/common-widgets/hover-tips/hover-tips.h -similarity index 100% -rename from plugins/account/src/widgets/hover-tips.h -rename to lib/common-widgets/hover-tips/hover-tips.h -diff --git a/plugins/account/src/widgets/kiran-tips.cpp b/lib/common-widgets/kiran-tips/kiran-tips.cpp -similarity index 100% -rename from plugins/account/src/widgets/kiran-tips.cpp -rename to lib/common-widgets/kiran-tips/kiran-tips.cpp -diff --git a/plugins/account/src/widgets/kiran-tips.h b/lib/common-widgets/kiran-tips/kiran-tips.h -similarity index 100% -rename from plugins/account/src/widgets/kiran-tips.h -rename to lib/common-widgets/kiran-tips/kiran-tips.h -diff --git a/plugins/account/src/widgets/kiran-tips.ui b/lib/common-widgets/kiran-tips/kiran-tips.ui -similarity index 100% -rename from plugins/account/src/widgets/kiran-tips.ui -rename to lib/common-widgets/kiran-tips/kiran-tips.ui -diff --git a/plugins/account/src/widgets/lineedit-with-checkicon.cpp b/lib/common-widgets/lineedit-with-checkicon/lineedit-with-checkicon.cpp -similarity index 95% -rename from plugins/account/src/widgets/lineedit-with-checkicon.cpp -rename to lib/common-widgets/lineedit-with-checkicon/lineedit-with-checkicon.cpp -index 1482d5b..2f2fef1 100644 ---- a/plugins/account/src/widgets/lineedit-with-checkicon.cpp -+++ b/lib/common-widgets/lineedit-with-checkicon/lineedit-with-checkicon.cpp -@@ -38,7 +38,7 @@ LineEditWithCheckIcon::~LineEditWithCheckIcon() - - void LineEditWithCheckIcon::setVerificationStatus(bool isPassed) - { -- QString iconPath = isPassed ? ":/kcp-account/images/success-indicator.svg" : ":/kcp-account/images/error-indicator.svg"; -+ QString iconPath = isPassed ? ":/kiran-control-panel/images/success-indicator.svg" : ":/kiran-control-panel/images/error-indicator.svg"; - m_verificationStatus = isPassed ? VERIFICATION_PASSED : VERIFICATION_ERROR; - setIcon(QIcon(iconPath)); - } -diff --git a/plugins/account/src/widgets/lineedit-with-checkicon.h b/lib/common-widgets/lineedit-with-checkicon/lineedit-with-checkicon.h -similarity index 100% -rename from plugins/account/src/widgets/lineedit-with-checkicon.h -rename to lib/common-widgets/lineedit-with-checkicon/lineedit-with-checkicon.h -diff --git a/plugins/account/CMakeLists.txt b/plugins/account/CMakeLists.txt -index 4dd6107..dfb4e01 100644 ---- a/plugins/account/CMakeLists.txt -+++ b/plugins/account/CMakeLists.txt -@@ -77,6 +77,7 @@ target_include_directories(${TARGET_NAME} PRIVATE - ${KIRAN_STYLE_HELPER_INCLUDE_DIRS}) - - target_link_libraries(${TARGET_NAME} -+ common-widgets - Qt5::Widgets - Qt5::DBus - Qt5::Svg -diff --git a/plugins/account/src/pages/advance-settings-page/advance-settings.cpp b/plugins/account/src/pages/advance-settings-page/advance-settings.cpp -index 77f714a..9e58fc2 100644 ---- a/plugins/account/src/pages/advance-settings-page/advance-settings.cpp -+++ b/plugins/account/src/pages/advance-settings-page/advance-settings.cpp -@@ -17,7 +17,7 @@ - #include "global-defines.h" - #include "ui_advance-settings.h" - #include "uid-validator.h" --#include "kiran-tips.h" -+#include "kiran-tips/kiran-tips.h" - - #include - #include -diff --git a/plugins/account/src/pages/create-user-page/create-user-page.cpp b/plugins/account/src/pages/create-user-page/create-user-page.cpp -index 22555d1..51197cb 100644 ---- a/plugins/account/src/pages/create-user-page/create-user-page.cpp -+++ b/plugins/account/src/pages/create-user-page/create-user-page.cpp -@@ -14,7 +14,7 @@ - - #include "create-user-page.h" - #include "accounts-global-info.h" --#include "kiran-tips.h" -+#include "kiran-tips/kiran-tips.h" - #include "passwd-helper.h" - #include "src/pages/advance-settings-page/advance-settings.h" - #include "ui_create-user-page.h" -diff --git a/plugins/account/src/pages/create-user-page/create-user-page.ui b/plugins/account/src/pages/create-user-page/create-user-page.ui -index 7e6024f..8894d01 100644 ---- a/plugins/account/src/pages/create-user-page/create-user-page.ui -+++ b/plugins/account/src/pages/create-user-page/create-user-page.ui -@@ -488,7 +488,7 @@ - - LineEditWithCheckIcon - QWidget --
lineedit-with-checkicon.h
-+
lineedit-with-checkicon/lineedit-with-checkicon.h
- 1 -
- -diff --git a/plugins/account/src/pages/user-info-page/user-info-page.cpp b/plugins/account/src/pages/user-info-page/user-info-page.cpp -index b4d9b4b..5ddb940 100644 ---- a/plugins/account/src/pages/user-info-page/user-info-page.cpp -+++ b/plugins/account/src/pages/user-info-page/user-info-page.cpp -@@ -14,7 +14,7 @@ - - #include "user-info-page.h" - #include "accounts-global-info.h" --#include "hover-tips.h" -+#include "hover-tips/hover-tips.h" - #include "ksd_accounts_user_proxy.h" - #include "passwd-helper.h" - #include "ui_user-info-page.h" -diff --git a/plugins/account/src/pages/user-info-page/user-info-page.h b/plugins/account/src/pages/user-info-page/user-info-page.h -index 5cba81e..99d59ba 100644 ---- a/plugins/account/src/pages/user-info-page/user-info-page.h -+++ b/plugins/account/src/pages/user-info-page/user-info-page.h -@@ -15,7 +15,7 @@ - #ifndef USERINFOPAGE_H - #define USERINFOPAGE_H - --#include "kiran-tips.h" -+#include "kiran-tips/kiran-tips.h" - - #include - -diff --git a/plugins/account/src/pages/user-info-page/user-info-page.ui b/plugins/account/src/pages/user-info-page/user-info-page.ui -index b0c9cbe..a452b75 100644 ---- a/plugins/account/src/pages/user-info-page/user-info-page.ui -+++ b/plugins/account/src/pages/user-info-page/user-info-page.ui -@@ -868,7 +868,7 @@ - - LineEditWithCheckIcon - QWidget --
lineedit-with-checkicon.h
-+
lineedit-with-checkicon/lineedit-with-checkicon.h
- 1 -
- -diff --git a/resources/control-panel-resources.qrc b/resources/control-panel-resources.qrc -index c478dd5..b4452e7 100644 ---- a/resources/control-panel-resources.qrc -+++ b/resources/control-panel-resources.qrc -@@ -12,14 +12,14 @@ - images/trash-hover.svg - images/trash-pressed.svg - images/indicator-selected.png -+ images/current-avatar-indicator.svg -+ images/error-indicator.svg - - - - images/create-user-avatar.png - images/change-user-avatar.png - images/current-avatar-indicator.svg -- images/current-avatar-indicator.svg -- images/error-indicator.svg - images/finger-0.svg - images/finger-25.svg - images/finger-50.svg --- -2.33.0 - diff --git a/0001-refactor-panel-set-panel-creategory-widget-auto-fill.patch b/0001-refactor-panel-set-panel-creategory-widget-auto-fill.patch deleted file mode 100644 index 7d1e4369163232934d2c4245f82fd693b16021d2..0000000000000000000000000000000000000000 --- a/0001-refactor-panel-set-panel-creategory-widget-auto-fill.patch +++ /dev/null @@ -1,29 +0,0 @@ -From cd389d7ded1fa975efe2082d1f5921f1fd00e809 Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Tue, 9 Aug 2022 09:38:42 +0800 -Subject: [PATCH] refactor(panel): set panel creategory widget auto fill - background -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 适配KiranStyle 滚动区域绘制调整,手动打开滚动区域autofillbackground ---- - src/category-widget.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/src/category-widget.cpp b/src/category-widget.cpp -index 83c3b26..4a0580e 100644 ---- a/src/category-widget.cpp -+++ b/src/category-widget.cpp -@@ -56,6 +56,7 @@ void CategoryWidget::init() - - //滚动区域 - auto pScrollArea = new QScrollArea(this); -+ pScrollArea->setAutoFillBackground(true); - pScrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - pScrollArea->setFrameStyle(QFrame::NoFrame); - layout->addWidget(pScrollArea); --- -2.33.0 - diff --git a/0002-fix-account-The-connection-singleton-in-the-signal-s.patch b/0002-fix-account-The-connection-singleton-in-the-signal-s.patch deleted file mode 100644 index 0c1b5a56ac98bfd6ad7b56d5884d7e1851fb4d61..0000000000000000000000000000000000000000 --- a/0002-fix-account-The-connection-singleton-in-the-signal-s.patch +++ /dev/null @@ -1,58 +0,0 @@ -From f8ddcc8b9d0a53e9105bc42feb6f5d02561e207e Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Thu, 18 Aug 2022 20:39:14 +0800 -Subject: [PATCH 2/2] fix(account): The connection singleton in the signal slot - is not automatically disconnected because the receiver parameter is not - added, resulting in a crash -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 修复账户管理中信号槽中连接单例未加入接受者参数导致未自动断开,崩溃问题 - -Closes #I5HRYF ---- - plugins/account/src/kiran-account-manager.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/plugins/account/src/kiran-account-manager.cpp b/plugins/account/src/kiran-account-manager.cpp -index 8602456..c21b8b9 100644 ---- a/plugins/account/src/kiran-account-manager.cpp -+++ b/plugins/account/src/kiran-account-manager.cpp -@@ -359,7 +359,7 @@ void KiranAccountManager::initPageSelectAvatar() - void KiranAccountManager::initPageAuthManager() - { - //TODO:init auth manager page -- connect(m_page_authManager, &AuthManagerPage::sigReturn, [this]() { -+ connect(m_page_authManager, &AuthManagerPage::sigReturn, this,[this]() { - m_stackWidget->setCurrentIndex(PAGE_USER_INFO); - }); - } -@@ -367,13 +367,13 @@ void KiranAccountManager::initPageAuthManager() - void KiranAccountManager::connectToInfoChanged() - { - //处理用户新增、删除 -- connect(AccountsGlobalInfo::instance(), &AccountsGlobalInfo::UserAdded, -+ connect(AccountsGlobalInfo::instance(), &AccountsGlobalInfo::UserAdded,this, - [this](const QDBusObjectPath &obj) { - KLOG_INFO() << "siderbar add item:" << obj.path(); - appendSiderbarItem(obj.path()); - }); - -- connect(AccountsGlobalInfo::instance(), &AccountsGlobalInfo::UserDeleted, -+ connect(AccountsGlobalInfo::instance(), &AccountsGlobalInfo::UserDeleted,this, - [this](const QDBusObjectPath &obj) { - KLOG_INFO() << "siderbar delete item:" << obj.path(); - int findIdx = -1; -@@ -402,7 +402,7 @@ void KiranAccountManager::connectToInfoChanged() - }); - - //处理用户属性变更 -- connect(AccountsGlobalInfo::instance(), &AccountsGlobalInfo::UserPropertyChanged, -+ connect(AccountsGlobalInfo::instance(), &AccountsGlobalInfo::UserPropertyChanged,this, - [this](QString userPath, QString propertyName, QVariant value) { - //侧边栏 - if ((propertyName == "locked") || (propertyName == "icon_file")) --- -2.36.1 - diff --git a/0002-fix-account-error-prompt-box-is-added-with-the-defau.patch b/0002-fix-account-error-prompt-box-is-added-with-the-defau.patch deleted file mode 100644 index 10e18e49d4d286d139ac2596a9edc42fd5cf2bf4..0000000000000000000000000000000000000000 --- a/0002-fix-account-error-prompt-box-is-added-with-the-defau.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0ea6996cf22fa8cece850bd8ba8aaa21ad1ff845 Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Wed, 10 Aug 2022 14:59:37 +0800 -Subject: [PATCH 2/2] fix(account): error prompt box is added with the default - disappearance time -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 错误提示框在点击消失的基础之上,加入默认消失时间 - -Closes #I5HR61 ---- - plugins/account/src/widgets/kiran-tips.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/plugins/account/src/widgets/kiran-tips.cpp b/plugins/account/src/widgets/kiran-tips.cpp -index 294671d..622be54 100644 ---- a/plugins/account/src/widgets/kiran-tips.cpp -+++ b/plugins/account/src/widgets/kiran-tips.cpp -@@ -82,6 +82,7 @@ KiranTips::KiranTips(QWidget *parent) : QWidget(parent), - } - }); - setVisible(false); -+ setHideTimeout(3000); - } - - KiranTips::~KiranTips() --- -2.33.0 - diff --git a/0002-fix-network-Temporarily-do-not-overwrite-the-Network.patch b/0002-fix-network-Temporarily-do-not-overwrite-the-Network.patch deleted file mode 100644 index 640eaedd5bec270448ba9d2a9985314908243802..0000000000000000000000000000000000000000 --- a/0002-fix-network-Temporarily-do-not-overwrite-the-Network.patch +++ /dev/null @@ -1,246 +0,0 @@ -From a06103989392882b5693a310b1e1540b5a998af0 Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Thu, 25 Aug 2022 19:28:58 +0800 -Subject: [PATCH 2/2] fix(network):Temporarily do not overwrite the - NetworkManager configuration and optimize the code -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 暂时不覆盖NetworkManager配置,优化代码 ---- - plugins/network/CMakeLists.txt | 2 +- - plugins/network/src/tray/network-tray.cpp | 25 ++++++++++++++--------- - plugins/network/src/tray/tray-page.cpp | 25 +++++++++++++++-------- - plugins/network/src/tray/tray-page.h | 7 +++---- - plugins/network/src/tray/tray-page.ui | 3 +++ - plugins/network/src/utils.cpp | 0 - plugins/network/src/utils.h | 0 - 7 files changed, 38 insertions(+), 24 deletions(-) - create mode 100644 plugins/network/src/utils.cpp - create mode 100644 plugins/network/src/utils.h - -diff --git a/plugins/network/CMakeLists.txt b/plugins/network/CMakeLists.txt -index 02dbe3a..802c52f 100644 ---- a/plugins/network/CMakeLists.txt -+++ b/plugins/network/CMakeLists.txt -@@ -117,7 +117,7 @@ SET(link_target ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}-link.desktop) - - set(NETWORK_SERVER_CONF /etc/NetworkManager/conf.d) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/00-server.conf.in ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf @ONLY) --install(FILES ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf DESTINATION ${NETWORK_SERVER_CONF}/) -+# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf DESTINATION ${NETWORK_SERVER_CONF}/) - - #安装插件和二进制文件 - install(TARGETS ${TARGET_NAME} DESTINATION ${PLUGIN_LIBS_INSTALL_DIR}/) -diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp -index 232882b..a282cf9 100644 ---- a/plugins/network/src/tray/network-tray.cpp -+++ b/plugins/network/src/tray/network-tray.cpp -@@ -15,6 +15,7 @@ - #include "network-tray.h" - #include - #include -+#include - #include - #include - #include -@@ -47,6 +48,8 @@ void NetworkTray::init() - initUI(); - initMenu(); - initConnect(); -+ -+ NetworkManager::Connection::List listConnections(); - } - - void NetworkTray::initUI() -@@ -127,6 +130,7 @@ void NetworkTray::initConnect() - } }); - - connect(notifier(), &Notifier::deviceRemoved, this, &NetworkTray::handleDeviceRemoved); -+ - connect(notifier(), &Notifier::statusChanged, this, &NetworkTray::handleNetworkManagerStatusChanged); - - connect(notifier(), &Notifier::primaryConnectionChanged, this, &NetworkTray::handlePrimaryConnectionChanged); -@@ -152,6 +156,7 @@ void NetworkTray::initTrayIcon() - { - m_systemTray = new QSystemTrayIcon(); - setTrayIcon(NetworkManager::status()); -+ KLOG_DEBUG() << " NetworkManager::status():" << NetworkManager::status(); - m_systemTray->show(); - } - -@@ -187,9 +192,8 @@ void NetworkTray::getAvailableDeviceList() - KLOG_DEBUG() << "dev->interfaceName():" << dev->interfaceName(); - KLOG_DEBUG() << "dev->state():" << dev->state(); - KLOG_DEBUG() << "dev->isValid():" << dev->isValid(); -+ KLOG_DEBUG() << "dev->managed():" << dev->managed(); - -- if (dev->state() == Device::Unavailable) -- continue; - if (dev->state() == Device::Unmanaged) - continue; - -@@ -317,21 +321,24 @@ void NetworkTray::setTrayIcon(NetworkManager::Status status) - // int signalStrength = wirelessNetwork->signalStrength(); - - m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wireless-4.svg")); -+ KLOG_DEBUG() << "setIcon kcp-network-images/wireless-4.svg"; -+ } -+ else -+ { -+ m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-connection.svg")); -+ KLOG_DEBUG() << "setIcon kcp-network-images/wireless-connection.svg"; - } -- } -- else -- { -- // 可用 -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-connection.svg")); - } - } -- else if (status == NetworkManager::Status::Disconnecting || NetworkManager::Status::Connecting) -+ else if ((status == NetworkManager::Status::Disconnecting) || (status == NetworkManager::Status::Connecting)) - { - // TODO:加载动画 -+ KLOG_DEBUG() << "setIcon null"; - } - else - { - m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -+ KLOG_DEBUG() << "setIcon kcp-network-images/wireless-disconnected.svg"; - } - } - -@@ -396,8 +403,6 @@ void NetworkTray::handleDeviceManagedChanged() - * XXX:由于在禁用和开启wifi时,并没有发出Wireless设备的deviceRemoved和deviceAdded信号 - * 并且当WirelessEnabledChanged信号发送时,device state 还处在unavailbel 不可用状态,需要处理 - */ -- --// TODO:托盘对不可用状态进行提示 - void NetworkTray::handleWirelessEnabledChanged(bool enable) - { - KLOG_DEBUG() << "-----------------------handleWirelessEnabledChanged:" << enable; -diff --git a/plugins/network/src/tray/tray-page.cpp b/plugins/network/src/tray/tray-page.cpp -index c854d36..fd986fd 100644 ---- a/plugins/network/src/tray/tray-page.cpp -+++ b/plugins/network/src/tray/tray-page.cpp -@@ -35,28 +35,33 @@ void TrayPage::init() - { - if (m_deviceList.count() != 0) - { -- Device::Type deviceType = m_deviceList.value(0)->type(); -- initUI(deviceType); -+ initUI(); - initConnection(); - } - } - - // XXX:修改初始化 --void TrayPage::initUI(Device::Type deviceType) -+void TrayPage::initUI() - { - setFixedWidth(240); - setMaximumHeight(434); - ui->stackedWidget->setContentsMargins(0, 0, 0, 0); - - // if (m_deviceList.count() > 1) -- // setMultiDeviceWidget(deviceType); -+ // setMultiDeviceWidget(); - // else if (m_deviceList.count() == 1) - // { -- // setSingleDeviceWidget(deviceType); -+ // setSingleDeviceWidget(); - // } -+ // else -+ // { -+ // // m_deviceeList.count == 0 -+ // return; -+ // } -+ - if (m_deviceList.count() != 0) - { -- setMultiDeviceWidget(deviceType); -+ setMultiDeviceWidget(); - } - else - { -@@ -69,12 +74,13 @@ void TrayPage::initConnection() - { - } - --void TrayPage::setMultiDeviceWidget(Device::Type deviceType) -+void TrayPage::setMultiDeviceWidget() - { - for (Device::Ptr dev : m_deviceList) - { - QString devicePath = dev->uni(); - QString deviceName = dev->interfaceName(); -+ Device::Type deviceType = dev->type(); - ui->deviceComboBox->addItem(deviceName, devicePath); - - if (deviceType == Device::Ethernet) -@@ -111,10 +117,11 @@ void TrayPage::setMultiDeviceWidget(Device::Type deviceType) - ui->selectDevicewidget->setVisible(true); - } - --void TrayPage::setSingleDeviceWidget(Device::Type deviceType) -+void TrayPage::setSingleDeviceWidget() - { - ui->selectDevicewidget->setVisible(false); -- QString devicePath = m_deviceList.at(0)->uni(); -+ QString devicePath = m_deviceList.value(0)->uni(); -+ Device::Type deviceType = m_deviceList.value(0)->type(); - if (deviceType == Device::Ethernet) - { - WiredTrayWidget *wiredTrayWidget = new WiredTrayWidget(devicePath, this); -diff --git a/plugins/network/src/tray/tray-page.h b/plugins/network/src/tray/tray-page.h -index 20cacd0..d49e670 100644 ---- a/plugins/network/src/tray/tray-page.h -+++ b/plugins/network/src/tray/tray-page.h -@@ -24,7 +24,6 @@ class TrayPage; - } - QT_END_NAMESPACE - -- - class TrayPage : public QWidget - { - Q_OBJECT -@@ -34,11 +33,11 @@ public: - ~TrayPage() override; - - void init(); -- void initUI(NetworkManager::Device::Type deviceType); -+ void initUI(); - void initConnection(); - -- void setMultiDeviceWidget(NetworkManager::Device::Type deviceType); -- void setSingleDeviceWidget(NetworkManager::Device::Type deviceType); -+ void setMultiDeviceWidget(); -+ void setSingleDeviceWidget(); - QStringList devicePathList(); - - public slots: -diff --git a/plugins/network/src/tray/tray-page.ui b/plugins/network/src/tray/tray-page.ui -index f922c84..7a089ca 100644 ---- a/plugins/network/src/tray/tray-page.ui -+++ b/plugins/network/src/tray/tray-page.ui -@@ -31,6 +31,9 @@ - - TrayPage - -+ -+ -+ - - - 0 -diff --git a/plugins/network/src/utils.cpp b/plugins/network/src/utils.cpp -new file mode 100644 -index 0000000..e69de29 -diff --git a/plugins/network/src/utils.h b/plugins/network/src/utils.h -new file mode 100644 -index 0000000..e69de29 --- -2.33.0 - diff --git a/0002-fix-network-fix-crash-and-wireless-network-disable-f.patch b/0002-fix-network-fix-crash-and-wireless-network-disable-f.patch deleted file mode 100644 index a1789383ac23f34d6ca2f7e8d7a6302b14c82942..0000000000000000000000000000000000000000 --- a/0002-fix-network-fix-crash-and-wireless-network-disable-f.patch +++ /dev/null @@ -1,1540 +0,0 @@ -From 48a78fb158d5f87d123ab8ff0a6358d71aa1eec2 Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Fri, 19 Aug 2022 09:20:18 +0800 -Subject: [PATCH 2/7] fix(network):fix crash and wireless network disable - function defects -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 修复网络页面与其他插件页面快速切换导致崩溃的问题 - 修复无线网络禁用的缺陷 ---- - plugins/network/src/connection-show-page.cpp | 60 +++-- - plugins/network/src/connection-show-page.h | 4 +- - .../src/plugin/cpanel-network-widget.cpp | 150 +++++++----- - .../src/plugin/cpanel-network-widget.h | 11 +- - plugins/network/src/plugin/details-page.cpp | 5 +- - .../src/plugin/manager/vpn-manager.cpp | 134 +++++------ - .../src/plugin/manager/wired-manager.cpp | 11 +- - .../src/plugin/manager/wireless-manager.cpp | 58 +++-- - .../src/plugin/setting-widget/vpn/vpn-ppp.cpp | 6 +- - plugins/network/src/tray/network-tray.cpp | 218 ++++++++++-------- - plugins/network/src/tray/network-tray.h | 2 +- - plugins/network/src/tray/tray-page.cpp | 17 +- - .../network/src/tray/wireless-tray-widget.cpp | 35 ++- - 13 files changed, 392 insertions(+), 319 deletions(-) - -diff --git a/plugins/network/src/connection-show-page.cpp b/plugins/network/src/connection-show-page.cpp -index 71ae95c..ae50b06 100644 ---- a/plugins/network/src/connection-show-page.cpp -+++ b/plugins/network/src/connection-show-page.cpp -@@ -27,13 +27,10 @@ using namespace NetworkManager; - ConnectionShowPage::ConnectionShowPage(QWidget* parent) : QWidget(parent), ui(new Ui::ConnectionShowPage) - { - ui->setupUi(this); -- initUI(); -- initConnect(); - } - - ConnectionShowPage::~ConnectionShowPage() - { -- KLOG_DEBUG() << "ConnectionShowPage::~ConnectionShowPage()"; - delete ui; - } - -@@ -42,14 +39,36 @@ void ConnectionShowPage::setTitle(QString title) - ui->title->setText(title); - } - -+void ConnectionShowPage::init(NetworkManager::ConnectionSettings::ConnectionType connectionType, const QString& devicePath) -+{ -+ m_connectionType = connectionType; -+ m_devicePath = devicePath; -+ ui->connectionLists->setDevicePath(devicePath); -+ ui->connectionLists->setItemWidgetType(ITEM_WIDGET_TYPE_PLUGIN); -+ -+ initUI(); -+ initConnect(); -+} -+ -+// TODO:增加判断设备是否可用的逻辑,unmanager 和 unavalibale的处理 - void ConnectionShowPage::initUI() - { -+ // switchButton Checked 默认为false - m_switchButton = new KiranSwitchButton(this); -+ initSwitchButton(); - - ui->titleLayout->addWidget(m_switchButton); - ui->connectionLists->setMaximumHeight(ui->connectionLists->sizeHintForRow(0) * ui->connectionLists->count() + (2 * ui->connectionLists->frameWidth())); - Kiran::StylePropertyHelper::setButtonType(ui->createConnectionButton, Kiran::BUTTON_Default); - ui->createConnectionButton->setIcon(QIcon(":/kcp-network-images/connection-add.svg")); -+ -+ if (m_connectionType == ConnectionSettings::Wireless) -+ { -+ ui->connectionLists->showWirelessNetworkLists(); -+ ui->connectionLists->setVisible(isWirelessEnabled()); -+ } -+ else -+ ui->connectionLists->showConnectionLists(m_connectionType); - } - - void ConnectionShowPage::initConnect() -@@ -66,31 +85,35 @@ void ConnectionShowPage::initConnect() - - connect(ui->connectionLists, &ConnectionLists::sendSsidToWireless, this, &ConnectionShowPage::sendSsidToWireless); - -- connect(m_switchButton, &KiranSwitchButton::toggled, this, &ConnectionShowPage::handleToggledSwitchButton); -+ connect(m_switchButton, &KiranSwitchButton::toggled, this, &ConnectionShowPage::handleToggledSwitchButton, Qt::UniqueConnection); - - /** - *如果频繁的打开/禁用网络,会频繁发送信号,使用定时器进行处理 - * */ -- m_timer.setInterval(100); -- m_timer.setSingleShot(true); -- connect(notifier(), &Notifier::wirelessEnabledChanged, [=](bool enable) -- { -- m_wirlessNetworkEnable = enable; -- m_timer.start(); }); -+ // m_timer.setInterval(200); -+ // m_timer.setSingleShot(true); -+ // connect(notifier(), &Notifier::wirelessEnabledChanged, this, [this](bool enable) -+ // { -+ // m_wirlessNetworkEnable = enable; -+ // m_timer.start(); }); -+ -+ // connect(&m_timer, &QTimer::timeout, this, [this]() -+ // { handleWirelessEnabledChanged(m_wirlessNetworkEnable); }); - -- connect(&m_timer, &QTimer::timeout, [=]() -- { handleWirelessEnabledChanged(m_wirlessNetworkEnable); }); -+ if (m_connectionType == ConnectionSettings::Wireless) -+ { -+ connect(notifier(), &Notifier::wirelessEnabledChanged, this, &ConnectionShowPage::handleWirelessEnabledChanged, Qt::UniqueConnection); -+ } - -- // connect(notifier(), &Notifier::wirelessEnabledChanged, this, &ConnectionShowPage::handleWirelessEnabledChanged); - connect(notifier(), &Notifier::networkingEnabledChanged, [=]() {}); - } - -+//弃用 - void ConnectionShowPage::setConnectionType(ConnectionSettings::ConnectionType connectionType) - { - m_connectionType = connectionType; - } - --// XXX:该函数有待修改 - void ConnectionShowPage::initSwitchButton() - { - switch (m_connectionType) -@@ -109,6 +132,7 @@ void ConnectionShowPage::initSwitchButton() - - void ConnectionShowPage::handleToggledSwitchButton(bool toggled) - { -+ KLOG_DEBUG() << "--------------------------------handleToggledSwitchButton:" << toggled; - switch (m_connectionType) - { - case ConnectionSettings::Wired: -@@ -125,14 +149,17 @@ void ConnectionShowPage::handleToggledSwitchButton(bool toggled) - } - } - --//TODO:控制无线网络设备开关 - void ConnectionShowPage::handleWirelessEnabledChanged(bool enabled) - { -+ KLOG_DEBUG() << "*****************************handleWirelessEnabledChanged:" << enabled; -+ //处理通过命令行等其他方式禁用无线网络的情况 -+ m_switchButton->blockSignals(true); - m_switchButton->setChecked(enabled); -+ m_switchButton->blockSignals(false); - ui->connectionLists->setVisible(enabled); -- // ui->createConnectionButton->setVisible(enabled); - } - -+//弃用 - void ConnectionShowPage::setDevicePath(const QString& devicePath) - { - m_devicePath = devicePath; -@@ -209,6 +236,7 @@ void ConnectionShowPage::updateItemActivatedStatus(const QString& activatedPath) - ui->connectionLists->updateItemActivatedStatus(activatedPath); - } - -+//弃用 - void ConnectionShowPage::setItemWidgetType(ItemWidgetType itemType) - { - ui->connectionLists->setItemWidgetType(itemType); -diff --git a/plugins/network/src/connection-show-page.h b/plugins/network/src/connection-show-page.h -index 9b618c2..308e5dc 100644 ---- a/plugins/network/src/connection-show-page.h -+++ b/plugins/network/src/connection-show-page.h -@@ -19,8 +19,8 @@ - #include - #include - #include --#include - #include -+#include - - QT_BEGIN_NAMESPACE - namespace Ui -@@ -39,6 +39,8 @@ class ConnectionShowPage : public QWidget - public: - explicit ConnectionShowPage(QWidget *parent = nullptr); - ~ConnectionShowPage() override; -+ -+ void init(NetworkManager::ConnectionSettings::ConnectionType connectionType, const QString &devicePath); - void initUI(); - void initConnect(); - -diff --git a/plugins/network/src/plugin/cpanel-network-widget.cpp b/plugins/network/src/plugin/cpanel-network-widget.cpp -index daf3c33..cb0ec10 100644 ---- a/plugins/network/src/plugin/cpanel-network-widget.cpp -+++ b/plugins/network/src/plugin/cpanel-network-widget.cpp -@@ -13,6 +13,7 @@ - */ - - #include "cpanel-network-widget.h" -+#include - #include - #include "plugin/details-page.h" - #include "ui_cpanel-network-widget.h" -@@ -48,52 +49,63 @@ void CPanelNetworkWidget::init() - initConnect(); - } - --//TODO:增加sidebarItem与设备的对应关系 -+// TODO:增加sidebarItem与设备的对应关系 - void CPanelNetworkWidget::initPage() - { - getAvailableDeviceList(); - int row = 0; - for (int i = 0; i < m_wiredDeviceList.count(); ++i) - { -- auto device = m_wiredDeviceList.value(i); -+ Device::Ptr device = m_wiredDeviceList.value(i); -+ connect(device.data(), &Device::managedChanged, this, &CPanelNetworkWidget::handleManagedChanged, Qt::UniqueConnection); -+ - QString devicePath = device->uni(); - QString deviceName = device->interfaceName(); - WiredManager *wiredManager = new WiredManager(devicePath, this); -- ui->stackedWidget->insertWidget(row,wiredManager); -+ ui->stackedWidget->insertWidget(row, wiredManager); - - QString subItemName = tr("Wired Network %1"); - QString subItemNameStr = subItemName.arg(i + 1); -- if(m_wiredDeviceList.count() == 1) -- ui->sidebar->insertItem(row, tr("Wired Network")); -+ -+ KiranSidebarItem *sidebarItem = new KiranSidebarItem(); -+ if (m_wiredDeviceList.count() == 1) -+ sidebarItem->setText(tr("Wired Network")); - else -- ui->sidebar->insertItem(row, subItemNameStr); -- ui->sidebar->item(row)->setData(Qt::UserRole, row); -- ui->sidebar->item(row)->setIcon(trayIconColorSwitch(":/kcp-network-images/wired.svg")); -+ sidebarItem->setText(subItemNameStr); -+ -+ ui->sidebar->insertItem(row, sidebarItem); -+ sidebarItem->setData(Qt::UserRole, row); -+ sidebarItem->setIcon(trayIconColorSwitch(":/kcp-network-images/wired.svg")); - row++; - } - - for (int i = 0; i < m_wirelessDeviceList.count(); ++i) - { -- auto device = m_wirelessDeviceList.value(i); -+ Device::Ptr device = m_wirelessDeviceList.value(i); -+ connect(device.data(), &Device::managedChanged, this, &CPanelNetworkWidget::handleManagedChanged, Qt::UniqueConnection); -+ - QString devicePath = device->uni(); - QString deviceName = device->interfaceName(); - WirelessManager *wirelessManager = new WirelessManager(devicePath, this); -- ui->stackedWidget->insertWidget(row,wirelessManager); -+ ui->stackedWidget->insertWidget(row, wirelessManager); - - QString subItemName = tr("Wireless Network %1"); -- QString subItemNameStr = subItemName.arg(i+1); -- if(m_wirelessDeviceList.count() == 1) -- ui->sidebar->insertItem(row, tr("Wireless Network")); -+ QString subItemNameStr = subItemName.arg(i + 1); -+ -+ KiranSidebarItem *sidebarItem = new KiranSidebarItem(); -+ if (m_wirelessDeviceList.count() == 1) -+ sidebarItem->setText(tr("Wireless Network")); - else -- ui->sidebar->insertItem(row, subItemNameStr); -+ sidebarItem->setText(subItemNameStr); - -- ui->sidebar->item(row)->setData(Qt::UserRole, row); -- ui->sidebar->item(row)->setIcon(trayIconColorSwitch(":/kcp-network-images/wireless.svg")); -+ ui->sidebar->insertItem(row, sidebarItem); -+ sidebarItem->setData(Qt::UserRole, row); -+ sidebarItem->setIcon(trayIconColorSwitch(":/kcp-network-images/wireless.svg")); - row++; - } - - VpnManager *vpnManager = new VpnManager(this); -- ui->stackedWidget->insertWidget(row,vpnManager); -+ ui->stackedWidget->insertWidget(row, vpnManager); - - ui->sidebar->insertItem(row, tr("VPN")); - ui->sidebar->item(row)->setData(Qt::UserRole, row); -@@ -101,7 +113,7 @@ void CPanelNetworkWidget::initPage() - row++; - - DetailsPage *networkDetails = new DetailsPage(this); -- ui->stackedWidget->insertWidget(row,networkDetails); -+ ui->stackedWidget->insertWidget(row, networkDetails); - ui->sidebar->insertItem(row, tr("Network Details")); - ui->sidebar->item(row)->setData(Qt::UserRole, row); - ui->sidebar->item(row)->setIcon(trayIconColorSwitch(":/kcp-network-images/network-details.svg")); -@@ -115,7 +127,7 @@ void CPanelNetworkWidget::getAvailableDeviceList() - const Device::List deviceList = networkInterfaces(); - for (Device::Ptr dev : deviceList) - { -- if (dev->state() == Device::Unavailable) -+ if (dev->state() == Device::Unmanaged) - continue; - - switch (dev->type()) -@@ -174,71 +186,89 @@ void CPanelNetworkWidget::initConnect() - { - m_Timer.setInterval(500); - m_Timer.setSingleShot(true); -- waitCounts = 1; -- connect(&m_Timer, &QTimer::timeout, [=]() -+ m_waitCounts = 1; -+ // Note:新设备插入后,需要等待一段时间,Device::List networkInterfaces() 来不及更新 -+ // Note:DeviceAdded signal is emitted when a new network interface is available. -+ -+ // XXX:当发出deviceAdded信号时,应该已经managed,需要修改并重新测试 -+ connect(notifier(), &Notifier::deviceAdded, this, [this](const QString &uni) - { -+ m_addDevicePath = uni; - Device::Ptr device = findNetworkInterface(m_addDevicePath); -- if(device->managed()) -+ if(device.isNull()) -+ { -+ KLOG_DEBUG() << "this device interface is not found"; -+ return; -+ } -+ if(device->isValid()) - { - handleDeviceAdded(m_addDevicePath); -- m_Timer.stop(); - } - else - { -- KLOG_INFO() << "this device interface is not ready"; -+ KLOG_INFO() << "this device interface is invalid!"; - m_Timer.start(); -- } -- waitCounts++; -- if(waitCounts > MAX_WAIT_COUNTS) -- { -- KLOG_INFO() << "This device is not currently managed by NetworkManager"; -- m_Timer.stop(); -+ KLOG_INFO() << "wait counts:" << m_waitCounts; - } }); - -- // Note:新设备插入后,需要等待一段时间,Device::List networkInterfaces() 来不及更新 -- connect(notifier(), &Notifier::deviceAdded, [=](const QString &uni) -+ connect(&m_Timer, &QTimer::timeout, this, [this]() - { -- m_addDevicePath = uni; - Device::Ptr device = findNetworkInterface(m_addDevicePath); -- KLOG_DEBUG() << "device->availableConnections().isEmpty():" << device->availableConnections().isEmpty(); -- KLOG_DEBUG() << "device->managed():" << device->managed(); -- if(!device->isValid()) -+ if(device->isValid()) - { -- KLOG_INFO() << "this device interface is invalid!"; -- return ; -- } -- if(device->managed()) - handleDeviceAdded(m_addDevicePath); -+ m_Timer.stop(); -+ } - else - { -- KLOG_INFO() << "this device interface is not ready"; -+ KLOG_INFO() << "this device interface is invalid!"; - m_Timer.start(); -- KLOG_INFO() << "wait counts:" << waitCounts; -+ } -+ m_waitCounts++; -+ if(m_waitCounts > MAX_WAIT_COUNTS) -+ { -+ KLOG_INFO() << "This device is currently invalid by NetworkManager"; -+ m_Timer.stop(); - } }); - - connect(notifier(), &Notifier::deviceRemoved, this, &CPanelNetworkWidget::handleDeviceRemoved); - -- connect(ui->sidebar, &QListWidget::itemClicked, this,&CPanelNetworkWidget::handleSideBarItemClicked); -+ connect(notifier(), &Notifier::wirelessEnabledChanged, this, &CPanelNetworkWidget::handleWirelessEnabledChanged); -+ connect(notifier(), &Notifier::networkingEnabledChanged, this, &CPanelNetworkWidget::handleNetworkingEnabledChanged); -+ -+ connect(ui->sidebar, &QListWidget::itemClicked, this, &CPanelNetworkWidget::handleSideBarItemClicked); - - connect(Kiran::StylePalette::instance(), &Kiran::StylePalette::themeChanged, this, &CPanelNetworkWidget::handleThemeChanged); - } - --// XXX:暂时全部item重新加载有待优化 --void CPanelNetworkWidget::handleDeviceAdded(const QString &devicePath) -+// XXX:需要优化,改成动态增减侧边栏subItems,而不是全部重新加载 -+void CPanelNetworkWidget::handleManagedChanged() - { -+ auto device = qobject_cast(sender()); -+ if (device != nullptr) -+ { -+ if (device->managed()) -+ { -+ } -+ } - reload(); - emit subItemsChanged(); - } - -+// TODO:侧边栏标签显示设备可用或禁用 -+void CPanelNetworkWidget::handleDeviceAdded(const QString &devicePath) -+{ -+ KLOG_DEBUG() << "--------------------DeviceAdded :" << devicePath; -+} -+ - void CPanelNetworkWidget::handleDeviceRemoved(const QString &devicePath) - { -- reload(); -- emit subItemsChanged(); -+ KLOG_DEBUG() << "---------------------DeviceRemoved: " << devicePath; - } - - void CPanelNetworkWidget::reload() - { -- for (int i = 0; i < ui->stackedWidget->count(); ++i) -+ for (int i = 0; i < ui->stackedWidget->count(); i++) - { - auto widget = ui->stackedWidget->widget(i); - ui->stackedWidget->removeWidget(widget); -@@ -255,10 +285,10 @@ void CPanelNetworkWidget::reload() - - QPixmap CPanelNetworkWidget::trayIconColorSwitch(const QString &iconPath) - { -- //icon原本为浅色 -+ // icon原本为浅色 - QIcon icon(iconPath); -- QPixmap pixmap = icon.pixmap(16,16); -- if( Kiran::StylePalette::instance()->paletteType() != Kiran::PALETTE_DARK ) -+ QPixmap pixmap = icon.pixmap(16, 16); -+ if (Kiran::StylePalette::instance()->paletteType() != Kiran::PALETTE_DARK) - { - QImage image = pixmap.toImage(); - image.invertPixels(QImage::InvertRgb); -@@ -272,7 +302,7 @@ void CPanelNetworkWidget::handleThemeChanged(Kiran::PaletteType paletteType) - for (int i = 0; i < ui->sidebar->count(); ++i) - { - auto icon = ui->sidebar->item(i)->icon(); -- QPixmap pixmap = icon.pixmap(16,16); -+ QPixmap pixmap = icon.pixmap(16, 16); - QImage image = pixmap.toImage(); - image.invertPixels(QImage::InvertRgb); - pixmap = QPixmap::fromImage(image); -@@ -283,10 +313,10 @@ void CPanelNetworkWidget::handleThemeChanged(Kiran::PaletteType paletteType) - void CPanelNetworkWidget::handleSideBarItemClicked(QListWidgetItem *item) - { - ui->stackedWidget->setCurrentIndex(item->data(Qt::UserRole).toInt()); -- -- QString itemText = item->text(); -- KLOG_DEBUG() << "item clicked:" << item->text(); -- if(itemText.contains(tr("Wireless Network"))) -+ -+ QString itemText = item->text(); -+ KLOG_DEBUG() << "item clicked:" << item->text(); -+ if (itemText.contains(tr("Wireless Network"))) - { - KLOG_DEBUG() << "item clicked wireless"; - for (auto device : m_wirelessDeviceList) -@@ -305,4 +335,12 @@ void CPanelNetworkWidget::handleSideBarItemClicked(QListWidgetItem *item) - } - } - } -+} -+ -+void CPanelNetworkWidget::handleWirelessEnabledChanged(bool enable) -+{ -+} -+ -+void CPanelNetworkWidget::handleNetworkingEnabledChanged(bool enable) -+{ - } -\ No newline at end of file -diff --git a/plugins/network/src/plugin/cpanel-network-widget.h b/plugins/network/src/plugin/cpanel-network-widget.h -index 112cab8..03c7350 100644 ---- a/plugins/network/src/plugin/cpanel-network-widget.h -+++ b/plugins/network/src/plugin/cpanel-network-widget.h -@@ -15,11 +15,11 @@ - #ifndef KIRAN_CPANEL_NETWORK_CPANEL_NETWORK_WIDGET_H - #define KIRAN_CPANEL_NETWORK_CPANEL_NETWORK_WIDGET_H - --#include - #include -+#include -+#include - #include "kiran-sidebar-widget.h" - #include "style-palette.h" --#include - - QT_BEGIN_NAMESPACE - namespace Ui -@@ -51,6 +51,9 @@ public slots: - void handleDeviceRemoved(const QString &devicePath); - void handleThemeChanged(Kiran::PaletteType paletteType); - void handleSideBarItemClicked(QListWidgetItem *item); -+ void handleManagedChanged(); -+ void handleWirelessEnabledChanged(bool enable); -+ void handleNetworkingEnabledChanged(bool enable); - - signals: - void subItemsChanged(); -@@ -63,7 +66,7 @@ private: - - QTimer m_Timer; - QString m_addDevicePath; -- int waitCounts; -+ int m_waitCounts; - }; - --#endif //KIRAN_CPANEL_NETWORK_CPANEL_NETWORK_WIDGET_H -+#endif // KIRAN_CPANEL_NETWORK_CPANEL_NETWORK_WIDGET_H -diff --git a/plugins/network/src/plugin/details-page.cpp b/plugins/network/src/plugin/details-page.cpp -index a585a68..dfee3f6 100644 ---- a/plugins/network/src/plugin/details-page.cpp -+++ b/plugins/network/src/plugin/details-page.cpp -@@ -58,7 +58,7 @@ void DetailsPage::initUI() - QWidget *widget = new ConnectionDetailsWidget(m_deviceList.at(0), this); - ui->stackedWidget->addWidget(widget); - } -- else if(m_deviceList.count() == 0) -+ else if (m_deviceList.count() == 0) - { - QWidget *widget = new ConnectionDetailsWidget(nullptr, this); - ui->stackedWidget->addWidget(widget); -@@ -105,12 +105,13 @@ void DetailsPage::handleDeviceRemoved(const QString &devicePath) - - void DetailsPage::handleActiveConnectionChanged() - { -+ reload(); - } - - void DetailsPage::handleActiveConnectionAdded(const QString &activeConnectionPath) - { - ActiveConnection::Ptr activeConnection = findActiveConnection(activeConnectionPath); -- connect(activeConnection.data(), &ActiveConnection::stateChanged, this, &DetailsPage::handleActiveConnectionStateChanged); -+ connect(activeConnection.data(), &ActiveConnection::stateChanged, this, &DetailsPage::handleActiveConnectionStateChanged, Qt::UniqueConnection); - } - - void DetailsPage::handleActiveConnectionRemoved(const QString &activeConnectionPath) -diff --git a/plugins/network/src/plugin/manager/vpn-manager.cpp b/plugins/network/src/plugin/manager/vpn-manager.cpp -index 96d6baa..cd858b5 100644 ---- a/plugins/network/src/plugin/manager/vpn-manager.cpp -+++ b/plugins/network/src/plugin/manager/vpn-manager.cpp -@@ -14,17 +14,17 @@ - - #include "vpn-manager.h" - #include -+#include - #include - #include - #include - #include - #include - #include -+#include "connection-name-widget.h" -+#include "status-notification.h" - #include "text-input-dialog.h" - #include "ui_vpn-manager.h" --#include "status-notification.h" --#include "connection-name-widget.h" --#include - using namespace NetworkManager; - - Q_DECLARE_METATYPE(VpnType) -@@ -43,21 +43,20 @@ VpnManager::~VpnManager() - - void VpnManager::initUI() - { -- ui->connectionShowPage->setConnectionType(ConnectionSettings::Vpn); -- ui->connectionShowPage->setItemWidgetType(ITEM_WIDGET_TYPE_PLUGIN); -+ ui->connectionShowPage->init(ConnectionSettings::Vpn, ""); - ui->connectionShowPage->setTitle(tr("VPN")); - ui->connectionShowPage->setSwitchButtonVisible(false); -- ui->connectionShowPage->showConnectionLists(ConnectionSettings::Vpn); - --// ui->vpnType->addItem(tr("L2TP"), VPN_TYPE_L2TP); -+ // ui->vpnType->addItem(tr("L2TP"), VPN_TYPE_L2TP); - ui->vpnType->addItem(tr("PPTP"), VPN_TYPE_PPTP); -- Kiran::StylePropertyHelper::setButtonType(ui->saveButton,Kiran::BUTTON_Default); -+ Kiran::StylePropertyHelper::setButtonType(ui->saveButton, Kiran::BUTTON_Default); - } - --//XXX:是否使用模板提升通用性 -+// XXX:是否使用模板提升通用性 - void VpnManager::initConnection() - { -- connect(ui->connectionShowPage, &ConnectionShowPage::requestCreatConnection, [=]() { -+ connect(ui->connectionShowPage, &ConnectionShowPage::requestCreatConnection, [=]() -+ { - //默认创建vpn类型:L2TP - ui->vpnTypeWidget->setVisible(true); - ui->vpnType->setCurrentIndex(0); -@@ -66,13 +65,13 @@ void VpnManager::initConnection() - - QPointer scrollBar = ui->scrollArea->verticalScrollBar(); - scrollBar->setValue(0); -- ui->stackedWidget->setCurrentIndex(PAGE_SETTING); -- }); -+ ui->stackedWidget->setCurrentIndex(PAGE_SETTING); }); - - connect(ui->connectionShowPage, &ConnectionShowPage::requestEditConnection, this, &VpnManager::handleRequestEditConnection); - connect(ui->connectionShowPage, &ConnectionShowPage::requestActivateCurrentItemConnection, this, &VpnManager::handleRequestActivateConnection); - -- connect(ui->vpnType, QOverload::of(&QComboBox::currentIndexChanged), [=](int index) { -+ connect(ui->vpnType, QOverload::of(&QComboBox::currentIndexChanged), [=](int index) -+ { - VpnType type = ui->vpnType->currentData().value(); - ui->vpnTypeStacked->setCurrentIndex(VPN_TYPE_PPTP); - switch (type) -@@ -85,49 +84,47 @@ void VpnManager::initConnection() - break; - default: - break; -- } -- }); -+ } }); - - connect(ui->returnButton, &QPushButton::clicked, this, &VpnManager::handleReturnPreviousPage); - connect(ui->l2tpSetting, &VpnL2tpSetting::returnPreviousPage, this, &VpnManager::handleReturnPreviousPage); - connect(ui->pptpSetting, &VpnPptpSetting::returnPreviousPage, this, &VpnManager::handleReturnPreviousPage); - -- connect(ui->saveButton, &QPushButton::clicked, [=]() { -- int index = ui->vpnTypeStacked->currentIndex(); -- switch (index) -- { -- case VPN_TYPE_L2TP: -- if(ui->l2tpSetting->isInputValid()) -+ connect(ui->saveButton, &QPushButton::clicked, [=]() - { -- ui->l2tpSetting->handleSaveButtonClicked(ConnectionSettings::ConnectionType::Vpn); -- handleReturnPreviousPage(); -- } -- break; -- case VPN_TYPE_PPTP: -- if(ui->pptpSetting->isInputValid()) -+ int index = ui->vpnTypeStacked->currentIndex(); -+ switch (index) -+ { -+ case VPN_TYPE_L2TP: -+ if(ui->l2tpSetting->isInputValid()) -+ { -+ ui->l2tpSetting->handleSaveButtonClicked(ConnectionSettings::ConnectionType::Vpn); -+ handleReturnPreviousPage(); -+ } -+ break; -+ case VPN_TYPE_PPTP: -+ if(ui->pptpSetting->isInputValid()) -+ { -+ ui->pptpSetting->handleSaveButtonClicked(ConnectionSettings::ConnectionType::Vpn); -+ handleReturnPreviousPage(); -+ } -+ break; -+ default: -+ break; -+ } }); -+ -+ connect(ui->connectionShowPage, &ConnectionShowPage::connectionUpdated, [=](const QString &path) - { -- ui->pptpSetting->handleSaveButtonClicked(ConnectionSettings::ConnectionType::Vpn); -- handleReturnPreviousPage(); -- } -- break; -- default: -- break; -- } -- }); -- -- connect(ui->connectionShowPage,&ConnectionShowPage::connectionUpdated,[=](const QString &path){ -- KLOG_DEBUG() << "Connection::updated:" << path; -- //移除后再加载进来以更新信息 -- ui->connectionShowPage->removeConnectionFromLists(path); -- Connection::Ptr updateConnection = findConnection(path); -- ui->connectionShowPage->addConnectionToLists(updateConnection,""); -- handleReturnPreviousPage(); -- }); -+ KLOG_DEBUG() << "Connection::updated:" << path; -+ //移除后再加载进来以更新信息 -+ ui->connectionShowPage->removeConnectionFromLists(path); -+ Connection::Ptr updateConnection = findConnection(path); -+ ui->connectionShowPage->addConnectionToLists(updateConnection,""); -+ handleReturnPreviousPage(); }); - - initNotifierConnection(); - } - -- - void VpnManager::handleRequestEditConnection(const QString &uuid, QString activeConnectionPath) - { - //隐藏选择VPN类型 -@@ -158,7 +155,7 @@ void VpnManager::handleRequestEditConnection(const QString &uuid, QString active - } - else - { -- //other type -+ // other type - } - - QPointer scrollBar = ui->scrollArea->verticalScrollBar(); -@@ -167,7 +164,7 @@ void VpnManager::handleRequestEditConnection(const QString &uuid, QString active - } - - //考虑弹窗输入密码的情况 --void VpnManager::handleRequestActivateConnection(const QString &connectionPath,const QString &connectionParameter) -+void VpnManager::handleRequestActivateConnection(const QString &connectionPath, const QString &connectionParameter) - { - Connection::Ptr connection = findConnection(connectionPath); - ConnectionSettings::Ptr settings = connection->settings(); -@@ -190,19 +187,19 @@ void VpnManager::handleRequestActivateConnection(const QString &connectionPath,c - QString tips = QString(tr("Password required to connect to %1.")).arg(settings->id()); - inputDialog.setText(tips); - -- connect(&inputDialog, &TextInputDialog::password, [=](const QString &password) { -+ connect(&inputDialog, &TextInputDialog::password, [=](const QString &password) -+ { - NMStringMap secretsMap = vpnSetting->secrets(); - secretsMap.insert("password", password); - vpnSetting->setSecrets(secretsMap); - activateVPNConnection(connectionPath, connectionParameter); -- connection->clearSecrets(); -- }); -+ connection->clearSecrets(); }); - - inputDialog.exec(); - } - } - --void VpnManager::activateVPNConnection(const QString &connectionPath,const QString &connectionParameter) -+void VpnManager::activateVPNConnection(const QString &connectionPath, const QString &connectionParameter) - { - QDBusPendingReply reply = - NetworkManager::activateConnection(connectionPath, "", connectionParameter); -@@ -222,11 +219,10 @@ void VpnManager::activateVPNConnection(const QString &connectionPath,const QStri - - void VpnManager::handleNotifierConnectionAdded(const QString &path) - { -- Connection::Ptr connection = findConnection(path); -- if ((connection->settings()->connectionType() == ConnectionSettings::ConnectionType::Vpn) -- && (!connection->name().isEmpty())) -+ Connection::Ptr connection = findConnection(path); -+ if ((connection->settings()->connectionType() == ConnectionSettings::ConnectionType::Vpn) && (!connection->name().isEmpty())) - { -- ui->connectionShowPage->addConnectionToLists(connection,""); -+ ui->connectionShowPage->addConnectionToLists(connection, ""); - } - } - -@@ -238,10 +234,10 @@ void VpnManager::handleNotifierConnectionRemoved(const QString &path) - void VpnManager::handleActiveConnectionAdded(const QString &activePath) - { - ActiveConnection::Ptr activatedConnection = findActiveConnection(activePath); -- if(activatedConnection == nullptr) -+ if (activatedConnection == nullptr) - { - KLOG_DEBUG() << "activatedConnection == nullptr"; -- return ; -+ return; - } - if (activatedConnection->type() == ConnectionSettings::ConnectionType::Vpn) - { -@@ -249,10 +245,9 @@ void VpnManager::handleActiveConnectionAdded(const QString &activePath) - QString uuid = vpnConnection->uuid(); - KLOG_DEBUG() << "vpn uuid:" << uuid; - QListWidgetItem *activeItem = ui->connectionShowPage->findItemByUuid(uuid); -- ui->connectionShowPage->updateItemActivatedPath(activeItem,activePath); -- connect(vpnConnection.data(), &VpnConnection::stateChanged, [=](VpnConnection::State state, VpnConnection::StateChangeReason reason) { -- handleVpnConnectionStateChanged(state, reason, activePath); -- }); -+ ui->connectionShowPage->updateItemActivatedPath(activeItem, activePath); -+ connect(vpnConnection.data(), &VpnConnection::stateChanged, [=](VpnConnection::State state, VpnConnection::StateChangeReason reason) -+ { handleVpnConnectionStateChanged(state, reason, activePath); }); - //加载等待动画 - auto item = ui->connectionShowPage->findItemByActivatedPath(activePath); - ui->connectionShowPage->updateItemActivatingStatus(item); -@@ -263,13 +258,13 @@ void VpnManager::handleActiveConnectionRemoved(const QString &activePath) - { - } - --//TODO:若没有安装VPN插件则需要提示 -+// TODO:若没有安装VPN插件则需要提示 - void VpnManager::handleVpnConnectionStateChanged(VpnConnection::State state, VpnConnection::StateChangeReason reason, const QString &activePath) - { - auto activeConnection = findActiveConnection(activePath); -- KLOG_DEBUG() << " activeConnection->id():" << activeConnection->id(); -+ KLOG_DEBUG() << " activeConnection->id():" << activeConnection->id(); - QString id = ""; -- if(activeConnection != nullptr) -+ if (activeConnection != nullptr) - id = activeConnection->id(); - switch (state) - { -@@ -294,13 +289,13 @@ void VpnManager::handleVpnConnectionStateChanged(VpnConnection::State state, Vpn - break; - case VpnConnection::State::Failed: - KLOG_DEBUG() << "VpnConnection::State::Failed"; -- if(!id.isEmpty()) -+ if (!id.isEmpty()) - StatusNotification::ActiveConnectionDeactivatedNotify(id); - handleVpnStateFailed(activePath); - break; - case VpnConnection::State::Disconnected: - KLOG_DEBUG() << "VpnConnection::State::Disconnected"; -- if(!id.isEmpty()) -+ if (!id.isEmpty()) - StatusNotification::ActiveConnectionDeactivatedNotify(id); - handleVpnStateDisconnected(activePath); - break; -@@ -354,9 +349,9 @@ void VpnManager::handleVpnConnectionStateChanged(VpnConnection::State state, Vpn - void VpnManager::handleVpnStateActivated(const QString &activePath) - { - ActiveConnection::Ptr activeConnection = findActiveConnection(activePath); -- if(activeConnection.isNull()) -- return ; -- if( activeConnection->type() == ConnectionSettings::Vpn) -+ if (activeConnection.isNull()) -+ return; -+ if (activeConnection->type() == ConnectionSettings::Vpn) - { - ui->connectionShowPage->updateItemActivatedStatus(activePath); - auto item = ui->connectionShowPage->findItemByActivatedPath(activePath); -@@ -398,4 +393,3 @@ void VpnManager::clearVpnSetting() - break; - } - } -- -diff --git a/plugins/network/src/plugin/manager/wired-manager.cpp b/plugins/network/src/plugin/manager/wired-manager.cpp -index dfccd25..cfd11b2 100644 ---- a/plugins/network/src/plugin/manager/wired-manager.cpp -+++ b/plugins/network/src/plugin/manager/wired-manager.cpp -@@ -40,25 +40,22 @@ WiredManager::~WiredManager() - - void WiredManager::initUI() - { -- ui->connectionShowPage->setConnectionType(ConnectionSettings::Wired); -- ui->connectionShowPage->setDevicePath(m_devicePath); -- ui->connectionShowPage->setItemWidgetType(ITEM_WIDGET_TYPE_PLUGIN); -+ ui->connectionShowPage->init(ConnectionSettings::Wired, m_devicePath); - ui->connectionShowPage->setTitle(tr("Wired Network Adapter")); - ui->connectionShowPage->setSwitchButtonVisible(false); -- ui->connectionShowPage->showConnectionLists(ConnectionSettings::ConnectionType::Wired); - Kiran::StylePropertyHelper::setButtonType(ui->saveButton, Kiran::BUTTON_Default); - } - - void WiredManager::initConnection() - { -- connect(ui->connectionShowPage, &ConnectionShowPage::requestCreatConnection, [=]() -+ connect(ui->connectionShowPage, &ConnectionShowPage::requestCreatConnection, this, [this]() - { - ui->wiredSettingPage->showSettingPage(); - QPointer scrollBar = ui->scrollArea->verticalScrollBar(); - scrollBar->setValue(0); - ui->stackedWidget->setCurrentIndex(PAGE_SETTING); }); - -- connect(ui->connectionShowPage, &ConnectionShowPage::requestEditConnection, [=](const QString &uuid, QString activeConnectionPath) -+ connect(ui->connectionShowPage, &ConnectionShowPage::requestEditConnection, this, [this](const QString &uuid, QString activeConnectionPath) - { - ui->wiredSettingPage->initConnectionSettings(ConnectionSettings::ConnectionType::Wired, uuid); - ui->wiredSettingPage->initSettingPage(); -@@ -73,7 +70,7 @@ void WiredManager::initConnection() - - connect(ui->wiredSettingPage, &WiredSettingPage::returnPreviousPage, this, &WiredManager::handleReturnPreviousPage); - -- connect(ui->connectionShowPage, &ConnectionShowPage::connectionUpdated, this,&WiredManager::handleConnectionUpdated); -+ connect(ui->connectionShowPage, &ConnectionShowPage::connectionUpdated, this, &WiredManager::handleConnectionUpdated); - - connect(ui->connectionShowPage, &ConnectionShowPage::requestActivateCurrentItemConnection, - this, &WiredManager::handleRequestActivateConnection); -diff --git a/plugins/network/src/plugin/manager/wireless-manager.cpp b/plugins/network/src/plugin/manager/wireless-manager.cpp -index 7c2eabb..2596c39 100644 ---- a/plugins/network/src/plugin/manager/wireless-manager.cpp -+++ b/plugins/network/src/plugin/manager/wireless-manager.cpp -@@ -11,6 +11,7 @@ - * - * Author: luoqing - */ -+#include "wireless-manager.h" - #include - #include - #include -@@ -20,7 +21,6 @@ - #include - #include "text-input-dialog.h" - #include "ui_wireless-manager.h" --#include "wireless-manager.h" - - using namespace NetworkManager; - -@@ -41,14 +41,10 @@ WirelessManager::~WirelessManager() - - void WirelessManager::initUI() - { -- ui->connectionShowPage->setConnectionType(ConnectionSettings::Wireless); -- ui->connectionShowPage->setDevicePath(m_devicePath); -- ui->connectionShowPage->setItemWidgetType(ITEM_WIDGET_TYPE_PLUGIN); -+ ui->connectionShowPage->init(ConnectionSettings::Wireless, m_devicePath); - ui->connectionShowPage->setTitle(tr("Wireless Network Adapter")); -- ui->connectionShowPage->initSwitchButton(); - ui->connectionShowPage->setSwitchButtonVisible(true); - ui->connectionShowPage->setCreateButtonVisible(false); -- ui->connectionShowPage->showWirelessNetworkLists(); - Kiran::StylePropertyHelper::setButtonType(ui->saveButton, Kiran::BUTTON_Default); - - // XXX:由于存在switchButton,所以特别修改一下topMargin -@@ -57,38 +53,38 @@ void WirelessManager::initUI() - - void WirelessManager::initConnection() - { -- connect(ui->connectionShowPage, &ConnectionShowPage::requestCreatConnection, [=]() -+ connect(ui->connectionShowPage, &ConnectionShowPage::requestCreatConnection, this, [this]() - { -- ui->wirelessSettingPage->showSettingPage(); -- QPointer scrollBar = ui->scrollArea->verticalScrollBar(); -- scrollBar->setValue(0); -- ui->stackedWidget->setCurrentIndex(PAGE_SETTING); }); -+ ui->wirelessSettingPage->showSettingPage(); -+ QPointer scrollBar = ui->scrollArea->verticalScrollBar(); -+ scrollBar->setValue(0); -+ ui->stackedWidget->setCurrentIndex(PAGE_SETTING); }); - -- connect(ui->connectionShowPage, &ConnectionShowPage::requestEditConnection, [=](const QString &uuid, QString activeConnectionPath) -+ connect(ui->connectionShowPage, &ConnectionShowPage::requestEditConnection, this, [this](const QString &uuid, QString activeConnectionPath) - { -- ActiveConnection::Ptr activeConnection = findActiveConnection(activeConnectionPath); -- ConnectionSettings::Ptr connectionSettings = activeConnection->connection()->settings(); -- ui->wirelessSettingPage->setConnection(activeConnection->connection()); -- ui->wirelessSettingPage->setConnectionSettings(connectionSettings); -- ui->wirelessSettingPage->initSettingPage(); -- ui->wirelessSettingPage->showSettingPage(activeConnectionPath); -- QPointer scrollBar = ui->scrollArea->verticalScrollBar(); -- scrollBar->setValue(0); -- ui->stackedWidget->setCurrentIndex(PAGE_SETTING); }); -+ ActiveConnection::Ptr activeConnection = findActiveConnection(activeConnectionPath); -+ ConnectionSettings::Ptr connectionSettings = activeConnection->connection()->settings(); -+ ui->wirelessSettingPage->setConnection(activeConnection->connection()); -+ ui->wirelessSettingPage->setConnectionSettings(connectionSettings); -+ ui->wirelessSettingPage->initSettingPage(); -+ ui->wirelessSettingPage->showSettingPage(activeConnectionPath); -+ QPointer scrollBar = ui->scrollArea->verticalScrollBar(); -+ scrollBar->setValue(0); -+ ui->stackedWidget->setCurrentIndex(PAGE_SETTING); }); - - connect(ui->returnButton, &QPushButton::clicked, this, &WirelessManager::handleReturnPreviousPage); -- connect(ui->saveButton, &QPushButton::clicked, [=]() -+ connect(ui->saveButton, &QPushButton::clicked, this, [this]() - { -- ui->wirelessSettingPage->handleSaveButtonClicked(ConnectionSettings::ConnectionType::Wireless); -- handleReturnPreviousPage(); }); -+ ui->wirelessSettingPage->handleSaveButtonClicked(ConnectionSettings::ConnectionType::Wireless); -+ handleReturnPreviousPage(); }); - - connect(ui->wirelessSettingPage, &WirelessSettingPage::returnPreviousPage, this, &WirelessManager::handleReturnPreviousPage); - // XXX:更改信号 -- connect(ui->wirelessSettingPage, &WirelessSettingPage::settingUpdated, [=]() -+ connect(ui->wirelessSettingPage, &WirelessSettingPage::settingUpdated, this, [this]() - { -- KLOG_DEBUG() << "WiredSettingPage::settingUpdated"; -- handleReturnPreviousPage(); -- refreshConnectionLists(); }); -+ KLOG_DEBUG() << "WiredSettingPage::settingUpdated"; -+ handleReturnPreviousPage(); -+ refreshConnectionLists(); }); - - connect(ui->connectionShowPage, &ConnectionShowPage::requestConnectWirelessNetwork, - this, &WirelessManager::handleRequestConnectWirelessNetwork); -@@ -99,8 +95,8 @@ void WirelessManager::initConnection() - connect(m_wirelessDevice.data(), &WirelessDevice::networkDisappeared, this, &WirelessManager::handleNetworkDisappeared, Qt::QueuedConnection); - connect(m_wirelessDevice.data(), &WirelessDevice::networkAppeared, this, &WirelessManager::handleNetworkAppeared); - -- //Note:插件与托盘都对该设备的信号进行了连接,容易干扰重复,因此,插件暂未实现该函数 -- connect(m_devicePtr.data(), &Device::stateChanged, this, &WirelessManager::handleDeviceStateChanged,Qt::UniqueConnection); -+ // Note:插件与托盘都对该设备的信号进行了连接,容易干扰重复,因此,插件暂未实现该函数 -+ connect(m_devicePtr.data(), &Device::stateChanged, this, &WirelessManager::handleDeviceStateChanged, Qt::UniqueConnection); - } - - //在已存在WirelessSetting配置的情况下,激活连接.(连接过一次后会创建WirelessSetting配置) -@@ -203,7 +199,7 @@ void WirelessManager::handleActiveConnectionAdded(const QString &path) - auto item = ui->connectionShowPage->item(row); - ui->connectionShowPage->itemSimpleStatus(item); - } -- connect(activatedConnection.data(), &ActiveConnection::stateChanged, this, &WirelessManager::handleActiveConnectionStateChanged,Qt::UniqueConnection); -+ connect(activatedConnection.data(), &ActiveConnection::stateChanged, this, &WirelessManager::handleActiveConnectionStateChanged, Qt::UniqueConnection); - } - } - -diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.cpp b/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.cpp -index c195235..383d3e4 100644 ---- a/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.cpp -+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-ppp.cpp -@@ -63,11 +63,11 @@ void VpnPpp::initOptionsButton(const QStringList &supportOptions) - switchButton->setProperty("option", option); - m_optionsButtonMap[option] = switchButton; - -- QHBoxLayout *horizontalLayout = new QHBoxLayout(this); -+ QHBoxLayout *horizontalLayout = new QHBoxLayout(); - horizontalLayout->addWidget(strLabel); - horizontalLayout->addStretch(); - horizontalLayout->addWidget(switchButton); -- horizontalLayout->setContentsMargins(0,0,0,0); -+ horizontalLayout->setContentsMargins(0, 0, 0, 0); - ui->optionsLayout->addLayout(horizontalLayout); - } - else -@@ -156,7 +156,7 @@ void VpnPpp::saveSettings() - m_vpnSetting->setInitialized(true); - } - --//XXX:优化流程 -+// XXX:优化流程 - void VpnPpp::showSettings() - { - if (m_vpnSetting != nullptr) -diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp -index 5aeb35d..232882b 100644 ---- a/plugins/network/src/tray/network-tray.cpp -+++ b/plugins/network/src/tray/network-tray.cpp -@@ -74,7 +74,7 @@ void NetworkTray::initConnect() - - // TODO:优化deviceAdded的逻辑 - // 需要等待一段时间,Device::List networkInterfaces() 来不及更新 -- connect(notifier(), &Notifier::deviceAdded, [this](const QString &uni) -+ connect(notifier(), &Notifier::deviceAdded, this, [this](const QString &uni) - { - m_addDevicePath = uni; - Device::Ptr device = findNetworkInterface(m_addDevicePath); -@@ -83,18 +83,17 @@ void NetworkTray::initConnect() - KLOG_DEBUG() << "this device interface is not found"; - return; - } -- -- KLOG_DEBUG() << "device->managed():" << device->managed(); -- if(!device->isValid()) -+ KLOG_DEBUG() << "device->uni():" << device->uni(); -+ KLOG_DEBUG() << "device->interfaceName():" << device->interfaceName(); -+ KLOG_DEBUG() << "device->state():" << device->state(); -+ KLOG_DEBUG() << "device->isValid():" << device->isValid(); -+ if(device->isValid()) - { -- KLOG_INFO() << "this device interface is invalid!"; -- return ; -- } -- if(device->managed()) - handleDeviceAdded(m_addDevicePath); -+ } - else - { -- KLOG_INFO() << "this device interface is not ready"; -+ KLOG_INFO() << "this device interface is invalid!"; - m_Timer.start(); - KLOG_INFO() << "wait counts:" << m_waitCounts; - } }); -@@ -102,7 +101,7 @@ void NetworkTray::initConnect() - m_Timer.setInterval(500); - m_Timer.setSingleShot(true); - m_waitCounts = 1; -- connect(&m_Timer, &QTimer::timeout, [this]() -+ connect(&m_Timer, &QTimer::timeout, this, [this]() - { - Device::Ptr device = findNetworkInterface(m_addDevicePath); - if(device.isNull()) -@@ -132,6 +131,8 @@ void NetworkTray::initConnect() - - connect(notifier(), &Notifier::primaryConnectionChanged, this, &NetworkTray::handlePrimaryConnectionChanged); - -+ connect(notifier(), &Notifier::wirelessEnabledChanged, this, &NetworkTray::handleWirelessEnabledChanged, Qt::UniqueConnection); -+ - // 无线网络如果一下消失多个网络,短时间会触发多次SizeHint变更的信号 - m_wirelessTimer.setInterval(100); - m_wirelessTimer.setSingleShot(true); -@@ -184,8 +185,8 @@ void NetworkTray::getAvailableDeviceList() - for (Device::Ptr dev : deviceList) - { - KLOG_DEBUG() << "dev->interfaceName():" << dev->interfaceName(); -- KLOG_DEBUG() << "dev->availableConnections():" << dev->availableConnections(); - KLOG_DEBUG() << "dev->state():" << dev->state(); -+ KLOG_DEBUG() << "dev->isValid():" << dev->isValid(); - - if (dev->state() == Device::Unavailable) - continue; -@@ -295,103 +296,50 @@ void NetworkTray::getTrayGeometry() - // TODO:增加其他状态图标 - void NetworkTray::setTrayIcon(NetworkManager::Status status) - { -- // 判断主连接类型,托盘网络图标以主连接类型为准 -- // NetworkManager::primaryConnectionType() 更新不及时,暂时不用 -- ActiveConnection::Ptr primaryActiveConnection = primaryConnection(); -- if (primaryActiveConnection != nullptr) -+ if (status == NetworkManager::Status::Connected) - { -- auto primaryConnectionType = primaryActiveConnection->connection()->settings()->connectionType(); -- if (primaryConnectionType == ConnectionSettings::Wireless) -+ // 判断主连接类型,托盘网络图标以主连接类型为准 -+ // NetworkManager::primaryConnectionType() 更新不及时,暂时不用 -+ ActiveConnection::Ptr primaryActiveConnection = primaryConnection(); -+ if (primaryActiveConnection != nullptr) - { -- // ActiveConnection::Ptr primaryActiveConnection = primaryConnection(); -- // WirelessSetting::Ptr wirelessSetting = primaryActiveConnection->connection()->settings()->setting(Setting::Wireless).dynamicCast(); -- // QString ssid = QString(wirelessSetting->ssid()); -+ auto primaryConnectionType = primaryActiveConnection->connection()->settings()->connectionType(); -+ if (primaryConnectionType == ConnectionSettings::Wireless) -+ { -+ // ActiveConnection::Ptr primaryActiveConnection = primaryConnection(); -+ // WirelessSetting::Ptr wirelessSetting = primaryActiveConnection->connection()->settings()->setting(Setting::Wireless).dynamicCast(); -+ // QString ssid = QString(wirelessSetting->ssid()); - -- // QString devicePath = primaryActiveConnection->devices().value(0); -- // Device::Ptr device = findNetworkInterface(devicePath); -- // WirelessDevice::Ptr wirelessDevice = qobject_cast(device); -- // WirelessNetwork::Ptr wirelessNetwork = wirelessDevice->findNetwork(ssid); -- // int signalStrength = wirelessNetwork->signalStrength(); -+ // QString devicePath = primaryActiveConnection->devices().value(0); -+ // Device::Ptr device = findNetworkInterface(devicePath); -+ // WirelessDevice::Ptr wirelessDevice = qobject_cast(device); -+ // WirelessNetwork::Ptr wirelessNetwork = wirelessDevice->findNetwork(ssid); -+ // int signalStrength = wirelessNetwork->signalStrength(); - -- switch (status) -- { -- case NetworkManager::Status::Unknown: -- // 未知 -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -- break; -- case NetworkManager::Status::Asleep: -- // 不可用 -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -- break; -- case NetworkManager::Status::Disconnected: -- // 不可用 -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -- break; -- case NetworkManager::Status::Disconnecting: -- break; -- case NetworkManager::Status::Connecting: -- // 加载动画 -- break; -- case NetworkManager::Status::ConnectedLinkLocal: -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -- // 不可用 -- break; -- case NetworkManager::Status::ConnectedSiteOnly: -- // 未知 -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -- break; -- case NetworkManager::Status::Connected: -- // 可用 - m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wireless-4.svg")); -- break; -- default: -- break; - } - } - else - { -- switch (status) -- { -- case NetworkManager::Status::Unknown: -- // 未知 -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -- break; -- case NetworkManager::Status::Asleep: -- // 不可用 -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -- break; -- case NetworkManager::Status::Disconnected: -- // 不可用 -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -- break; -- case NetworkManager::Status::Disconnecting: -- break; -- case NetworkManager::Status::Connecting: -- // 加载动画 -- break; -- case NetworkManager::Status::ConnectedLinkLocal: -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -- // 不可用 -- break; -- case NetworkManager::Status::ConnectedSiteOnly: -- // 未知 -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -- break; -- case NetworkManager::Status::Connected: -- // 可用 -- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-connection.svg")); -- break; -- default: -- break; -- } -+ // 可用 -+ m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-connection.svg")); - } - } -+ else if (status == NetworkManager::Status::Disconnecting || NetworkManager::Status::Connecting) -+ { -+ // TODO:加载动画 -+ } -+ else -+ { -+ m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg")); -+ } - } - - // 重新获取device、初始化,刷新 - // XXX:可以优化 - void NetworkTray::handleDeviceAdded(const QString &devicePath) - { -+ KLOG_DEBUG() << "---------------------handleDeviceAdded:" << devicePath; - Device::Ptr device = findNetworkInterface(devicePath); - if (device->type() == Device::Ethernet) - { -@@ -406,6 +354,7 @@ void NetworkTray::handleDeviceAdded(const QString &devicePath) - // XXX:当device被移除时,由于设备对象可能已经被删除,所以并不能通过findNetworkInterface(path)找到该设备接口,进而知道被删除的设备类型 - void NetworkTray::handleDeviceRemoved(const QString &devicePath) - { -+ KLOG_DEBUG() << "handle Device Removed :" << devicePath; - if (m_wiredTrayPage != nullptr) - { - if (m_wiredTrayPage->devicePathList().contains(devicePath)) -@@ -424,12 +373,76 @@ void NetworkTray::handleDeviceStateChanged(NetworkManager::Device::State newstat - NetworkManager::Device::State oldstate, - NetworkManager::Device::StateChangeReason reason) - { -+ if ((oldstate == Device::Unavailable) && -+ (newstate != Device::Unmanaged && newstate != Device::UnknownState)) -+ { -+ } -+ -+ if (newstate == Device::State::Unavailable) -+ { -+ Device *device = qobject_cast(sender()); -+ // KLOG_DEBUG() << "Device::State::Unavailable"; -+ // KLOG_DEBUG() << "device->uni():" << device->uni(); -+ // KLOG_DEBUG() << "device->interfaceName():" << device->interfaceName(); -+ } - } - - void NetworkTray::handleDeviceManagedChanged() - { - } - -+// TODO:托盘对不可用状态进行提示 -+/** -+ * XXX:由于在禁用和开启wifi时,并没有发出Wireless设备的deviceRemoved和deviceAdded信号 -+ * 并且当WirelessEnabledChanged信号发送时,device state 还处在unavailbel 不可用状态,需要处理 -+ */ -+ -+// TODO:托盘对不可用状态进行提示 -+void NetworkTray::handleWirelessEnabledChanged(bool enable) -+{ -+ KLOG_DEBUG() << "-----------------------handleWirelessEnabledChanged:" << enable; -+ -+ if (m_wirelessTrayPage != nullptr) -+ { -+ m_verticalLayout->removeWidget(m_wirelessTrayPage); -+ delete m_wirelessTrayPage; -+ m_wirelessTrayPage = nullptr; -+ } -+ m_wirelessDeviceList.clear(); -+ -+ if (enable) -+ { -+ // networkInterfaces() 是否及时更新,需验证 -+ const Device::List deviceList = networkInterfaces(); -+ for (Device::Ptr dev : deviceList) -+ { -+ KLOG_DEBUG() << "dev->interfaceName():" << dev->interfaceName(); -+ KLOG_DEBUG() << "dev->state():" << dev->state(); -+ KLOG_DEBUG() << "dev->isValid():" << dev->isValid(); -+ -+ if ((dev->state() == Device::Unmanaged) || (dev->state() == Device::UnknownState)) -+ continue; -+ -+ if (dev->type() == Device::Wifi) -+ { -+ // Note:此时WirelessDevice状态还处在Unavailable,但还是将该设备加载 -+ if (dev->state() == Device::Unavailable) -+ { -+ } -+ m_wirelessDeviceList << dev; -+ } -+ } -+ -+ if (m_wirelessDeviceList.count() != 0) -+ { -+ m_wirelessTrayPage = new TrayPage(m_wirelessDeviceList, this); -+ m_verticalLayout->insertWidget(-1, m_wirelessTrayPage); -+ m_verticalLayout->setMargin(0); -+ update(); -+ } -+ } -+} -+ - void NetworkTray::handleNetworkManagerStatusChanged(NetworkManager::Status status) - { - setTrayIcon(status); -@@ -446,14 +459,15 @@ void NetworkTray::reloadWiredTrayPage() - delete m_wiredTrayPage; - m_wiredTrayPage = nullptr; - m_wiredDeviceList.clear(); -+ - getAvailableDeviceList(); - if (m_wiredDeviceList.count() != 0) -+ { - m_wiredTrayPage = new TrayPage(m_wiredDeviceList, this); -- -- // XXX:待修改,使有线widget一直在最上层 -- m_verticalLayout->insertWidget(0, m_wiredTrayPage); -- m_verticalLayout->setMargin(0); -- update(); -+ m_verticalLayout->insertWidget(0, m_wiredTrayPage); -+ m_verticalLayout->setMargin(0); -+ update(); -+ } - } - - void NetworkTray::reloadWirelessTrayPage() -@@ -465,10 +479,12 @@ void NetworkTray::reloadWirelessTrayPage() - - getAvailableDeviceList(); - if (m_wirelessDeviceList.count() != 0) -+ { - m_wirelessTrayPage = new TrayPage(m_wirelessDeviceList, this); -- m_verticalLayout->insertWidget(-1, m_wirelessTrayPage); -- m_verticalLayout->setMargin(0); -- update(); -+ m_verticalLayout->insertWidget(-1, m_wirelessTrayPage); -+ m_verticalLayout->setMargin(0); -+ update(); -+ } - } - - void NetworkTray::handleAdjustedTraySize(QSize sizeHint) -@@ -476,8 +492,8 @@ void NetworkTray::handleAdjustedTraySize(QSize sizeHint) - // this->sizeHint() 更新不及时,需要等一段时间 - QTimer::singleShot(100, this, [=]() - { -- adjustSize(); -- setTrayPagePos(); }); -+ adjustSize(); -+ setTrayPagePos(); }); - } - - void NetworkTray::handleThemeChanged(Kiran::PaletteType paletteType) -diff --git a/plugins/network/src/tray/network-tray.h b/plugins/network/src/tray/network-tray.h -index 7601e4f..23a0a9b 100644 ---- a/plugins/network/src/tray/network-tray.h -+++ b/plugins/network/src/tray/network-tray.h -@@ -23,7 +23,6 @@ - #include - #include "kiran-rounded-tray-popup/kiran-rounded-tray-popup.h" - -- - class WiredTrayWidget; - class WirelessTrayWidget; - class StatusNotifierManagerInterface; -@@ -65,6 +64,7 @@ public slots: - NetworkManager::Device::State oldstate, - NetworkManager::Device::StateChangeReason reason); - void handleDeviceManagedChanged(); -+ void handleWirelessEnabledChanged(bool enable); - - void handleAdjustedTraySize(QSize sizeHint); - -diff --git a/plugins/network/src/tray/tray-page.cpp b/plugins/network/src/tray/tray-page.cpp -index 7415dc8..c854d36 100644 ---- a/plugins/network/src/tray/tray-page.cpp -+++ b/plugins/network/src/tray/tray-page.cpp -@@ -33,11 +33,15 @@ TrayPage::~TrayPage() - - void TrayPage::init() - { -- Device::Type deviceType = m_deviceList.at(0)->type(); -- initUI(deviceType); -- initConnection(); -+ if (m_deviceList.count() != 0) -+ { -+ Device::Type deviceType = m_deviceList.value(0)->type(); -+ initUI(deviceType); -+ initConnection(); -+ } - } - -+// XXX:修改初始化 - void TrayPage::initUI(Device::Type deviceType) - { - setFixedWidth(240); -@@ -50,7 +54,7 @@ void TrayPage::initUI(Device::Type deviceType) - // { - // setSingleDeviceWidget(deviceType); - // } -- if(m_deviceList.count() != 0) -+ if (m_deviceList.count() != 0) - { - setMultiDeviceWidget(deviceType); - } -@@ -133,12 +137,9 @@ void TrayPage::handleDeviceComboBoxChanged(int index) - QStringList TrayPage::devicePathList() - { - QStringList devicePathList; -- KLOG_DEBUG() << "m_deviceList:" << m_deviceList; - for (Device::Ptr device : m_deviceList) - { -- if (device == nullptr) -- KLOG_DEBUG() << "device == nullptr"; -- else -+ if (device != nullptr) - devicePathList << device->uni(); - } - KLOG_DEBUG() << "devicePathList:" << devicePathList; -diff --git a/plugins/network/src/tray/wireless-tray-widget.cpp b/plugins/network/src/tray/wireless-tray-widget.cpp -index 2a480b1..32a9791 100644 ---- a/plugins/network/src/tray/wireless-tray-widget.cpp -+++ b/plugins/network/src/tray/wireless-tray-widget.cpp -@@ -43,10 +43,9 @@ void WirelessTrayWidget::init() - initUI(); - initConnection(); - -- ActiveConnection::Ptr activatedConnection = m_wirelessDevice->activeConnection(); -- if(!activatedConnection.isNull()) -+ ActiveConnection::Ptr activatedConnection = m_wirelessDevice->activeConnection(); -+ if (!activatedConnection.isNull()) - connect(activatedConnection.data(), &ActiveConnection::stateChanged, this, &WirelessTrayWidget::handleActiveConnectionStateChanged, Qt::UniqueConnection); -- - } - - void WirelessTrayWidget::initUI() -@@ -70,7 +69,7 @@ void WirelessTrayWidget::initConnection() - connect(m_connectionLists, &ConnectionLists::sendPasswordToWirelessSetting, this, &WirelessTrayWidget::setSecurityPskAndActivateWirelessConnection); - connect(m_connectionLists, &ConnectionLists::sendSsidToWireless, this, &WirelessTrayWidget::handleRequestConnectHiddenNetwork); - -- connect(m_devicePtr.data(), &Device::stateChanged, this, &WirelessTrayWidget::handleDeviceStateChanged,Qt::UniqueConnection); -+ connect(m_devicePtr.data(), &Device::stateChanged, this, &WirelessTrayWidget::handleDeviceStateChanged, Qt::UniqueConnection); - connect(m_connectionLists, &ConnectionLists::adjustedTraySize, this, &WirelessTrayWidget::adjustedTraySize); - } - -@@ -110,7 +109,7 @@ void WirelessTrayWidget::handleRequestConnectHiddenNetwork(const QString &ssid) - { - KLOG_DEBUG() << "Hidden networks have been explicitly detected,return"; - StatusNotification::connectitonHiddenNetworkFailedNotify(ssid); -- -+ - QListWidgetItem *item = m_connectionLists->getHiddenNetworkItem(); - m_connectionLists->itemSimpleStatus(item); - return; -@@ -148,7 +147,7 @@ void WirelessTrayWidget::getWirelessAvailableConnections(const QString &devicePa - } - - // 在已存在WirelessSetting配置的情况下,激活连接.(连接过一次后会创建WirelessSetting配置) --//Note:不存在的无线网络或者配置,能activate成功,但是返回的ActivateConnection可能会空,从而导致错误 -+// Note:不存在的无线网络或者配置,能activate成功,但是返回的ActivateConnection可能会空,从而导致错误 - void WirelessTrayWidget::activateWirelessConnection(const QString &connectionPath, const QString &devicePath, const QString &accessPointPath) - { - if (!connectionPath.isEmpty()) -@@ -164,7 +163,7 @@ void WirelessTrayWidget::activateWirelessConnection(const QString &connectionPat - StatusNotification::connectitonFailedNotify(connectionPath); - } - else -- KLOG_DEBUG() << "reply.reply():" << reply.reply(); -+ KLOG_DEBUG() << "reply.reply():" << reply.reply(); - } - } - -@@ -226,13 +225,13 @@ void WirelessTrayWidget::createConnectionSettings(const QString &ssid, const QSt - } - } - --//Note:不存在的无线网络或者配置,activate成功,但是返回的ActivateConnection可能会空,从而导致错误 -+// Note:不存在的无线网络或者配置,activate成功,但是返回的ActivateConnection可能会空,从而导致错误 - void WirelessTrayWidget::addAndActivateWirelessConnection(ConnectionSettings::Ptr connectionSettings) - { - const QString ssid = m_connectionInfo.wirelessInfo.ssid; - const QString accessPointPath = m_connectionInfo.wirelessInfo.accessPointPath; - KLOG_DEBUG() << "accessPointPath" << accessPointPath; -- KLOG_DEBUG() << "wireless device path:" << m_devicePath; -+ KLOG_DEBUG() << "wireless device path:" << m_devicePath; - QDBusPendingReply reply = - NetworkManager::addAndActivateConnection(connectionSettings->toMap(), m_devicePath, accessPointPath); - -@@ -260,9 +259,9 @@ void WirelessTrayWidget::handleRequestDisconnect(const QString &activatedConnect - } - - /*FIX: --*由于ActiveConnection为空,暂时无法获得有效的连接信息 --*存在多个网卡时,由于无法确定是那个该ActiveConnection来自那个设备,则多个设备都会发送通知 --*/ -+ *由于ActiveConnection为空,暂时无法获得有效的连接信息 -+ *存在多个网卡时,由于无法确定是那个该ActiveConnection来自那个设备,则多个设备都会发送通知 -+ */ - void WirelessTrayWidget::handleActiveConnectionAdded(const QString &path) - { - //多个网卡,还需要判断设备 -@@ -270,12 +269,12 @@ void WirelessTrayWidget::handleActiveConnectionAdded(const QString &path) - ActiveConnection::Ptr activatedConnection = findActiveConnection(path); - if (activatedConnection == nullptr) - { -- //Note:目前已知连接一个不存在的无线网络时,activatedConnection为空 -+ // Note:目前已知连接一个不存在的无线网络时,activatedConnection为空 - StatusNotification::connectitonFailedNotify(); - KLOG_DEBUG() << "new add activatedConnection is nullptr"; - return; - } -- -+ - QStringList deviceList = activatedConnection->devices(); - if ((activatedConnection->type() == ConnectionSettings::ConnectionType::Wireless) && deviceList.contains(m_devicePath)) - { -@@ -296,7 +295,7 @@ void WirelessTrayWidget::handleActiveConnectionAdded(const QString &path) - m_connectionLists->itemSimpleStatus(item); - } - connect(activatedConnection.data(), &ActiveConnection::stateChanged, this, &WirelessTrayWidget::handleActiveConnectionStateChanged, Qt::UniqueConnection); -- } -+ } - } - - void WirelessTrayWidget::handleActiveConnectionRemoved(const QString &path) -@@ -310,7 +309,7 @@ void WirelessTrayWidget::handleStateActivating(const QString &activatedPath) - ActiveConnection::Ptr activatedConnection = findActiveConnection(activatedPath); - if (activatedConnection == nullptr) - { -- //Note:目前已知连接一个不存在的无线网络时,activatedConnection为空 -+ // Note:目前已知连接一个不存在的无线网络时,activatedConnection为空 - StatusNotification::connectitonFailedNotify(); - KLOG_DEBUG() << "activatedConnection == nullptr"; - return; -@@ -357,7 +356,6 @@ void WirelessTrayWidget::handleStateActivated(const QString &activatedPath) - //连接成功后手动rescan - QDBusPendingReply<> replyRequestScan = m_wirelessDevice->requestScan(); - replyRequestScan.waitForFinished(); -- KLOG_DEBUG() << "--------------------------StateActivated requestScan"; - if (replyRequestScan.isError()) - { - KLOG_DEBUG() << "StateActivated requestScan error:" << replyRequestScan.error(); -@@ -447,8 +445,7 @@ void WirelessTrayWidget::handleRequestIgnore(const QString &activatedConnectionP - QDBusPendingReply<> replyRemove = connection->remove(); - replyRemove.waitForFinished(); - if (replyRemove.isError()) -- KLOG_INFO() << "Remove connection failed:" << replyRemove.error(); -- }); -+ KLOG_INFO() << "Remove connection failed:" << replyRemove.error(); }); - } - - void WirelessTrayWidget::setSecurityPskAndActivateWirelessConnection(const QString &password) --- -2.33.0 - diff --git a/0002-refactor-systeminfo-update-systeminfo-plugin-dialog-.patch b/0002-refactor-systeminfo-update-systeminfo-plugin-dialog-.patch deleted file mode 100644 index 4a87e362119ea53d4e721711043a95510bddf002..0000000000000000000000000000000000000000 --- a/0002-refactor-systeminfo-update-systeminfo-plugin-dialog-.patch +++ /dev/null @@ -1,236 +0,0 @@ -From 01ff81b4cfe1749f685f33798c3394f62180353f Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Wed, 3 Aug 2022 17:15:21 +0800 -Subject: [PATCH 2/2] refactor(systeminfo): update systeminfo plugin dialog - style -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 更新统一系统信息页面插件弹窗风格样式 - -Closes #I5H3YX ---- - .../change-host-name-widget.ui | 60 ++++++++++++++++--- - .../system-information/license-agreement.ui | 51 ++++++++++++---- - 2 files changed, 91 insertions(+), 20 deletions(-) - -diff --git a/plugins/system/src/pages/system-information/change-host-name-widget.ui b/plugins/system/src/pages/system-information/change-host-name-widget.ui -index f56bb94..a677bbc 100644 ---- a/plugins/system/src/pages/system-information/change-host-name-widget.ui -+++ b/plugins/system/src/pages/system-information/change-host-name-widget.ui -@@ -122,7 +122,7 @@ - - - -- 58 -+ 0 - - - 0 -@@ -136,18 +136,31 @@ - - 0 - -+ -+ -+ -+ Qt::Horizontal -+ -+ -+ -+ 40 -+ 20 -+ -+ -+ -+ - - - - -- 192 -- 60 -+ 110 -+ 40 - - - - -- 192 -- 60 -+ 110 -+ 40 - - - -@@ -155,18 +168,34 @@ - - - -+ -+ -+ -+ Qt::Horizontal -+ -+ -+ QSizePolicy::Fixed -+ -+ -+ -+ 40 -+ 20 -+ -+ -+ -+ - - - - -- 192 -- 60 -+ 110 -+ 40 - - - - -- 192 -- 60 -+ 110 -+ 40 - - - -@@ -174,6 +203,19 @@ - - - -+ -+ -+ -+ Qt::Horizontal -+ -+ -+ -+ 40 -+ 20 -+ -+ -+ -+ - - - -diff --git a/plugins/system/src/pages/system-information/license-agreement.ui b/plugins/system/src/pages/system-information/license-agreement.ui -index 83f20d2..727cc85 100644 ---- a/plugins/system/src/pages/system-information/license-agreement.ui -+++ b/plugins/system/src/pages/system-information/license-agreement.ui -@@ -76,15 +76,15 @@ - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> - p, li { white-space: pre-wrap; } --</style></head><body style=" font-family:'Noto Sans CJK SC'; font-size:9pt; font-weight:400; font-style:normal;"> --<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> -+</style></head><body style=" font-family:'Noto Sans CJK SC'; font-size:10pt; font-weight:400; font-style:normal;"> -+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;"><br /></p></body></html> - - - - - - -- 24 -+ 0 - - - 24 -@@ -92,18 +92,31 @@ p, li { white-space: pre-wrap; } - - 24 - -+ -+ -+ -+ Qt::Horizontal -+ -+ -+ -+ 40 -+ 20 -+ -+ -+ -+ - - - - -- 252 -- 60 -+ 110 -+ 40 - - - - -- 252 -- 60 -+ 110 -+ 40 - - - -@@ -116,6 +129,9 @@ p, li { white-space: pre-wrap; } - - Qt::Horizontal - -+ -+ QSizePolicy::Fixed -+ - - - 40 -@@ -134,14 +150,14 @@ p, li { white-space: pre-wrap; } - - - -- 252 -- 60 -+ 110 -+ 40 - - - - -- 252 -- 60 -+ 110 -+ 40 - - - -@@ -149,6 +165,19 @@ p, li { white-space: pre-wrap; } - - - -+ -+ -+ -+ Qt::Horizontal -+ -+ -+ -+ 40 -+ 20 -+ -+ -+ -+ - - - --- -2.33.0 - diff --git a/0003-fix-network-fix-the-problem-of-network-and-details-c.patch b/0003-fix-network-fix-the-problem-of-network-and-details-c.patch deleted file mode 100644 index 8e6cf403a91772c5a6449129ad2c869d3bf10da8..0000000000000000000000000000000000000000 --- a/0003-fix-network-fix-the-problem-of-network-and-details-c.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 50c2ccba7af88dfe335a5dfdeff54e4371238316 Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Fri, 19 Aug 2022 15:24:13 +0800 -Subject: [PATCH 3/7] fix(network):fix the problem of network and details - corresponding error -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 修复网络详情页面中网络与详情对应错误 - -Close #I5M0L9 ---- - plugins/network/src/plugin/details-page.cpp | 10 ++++++---- - plugins/network/src/plugin/details-page.h | 2 +- - 2 files changed, 7 insertions(+), 5 deletions(-) - -diff --git a/plugins/network/src/plugin/details-page.cpp b/plugins/network/src/plugin/details-page.cpp -index dfee3f6..5ba4d12 100644 ---- a/plugins/network/src/plugin/details-page.cpp -+++ b/plugins/network/src/plugin/details-page.cpp -@@ -75,11 +75,11 @@ void DetailsPage::initMultiConnectionDetailsWidget() - QWidget *widget = new ConnectionDetailsWidget(device, this); - ui->stackedWidget->addWidget(widget); - } -- connect(ui->activatedConnectionComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, -- &DetailsPage::handleActivatedConnectionComboBoxChanged); -+ connect(ui->activatedConnectionComboBox, QOverload::of(&QComboBox::activated), this, -+ &DetailsPage::handleActivatedConnectionComboBoxActivated, Qt::UniqueConnection); - } - --void DetailsPage::handleActivatedConnectionComboBoxChanged(int index) -+void DetailsPage::handleActivatedConnectionComboBoxActivated(int index) - { - ui->stackedWidget->setCurrentIndex(index); - } -@@ -131,10 +131,12 @@ void DetailsPage::clear() - { - m_deviceList.clear(); - ui->activatedConnectionComboBox->clear(); -- for (int i = 0; i < ui->stackedWidget->count(); ++i) -+ int count = ui->stackedWidget->count(); -+ for (int i = 0; i < count; i++) - { - QWidget *widget = ui->stackedWidget->currentWidget(); - ui->stackedWidget->removeWidget(widget); -+ widget->deleteLater(); - } - } - -diff --git a/plugins/network/src/plugin/details-page.h b/plugins/network/src/plugin/details-page.h -index e7cb744..f0cceb1 100644 ---- a/plugins/network/src/plugin/details-page.h -+++ b/plugins/network/src/plugin/details-page.h -@@ -39,7 +39,7 @@ public: - void reload(); - - public slots: -- void handleActivatedConnectionComboBoxChanged(int index); -+ void handleActivatedConnectionComboBoxActivated(int index); - void handleDeviceAdded(const QString &devicePath); - void handleDeviceRemoved(const QString &devicePath); - void handleActiveConnectionAdded(const QString &activeConnectionPath); --- -2.33.0 - diff --git a/0004-fix-network-Add-error-prompt-box-when-saving-configu.patch b/0004-fix-network-Add-error-prompt-box-when-saving-configu.patch deleted file mode 100644 index 823d6ff67a5f0f6a9de59acc43b6c85b43913607..0000000000000000000000000000000000000000 --- a/0004-fix-network-Add-error-prompt-box-when-saving-configu.patch +++ /dev/null @@ -1,532 +0,0 @@ -From 4b63a44d04c18418076fe7570887e601b499671c Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Tue, 23 Aug 2022 09:19:05 +0800 -Subject: [PATCH 4/7] fix(network):Add error prompt box when saving - configuration -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 保存配置时,增加错误提示框 - -Close #I5GYQD ---- - .../src/plugin/manager/wired-manager.cpp | 2 + - .../setting-widget/connection-name-widget.cpp | 16 ++- - .../plugin/setting-widget/ethernet-widget.cpp | 27 +++-- - .../src/plugin/setting-widget/ipv4-widget.cpp | 105 ++++++++++++++---- - .../src/plugin/setting-widget/ipv6-widget.cpp | 62 +++++++++-- - .../src/plugin/settings/setting-page.cpp | 10 +- - .../plugin/settings/wired-setting-page.cpp | 7 +- - 7 files changed, 180 insertions(+), 49 deletions(-) - -diff --git a/plugins/network/src/plugin/manager/wired-manager.cpp b/plugins/network/src/plugin/manager/wired-manager.cpp -index cfd11b2..9ceeb89 100644 ---- a/plugins/network/src/plugin/manager/wired-manager.cpp -+++ b/plugins/network/src/plugin/manager/wired-manager.cpp -@@ -180,7 +180,9 @@ void WiredManager::handleSaveButtonClicked() - handleReturnPreviousPage(); - } - else -+ { - KLOG_DEBUG() << "Invalid input exists"; -+ } - } - - void WiredManager::handleConnectionUpdated(const QString &path) -diff --git a/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp b/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp -index 71b3626..5ee8b62 100644 ---- a/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp -+++ b/plugins/network/src/plugin/setting-widget/connection-name-widget.cpp -@@ -13,6 +13,7 @@ - */ - - #include "connection-name-widget.h" -+#include - #include - #include - #include -@@ -82,7 +83,7 @@ void ConnectionNameWidget::showSettings(ConnectionSettings::ConnectionType conne - } - else if (m_connectionType == ConnectionSettings::Wireless) - { -- if(m_connectionSettings != nullptr) -+ if (m_connectionSettings != nullptr) - { - WirelessSetting::Ptr wirelessSetting = m_connectionSettings->setting(Setting::Wireless).dynamicCast(); - ui->connectionName->setText(wirelessSetting->ssid()); -@@ -91,8 +92,8 @@ void ConnectionNameWidget::showSettings(ConnectionSettings::ConnectionType conne - } - else - { --// ui->connectionName->setEnabled(true); --// m_autoConnection->setChecked(true); -+ // ui->connectionName->setEnabled(true); -+ // m_autoConnection->setChecked(true); - } - } - } -@@ -173,11 +174,16 @@ void ConnectionNameWidget::clearPtr() - - bool ConnectionNameWidget::isInputValid() - { -- bool valid = true; - QString nameStr = ui->connectionName->text(); - if (nameStr.isEmpty()) - { -+ QString error = QString(tr("Connection name can not be empty")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ -+ KLOG_DEBUG() << "Connection name cannot be empty"; - return false; - } -- return valid; -+ return true; - } -\ No newline at end of file -diff --git a/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp b/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp -index 55c5cd8..ae43125 100644 ---- a/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp -+++ b/plugins/network/src/plugin/setting-widget/ethernet-widget.cpp -@@ -13,11 +13,13 @@ - */ - - #include "ethernet-widget.h" -+#include - #include - #include - #include - #include - #include "ui_ethernet-widget.h" -+ - using namespace NetworkManager; - - EthernetWidget::EthernetWidget(QWidget *parent) : QWidget(parent), ui(new Ui::EthernetWidget) -@@ -38,7 +40,7 @@ void EthernetWidget::initUI() - ui->customMTU->setVisible(false); - ui->customMTU->setMinimum(0); - ui->customMTU->setMaximum(10000); -- //UserData设为空"",为了匹配Mac地址为空的情况 -+ // UserData设为空"",为了匹配Mac地址为空的情况 - ui->deviceMac->addItem(tr("No device specified"), ""); - initEthernetMacComboBox(); - } -@@ -75,7 +77,7 @@ void EthernetWidget::setWiredSetting(const WiredSetting::Ptr &wiredSetting) - - void EthernetWidget::saveSettings() - { -- if(m_wiredSetting != nullptr) -+ if (m_wiredSetting != nullptr) - { - QString macAddress = ui->deviceMac->currentData().toString(); - QString cloneMac = ui->cloneDeviceMac->text(); -@@ -89,7 +91,7 @@ void EthernetWidget::saveSettings() - - void EthernetWidget::showSettings() - { -- if(m_wiredSetting != nullptr) -+ if (m_wiredSetting != nullptr) - { - QString deviceMac = m_wiredSetting->macAddress().toHex(':').toUpper(); - QString cloneDeviceMac = m_wiredSetting->clonedMacAddress().toHex(':').toUpper(); -@@ -132,15 +134,26 @@ void EthernetWidget::clearPtr() - - bool EthernetWidget::isInputValid() - { -- isCloneMacValid(ui->cloneDeviceMac->text()); -- return false; -+ if (!isCloneMacValid(ui->cloneDeviceMac->text())) -+ { -+ QString error = QString(tr("Clone Mac invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ -+ KLOG_DEBUG() << "Clone Mac invalid"; -+ return false; -+ } -+ return true; - } - - bool EthernetWidget::isCloneMacValid(const QString &cloneMac) - { -- if (cloneMac.isEmpty()) { -+ if (cloneMac.isEmpty()) -+ { - return true; - } -- bool matched = QRegExp("^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$").exactMatch(cloneMac); -+ bool matched = QRegExp("^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$").exactMatch(cloneMac); -+ - return matched; - } -diff --git a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp -index 30f7844..7f28576 100644 ---- a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp -+++ b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp -@@ -13,6 +13,7 @@ - */ - - #include "ipv4-widget.h" -+#include - #include - #include - #include "ui_ipv4-widget.h" -@@ -65,7 +66,6 @@ void Ipv4Widget::setIpv4Setting(const Ipv4Setting::Ptr &ipv4Setting) - m_ipv4Setting = ipv4Setting; - } - --// TODO:错误提示弹窗 - void Ipv4Widget::saveSettings() - { - if (m_ipv4Setting != nullptr) -@@ -85,7 +85,6 @@ void Ipv4Widget::saveSettings() - m_ipv4Setting->setMethod(method); - - ipv4Address.setIp(QHostAddress(ui->ipv4Address->text())); -- // XXX:输入合法性检测 - QString netMask = ui->ipv4Netmask->text(); - if (!netMask.contains(".")) - { -@@ -134,8 +133,11 @@ void Ipv4Widget::showSettings() - { - if (m_ipv4Setting != nullptr) - { -+ KLOG_DEBUG() << "m_ipv4Setting->method():" << m_ipv4Setting->method(); -+ - if (m_ipv4Setting->method() == Ipv4Setting::ConfigMethod::Automatic) - { -+ KLOG_DEBUG() << "Ipv4Setting::ConfigMethod::Automatic"; - resetSettings(); - } - else if (m_ipv4Setting->method() == Ipv4Setting::ConfigMethod::Manual) -@@ -143,11 +145,15 @@ void Ipv4Widget::showSettings() - int ipv4MethodIndex = ui->ipv4Method->findData(m_ipv4Setting->method()); - ui->ipv4Method->setCurrentIndex(ipv4MethodIndex); - // xxx:取addresses的方式有待改进 -- IpAddress ipv4Address = m_ipv4Setting->addresses().at(0); -+ IpAddress ipv4Address = m_ipv4Setting->addresses().value(0); - QString address = ipv4Address.ip().toString(); - QString netmask = ipv4Address.netmask().toString(); - QString gateway = ipv4Address.gateway().toString(); - -+ KLOG_DEBUG() << "address:" << address; -+ KLOG_DEBUG() << "netmask:" << netmask; -+ KLOG_DEBUG() << "gateway:" << gateway; -+ - ui->ipv4Address->setText(address); - ui->ipv4Netmask->setText(netmask); - ui->ipv4Gateway->setText(gateway); -@@ -188,57 +194,108 @@ void Ipv4Widget::clearPtr() - } - - // TODO:验证功能待完善 -+// XXX:输入验证提示暂时先用弹框,之后修改 - bool Ipv4Widget::isInputValid() - { - Ipv4Setting::ConfigMethod configMethod = ui->ipv4Method->currentData().value(); -- bool valid = true; -+ - if (configMethod == Ipv4Setting::ConfigMethod::Automatic) - { -- isIpv4AddressValid(ui->ipv4PreferredDNS->text()); -- isIpv4AddressValid(ui->ipv4AlternateDNS->text()); - } - else if (configMethod == Ipv4Setting::ConfigMethod::Manual) - { -- QString ipv4 = ui->ipv4Address->text(); -- QString netMask = ui->ipv4Netmask->text(); -+ QString ipv4 = ui->ipv4Address->text(); -+ QString netMask = ui->ipv4Netmask->text(); -+ QString ipv4Gateway = ui->ipv4Gateway->text(); - - if (ipv4.isEmpty()) - { -- valid = false; -- KLOG_DEBUG() << "Ipv4 address cannot be empty"; -+ QString error = QString(tr("Ipv4 address can not be empty")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ -+ KLOG_DEBUG() << "Ipv4 address can not be empty"; -+ return false; - } - else - { -- if(!isIpv4AddressValid(ipv4)) -+ if (!isIpv4AddressValid(ipv4)) - { -- valid = false; -- KLOG_DEBUG() << "Ipv4Address invalid"; -+ QString error = QString(tr("Ipv4 Address invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ KLOG_DEBUG() << "Ipv4 Address invalid"; -+ return false; - } - } -- -+ - if (netMask.isEmpty()) - { -- valid = false; -+ QString error = QString(tr("NetMask can not be empty")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); - KLOG_DEBUG() << "NetMask cannot be empty"; -+ return false; - } - else - { -- if(!isIpv4NetmaskValid(netMask)) -+ if (!isIpv4NetmaskValid(netMask)) - { -- valid = false; -+ QString error = QString(tr("Netmask invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); - KLOG_DEBUG() << "Netmask invalid"; -+ return false; - } - } - -- ui->ipv4Gateway->text(); -- ui->ipv4PreferredDNS->text(); -- ui->ipv4AlternateDNS->text(); -- isIpv4AddressValid(ui->ipv4Gateway->text()); -- isIpv4AddressValid(ui->ipv4PreferredDNS->text()); -- isIpv4AddressValid(ui->ipv4AlternateDNS->text()); -+ if (!ipv4Gateway.isEmpty()) -+ { -+ if (!isIpv4AddressValid(ipv4Gateway)) -+ { -+ QString error = QString(tr("Ipv4 Gateway invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ KLOG_DEBUG() << "Ipv4 Netmask invalid"; -+ return false; -+ } -+ } -+ } - -+ QString preferredDNS = ui->ipv4PreferredDNS->text(); -+ if (!preferredDNS.isEmpty()) -+ { -+ if (!isIpv4AddressValid(preferredDNS)) -+ { -+ QString error = QString(tr("Ipv4 Preferred DNS invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ KLOG_DEBUG() << "Ipv4 Preferred DNS invalid"; -+ return false; -+ } - } -- return valid; -+ -+ QString alternateDNS = ui->ipv4AlternateDNS->text(); -+ if (!alternateDNS.isEmpty()) -+ { -+ if (!isIpv4AddressValid(alternateDNS)) -+ { -+ QString error = QString(tr("Ipv4 Alternate DNS invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ KLOG_DEBUG() << "Ipv4 Alternate DNS invalid"; -+ return false; -+ } -+ } -+ -+ return true; - } - - bool Ipv4Widget::isIpv4AddressValid(const QString &address) -diff --git a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp -index a703f95..a9f1676 100644 ---- a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp -+++ b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp -@@ -13,6 +13,7 @@ - */ - - #include "ipv6-widget.h" -+#include - #include - #include "ui_ipv6-widget.h" - using namespace NetworkManager; -@@ -177,7 +178,7 @@ void Ipv6Widget::clearPtr() - bool Ipv6Widget::isInputValid() - { - Ipv6Setting::ConfigMethod configMethod = ui->ipv6Method->currentData().value(); -- bool valid = true; -+ - if (configMethod == Ipv6Setting::ConfigMethod::Ignored) - { - } -@@ -189,24 +190,71 @@ bool Ipv6Widget::isInputValid() - QString ipv6 = ui->ipv6Address->text(); - if (ipv6.isEmpty()) - { -- valid = false; -+ QString error = QString(tr("Ipv6 address can not be empty")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ - KLOG_DEBUG() << "Ipv6 Address cannot be empty"; -+ return false; - } - else - { - if (!isIpv6AddressValid(ipv6)) - { -- valid = false; -+ QString error = QString(tr("Ipv6 address invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); - KLOG_DEBUG() << "Ipv6Address invalid"; -+ return false; - } - } - -- isIpv6AddressValid(ui->ipv6Gateway->text()); -- isIpv6AddressValid(ui->ipv6AlternateDNS->text()); -- isIpv6AddressValid(ui->ipv6PreferredDNS->text()); -+ QString ipv6Gateway = ui->ipv6Gateway->text(); -+ if (!ipv6Gateway.isEmpty()) -+ { -+ if (!isIpv6AddressValid(ipv6Gateway)) -+ { -+ QString error = QString(tr("Ipv6 Gateway invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ KLOG_DEBUG() << "Ipv6 Netmask invalid"; -+ return false; -+ } -+ } - } - -- return valid; -+ QString preferredDNS = ui->ipv6PreferredDNS->text(); -+ if (!preferredDNS.isEmpty()) -+ { -+ if (!isIpv6AddressValid(preferredDNS)) -+ { -+ QString error = QString(tr("Ipv6 Preferred DNS invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ KLOG_DEBUG() << "Ipv6 Preferred DNS invalid"; -+ return false; -+ } -+ } -+ -+ QString alternateDNS = ui->ipv6AlternateDNS->text(); -+ if (!alternateDNS.isEmpty()) -+ { -+ if (!isIpv6AddressValid(alternateDNS)) -+ { -+ QString error = QString(tr("Ipv6 Alternate DNS invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ KLOG_DEBUG() << "Ipv6 Alternate DNS invalid"; -+ return false; -+ } -+ } -+ -+ return true; - } - - bool Ipv6Widget::isIpv6AddressValid(const QString &address) -diff --git a/plugins/network/src/plugin/settings/setting-page.cpp b/plugins/network/src/plugin/settings/setting-page.cpp -index 241f46c..dd84209 100644 ---- a/plugins/network/src/plugin/settings/setting-page.cpp -+++ b/plugins/network/src/plugin/settings/setting-page.cpp -@@ -76,11 +76,12 @@ void SettingPage::setConnectionSettings(const ConnectionSettings::Ptr& other) - - void SettingPage::handleSaveButtonClicked(ConnectionSettings::ConnectionType connectionType) - { -- if(m_connectionSettings == nullptr) -+ if (m_connectionSettings == nullptr) - { - initConnectionSettings(connectionType); - initSettingPage(); - saveSettingPage(); -+ KLOG_DEBUG() << " m_connectionSettings->toMap():" << m_connectionSettings->toMap(); - QDBusPendingReply replyAdd = NetworkManager::addConnection(m_connectionSettings->toMap()); - replyAdd.waitForFinished(); - if (replyAdd.isError()) -@@ -88,13 +89,16 @@ void SettingPage::handleSaveButtonClicked(ConnectionSettings::ConnectionType con - KLOG_DEBUG() << "add connection failed," << replyAdd.error(); - } - else -- KLOG_DEBUG() << "add new connection"; -+ { -+ KLOG_DEBUG() << "add new connection reply:" << replyAdd.reply(); -+ } - } - else - { - saveSettingPage(); - //只有无线网络使用自定义settingUpdated信号,因为未连接无线网络前不存在本地Setting,无法在初始化时监听信号 -- connect(m_connection.data(),&NetworkManager::Connection::updated,this,&SettingPage::settingUpdated,Qt::UniqueConnection); -+ connect(m_connection.data(), &NetworkManager::Connection::updated, this, &SettingPage::settingUpdated, Qt::UniqueConnection); -+ KLOG_DEBUG() << "m_connectionSettings->toMap():" << m_connectionSettings->toMap(); - QDBusPendingReply<> replyUpdate = m_connection->update(m_connectionSettings->toMap()); - replyUpdate.waitForFinished(); - if (replyUpdate.isError()) -diff --git a/plugins/network/src/plugin/settings/wired-setting-page.cpp b/plugins/network/src/plugin/settings/wired-setting-page.cpp -index 86ec372..4466468 100644 ---- a/plugins/network/src/plugin/settings/wired-setting-page.cpp -+++ b/plugins/network/src/plugin/settings/wired-setting-page.cpp -@@ -20,18 +20,17 @@ - #include - #include - #include "ui_wired-setting-page.h" -+ - using namespace NetworkManager; - - WiredSettingPage::WiredSettingPage(QWidget *parent) : SettingPage(parent), ui(new Ui::WiredSettingPage) - { - ui->setupUi(this); - initConnecton(); -- KLOG_DEBUG() << "WiredSettingPage::WiredSettingPage(QWidget *parent)"; - } - - WiredSettingPage::~WiredSettingPage() - { -- KLOG_DEBUG() << "WiredSettingPage::~WiredSettingPage()"; - delete ui; - } - -@@ -54,6 +53,7 @@ void WiredSettingPage::initSpecificSettings() - m_wiredSetting = m_connectionSettings->setting(Setting::SettingType::Wired).dynamicCast(); - } - -+// TODO:修改命名 - void WiredSettingPage::initWidgets() - { - ui->connectionNameWidget->setConnectionSettings(m_connectionSettings); -@@ -109,7 +109,8 @@ void WiredSettingPage::clearPtr() - - bool WiredSettingPage::isInputValid() - { -- if (ui->ipv4Widget->isInputValid() && ui->ipv6Widget->isInputValid() && ui->connectionNameWidget->isInputValid()) -+ if (ui->ipv4Widget->isInputValid() && ui->ipv6Widget->isInputValid() && -+ ui->connectionNameWidget->isInputValid() && ui->ethernetWidget->isInputValid()) - return true; - else - return false; --- -2.33.0 - diff --git a/0005-fix-network-fix-invalid-configuration-created-for-th.patch b/0005-fix-network-fix-invalid-configuration-created-for-th.patch deleted file mode 100644 index f7bce0ca77450577ed5730eb45b4595d4fdc2bf1..0000000000000000000000000000000000000000 --- a/0005-fix-network-fix-invalid-configuration-created-for-th.patch +++ /dev/null @@ -1,466 +0,0 @@ -From 78bd84e3e5f9626e363e295a1f175c6f2f816ffe Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Tue, 23 Aug 2022 11:45:12 +0800 -Subject: [PATCH 5/7] fix(network):fix invalid configuration created for the - first time -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 修复初次创建配置失效的问题 ---- - .../src/plugin/setting-widget/ipv6-widget.cpp | 27 ++++++++++--------- - .../src/plugin/settings/setting-page.cpp | 4 +-- - .../src/plugin/settings/setting-page.h | 4 +-- - .../plugin/settings/vpn/vpn-l2tp-setting.cpp | 17 ++++++------ - .../plugin/settings/vpn/vpn-l2tp-setting.h | 5 ++-- - .../plugin/settings/vpn/vpn-pptp-setting.cpp | 18 ++++++------- - .../plugin/settings/vpn/vpn-pptp-setting.h | 5 ++-- - .../plugin/settings/wired-setting-page.cpp | 9 +++---- - .../src/plugin/settings/wired-setting-page.h | 3 +-- - .../plugin/settings/wireless-setting-page.cpp | 19 +++++++------ - .../plugin/settings/wireless-setting-page.h | 8 +++--- - 11 files changed, 54 insertions(+), 65 deletions(-) - -diff --git a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp -index a9f1676..a16bff5 100644 ---- a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp -+++ b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp -@@ -81,7 +81,6 @@ void Ipv6Widget::saveSettings() - { - m_ipv6Setting->setMethod(method); - m_ipv6Setting->setAddresses(QList()); -- return; - } - else if (method == Ipv6Setting::ConfigMethod::Automatic) - { -@@ -119,11 +118,13 @@ void Ipv6Widget::showSettings() - { - if (m_ipv6Setting->method() == Ipv6Setting::ConfigMethod::Ignored) - { -- resetSettings(); -+ int ipv6MethodIndex = ui->ipv6Method->findData(Ipv6Setting::ConfigMethod::Ignored); -+ ui->ipv6Method->setCurrentIndex(ipv6MethodIndex); - } - else if (m_ipv6Setting->method() == Ipv6Setting::ConfigMethod::Automatic) - { -- resetSettings(); -+ int ipv6MethodIndex = ui->ipv6Method->findData(Ipv6Setting::ConfigMethod::Automatic); -+ ui->ipv6Method->setCurrentIndex(ipv6MethodIndex); - } - else if (m_ipv6Setting->method() == Ipv6Setting::ConfigMethod::Manual) - { -@@ -135,24 +136,24 @@ void Ipv6Widget::showSettings() - QString ip = ipv6Address.ip().toString(); - int prefix = ipv6Address.prefixLength(); - QString gateway = ipv6Address.gateway().toString(); -- QString preferredDNS = ""; -- QString alternateDNS = ""; - - ui->ipv6Address->setText(ip); - ui->ipv6Prefix->setValue(prefix); - ui->ipv6Gateway->setText(gateway); -+ } - -- if (!m_ipv6Setting->dns().isEmpty()) -+ QString preferredDNS = ""; -+ QString alternateDNS = ""; -+ if (!m_ipv6Setting->dns().isEmpty()) -+ { -+ preferredDNS = m_ipv6Setting->dns().at(0).toString(); -+ if (m_ipv6Setting->dns().count() >= 2) - { -- preferredDNS = m_ipv6Setting->dns().at(0).toString(); -- if (m_ipv6Setting->dns().count() >= 2) -- { -- alternateDNS = m_ipv6Setting->dns().at(1).toString(); -- } -+ alternateDNS = m_ipv6Setting->dns().at(1).toString(); - } -- ui->ipv6PreferredDNS->setText(preferredDNS); -- ui->ipv6AlternateDNS->setText(alternateDNS); - } -+ ui->ipv6PreferredDNS->setText(preferredDNS); -+ ui->ipv6AlternateDNS->setText(alternateDNS); - } - else - resetSettings(); -diff --git a/plugins/network/src/plugin/settings/setting-page.cpp b/plugins/network/src/plugin/settings/setting-page.cpp -index dd84209..512b263 100644 ---- a/plugins/network/src/plugin/settings/setting-page.cpp -+++ b/plugins/network/src/plugin/settings/setting-page.cpp -@@ -81,7 +81,7 @@ void SettingPage::handleSaveButtonClicked(ConnectionSettings::ConnectionType con - initConnectionSettings(connectionType); - initSettingPage(); - saveSettingPage(); -- KLOG_DEBUG() << " m_connectionSettings->toMap():" << m_connectionSettings->toMap(); -+ - QDBusPendingReply replyAdd = NetworkManager::addConnection(m_connectionSettings->toMap()); - replyAdd.waitForFinished(); - if (replyAdd.isError()) -@@ -98,7 +98,6 @@ void SettingPage::handleSaveButtonClicked(ConnectionSettings::ConnectionType con - saveSettingPage(); - //只有无线网络使用自定义settingUpdated信号,因为未连接无线网络前不存在本地Setting,无法在初始化时监听信号 - connect(m_connection.data(), &NetworkManager::Connection::updated, this, &SettingPage::settingUpdated, Qt::UniqueConnection); -- KLOG_DEBUG() << "m_connectionSettings->toMap():" << m_connectionSettings->toMap(); - QDBusPendingReply<> replyUpdate = m_connection->update(m_connectionSettings->toMap()); - replyUpdate.waitForFinished(); - if (replyUpdate.isError()) -@@ -111,7 +110,6 @@ void SettingPage::handleSaveButtonClicked(ConnectionSettings::ConnectionType con - void SettingPage::initSettingPage() - { - initSpecificSettings(); -- initWidgets(); - } - - bool SettingPage::isInputValid() -diff --git a/plugins/network/src/plugin/settings/setting-page.h b/plugins/network/src/plugin/settings/setting-page.h -index ef5a8a7..474751a 100644 ---- a/plugins/network/src/plugin/settings/setting-page.h -+++ b/plugins/network/src/plugin/settings/setting-page.h -@@ -39,7 +39,6 @@ public: - - virtual void initSettingPage(); - virtual void initSpecificSettings() = 0; -- virtual void initWidgets() = 0; - virtual void saveSettingPage() = 0; - virtual bool isInputValid(); - -@@ -53,7 +52,6 @@ signals: - void settingChanged(); - void settingUpdated(); - -- - protected: - NetworkManager::Connection::Ptr m_connection = nullptr; - NetworkManager::ConnectionSettings::Ptr m_connectionSettings = nullptr; -@@ -68,4 +66,4 @@ private: - bool m_isNewConnection; - }; - --#endif //KIRAN_CPANEL_NETWORK_SETTINGPAGE_H -+#endif // KIRAN_CPANEL_NETWORK_SETTINGPAGE_H -diff --git a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp -index b9c7e84..dc9e4d2 100644 ---- a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp -+++ b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp -@@ -13,9 +13,9 @@ - */ - - #include "vpn-l2tp-setting.h" --#include "ui_vpn-l2tp-setting.h" --#include - #include -+#include -+#include "ui_vpn-l2tp-setting.h" - #define ServiceTypeL2TP "org.freedesktop.NetworkManager.l2tp" - using namespace NetworkManager; - -@@ -33,25 +33,24 @@ VpnL2tpSetting::~VpnL2tpSetting() - - void VpnL2tpSetting::initConnection() - { -- connect(ui->disconnectAndDeleteWidget,&DisconnectAndDeleteButton::disconnectButtonClicked,this,&VpnL2tpSetting::returnPreviousPage); -- connect(ui->disconnectAndDeleteWidget,&DisconnectAndDeleteButton::deleteButtonClicked,this,&VpnL2tpSetting::returnPreviousPage); -+ connect(ui->disconnectAndDeleteWidget, &DisconnectAndDeleteButton::disconnectButtonClicked, this, &VpnL2tpSetting::returnPreviousPage); -+ connect(ui->disconnectAndDeleteWidget, &DisconnectAndDeleteButton::deleteButtonClicked, this, &VpnL2tpSetting::returnPreviousPage); - } - - void VpnL2tpSetting::initSettingPage() - { - initSpecificSettings(); -- initWidgets(); - } - - void VpnL2tpSetting::initSpecificSettings() - { - m_vpnSetting = m_connectionSettings->setting(Setting::SettingType::Vpn).dynamicCast(); - m_ipv4Setting = m_connectionSettings->setting(Setting::SettingType::Ipv4).dynamicCast(); -+ - m_vpnSetting->setServiceType(ServiceTypeL2TP); --} -+ m_vpnSetting->setInitialized(true); -+ m_ipv4Setting->setInitialized(true); - --void VpnL2tpSetting::initWidgets() --{ - ui->connectioNameWidget->setConnectionSettings(m_connectionSettings); - ui->vpnWidget->setVpnSetting(m_vpnSetting); - ui->vpnPpp->setVpnSetting(m_vpnSetting); -@@ -80,7 +79,7 @@ void VpnL2tpSetting::showSettingPage(QString activeConnectionPath) - if (activeConnectionPath.isEmpty()) - ui->disconnectAndDeleteWidget->initButton(SETTING_CONNECTION_STATUS_DEACTIVATED); - else -- ui->disconnectAndDeleteWidget->initButton(SETTING_CONNECTION_STATUS_ACTIVATED,activeConnectionPath); -+ ui->disconnectAndDeleteWidget->initButton(SETTING_CONNECTION_STATUS_ACTIVATED, activeConnectionPath); - } - } - -diff --git a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.h b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.h -index cda99b6..daefdb8 100644 ---- a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.h -+++ b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.h -@@ -15,8 +15,8 @@ - #ifndef KIRAN_CPANEL_NETWORK_VPN_L2TP_SETTING_H - #define KIRAN_CPANEL_NETWORK_VPN_L2TP_SETTING_H - --#include - #include -+#include - #include "setting-page.h" - QT_BEGIN_NAMESPACE - namespace Ui -@@ -36,7 +36,6 @@ public: - void initConnection(); - void initSettingPage() override; - void initSpecificSettings() override; -- void initWidgets() override; - void clearPtr() override; - - public slots: -@@ -49,4 +48,4 @@ private: - NetworkManager::VpnSetting::Ptr m_vpnSetting; - }; - --#endif //KIRAN_CPANEL_NETWORK_VPN_L2TP_SETTING_H -+#endif // KIRAN_CPANEL_NETWORK_VPN_L2TP_SETTING_H -diff --git a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp -index c09b2aa..260ae22 100644 ---- a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp -+++ b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp -@@ -13,8 +13,8 @@ - */ - - #include "vpn-pptp-setting.h" --#include "ui_vpn-pptp-setting.h" - #include -+#include "ui_vpn-pptp-setting.h" - #define ServiceTypePPTP "org.freedesktop.NetworkManager.pptp" - using namespace NetworkManager; - -@@ -22,8 +22,8 @@ VpnPptpSetting::VpnPptpSetting(QWidget *parent) : SettingPage(parent), ui(new Ui - { - ui->setupUi(this); - ui->generalWidget->setNameLabel(tr("VPN name")); -- connect(ui->generalButton,&DisconnectAndDeleteButton::disconnectButtonClicked,this,&VpnPptpSetting::returnPreviousPage); -- connect(ui->generalButton,&DisconnectAndDeleteButton::deleteButtonClicked,this,&VpnPptpSetting::returnPreviousPage); -+ connect(ui->generalButton, &DisconnectAndDeleteButton::disconnectButtonClicked, this, &VpnPptpSetting::returnPreviousPage); -+ connect(ui->generalButton, &DisconnectAndDeleteButton::deleteButtonClicked, this, &VpnPptpSetting::returnPreviousPage); - } - - VpnPptpSetting::~VpnPptpSetting() -@@ -34,19 +34,17 @@ VpnPptpSetting::~VpnPptpSetting() - void VpnPptpSetting::initSettingPage() - { - initSpecificSettings(); -- initWidgets(); - } - -- - void VpnPptpSetting::initSpecificSettings() - { - m_vpnSetting = m_connectionSettings->setting(Setting::SettingType::Vpn).dynamicCast(); - m_ipv4Setting = m_connectionSettings->setting(Setting::SettingType::Ipv4).dynamicCast(); -+ - m_vpnSetting->setServiceType(ServiceTypePPTP); --} -+ m_vpnSetting->setInitialized(true); -+ m_ipv4Setting->setInitialized(true); - --void VpnPptpSetting::initWidgets() --{ - ui->generalWidget->setConnectionSettings(m_connectionSettings); - ui->vpnWidget->setVpnSetting(m_vpnSetting); - ui->vpnPpp->setVpnSetting(m_vpnSetting); -@@ -81,13 +79,13 @@ void VpnPptpSetting::showSettingPage(QString activeConnectionPath) - if (activeConnectionPath.isEmpty()) - ui->generalButton->initButton(SETTING_CONNECTION_STATUS_DEACTIVATED); - else -- ui->generalButton->initButton(SETTING_CONNECTION_STATUS_ACTIVATED,activeConnectionPath); -+ ui->generalButton->initButton(SETTING_CONNECTION_STATUS_ACTIVATED, activeConnectionPath); - } - } - - void VpnPptpSetting::clearPtr() - { -- KLOG_DEBUG() << "VpnPptpSetting::clearPtr" ; -+ KLOG_DEBUG() << "VpnPptpSetting::clearPtr"; - m_vpnSetting.clear(); - SettingPage::clearPtr(); - -diff --git a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.h b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.h -index 729d1da..fa179a1 100644 ---- a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.h -+++ b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.h -@@ -15,9 +15,9 @@ - #ifndef KIRAN_CPANEL_NETWORK_VPN_PPTP_SETTING_H - #define KIRAN_CPANEL_NETWORK_VPN_PPTP_SETTING_H - -+#include - #include - #include "setting-page.h" --#include - QT_BEGIN_NAMESPACE - namespace Ui - { -@@ -34,7 +34,6 @@ public: - ~VpnPptpSetting() override; - void initSettingPage() override; - void initSpecificSettings() override; -- void initWidgets() override; - void clearPtr() override; - - public slots: -@@ -47,4 +46,4 @@ private: - NetworkManager::VpnSetting::Ptr m_vpnSetting; - }; - --#endif //KIRAN_CPANEL_NETWORK_VPN_PPTP_SETTING_H -+#endif // KIRAN_CPANEL_NETWORK_VPN_PPTP_SETTING_H -diff --git a/plugins/network/src/plugin/settings/wired-setting-page.cpp b/plugins/network/src/plugin/settings/wired-setting-page.cpp -index 4466468..507aee5 100644 ---- a/plugins/network/src/plugin/settings/wired-setting-page.cpp -+++ b/plugins/network/src/plugin/settings/wired-setting-page.cpp -@@ -37,7 +37,6 @@ WiredSettingPage::~WiredSettingPage() - void WiredSettingPage::initSettingPage() - { - initSpecificSettings(); -- initWidgets(); - } - - void WiredSettingPage::initConnecton() -@@ -51,11 +50,11 @@ void WiredSettingPage::initSpecificSettings() - m_ipv4Setting = m_connectionSettings->setting(Setting::SettingType::Ipv4).dynamicCast(); - m_ipv6Setting = m_connectionSettings->setting(Setting::SettingType::Ipv6).dynamicCast(); - m_wiredSetting = m_connectionSettings->setting(Setting::SettingType::Wired).dynamicCast(); --} - --// TODO:修改命名 --void WiredSettingPage::initWidgets() --{ -+ m_ipv4Setting->setInitialized(true); -+ m_ipv6Setting->setInitialized(true); -+ m_wiredSetting->setInitialized(true); -+ - ui->connectionNameWidget->setConnectionSettings(m_connectionSettings); - ui->ipv4Widget->setIpv4Setting(m_ipv4Setting); - ui->ipv6Widget->setIpv6Setting(m_ipv6Setting); -diff --git a/plugins/network/src/plugin/settings/wired-setting-page.h b/plugins/network/src/plugin/settings/wired-setting-page.h -index f90c8a7..335d7a4 100644 ---- a/plugins/network/src/plugin/settings/wired-setting-page.h -+++ b/plugins/network/src/plugin/settings/wired-setting-page.h -@@ -37,7 +37,6 @@ public: - void initConnecton(); - void initSettingPage() override; - void initSpecificSettings() override; -- void initWidgets() override; - void clearPtr() override; - - public slots: -@@ -50,4 +49,4 @@ private: - KiranSwitchButton *m_security; - }; - --#endif //KIRAN_CPANEL_NETWORK_WIRED_SETTING_PAGE_H -+#endif // KIRAN_CPANEL_NETWORK_WIRED_SETTING_PAGE_H -diff --git a/plugins/network/src/plugin/settings/wireless-setting-page.cpp b/plugins/network/src/plugin/settings/wireless-setting-page.cpp -index efcdbe1..b0d5877 100644 ---- a/plugins/network/src/plugin/settings/wireless-setting-page.cpp -+++ b/plugins/network/src/plugin/settings/wireless-setting-page.cpp -@@ -13,8 +13,8 @@ - */ - - #include "wireless-setting-page.h" --#include "ui_wireless-setting-page.h" - #include -+#include "ui_wireless-setting-page.h" - using namespace NetworkManager; - - WirelessSettingPage::WirelessSettingPage(QWidget *parent) : SettingPage(parent), ui(new Ui::WirelessSettingPage) -@@ -32,14 +32,13 @@ WirelessSettingPage::~WirelessSettingPage() - - void WirelessSettingPage::initConnection() - { -- connect(ui->disconnectAndDeleteButton,&DisconnectAndDeleteButton::disconnectButtonClicked,this,&WirelessSettingPage::returnPreviousPage); -- connect(ui->disconnectAndDeleteButton,&DisconnectAndDeleteButton::deleteButtonClicked,this,&WirelessSettingPage::returnPreviousPage); -+ connect(ui->disconnectAndDeleteButton, &DisconnectAndDeleteButton::disconnectButtonClicked, this, &WirelessSettingPage::returnPreviousPage); -+ connect(ui->disconnectAndDeleteButton, &DisconnectAndDeleteButton::deleteButtonClicked, this, &WirelessSettingPage::returnPreviousPage); - } - - void WirelessSettingPage::initSettingPage() - { - initSpecificSettings(); -- initWidgets(); - } - - void WirelessSettingPage::initSpecificSettings() -@@ -48,10 +47,12 @@ void WirelessSettingPage::initSpecificSettings() - m_ipv6Setting = m_connectionSettings->setting(Setting::SettingType::Ipv6).dynamicCast(); - m_wirelessSetting = m_connectionSettings->setting(Setting::SettingType::Wireless).dynamicCast(); - m_wirelessSecuritySetting = m_connectionSettings->setting(Setting::SettingType::WirelessSecurity).dynamicCast(); --} - --void WirelessSettingPage::initWidgets() --{ -+ m_ipv4Setting->setInitialized(true); -+ m_ipv6Setting->setInitialized(true); -+ m_wirelessSetting->setInitialized(true); -+ m_wirelessSecuritySetting->setInitialized(true); -+ - ui->generalWidget->setConnectionSettings(m_connectionSettings); - ui->ipv4Widget->setIpv4Setting(m_ipv4Setting); - ui->ipv6Widget->setIpv6Setting(m_ipv6Setting); -@@ -81,7 +82,7 @@ void WirelessSettingPage::showSettingPage(QString activeConnectionPath) - if (activeConnectionPath.isEmpty()) - ui->disconnectAndDeleteButton->initButton(SETTING_CONNECTION_STATUS_DEACTIVATED); - else -- ui->disconnectAndDeleteButton->initButton(SETTING_CONNECTION_STATUS_ACTIVATED,activeConnectionPath); -+ ui->disconnectAndDeleteButton->initButton(SETTING_CONNECTION_STATUS_ACTIVATED, activeConnectionPath); - } - } - -@@ -109,5 +110,3 @@ void WirelessSettingPage::clearPtr() - ui->wirelessSecurity->clearPtr(); - ui->wireless->clearPtr(); - } -- -- -diff --git a/plugins/network/src/plugin/settings/wireless-setting-page.h b/plugins/network/src/plugin/settings/wireless-setting-page.h -index d0cf97b..bb963fe 100644 ---- a/plugins/network/src/plugin/settings/wireless-setting-page.h -+++ b/plugins/network/src/plugin/settings/wireless-setting-page.h -@@ -15,10 +15,10 @@ - #ifndef KIRAN_CPANEL_NETWORK_WIRELESS_SETTING_PAGE_H - #define KIRAN_CPANEL_NETWORK_WIRELESS_SETTING_PAGE_H - -+#include -+#include - #include - #include "setting-page.h" --#include --#include - QT_BEGIN_NAMESPACE - namespace Ui - { -@@ -36,16 +36,16 @@ public: - void initConnection(); - void initSettingPage() override; - void initSpecificSettings() override; -- void initWidgets() override; - void clearPtr() override; - - public slots: - void saveSettingPage() override; - void showSettingPage(QString activeConnectionPath = ""); -+ - private: - Ui::WirelessSettingPage *ui; - NetworkManager::WirelessSetting::Ptr m_wirelessSetting; - NetworkManager::WirelessSecuritySetting::Ptr m_wirelessSecuritySetting; - }; - --#endif //KIRAN_CPANEL_NETWORK_WIRELESS_SETTING_PAGE_H -+#endif // KIRAN_CPANEL_NETWORK_WIRELESS_SETTING_PAGE_H --- -2.33.0 - diff --git a/0006-fix-network-only-L2TP-type-is-supported-temporary-an.patch b/0006-fix-network-only-L2TP-type-is-supported-temporary-an.patch deleted file mode 100644 index bea337644c4b67434880be21cfac6d573659a957..0000000000000000000000000000000000000000 --- a/0006-fix-network-only-L2TP-type-is-supported-temporary-an.patch +++ /dev/null @@ -1,211 +0,0 @@ -From 963d10274ea3f9bf5321755a9f6f9b21ca98206d Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Tue, 23 Aug 2022 15:20:59 +0800 -Subject: [PATCH 6/7] fix(network):only L2TP type is supported temporary, and - fix input defect -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 暂时只支持l2tp类型,修复输入缺陷 ---- - .../src/plugin/manager/vpn-manager.cpp | 27 +++++------ - .../network/src/plugin/manager/vpn-manager.h | 9 ++-- - .../plugin/setting-widget/vpn/vpn-widget.cpp | 46 +++++++++++++++---- - .../plugin/settings/vpn/vpn-l2tp-setting.cpp | 2 +- - .../plugin/settings/vpn/vpn-pptp-setting.cpp | 1 - - 5 files changed, 58 insertions(+), 27 deletions(-) - -diff --git a/plugins/network/src/plugin/manager/vpn-manager.cpp b/plugins/network/src/plugin/manager/vpn-manager.cpp -index cd858b5..e4aecaf 100644 ---- a/plugins/network/src/plugin/manager/vpn-manager.cpp -+++ b/plugins/network/src/plugin/manager/vpn-manager.cpp -@@ -47,8 +47,8 @@ void VpnManager::initUI() - ui->connectionShowPage->setTitle(tr("VPN")); - ui->connectionShowPage->setSwitchButtonVisible(false); - -- // ui->vpnType->addItem(tr("L2TP"), VPN_TYPE_L2TP); -- ui->vpnType->addItem(tr("PPTP"), VPN_TYPE_PPTP); -+ ui->vpnType->addItem(tr("L2TP"), VPN_TYPE_L2TP); -+ // ui->vpnType->addItem(tr("PPTP"), VPN_TYPE_PPTP); - Kiran::StylePropertyHelper::setButtonType(ui->saveButton, Kiran::BUTTON_Default); - } - -@@ -59,9 +59,10 @@ void VpnManager::initConnection() - { - //默认创建vpn类型:L2TP - ui->vpnTypeWidget->setVisible(true); -- ui->vpnType->setCurrentIndex(0); -- ui->vpnTypeStacked->setCurrentIndex(VPN_TYPE_PPTP); -- ui->pptpSetting->showSettingPage(); -+ ui->vpnType->setCurrentIndex(VPN_TYPE_L2TP); -+ ui->vpnTypeStacked->setCurrentIndex(VPN_TYPE_L2TP); -+ ui->l2tpSetting->showSettingPage(); -+ // ui->vpnType->setCurrentIndex(0); - - QPointer scrollBar = ui->scrollArea->verticalScrollBar(); - scrollBar->setValue(0); -@@ -73,7 +74,7 @@ void VpnManager::initConnection() - connect(ui->vpnType, QOverload::of(&QComboBox::currentIndexChanged), [=](int index) - { - VpnType type = ui->vpnType->currentData().value(); -- ui->vpnTypeStacked->setCurrentIndex(VPN_TYPE_PPTP); -+ ui->vpnTypeStacked->setCurrentIndex(type); - switch (type) - { - case VPN_TYPE_L2TP: -@@ -186,14 +187,14 @@ void VpnManager::handleRequestActivateConnection(const QString &connectionPath, - inputDialog.setTitle(tr("Tips")); - QString tips = QString(tr("Password required to connect to %1.")).arg(settings->id()); - inputDialog.setText(tips); -- -- connect(&inputDialog, &TextInputDialog::password, [=](const QString &password) -+ inputDialog.setlineEditEchoMode(QLineEdit::Password); -+ connect(&inputDialog, &TextInputDialog::password, this, [=](const QString &password) - { -- NMStringMap secretsMap = vpnSetting->secrets(); -- secretsMap.insert("password", password); -- vpnSetting->setSecrets(secretsMap); -- activateVPNConnection(connectionPath, connectionParameter); -- connection->clearSecrets(); }); -+ NMStringMap secretsMap = vpnSetting->secrets(); -+ secretsMap.insert("password", password); -+ vpnSetting->setSecrets(secretsMap); -+ activateVPNConnection(connectionPath, connectionParameter); -+ connection->clearSecrets(); }); - - inputDialog.exec(); - } -diff --git a/plugins/network/src/plugin/manager/vpn-manager.h b/plugins/network/src/plugin/manager/vpn-manager.h -index 81233ab..e3fd096 100644 ---- a/plugins/network/src/plugin/manager/vpn-manager.h -+++ b/plugins/network/src/plugin/manager/vpn-manager.h -@@ -39,23 +39,24 @@ public: - public slots: - void clearVpnSetting(); - void handleRequestEditConnection(const QString &uuid, QString activeConnectionPath); -- void handleRequestActivateConnection(const QString &connectionPath,const QString &connectionParameter); -+ void handleRequestActivateConnection(const QString &connectionPath, const QString &connectionParameter); - - void handleNotifierConnectionAdded(const QString &path) override; - void handleNotifierConnectionRemoved(const QString &path) override; -- void activateVPNConnection(const QString &connectionPath,const QString &connectionParameter); -+ void activateVPNConnection(const QString &connectionPath, const QString &connectionParameter); - - void handleActiveConnectionAdded(const QString &activePath) override; - void handleActiveConnectionRemoved(const QString &activePath) override; - -- void handleVpnConnectionStateChanged(NetworkManager::VpnConnection::State state, NetworkManager::VpnConnection::StateChangeReason reason,const QString &activePath); -+ void handleVpnConnectionStateChanged(NetworkManager::VpnConnection::State state, NetworkManager::VpnConnection::StateChangeReason reason, const QString &activePath); - void handleVpnStateActivated(const QString &activePath); - void handleVpnStateDisconnected(const QString &activePath); - void handleVpnStateFailed(const QString &activePath); - - void handleReturnPreviousPage(); -+ - private: - Ui::VpnManager *ui; - }; - --#endif //KIRAN_CPANEL_NETWORK_VPN_MANAGER_H -+#endif // KIRAN_CPANEL_NETWORK_VPN_MANAGER_H -diff --git a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.cpp b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.cpp -index 2439947..27de2af 100644 ---- a/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.cpp -+++ b/plugins/network/src/plugin/setting-widget/vpn/vpn-widget.cpp -@@ -13,6 +13,7 @@ - */ - - #include "vpn-widget.h" -+#include - #include - #include - #include "ui_vpn-widget.h" -@@ -150,24 +151,53 @@ void VpnWidget::clearPtr() - - bool VpnWidget::isInputValid() - { -- bool valid = true; - QString gatewayStr = ui->gateway->text(); - if (gatewayStr.isEmpty()) -- valid = false; -+ { -+ QString error = QString(tr("Gateway can not be empty")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ KLOG_DEBUG() << "Gateway cannot be empty"; -+ return false; -+ } - else - { - if (!isIpv4AddressValid(gatewayStr)) -- valid = false; -+ { -+ QString error = QString(tr("Gateway invalid")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ KLOG_DEBUG() << "Gateway invalid"; -+ return false; -+ } - } - - if (ui->userName->text().isEmpty()) -- valid = false; -+ { -+ QString error = QString(tr("user name can not be empty")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); - -- if ((ui->passwordOptions->currentData().value() == NetworkManager::Setting::SecretFlagType::None) -- && ui->password->text().isEmpty()) -- valid = false; -+ KLOG_DEBUG() << "user name can not be empty"; -+ return false; -+ } -+ -+ if ((ui->passwordOptions->currentData().value() == Setting::SecretFlagType::None) && -+ ui->password->text().isEmpty()) -+ { -+ QString error = QString(tr("password can not be empty")); -+ KiranMessageBox::KiranStandardButton btn = KiranMessageBox::message(this, tr("Error"), -+ error, -+ KiranMessageBox::Yes | KiranMessageBox::No); -+ -+ KLOG_DEBUG() << "password can not be empty"; -+ return false; -+ } - -- return valid; -+ return true; - } - - bool VpnWidget::isIpv4AddressValid(const QString &address) -diff --git a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp -index dc9e4d2..09a7109 100644 ---- a/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp -+++ b/plugins/network/src/plugin/settings/vpn/vpn-l2tp-setting.cpp -@@ -107,5 +107,5 @@ void VpnL2tpSetting::clearPtr() - - bool VpnL2tpSetting::isInputValid() - { -- return ui->vpnWidget->isInputValid() || ui->connectioNameWidget->isInputValid(); -+ return ui->vpnWidget->isInputValid() && ui->connectioNameWidget->isInputValid(); - } -diff --git a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp -index 260ae22..817171c 100644 ---- a/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp -+++ b/plugins/network/src/plugin/settings/vpn/vpn-pptp-setting.cpp -@@ -85,7 +85,6 @@ void VpnPptpSetting::showSettingPage(QString activeConnectionPath) - - void VpnPptpSetting::clearPtr() - { -- KLOG_DEBUG() << "VpnPptpSetting::clearPtr"; - m_vpnSetting.clear(); - SettingPage::clearPtr(); - --- -2.33.0 - diff --git a/0007-feature-network-update-translations.patch b/0007-feature-network-update-translations.patch deleted file mode 100644 index ab7f243920dc9bd29976c8339afda47cd359dae5..0000000000000000000000000000000000000000 --- a/0007-feature-network-update-translations.patch +++ /dev/null @@ -1,460 +0,0 @@ -From e25198845ff304e2a968f6d01b557acc15ba2821 Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Tue, 23 Aug 2022 16:14:27 +0800 -Subject: [PATCH 7/7] feature(network):update translations -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 更新翻译 ---- - .../kiran-cpanel-network.zh_CN.ts | 223 ++++++++++++++---- - 1 file changed, 176 insertions(+), 47 deletions(-) - -diff --git a/plugins/network/translations/kiran-cpanel-network.zh_CN.ts b/plugins/network/translations/kiran-cpanel-network.zh_CN.ts -index 10521ae..0a1f191 100644 ---- a/plugins/network/translations/kiran-cpanel-network.zh_CN.ts -+++ b/plugins/network/translations/kiran-cpanel-network.zh_CN.ts -@@ -25,38 +25,39 @@ - 无线连接 - - -- -- -+ -+ - Wired Network %1 - 有线网络 %1 - - -- -- -+ -+ - Wired Network - 有线网络 - - -- -- -+ -+ - Wireless Network %1 - 无线网络 %1 - - -- -- -+ -+ -+ - Wireless Network - 无线网络 - - -- -- -+ -+ - VPN - VPN - - -- -- -+ -+ - Network Details - 网络详情 - -@@ -184,25 +185,35 @@ - 自动连接 - - -- -+ - Required - 必填 - - -- -+ - Wired Connection %1 - 有线网络%1 - - -- -+ - VPN L2TP %1 - - - -- -+ - VPN PPTP %1 - - -+ -+ -+ Connection name can not be empty -+ 网络名称不能为空 -+ -+ -+ -+ Error -+ 错误 -+ - - - ConnectionShowPage -@@ -262,12 +273,12 @@ - 忽略 - - -- -+ - Are you sure you want to delete the connection %1 - 您是否确定要删除连接 "%1" - - -- -+ - Warning - 警告 - -@@ -344,10 +355,20 @@ - 自定义MTU - - -- -+ - No device specified - 不指定设备 - -+ -+ -+ Clone Mac invalid -+ 无效的克隆MAC地址 -+ -+ -+ -+ Error -+ 错误 -+ - - - Ipv4Widget -@@ -387,21 +408,67 @@ - 备选DNS - - -- -+ - Auto - 自动 - - -- -+ - Manual - 手动 - - -- - -+ - Required - 必填 - -+ -+ -+ Ipv4 address can not be empty -+ Ipv4地址不能为空 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Error -+ 错误 -+ -+ -+ -+ Ipv4 Address invalid -+ 无效的Ipv4地址 -+ -+ -+ -+ NetMask can not be empty -+ 子网掩码不能为空 -+ -+ -+ -+ Netmask invalid -+ 无效的子网掩码 -+ -+ -+ -+ Ipv4 Gateway invalid -+ 无效的Ipv4网关 -+ -+ -+ -+ Ipv4 Preferred DNS invalid -+ 无效的Ipv4首选DNS -+ -+ -+ -+ Ipv4 Alternate DNS invalid -+ 无效的Ipv4备选DNS -+ - - - Ipv6Widget -@@ -441,25 +508,59 @@ - 备选DNS - - -- -+ - Auto - 自动 - - -- -+ - Manual - 手动 - - -- -+ - Ignored - 忽略 - - -- -+ - Required - 必填 - -+ -+ -+ Ipv6 address can not be empty -+ Ipv6地址不能为空 -+ -+ -+ -+ -+ -+ -+ -+ Error -+ 错误 -+ -+ -+ -+ Ipv6 address invalid -+ 无效的Ipv6地址 -+ -+ -+ -+ Ipv6 Gateway invalid -+ 无效的Ipv6网关 -+ -+ -+ -+ Ipv6 Preferred DNS invalid -+ 无效的Ipv6首选DNS -+ -+ -+ -+ Ipv6 Alternate DNS invalid -+ 无效的Ipv6备选DNS -+ - - - ManagerTray -@@ -471,7 +572,7 @@ - - NetworkTray - -- -+ - Network settings - 网络设置 - -@@ -629,17 +730,17 @@ - - - -- -+ - TextLabel - - - -- -+ - Select wired network card -- 请选择 有线网卡 -+ 请选择有线网卡 - - -- -+ - Select wireless network card - 请选择无线网卡 - -@@ -751,22 +852,22 @@ - 返回 - - -- -+ - VPN - VPN - - -- -- PPTP -+ -+ L2TP - - - -- -+ - Tips - 提示 - - -- -+ - Password required to connect to %1. - 连接网络 "%1" 需要密码 - -@@ -915,27 +1016,55 @@ - NT域 - - -- - - -+ - Required - 必填 - - -- -+ - Saved - 已保存的 - - -- -+ - Ask - 总是询问 - - -- -+ - Not required - 不要求 - -+ -+ -+ Gateway can not be empty -+ 网关不能为空 -+ -+ -+ -+ -+ -+ -+ Error -+ 错误 -+ -+ -+ -+ Gateway invalid -+ 无效的网关 -+ -+ -+ -+ user name can not be empty -+ 用户名不能为空 -+ -+ -+ -+ password can not be empty -+ 密码不能为空 -+ - - - WiredManager -@@ -955,7 +1084,7 @@ - 返回 - - -- -+ - Wired Network Adapter - 有线网卡 - -@@ -968,7 +1097,7 @@ - - - -- -+ - Network name - 网络名称 - -@@ -991,17 +1120,17 @@ - 返回 - - -- -+ - Wireless Network Adapter - 无线网卡 - - -- -+ - Tips - 提示 - - -- -+ - Password required to connect to %1. - 连接网络 "%1" 需要密码 - -@@ -1076,7 +1205,7 @@ - - - -- -+ - Wireless name - 无线网络名称 - -@@ -1084,7 +1213,7 @@ - - WirelessTrayWidget - -- -+ - the network "%1" not found - 未找到网络 "%1" - --- -2.33.0 - diff --git a/kiran-control-panel-2.3.4.tar.gz b/kiran-control-panel-2.3.5.tar.gz similarity index 67% rename from kiran-control-panel-2.3.4.tar.gz rename to kiran-control-panel-2.3.5.tar.gz index 6266c677f0508ffb7a0a0dd412d11ae7d225e326..ad49a42a76fd5f0088a5070eb050b0aafc2187c3 100644 Binary files a/kiran-control-panel-2.3.4.tar.gz and b/kiran-control-panel-2.3.5.tar.gz differ diff --git a/kiran-control-panel.spec b/kiran-control-panel.spec index 658c5b6d5c539f31acae7c1e24f3b6b2e31396bc..590b085d76053e265ef070c9c6eb5a81d4406464 100644 --- a/kiran-control-panel.spec +++ b/kiran-control-panel.spec @@ -1,33 +1,12 @@ Name: kiran-control-panel -Version: 2.3.4 -Release: 10 +Version: 2.3.5 +Release: 1 Summary: Kiran Control Panel Summary(zh_CN): Kiran桌面控制面板 License: MulanPSL-2.0 Source0: %{name}-%{version}.tar.gz -Patch0001: 0001-fix-system-buttons-on-the-system-information-page-ar.patch -Patch0002: 0002-refactor-systeminfo-update-systeminfo-plugin-dialog-.patch -Patch0003: 0001-fix-netwowrk-fix-not-searching-the-wireless-network-.patch -Patch0004: 0001-refactor-panel-set-panel-creategory-widget-auto-fill.patch -Patch0005: 0001-fix-search-when-the-relevant-setting-interface-canno.patch -Patch0006: 0002-fix-account-error-prompt-box-is-added-with-the-defau.patch -Patch0007: 0001-fix-battery-idle-remove-invalid-idle-shutdown-displa.patch -Patch0008: 0002-fix-account-The-connection-singleton-in-the-signal-s.patch -Patch0009: 0001-feature-network-Add-the-conf-file-to-overwrite-the-o.patch -Patch0010: 0002-fix-network-fix-crash-and-wireless-network-disable-f.patch -Patch0011: 0003-fix-network-fix-the-problem-of-network-and-details-c.patch -Patch0012: 0004-fix-network-Add-error-prompt-box-when-saving-configu.patch -Patch0013: 0005-fix-network-fix-invalid-configuration-created-for-th.patch -Patch0014: 0006-fix-network-only-L2TP-type-is-supported-temporary-an.patch -Patch0015: 0007-feature-network-update-translations.patch -Patch0016: 0001-feat-accessibleName-updates-accessiblename.patch -Patch0017: 0001-feature-audio-network-Add-labels-to-volume-and-netwo.patch -Patch0018: 0002-fix-network-Temporarily-do-not-overwrite-the-Network.patch -Patch0019: 0001-refactor-account-move-some-account-management-contro.patch - - BuildRequires: gcc-c++ BuildRequires: cmake >= 3.2 BuildRequires: glib2-devel @@ -149,7 +128,7 @@ make %{?_smp_mflags} #network %{_sysconfdir}/xdg/autostart/kiran-network-status-icon.desktop %{_bindir}/kiran-network-status-icon -# /etc/NetworkManager/conf.d/00-server.conf +/etc/NetworkManager/conf.d/00-server.conf #display %{_datadir}/kiran-cpanel-display/translations/* @@ -187,6 +166,12 @@ make %{?_smp_mflags} rm -rf %{buildroot} %changelog +* Mon Sep 05 2022 luoqing - 2.3.5-1 +- KYOS-F: Fix the network connection status does not change after unplugging the network cable (#I5I0AA) +- KYOS-F: Fix network tay crash (#I5OKBR) +- KYOS-F: Optimized prompt pop-up box, consistent with the overall style (#I5O86G) +- KYOS-F: Re add the network profile during installation to overwrite the original configuration + * Mon Sep 05 2022 liuxinhao - 2.3.4-10 - KYOS-F: move some account management controls to common component library