Skip to content

Conversation

@caixr23
Copy link
Contributor

@caixr23 caixr23 commented Apr 7, 2025

Synchronize to 107x

pms: TASK-361719

Summary by Sourcery

Synchronize the network plugin to version 107x, introducing significant architectural changes and improvements to the network management and display components

New Features:

  • Introduced a new dock content widget for network plugin
  • Added support for network check and settings buttons in the dock popup
  • Implemented a more flexible quick panel widget for network status

Bug Fixes:

  • Fixed potential memory leaks in network plugin
  • Improved handling of network device status changes
  • Enhanced translation and localization support

Enhancements:

  • Refactored network plugin architecture to improve modularity
  • Enhanced network item sorting and display logic
  • Improved theme and icon handling
  • Added more robust event filtering and connection management

@sourcery-ai
Copy link

sourcery-ai bot commented Apr 7, 2025

Reviewer's Guide by Sourcery

This pull request synchronizes the dock network plugin to the 107x version. This includes major refactoring, UI improvements, and feature enhancements such as VPN and proxy support, and network notifications. The changes involve replacing the old implementation with a new one based on NetManager, NetView, and NetStatus classes, updating the build system, and modernizing the code.

Sequence diagram for showing the network dialog

sequenceDiagram
    participant NP as NetworkPlugin
    participant PI as PluginProxyInterface
    NP->PI: requestSetAppletVisible(NETWORK_KEY, true)
    PI->NP: appletVisibleChanged(NETWORK_KEY, true)
    NP->NW: show()
    loop
    NW->NW: Update UI
    end
Loading

Updated class diagram for NetStatus

classDiagram
    class NetStatus {
        -NetManager *m_manager
        -NetIconButton *m_networkBut
        -NetIconButton *m_vpnAndProxyBut
        -QWidget *m_dockIconWidget
        -QBoxLayout *m_dockIconWidgetlayout
        -QPointer<QLabel> m_tipsLabel
        -QString m_networkTips
        -QString m_vpnAndProxyTips
        -QIcon m_networkIcon
        -QIcon m_vpnAndProxyIcon
        -bool m_vpnAndProxyIconVisibel
        -unsigned int m_deviceFlag
        +NetStatus()
        +~NetStatus()
        +needShowControlCenter() const
        +contextMenu() const
        +createDockIconWidget()
        +createDockItemTips()
        +setDirection()
        +refreshIcon()
        +invokeMenuItem()
        +networkActive() const
        +quickTitle() const
        +quickDescription() const
        +quickIcon() const
        +vpnAndProxyIconVisibel() const
        +hasDevice() const
        +setHoverTips()
        +toggleNetworkActive()
        -onChildAdded()
        -onChildRemoved()
        -onStrengthLevelChanged()
        -updateVpnAndProxyStatus()
        -doUpdateStatus()
        -updateNetworkIcon()
        -updateNetworkTips()
        -updateQuick()
        -getDeviceConnections()
        -updateItemWidgetSize()
    }
    NetStatus -- NetManager : has a
Loading

File-Level Changes

Change Details Files
Refactors the network plugin to align with the 107x version, including UI changes, code modernization, and feature enhancements.
  • Replaces the old network plugin implementation with a new one.
  • Updates the plugin to use the new NetManager, NetView, and NetStatus classes.
  • Adds support for VPN and proxy settings.
  • Improves the UI of the network plugin.
  • Adds support for network notifications.
  • Removes the old NetworkPluginHelper and NetworkDialog classes.
  • Updates the plugin to use the new Dtk6 and Qt6 libraries.
  • Adds a DockContentWidget to manage the network view in the dock.
  • Implements a QuickPanelWidget for quick network actions.
  • Adds a NetSortProxyModel for sorting network items.
  • Updates translations and build configurations.
dock-network-plugin/networkplugin.cpp
net-view/window/netstatus.cpp
net-view/window/private/netdelegate.cpp
net-view/operation/private/netmanagerthreadprivate.cpp
dock-network-plugin/networkplugin.h
net-view/operation/nettype.h
net-view/operation/netmanager.cpp
net-view/window/private/netmodel.cpp
dss-network-plugin/notification/bubbletool.cpp
net-view/operation/netitem.cpp
net-view/operation/netitem.h
net-view/operation/private/netitemprivate.h
dss-network-plugin/CMakeLists.txt
net-view/operation/netmanager.h
net-view/window/netview.cpp
net-view/operation/private/netmanager_p.h
net-view/window/private/netsecretwidget.cpp
net-view/operation/private/netitemprivate.cpp
dss-network-plugin/notification/bubbletool.h
dss-network-plugin/notification/bubble.h
dss-network-plugin/notification/bubble.cpp
dss-network-plugin/notification/bubblemanager.cpp
net-view/window/private/netdelegate.h
net-view/window/private/netmodel.h
dss-network-plugin/notification/actionbutton.cpp
net-view/window/private/netsortproxymodel.cpp
dock-network-plugin/widget/commoniconbutton.cpp
dock-network-plugin/quickpanelwidget.cpp
dock-network-plugin/widget/jumpsettingbutton.cpp
dss-network-plugin/networkmodule.cpp
dock-network-plugin/dockcontentwidget.h
net-view/window/private/netsortproxymodel.h
dss-network-plugin/notification/notificationmanager.cpp
dss-network-plugin/notification/notificationmanager.h
dock-network-plugin/network_v2.json
dss-network-plugin/10-network-manager.pkla
dock-network-plugin/quickpanel.cpp
dock-network-plugin/quickpanel.h
dss-network-plugin/50-dss-network-plugin.rules
dss-network-plugin/dockpopupwindow.cpp
dss-network-plugin/dockpopupwindow.h
dss-network-plugin/network_module.cpp
dss-network-plugin/network_module.h
dss-network-plugin/notificationmanager.cpp
dss-network-plugin/notificationmanager.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions
Copy link

github-actions bot commented Apr 7, 2025

TAG Bot

TAG: 2.0.52
EXISTED: yes
DISTRIBUTION: unstable

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We encountered an error and are unable to review this PR. We have been notified and are working to fix it.

You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.

@caixr23 caixr23 force-pushed the master branch 4 times, most recently from 09e5b34 to 29cc742 Compare April 8, 2025 05:25
Synchronize to 107x

pms: TASK-361719
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, robertkill

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@caixr23 caixr23 merged commit 73c4837 into linuxdeepin:master Apr 10, 2025
14 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants