Skip to content

Commit

Permalink
a2error_dialog got show function
Browse files Browse the repository at this point in the history
  • Loading branch information
ewerybody committed Apr 19, 2023
1 parent 9f420c7 commit 057b720
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ui/a2element/menu_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def call_code(self):
try:
self.mod.call_python_script(file_name)
except Exception as error:
a2error_dialog.A2ErrorDialog(
a2error_dialog.show(
traceback.format_exc().strip(),
f'There was an error trying to execute the script "{script_name}":',
error,
self
self.main
)


Expand Down
8 changes: 7 additions & 1 deletion ui/a2widget/a2error_dialog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from a2qt import QtCore, QtWidgets
from a2qt import QtWidgets
from a2widget import a2text_field


Expand Down Expand Up @@ -32,6 +32,12 @@ def __init__(self, error, message=None, title=None, parent=None):
layout.addWidget(self.a2ok_button)


def show(error, message=None, title=None, parent=None):
dialog = A2ErrorDialog(error, message, title, parent)
dialog.show()
return dialog


if __name__ == '__main__':
from a2widget.demo import a2dialog_demo

Expand Down

0 comments on commit 057b720

Please sign in to comment.