diff --git a/pygadmin/widgets/csv_import.py b/pygadmin/widgets/csv_import.py index 5b745df..3f0ae1b 100644 --- a/pygadmin/widgets/csv_import.py +++ b/pygadmin/widgets/csv_import.py @@ -14,6 +14,10 @@ class CSVImportDialog(QDialog): def __init__(self, host, user, database, port, csv_file): super().__init__() + # Set the dialog modal, so during the csv import operation, other data manipulation operations are not possible + # with pygadmin. + self.setModal(True) + # Add the pygadmin icon as window icon. icon_adder = IconAdder() icon_adder.add_icon_to_widget(self) diff --git a/pygadmin/widgets/main_window.py b/pygadmin/widgets/main_window.py index 759dfbd..1257f1a 100644 --- a/pygadmin/widgets/main_window.py +++ b/pygadmin/widgets/main_window.py @@ -503,6 +503,14 @@ class MainWindow(QMainWindow): database_connection_parameters["port"], file_name) + # Activate the slot for changing the tree structure after a csv import. This import could include creating and + # dropping different tables, so the changes are visable in the tree. + self.csv_import_dialog.finished.connect(lambda: self.change_tree_structure(("TABLE", { + "host": database_connection_parameters["host"], + "user": database_connection_parameters["user"], + "database": database_connection_parameters["database"], + "port": database_connection_parameters["port"]}))) + @pyqtSlot(str) def show_status_bar_message(self, message): """