Skip to content

Refactor NetworkWindow#174

Merged
HugoCLSC merged 39 commits intodevfrom
ref/network_window
Feb 4, 2026
Merged

Refactor NetworkWindow#174
HugoCLSC merged 39 commits intodevfrom
ref/network_window

Conversation

@gmmcosta15
Copy link
Collaborator

@gmmcosta15 gmmcosta15 commented Feb 3, 2026

Description

Select the type:

  • Feature
  • Bug fix
  • Code refactor
  • Documentation

BlocksScreen/lib/network.py:

  • Added method get_device_ip_by_interface to get IPv4 address for a specific interface via NetworkManager D-Bus.

BlocksScreen/lib/panels/networkWindow.py

  • Programmatically creates the UI instead of needed the wifiConnectivityWindow file.
  • Added a page to handle hidden networks.
  • The refresh is now a QRunnable task emittedto the threadpool.
  • Added Constants as global variable to improve maintainability.
  • Changed the use from QtWidgets.QListWidgetItem to use our custom EntryDelegate and each network is a EntryList.
  • Added a separator between saved and unsaved networks.
  • Improved error handling.
  • All changes to the WiFi and Hotspot toggle button are protected by QtCore.QSignalBlocker to make them always sync.
  • Stop showing the password field on open networks.

BlocksScreen/lib/ui/resources/icon_resources.qrc:

  • Added new icons for different signal types and security types.

BlocksScreen/lib/utils/list_model.py:

  • Added a flag to the entrylist to make a item not clickable.

BlocksScreen/lib/utils/blocks_Scrollbar.py:

  • Fixed behaviour of scrollbar at edges.

BlocksScreen/lib/utils/blocks_linedit.py:

  • Pre-allocated elements used by Qt for better performance.

Motivation

  • Improve Responsiveness: Perform network refreshes off the main thread to avoid UI freezes.
  • Increase Usability: Support hidden networks and separate saved/unsaved networks visually.
  • Enhance Maintainability: Use constants and programmatic UI to simplify future updates.
  • Increase Stability: Add robust error handling and synchronized toggle state.
  • Update icons to reflect signal and security types and streamline network list behavior.

Screenshots

Before

Captura de ecrã 2025-12-12 125550

After

Captura de ecrã 2025-12-12 152508

Tests

Tested on RF50,
Missing Unit and Integration Tests,

Co-Authors

Co‑author: @Robert0Mart
Co‑author: @claudiobrinca

gmmcosta15 and others added 30 commits December 11, 2025 17:37
wifiConnectivityWindow.ui: change horizontalLayout to a vertical layout with a listview and a vertical scrollbar
wifiConnectivityWindow.py: generated file from QtDesigner with some optimizations

Signed-off-by: Guilherme Costa <guiherme.costa@blockstec.com>
Signed-off-by: Guilherme Costa <guiherme.costa@blockstec.com>
Signed-off-by: Guilherme Costa <guiherme.costa@blockstec.com>
Signed-off-by: Guilherme Costa <guiherme.costa@blockstec.com>
@gmmcosta15 gmmcosta15 requested a review from HugoCLSC February 3, 2026 13:44
@gmmcosta15 gmmcosta15 self-assigned this Feb 3, 2026
@gmmcosta15 gmmcosta15 added UI/UX User Interface what changed with this code Refactor Enhancing code's readability, maintainability, and extensibility while addressing technical debt. labels Feb 3, 2026
@gmmcosta15 gmmcosta15 changed the title Refactor NetworkWindow Panels Refactor NetworkWindow Feb 3, 2026
Copy link
Member

@HugoCLSC HugoCLSC left a comment

Choose a reason for hiding this comment

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

Looks good, some typing definitions are deprecated since python 3.9 apparently, these include typing.Optional, typing.Dict and typing.List.

@HugoCLSC HugoCLSC merged commit 72fb8a0 into dev Feb 4, 2026
7 of 8 checks passed
@gmmcosta15 gmmcosta15 mentioned this pull request Feb 4, 2026
4 tasks
HugoCLSC added a commit that referenced this pull request Feb 4, 2026
* ADD: Additional load messages (#169)

Co-authored-by: Roberto <roberto.martins@blockstec.com>

* Refactor `NetworkWindow` (#174)

* refactor: change network list to listview

* Refactor: Refac to MVC view with Controller being runnables on a threadpoll

* UPD: Regenerated icon_resources_rc

* networkWindow.py: refactor to include listview
wifiConnectivityWindow.ui: change horizontalLayout to a vertical layout with a listview and a vertical scrollbar
wifiConnectivityWindow.py: generated file from QtDesigner with some optimizations

Signed-off-by: Guilherme Costa <guiherme.costa@blockstec.com>

* networkWindow: rebase merge conflits fix and cleanup

Signed-off-by: Guilherme Costa <guiherme.costa@blockstec.com>

* networkWindow.py: added missing right icon

Signed-off-by: Guilherme Costa <guiherme.costa@blockstec.com>

* Fix typo

* networkWindow.py:  optimize and bugfix on self.paths

Signed-off-by: Guilherme Costa <guiherme.costa@blockstec.com>

* networkWindow.py:  comments cleanup

* networkWindow.py: fix missing formatting

* Revert accidental changes to requirements.txt

* networkwindo.py: between 5 and 25 show only one bar icon

* bugfix: fixed wrong imports

* bugfix: wrong button name

* resolve merge conflits

* add missing docstrings

* add missing docstrings

* separation between saved and unsaved network and update code

* refactor network window file

* Add hidden network page, fix scrollbar behaviour at borders remove the need to use wificonnectivitywindow_ui

* cleanup of unused code

* fix code formatation

* changed QtWidgets.QApplication.processEvents for repaint

* delete unused files

* fix formatting issues and logic to parse sensors

* fix code formatation

---------

Signed-off-by: Guilherme Costa <guiherme.costa@blockstec.com>
Co-authored-by: Roberto Martins <robertomicael.martins@gmail.com>
Co-authored-by: Guilherme Costa <guiherme.costa@blockstec.com>
Co-authored-by: HugoCLSC <hugo.santos.costa@gmail.com>
Co-authored-by: Roberto <roberto.martins@blockstec.com>

* Fix incorrect file removal (#177)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Hugo Costa <hugo.santos.costa@gmail.com>
Signed-off-by: Guilherme Costa <guiherme.costa@blockstec.com>
Signed-off-by: gmmcosta15 <guilherme.costa@blockstec.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Roberto Martins <robertomicael.martins@gmail.com>
Co-authored-by: Roberto <roberto.martins@blockstec.com>
Co-authored-by: Guilherme Costa <guilherme.costa@blockstec.com>
Co-authored-by: Guilherme Costa <guiherme.costa@blockstec.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Enhancing code's readability, maintainability, and extensibility while addressing technical debt. UI/UX User Interface what changed with this code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants