Skip to content

Clarify raw data / archive download message #1116

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.

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ def _download_data(self, button_instance):
Args:
button_instance (ipywidgets.Button): The button instance that was clicked.
"""
self._disable_buttons()
if "archive" in button_instance.description:
what = "archive"
filename = f"export_qeapp_calculation_pk_{self.node.pk}.aiida"
else:
what = "raw"
filename = f"export_{self.node.pk}_raw.zip"

self._disable_buttons()
self._show_downloading_message(what)
data = self.produce_bitestream(self.node, what=what)
self._download(payload=data, filename=filename)
Expand All @@ -99,7 +99,12 @@ def _download_data(self, button_instance):
self._enable_buttons()

def _show_downloading_message(self, what):
self._downloading_message.value = f"Downloading {what} data..."
self._downloading_message.value = f"""
<div style="display: flex; align-items: center; margin: 6px 0;">
Creating {what} data to download
<i class="fa fa-spinner fa-spin fa-2x fa-fw" style="margin-left: 4px;"></i>
</div>
"""

def _hide_downloading_message(self):
self._downloading_message.value = ""
Expand Down
2 changes: 1 addition & 1 deletion src/aiidalab_qe/common/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ def __init__(self, message="Loading", **kwargs):
super().__init__(
children=[
self.message,
ipw.HTML("<i class='fa fa-spinner fa-spin fa-2x fa-fw'/>"),
ipw.HTML("<i class='fa fa-spinner fa-spin fa-2x fa-fw'></i>"),
],
**kwargs,
)
Expand Down
Loading