clean up drop event function

This commit is contained in:
WorldTeacher
2024-10-23 10:27:06 +02:00
parent 115c816d50
commit f358048856

View File

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