From fca3047eaf376bd0b40a4f2d784e65645755e6df Mon Sep 17 00:00:00 2001 From: moshernoah <88799553+moshernoah@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:23:17 -0500 Subject: [PATCH] Part 2 of 2: Addressing Comments This push moved the UI pieces of exporting to CSV to the data_analysis_ui.py file after removing them from the experiment_database.py file. Signed-off-by: moshernoah <88799553+moshernoah@users.noreply.github.com> --- experiment_pages/experiment/data_analysis_ui.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/experiment_pages/experiment/data_analysis_ui.py b/experiment_pages/experiment/data_analysis_ui.py index 6e1fe8ab..6070e3c3 100644 --- a/experiment_pages/experiment/data_analysis_ui.py +++ b/experiment_pages/experiment/data_analysis_ui.py @@ -32,6 +32,8 @@ def export_to_csv(self): db = ExperimentDatabase(self.db_file) db.export_all_tables_to_csv() print("Data exported successfully to CSV files.") + # Once export is done, show the success notification + self.show_success_notification() except Exception as e: print(f"An error occurred while exporting data: {e}") @@ -39,3 +41,16 @@ def raise_frame(self): '''Raise the frame for this UI''' super().raise_frame() + def show_success_notification(self): + '''Displays a success notification when export is complete.''' + notification = CTk() # Create a new window + notification.title("Export Successful") + notification.geometry("300x100") # Set the window size + + label = CTkLabel(notification, text="Export to CSV was successful!", pady=20) + label.pack() + + ok_button = CTkButton(notification, text="OK", command=notification.destroy) + ok_button.pack(pady=10) + + notification.mainloop()