Skip to content

Commit

Permalink
Part 2 of 2: Addressing Comments
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
moshernoah authored Oct 2, 2024
1 parent 6160ee3 commit fca3047
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions experiment_pages/experiment/data_analysis_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,25 @@ 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}")

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()

0 comments on commit fca3047

Please sign in to comment.