From f358048856a53d78d922bc55cae1116a8471ef17 Mon Sep 17 00:00:00 2001 From: WorldTeacher <41587052+WorldTeacher@users.noreply.github.com> Date: Wed, 23 Oct 2024 10:27:06 +0200 Subject: [PATCH] clean up drop event function --- application.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/application.py b/application.py index b7adae6..7940ceb 100644 --- a/application.py +++ b/application.py @@ -39,18 +39,9 @@ class Application(QtWidgets.QMainWindow, MainWindow): def dropEvent(self, event): for url in event.mimeData().urls(): if url.isLocalFile(): - if url.toLocalFile().endswith(".json"): + supported = [".json", ".log"] + if url.toLocalFile().endswith(tuple(supported)): self.data_source.setText(url.toLocalFile()) - elif url.toLocalFile().endswith(".log"): - msg = QtWidgets.QMessageBox() - msg.setIcon(QtWidgets.QMessageBox.Icon.Information) - msg.setText("Not yet supported") #TODO add support for log files - msg.setWindowTitle("Parse Log File?") - msg.exec() - # if msg.clickedButton().text() == "Yes": - # self.data_source.setText(url.toLocalFile()) - # else: - # continue else: # Show error message in dialog msg = QtWidgets.QMessageBox()