Skip to content

Commit

Permalink
Update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
smaierhofer committed Nov 25, 2024
1 parent faa9647 commit 2adbcf1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Command line interface: Providing no input path
- Scenario fails to be opened, if any of the dynamic obstacles does not contain a prediction
- GUI: wrong usage of button
- Check for qt6 so that map conversions work under Ubuntu 20.04

## [0.8.2] - 2024-07-22

Expand Down
47 changes: 21 additions & 26 deletions crdesigner/ui/gui/utilities/errors.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
try:
# required for Ubuntu 20.04 since there a system library is too old for pyqt6 and the import fails
# when not importing this, one can still use the map conversion
from PyQt6.QtWidgets import QMessageBox, QWidget
from PyQt6.QtWidgets import QMessageBox, QWidget

pyqt_available = True

def _message(
widget: QWidget,
title: str,
text: str,
buttons=QMessageBox.StandardButton.Ok,
default_button=QMessageBox.StandardButton.Ok,
) -> QMessageBox.StandardButton:
messagebox = QMessageBox()
reply = messagebox.warning(widget, title, text, buttons, default_button)
messagebox.close()
return reply
def _message(
widget: QWidget,
title: str,
text: str,
buttons=QMessageBox.StandardButton.Ok,
default_button=QMessageBox.StandardButton.Ok,
) -> QMessageBox.StandardButton:
messagebox = QMessageBox()
reply = messagebox.warning(widget, title, text, buttons, default_button)
messagebox.close()
return reply

def error(
widget: QWidget, text: str, buttons=QMessageBox.StandardButton.Ok, default_button=QMessageBox.StandardButton.Ok
) -> QMessageBox.StandardButton:
return _message(widget, "Error", text, buttons, default_button)

def warning(
widget: QWidget, text: str, buttons=QMessageBox.StandardButton.Ok, default_button=QMessageBox.StandardButton.Ok
) -> QMessageBox.StandardButton:
return _message(widget, "Warning", text, buttons, default_button)
def error(
widget: QWidget, text: str, buttons=QMessageBox.StandardButton.Ok, default_button=QMessageBox.StandardButton.Ok
) -> QMessageBox.StandardButton:
return _message(widget, "Error", text, buttons, default_button)

except (ImportError, RuntimeError):
pyqt_available = False

def warning(
widget: QWidget, text: str, buttons=QMessageBox.StandardButton.Ok, default_button=QMessageBox.StandardButton.Ok
) -> QMessageBox.StandardButton:
return _message(widget, "Warning", text, buttons, default_button)

0 comments on commit 2adbcf1

Please sign in to comment.