GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Work connnectivity update page by Robert0Mart · Pull Request #139 · BlocksTechnology/BlocksScreen

Work connnectivity update page #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
HugoCLSC merged 10 commits into dev from work-connnectivity-update-page
Jan 12, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

Work connnectivity update page #139

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
10 commits
Select commit Hold shift + click to select a range
61e3030
ADD: added update page to connection page
RobeMartins Dec 22, 2025
f5ee5eb
ADD: added reload button to updatepage
RobeMartins Dec 22, 2025
59fa42b
Refactor: when update page gets refreshed
RobeMartins Dec 22, 2025
dd02579
Added: icon_button pressed state
RobeMartins Dec 22, 2025
aa6a592
Rev: removed updatepage instances
RobeMartins Jan 8, 2026
0343e9b
Fix: fixed loadwidget not hiding
RobeMartins Jan 8, 2026
52c7c5b
add: added update page instance
RobeMartins Jan 8, 2026
9ea5364
Refactor: ran ruff formatter
RobeMartins Jan 8, 2026
87dccb9
refactor: removed unused import
RobeMartins Jan 12, 2026
a66c272
Refactor: ran ruff formatter
RobeMartins Jan 12, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

15 changes: 9 additions & 6 deletions 15 BlocksScreen/lib/moonrakerComm.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -734,13 +734,16 @@ def update_status(self, refresh: bool = False) -> bool:

@QtCore.pyqtSlot(name="update-refresh")
@QtCore.pyqtSlot(str, name="update-refresh")
def refresh_update_status(self, name: str = "") -> bool:
def refresh_update_status(self, name: str = None) -> bool:
"""Refresh packages state"""
if not isinstance(name, str) or not name:
return False
return self._ws.send_request(
method="machine.update.refresh", params={"name": name}
)
if isinstance(name, str):
return self._ws.send_request(
method="machine.update.refresh", params={"name": name}
)
else:
return self._ws.send_request(
method="machine.update.refresh",
)

@QtCore.pyqtSlot(name="update-full")
def full_update(self) -> bool:
Expand Down
43 changes: 42 additions & 1 deletion 43 BlocksScreen/lib/panels/mainWindow.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from lib.panels.widgets.popupDialogWidget import Popup
from lib.printer import Printer
from lib.ui.mainWindow_ui import Ui_MainWindow # With header
from lib.panels.widgets.updatePage import UpdatePage

# from lib.ui.mainWindow_v2_ui import Ui_MainWindow # No header
from lib.ui.resources.background_resources_rc import *
Expand Down Expand Up @@ -58,6 +59,7 @@ class MainWindow(QtWidgets.QMainWindow):
gcode_response = QtCore.pyqtSignal(list, name="gcode_response")
handle_error_response = QtCore.pyqtSignal(list, name="handle_error_response")
call_network_panel = QtCore.pyqtSignal(name="call-network-panel")
call_update_panel = QtCore.pyqtSignal(name="call-update-panel")
on_update_message: typing.ClassVar[QtCore.pyqtSignal] = QtCore.pyqtSignal(
dict, name="on-update-message"
)
Expand All @@ -77,6 +79,8 @@ def __init__(self):
self.index_stack = deque(maxlen=4)
self.printer = Printer(self, self.ws)
self.conn_window = ConnectionPage(self, self.ws)
self.up = UpdatePage(self)
self.up.hide()
self.installEventFilter(self.conn_window)
self.printPanel = PrintTab(
self.ui.printTab, self.file_data, self.ws, self.printer
Expand Down Expand Up @@ -152,14 +156,51 @@ def __init__(self):
self.controlPanel.probe_helper_page.handle_error_response
)
self.controlPanel.disable_popups.connect(self.popup_toggle)
self.on_update_message.connect(self.utilitiesPanel.on_update_message)
self.on_update_message.connect(self.up.handle_update_message)
self.up.request_full_update.connect(self.ws.api.full_update)
self.up.request_recover_repo[str].connect(self.ws.api.recover_corrupt_repo)
self.up.request_recover_repo[str, bool].connect(
self.ws.api.recover_corrupt_repo
)
self.up.request_refresh_update.connect(self.ws.api.refresh_update_status)
self.up.request_refresh_update[str].connect(self.ws.api.refresh_update_status)
self.up.request_rollback_update.connect(self.ws.api.rollback_update)
self.up.request_update_client.connect(self.ws.api.update_client)
self.up.request_update_klipper.connect(self.ws.api.update_klipper)
self.up.request_update_moonraker.connect(self.ws.api.update_moonraker)
self.up.request_update_status.connect(self.ws.api.update_status)
self.up.request_update_system.connect(self.ws.api.update_system)
self.up.update_back_btn.clicked.connect(self.up.hide)
self.utilitiesPanel.show_update_page.connect(self.show_update_page)
self.conn_window.update_button_clicked.connect(self.show_update_page)
self.ui.extruder_temp_display.display_format = "upper_downer"
self.ui.bed_temp_display.display_format = "upper_downer"
if self.config.has_section("server"):
# @ Start websocket connection with moonraker
self.bo_ws_startup.emit()
self.reset_tab_indexes()

@QtCore.pyqtSlot(bool, name="show-update-page")
def show_update_page(self, fullscreen: bool):
"""Slot for displaying update Panel"""
if not fullscreen:
self.up.setParent(self.ui.main_content_widget)
current_index = self.ui.main_content_widget.currentIndex()
tab_rect = self.ui.main_content_widget.tabBar().tabRect(current_index)
width = tab_rect.width()
_parent_size = self.up.parent().size()
self.up.setGeometry(
width, 0, _parent_size.width() - width, _parent_size.height()
)
else:
self.up.setParent(self)
self.up.setGeometry(0, 0, self.width(), self.height())

self.up.raise_()
self.up.updateGeometry()
self.up.repaint()
self.up.show()

@QtCore.pyqtSlot(name="on-cancel-print")
def on_cancel_print(self):
"""Slot for cancel print signal"""
Expand Down
39 changes: 7 additions & 32 deletions 39 BlocksScreen/lib/panels/utilitiesTab.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from lib.moonrakerComm import MoonWebSocket
from lib.panels.widgets.troubleshootPage import TroubleshootPage
from lib.panels.widgets.updatePage import UpdatePage
from lib.printer import Printer
from lib.ui.utilitiesStackedWidget_ui import Ui_utilitiesStackedWidget
from lib.utils.blocks_button import BlocksCustomButton
Expand Down Expand Up @@ -87,6 +86,10 @@ class UtilitiesTab(QtWidgets.QStackedWidget):
bool, name="update-available"
)

show_update_page: typing.ClassVar[QtCore.pyqtSignal] = QtCore.pyqtSignal(
bool, name="show-update-page"
)

def __init__(
self, parent: QtWidgets.QWidget, ws: MoonWebSocket, printer: Printer
) -> None:
Expand Down Expand Up @@ -126,8 +129,9 @@ def __init__(
)
self.loadPage.add_widget(self.loadwidget)

self.update_page = UpdatePage(self)
self.addWidget(self.update_page)
self.panel.update_btn.clicked.connect(
lambda: self.show_update_page[bool].emit(False)
)

self.is_page = InputShaperPage(self)
self.addWidget(self.is_page)
Expand All @@ -142,14 +146,12 @@ def __init__(
self.panel.leds_slider_back_btn,
self.panel.input_shaper_back_btn,
self.panel.routine_check_back_btn,
self.update_page.update_back_btn,
self.is_page.update_back_btn,
):
button.clicked.connect(self.back_button)

# --- Page Navigation ---
self._connect_page_change(self.panel.utilities_axes_btn, self.panel.axes_page)
self._connect_page_change(self.panel.update_btn, self.update_page)
self._connect_page_change(
self.panel.utilities_input_shaper_btn, self.panel.input_shaper_page
)
Expand Down Expand Up @@ -202,33 +204,6 @@ def __init__(
self.printer.printer_config.connect(self.on_printer_config_received)
self.printer.gcode_move_update.connect(self.on_gcode_move_update)

# ---- Websocket connections ----

self.on_update_message.connect(self.update_page.handle_update_message)
self.update_page.request_full_update.connect(self.ws.api.full_update)
self.update_page.request_recover_repo[str].connect(
self.ws.api.recover_corrupt_repo
)
self.update_page.request_recover_repo[str, bool].connect(
self.ws.api.recover_corrupt_repo
)
self.update_page.request_refresh_update.connect(
self.ws.api.refresh_update_status
)
self.update_page.request_refresh_update[str].connect(
self.ws.api.refresh_update_status
)
self.printer.gcode_response.connect(self.handle_gcode_response)
self.update_page.request_rollback_update.connect(self.ws.api.rollback_update)
self.update_page.request_update_client.connect(self.ws.api.update_client)
self.update_page.request_update_klipper.connect(self.ws.api.update_klipper)
self.update_page.request_update_moonraker.connect(self.ws.api.update_moonraker)
self.update_page.request_update_status.connect(self.ws.api.update_status)
self.update_page.request_update_system.connect(self.ws.api.update_system)
self.update_page.update_available.connect(self.update_available.emit)
self.update_page.update_available.connect(
self.panel.update_btn.setShowNotification
)
self.panel.update_btn.setPixmap(
QtGui.QPixmap(":/system/media/btn_icons/update-software-icon.svg")
)
Expand Down
61 changes: 36 additions & 25 deletions 61 BlocksScreen/lib/panels/widgets/connectionPage.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ class ConnectionPage(QtWidgets.QFrame):
reboot_clicked = QtCore.pyqtSignal(name="reboot_clicked")
restart_klipper_clicked = QtCore.pyqtSignal(name="restart_klipper_clicked")
firmware_restart_clicked = QtCore.pyqtSignal(name="firmware_restart_clicked")
update_button_clicked = QtCore.pyqtSignal(bool, name="show-update-page")

def __init__(self, parent: QtWidgets.QWidget, ws: MoonWebSocket, /):
super().__init__(parent)
self.setMinimumSize(QtCore.QSize(800, 480))
self.panel = Ui_ConnectivityForm()
self.panel.setupUi(self)

self.panel.updatepageButton.clicked.connect(
lambda: self.update_button_clicked[bool].emit(True)
)

self.ws = ws
self._moonraker_status: str = "disconnected"
self._klippy_state: str = "closed"
Expand Down Expand Up @@ -55,9 +62,16 @@ def show_panel(self, reason: str | None = None):
self.text_update()
return False

def showEvent(self, a0: QtCore.QEvent | None):
"""Handle show event"""
self.ws.api.refresh_update_status()
return super().showEvent(a0)

@QtCore.pyqtSlot(bool, name="on_klippy_connected")
def on_klippy_connection(self, connected: bool):
"""Handle klippy connection state"""
self.dot_timer.stop()

self._klippy_connection = connected
if not connected:
self.panel.connectionTextBox.setText("Klipper Disconnected")
Expand All @@ -69,6 +83,7 @@ def on_klippy_connection(self, connected: bool):
@QtCore.pyqtSlot(str, name="on_klippy_state")
def on_klippy_state(self, state: str):
"""Handle klippy state changes"""
self.dot_timer.stop()
if state == "error":
self.panel.connectionTextBox.setText("Klipper Connection Error")
if not self.isVisible():
Expand All @@ -87,7 +102,6 @@ def on_klippy_state(self, state: str):
self.panel.connectionTextBox.setText("Klipper Startup")
elif state == "ready":
self.panel.connectionTextBox.setText("Klipper Ready")
self.hide()

@QtCore.pyqtSlot(int, name="on_websocket_connecting")
@QtCore.pyqtSlot(str, name="on_websocket_connecting")
Expand All @@ -98,21 +112,22 @@ def on_websocket_connecting(self, attempt: int):
@QtCore.pyqtSlot(name="on_websocket_connection_achieved")
def on_websocket_connection_achieved(self):
"""Handle websocket connected state"""
self.dot_timer.stop()
self.panel.connectionTextBox.setText("Moonraker Connected\n Klippy not ready")
self.hide()

@QtCore.pyqtSlot(name="on_websocket_connection_lost")
@QtCore.pyqtSlot(name="on_websocket_connection_lzost")
def on_websocket_connection_lost(self):
"""Handle websocket connection lost state"""
if not self.isVisible():
self.show()
self.dot_timer.stop()
self.text_update(text="Websocket lost")

def text_update(self, text: int | str | None = None):
"""Update widget text"""
if self.state == "shutdown" and self.message is not None:
return False

self.dot_timer.stop()
logging.debug(f"[ConnectionWindowPanel] text_update: {text}")
if text == "wb lost":
self.panel.connectionTextBox.setText("Moonraker connection lost")
Expand All @@ -125,41 +140,34 @@ def text_update(self, text: int | str | None = None):
return True
if isinstance(text, str):
self.panel.connectionTextBox.setText(
f"""
Connection to Moonraker unavailable\nTry again by reconnecting or \nrestarting klipper\n{text}
"""
f"""Connection to Moonraker unavailable\nTry again by reconnecting or \nrestarting klipper\n{text}"""
)
return True
if isinstance(text, int):
# * Websocket connection messages

self.base_text = f"Attempting to reconnect to Moonraker.\n\nConnection try number: {text}"

if text == 0:
self.dot_timer.stop()
self.panel.connectionTextBox.setText(
"Unable to Connect to Moonraker.\n\nTry again"
"Connection to Moonraker timeout \n \n please retry"
)
return False

if text == 1:
if self.dot_timer.isActive():
self.dot_timer.stop()
return
self.dot_timer.start()
return
self.dot_count = 0

self.text2 = f"Attempting to reconnect to Moonraker.\n\nConnection try number: {text}"
self.dot_timer.start()
self._add_dot()

return False

def _add_dot(self):
if self.state == "shutdown" and self.message is not None:
"""Add one dot per second (max 3)."""
self.dot_count += 1
if self.dot_count > 3:
self.dot_timer.stop()
return False

if self.dot_count > 2:
self.dot_count = 1
else:
self.dot_count += 1
return
dots = "." * self.dot_count + " " * (3 - self.dot_count)
self.panel.connectionTextBox.setText(f"{self.text2}{dots}")
self.panel.connectionTextBox.setText(f"{self.base_text}{dots}")

@QtCore.pyqtSlot(str, str, name="webhooks_update")
def webhook_update(self, state: str, message: str):
Expand All @@ -171,16 +179,19 @@ def webhook_update(self, state: str, message: str):
def eventFilter(self, object: QtCore.QObject, event: QtCore.QEvent) -> bool:
"""Re-implemented method, filter events"""
if event.type() == KlippyDisconnected.type():
self.dot_timer.stop()
if not self.isVisible():
self.panel.connectionTextBox.setText("Klippy Disconnected")
self.show()

elif event.type() == KlippyReady.type():
self.dot_timer.stop()
self.panel.connectionTextBox.setText("Klippy Ready")
self.hide()
return False

elif event.type() == KlippyShutdown.type():
self.dot_timer.stop()
if not self.isVisible():
self.panel.connectionTextBox.setText(f"{self.message}")
self.show()
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.