Browse Source

Adding and/or fixing captions.

QGC4.4
dogmaphobic 10 years ago
parent
commit
81b4fd3a39
  1. 12
      src/ui/QGCDataPlot2D.cc
  2. 6
      src/ui/WaypointList.cc

12
src/ui/QGCDataPlot2D.cc

@ -116,7 +116,7 @@ void QGCDataPlot2D::loadFile(QString file) @@ -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() @@ -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;

6
src/ui/WaypointList.cc

@ -217,13 +217,15 @@ void WaypointList::setUAS(UASInterface* uas) @@ -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);
}

Loading…
Cancel
Save