-
Notifications
You must be signed in to change notification settings - Fork 0
Add popups confirming saves and calculation start #33
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY | ||
| version = 1 | ||
| name = "astra_gui" | ||
|
|
||
| [setup] | ||
| script = "" | ||
|
|
||
| [[actions]] | ||
| name = "Run" | ||
| icon = "run" | ||
| command = "hatch run all" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ | |
| invalid_input_popup, | ||
| missing_script_file_popup, | ||
| required_field_popup, | ||
| started_calculation_popup, | ||
| ) | ||
| from .symmetry_module import Symmetry | ||
|
|
||
|
|
@@ -316,8 +317,7 @@ def get_cpu_stats_data() -> list[str]: | |
| lines = stdout.split('\n') | ||
| else: | ||
| try: | ||
| with Path(proc_stat_file).open('r') as f: | ||
| lines = f.read().split('\n') | ||
| lines = Path(proc_stat_file).read_text().split('\n') | ||
| except FileNotFoundError: | ||
| if system() == 'Darwin': | ||
| logger.warning( | ||
|
|
@@ -577,6 +577,10 @@ def check_programs_helper(script_name: str) -> None: | |
| return | ||
| if not run[0]: | ||
| return | ||
| self.controller.after( | ||
| 0, | ||
| lambda: started_calculation_popup(f'{script_name} started running.'), | ||
| ) | ||
|
Comment on lines
+580
to
+583
|
||
|
|
||
| if self.ssh_client: | ||
| remote_command = ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,6 +88,16 @@ def completed_calculation_popup(message: str) -> None: | |
| messagebox.showinfo('Completed Calculation!', message) | ||
|
|
||
|
|
||
| def started_calculation_popup(message: str) -> None: | ||
| """Display a start message for long-running calculations.""" | ||
| messagebox.showinfo('Calculation Started', message) | ||
|
|
||
|
|
||
| def save_success_popup(message: str) -> None: | ||
| """Display a confirmation message after saving files.""" | ||
| messagebox.showinfo('Files Saved', message) | ||
|
|
||
|
Comment on lines
+91
to
+99
|
||
|
|
||
| def missing_script_file_popup(name: str) -> None: | ||
| """Inform that a required script file has not been saved yet.""" | ||
| messagebox.showerror('Missing script file!', f'Please save the script for {name} before running!') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
save_success_popupis shown unconditionally aftersave_script(...), butsave_scriptcan return early without writing anything (e.g., whenidle_processor_popup(...)is declined). This can lead to a false “inputs saved successfully” confirmation. Consider havingsave_scriptreturn a boolean indicating whether it actually saved, or restructuring so the success popup is only shown after the save definitely occurred.