clean up drop event function
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user