Skip to content

Commit

Permalink
Cleanup, stop connecting on network timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
meowmeowahr committed Dec 14, 2024
1 parent 4663e2b commit 9ad734e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/kevinbot_desktopclient/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def run(self):
ConnectionRefusedError,
kevinbotlib.exceptions.HandshakeTimeoutException,
socket.gaierror,
TimeoutError,
) as e:
logger.error(f"Failed to connect to MQTT broker: {e!r}")
self.signals.connection_error.emit(e, traceback.format_exc())
Expand Down
4 changes: 2 additions & 2 deletions src/kevinbot_desktopclient/ui/delegates.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Useful delegates for Qt
"""

from PySide6.QtCore import QModelIndex
from PySide6.QtCore import QModelIndex, QPersistentModelIndex
from PySide6.QtGui import QPainter
from PySide6.QtWidgets import QApplication, QStyle, QStyledItemDelegate, QStyleOptionViewItem

Expand All @@ -16,7 +16,7 @@ class ComboBoxNoTextDelegate(QStyledItemDelegate):
def __init__(self, parent=None):
super().__init__(parent)

def paint(self, painter: QPainter, option: 'QStyleOptionViewItem', index: QModelIndex) -> None:
def paint(self, painter: QPainter, option: QStyleOptionViewItem, index: QModelIndex | QPersistentModelIndex) -> None:
# Create a copy of the style option
opt = option

Expand Down

0 comments on commit 9ad734e

Please sign in to comment.