Commit 758258fd authored by pixhawk's avatar pixhawk

Fixed logging on logging abort bug

parent 4dc1b91a
......@@ -12,14 +12,14 @@
#define WITH_TEXT_TO_SPEECH 1
#define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_APPLICATION_VERSION "v. 0.9.0 (Alpha RC1)"
#define QGC_APPLICATION_VERSION "v. 0.9.1 (Alpha RC1)"
namespace QGC
{
const QString APPNAME = "QGROUNDCONTROL";
const QString COMPANYNAME = "QGROUNDCONTROL";
const int APPLICATIONVERSION = 90; // 0.9.0
const int APPLICATIONVERSION = 91; // 0.9.0
}
#endif // QGC_CONFIGURATION_H
......@@ -453,11 +453,6 @@ void LinechartWidget::startLogging()
// QString("./pixhawk-log-" + date.toString("yyyy-MM-dd") + "-" + QString::number(logindex) + ".log")
QString fileName = QFileDialog::getSaveFileName(this, tr("Specify log file name"), QDesktopServices::storageLocation(QDesktopServices::DesktopLocation), tr("Logfile (*.csv *.txt);;"));
if (!fileName.contains(".")) {
// .csv is default extension
fileName.append(".csv");
}
while (!(fileName.endsWith(".txt") || fileName.endsWith(".csv")) && !abort && fileName != "") {
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Critical);
......@@ -465,14 +460,16 @@ void LinechartWidget::startLogging()
msgBox.setInformativeText("Please choose .txt or .csv as file extension. Click OK to change the file extension, cancel to not start logging.");
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
if(msgBox.exec() == QMessageBox::Cancel) {
if(msgBox.exec() != QMessageBox::Ok)
{
abort = true;
break;
}
fileName = QFileDialog::getSaveFileName(this, tr("Specify log file name"), QDesktopServices::storageLocation(QDesktopServices::DesktopLocation), tr("Logfile (*.txt, *.csv);;"));
fileName = QFileDialog::getSaveFileName(this, tr("Specify log file name"), QDesktopServices::storageLocation(QDesktopServices::DesktopLocation), tr("Logfile (*.txt *.csv);;"));
}
qDebug() << "SAVE FILE" << fileName;
// Check if the user did not abort the file save dialog
if (!abort && fileName != "") {
logFile = new QFile(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