diff --git a/src/ui/QGCDataPlot2D.cc b/src/ui/QGCDataPlot2D.cc index 1f5318e3c3f3e44a46910c99da4ba1a892e660c7..3dfa9012ae18de10e7c4149322112fd7e0b532d0 100644 --- a/src/ui/QGCDataPlot2D.cc +++ b/src/ui/QGCDataPlot2D.cc @@ -116,7 +116,7 @@ void QGCDataPlot2D::loadFile(QString file) QString QGCDataPlot2D::getSavePlotFilename() { QString fileName = QGCFileDialog::getSaveFileName( - this, "Export File Name", QStandardPaths::writableLocation(QStandardPaths::DesktopLocation), + this, "Export Plot File", QStandardPaths::writableLocation(QStandardPaths::DesktopLocation), "PDF Documents (*.pdf);;SVG Images (*.svg)", "pdf"); return fileName; @@ -131,11 +131,13 @@ void QGCDataPlot2D::savePlot() if (fileName.isEmpty()) return; + // TODO This will change once we add "strict" file types in file selection dialogs while(!(fileName.endsWith(".svg") || fileName.endsWith(".pdf"))) { - QMessageBox::StandardButton button = QGCMessageBox::critical(tr("Unsuitable file extension for PDF or SVG"), - tr("Please choose .pdf or .svg as file extension. Click OK to change the file extension, cancel to not save the file."), - QMessageBox::Ok | QMessageBox::Cancel, - QMessageBox::Ok); + QMessageBox::StandardButton button = QGCMessageBox::warning( + tr("Unsuitable file extension for Plot document type."), + tr("Please choose .pdf or .svg as file extension. Click OK to change the file extension, cancel to not save the file."), + QMessageBox::Ok | QMessageBox::Cancel, + QMessageBox::Ok); // Abort if cancelled if (button == QMessageBox::Cancel) { return; diff --git a/src/ui/WaypointList.cc b/src/ui/WaypointList.cc index d5091f3a7b2ef7e50c581cb46b18303e2a87f6f6..5354cf2af2fab78607423e7871b41ca347dd33b8 100644 --- a/src/ui/WaypointList.cc +++ b/src/ui/WaypointList.cc @@ -217,13 +217,15 @@ void WaypointList::setUAS(UASInterface* uas) void WaypointList::saveWaypoints() { - QString fileName = QGCFileDialog::getSaveFileName(this, tr("Save File"), "./waypoints.txt", tr("Waypoint File (*.txt)"), "txt"); + // TODO Need better default directory + // TODO Need better extension than .txt + QString fileName = QGCFileDialog::getSaveFileName(this, tr("Save Waypoint File"), "./waypoints.txt", tr("Waypoint File (*.txt)"), "txt"); WPM->saveWaypoints(fileName); } void WaypointList::loadWaypoints() { - QString fileName = QGCFileDialog::getOpenFileName(this, tr("Load File"), ".", tr("Waypoint File (*.txt)")); + QString fileName = QGCFileDialog::getOpenFileName(this, tr("Load Waypoint File"), ".", tr("Waypoint File (*.txt)")); WPM->loadWaypoints(fileName); }