Skip to content

Commit

Permalink
Merge pull request #4 from strubium/more-popups
Browse files Browse the repository at this point in the history
Improve popup system
  • Loading branch information
strubium authored Jun 18, 2024
2 parents c582843 + 9594025 commit d6ac0d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion QtPyHammer/ui/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def __init__(self, parent):
self.setGeometry(780, 220, 360, 640)
app = QtWidgets.QApplication.instance()
if len(app.fgd.entities) == 0:
raise RuntimeError("No entites to browse!")
error_popup = popup.browser(parent=self, popuptext="Error", msgtext="No entites to browse!")
error_popup.show()

def is_point_or_solid(e):
return e.class_type in ("PointClass", "SolidClass")
Expand Down
2 changes: 1 addition & 1 deletion QtPyHammer/ui/popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from ..utilities import lang

class browser(QtWidgets.QDialog):
def __init__(self, parent, popuptext, msgtext):
def __init__(self, parent, popuptext="Error", msgtext="Something's wrong, but we don't know what"):
super(browser, self).__init__(parent, QtCore.Qt.Tool)
self.setWindowTitle(popuptext)

Expand Down

0 comments on commit d6ac0d6

Please sign in to comment.