Commit 81b4fd3a authored by dogmaphobic's avatar dogmaphobic

Adding and/or fixing captions.

parent e993032a
...@@ -116,7 +116,7 @@ void QGCDataPlot2D::loadFile(QString file) ...@@ -116,7 +116,7 @@ void QGCDataPlot2D::loadFile(QString file)
QString QGCDataPlot2D::getSavePlotFilename() QString QGCDataPlot2D::getSavePlotFilename()
{ {
QString fileName = QGCFileDialog::getSaveFileName( 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 Documents (*.pdf);;SVG Images (*.svg)",
"pdf"); "pdf");
return fileName; return fileName;
...@@ -131,11 +131,13 @@ void QGCDataPlot2D::savePlot() ...@@ -131,11 +131,13 @@ void QGCDataPlot2D::savePlot()
if (fileName.isEmpty()) if (fileName.isEmpty())
return; return;
// TODO This will change once we add "strict" file types in file selection dialogs
while(!(fileName.endsWith(".svg") || fileName.endsWith(".pdf"))) { while(!(fileName.endsWith(".svg") || fileName.endsWith(".pdf"))) {
QMessageBox::StandardButton button = QGCMessageBox::critical(tr("Unsuitable file extension for PDF or SVG"), QMessageBox::StandardButton button = QGCMessageBox::warning(
tr("Please choose .pdf or .svg as file extension. Click OK to change the file extension, cancel to not save the file."), tr("Unsuitable file extension for Plot document type."),
QMessageBox::Ok | QMessageBox::Cancel, 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::Ok | QMessageBox::Cancel,
QMessageBox::Ok);
// Abort if cancelled // Abort if cancelled
if (button == QMessageBox::Cancel) { if (button == QMessageBox::Cancel) {
return; return;
......
...@@ -217,13 +217,15 @@ void WaypointList::setUAS(UASInterface* uas) ...@@ -217,13 +217,15 @@ void WaypointList::setUAS(UASInterface* uas)
void WaypointList::saveWaypoints() 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); WPM->saveWaypoints(fileName);
} }
void WaypointList::loadWaypoints() 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); WPM->loadWaypoints(fileName);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment