Commit 81b4fd3a authored by dogmaphobic's avatar dogmaphobic

Adding and/or fixing captions.

parent e993032a
......@@ -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;
......
......@@ -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);
}
......
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