Connect tree change with csv import

After the csv import dialog, the changes in the tree structure (like new
tables or deleting old tables) are visible to the user.
This commit is contained in:
Lea Laux 2021-02-22 11:59:52 +01:00 committed by KDV Admin
parent 7747dba026
commit e53ccdd62c
2 changed files with 12 additions and 0 deletions

View File

@ -14,6 +14,10 @@ class CSVImportDialog(QDialog):
def __init__(self, host, user, database, port, csv_file): def __init__(self, host, user, database, port, csv_file):
super().__init__() 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. # Add the pygadmin icon as window icon.
icon_adder = IconAdder() icon_adder = IconAdder()
icon_adder.add_icon_to_widget(self) icon_adder.add_icon_to_widget(self)

View File

@ -503,6 +503,14 @@ class MainWindow(QMainWindow):
database_connection_parameters["port"], database_connection_parameters["port"],
file_name) 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) @pyqtSlot(str)
def show_status_bar_message(self, message): def show_status_bar_message(self, message):
""" """