From 758258fdb36f35dea5297874f7e168b9b666cdc6 Mon Sep 17 00:00:00 2001 From: pixhawk Date: Tue, 6 Sep 2011 16:31:54 +0200 Subject: [PATCH] Fixed logging on logging abort bug --- src/configuration.h | 4 ++-- src/ui/linechart/LinechartWidget.cc | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index 59ef6a327..4a515331e 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -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 diff --git a/src/ui/linechart/LinechartWidget.cc b/src/ui/linechart/LinechartWidget.cc index ae5981f0b..5b78a42b3 100644 --- a/src/ui/linechart/LinechartWidget.cc +++ b/src/ui/linechart/LinechartWidget.cc @@ -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); -- 2.22.0