Skip to content

Commit 60b0a62

Browse files
committed
Drag and drop datafile
1 parent cec819c commit 60b0a62

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Desktop/mainwindow.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,13 +870,22 @@ void MainWindow::openURLFile(QString fileURLPath)
870870
return;
871871
}
872872

873-
if (!FileTypeBaseValidName(fileInfo.suffix().toLower().toStdString()))
873+
Utils::FileType fileType = Utils::getTypeFromFileName(fq(filePath));
874+
875+
if (fileType == Utils::FileType::empty || fileType == Utils::FileType::unknown || fileType == Utils::FileType::html || fileType == Utils::FileType::pdf)
874876
{
875877
MessageForwarder::showWarning(tr("Open file"), tr("JASP does not support this file type %1.").arg(filePath));
876878
return;
877879
}
878880

879-
open(filePath);
881+
if (_package->hasDataSet() && fileType != Utils::FileType::jasp)
882+
{
883+
FileEvent * syncEvent = new FileEvent(_fileMenu, FileEvent::FileSyncData);
884+
syncEvent->setPath(filePath);
885+
syncEvent->setStarted();
886+
}
887+
else
888+
open(filePath);
880889
}
881890

882891
void MainWindow::open(const QString & mainFilePath, const QString & inputDataFile, const QString & outputFile, bool keepJASPOpen)

0 commit comments

Comments
 (0)