Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
3acd1ab7
Commit
3acd1ab7
authored
Jun 26, 2014
by
Bryant Mairs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QDesktopServices no longer provides system paths, switched to QStandardPaths.
parent
187293ea
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
23 deletions
+23
-23
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+3
-3
HUD.cc
src/ui/HUD.cc
+3
-3
MAVLinkSettingsWidget.cc
src/ui/MAVLinkSettingsWidget.cc
+2
-2
MainWindow.cc
src/ui/MainWindow.cc
+1
-1
QGCDataPlot2D.cc
src/ui/QGCDataPlot2D.cc
+5
-5
QGCMAVLinkLogPlayer.cc
src/ui/QGCMAVLinkLogPlayer.cc
+2
-2
QGCStatusBar.cc
src/ui/QGCStatusBar.cc
+1
-1
QGCToolWidget.cc
src/ui/designer/QGCToolWidget.cc
+3
-3
LinechartWidget.cc
src/ui/linechart/LinechartWidget.cc
+3
-3
No files found.
src/comm/MAVLinkProtocol.cc
View file @
3acd1ab7
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include <QApplication>
#include <QApplication>
#include <QMessageBox>
#include <QMessageBox>
#include <QSettings>
#include <QSettings>
#include <Q
DesktopService
s>
#include <Q
StandardPath
s>
#include <QtEndian>
#include <QtEndian>
#include <QMetaType>
#include <QMetaType>
...
@@ -101,7 +101,7 @@ void MAVLinkProtocol::loadSettings()
...
@@ -101,7 +101,7 @@ void MAVLinkProtocol::loadSettings()
}
}
else
if
(
m_logfile
==
NULL
)
else
if
(
m_logfile
==
NULL
)
{
{
m_logfile
=
new
QFile
(
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
HomeLocation
)
+
"/qgroundcontrol_packetlog.mavlink"
);
m_logfile
=
new
QFile
(
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
HomeLocation
)
+
"/qgroundcontrol_packetlog.mavlink"
);
}
}
// Enable logging
// Enable logging
enableLogging
(
settings
.
value
(
"LOGGING_ENABLED"
,
m_loggingEnabled
).
toBool
());
enableLogging
(
settings
.
value
(
"LOGGING_ENABLED"
,
m_loggingEnabled
).
toBool
());
...
@@ -205,7 +205,7 @@ QString MAVLinkProtocol::getLogfileName()
...
@@ -205,7 +205,7 @@ QString MAVLinkProtocol::getLogfileName()
}
}
else
else
{
{
return
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
HomeLocation
)
+
"/qgroundcontrol_packetlog.mavlink"
;
return
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
HomeLocation
)
+
"/qgroundcontrol_packetlog.mavlink"
;
}
}
}
}
...
...
src/ui/HUD.cc
View file @
3acd1ab7
...
@@ -32,7 +32,7 @@ This file is part of the QGROUNDCONTROL project
...
@@ -32,7 +32,7 @@ This file is part of the QGROUNDCONTROL project
#include <QShowEvent>
#include <QShowEvent>
#include <QContextMenuEvent>
#include <QContextMenuEvent>
#include <QMenu>
#include <QMenu>
#include <Q
DesktopService
s>
#include <Q
StandardPath
s>
#include <QFileDialog>
#include <QFileDialog>
#include <QPaintEvent>
#include <QPaintEvent>
#include <QDebug>
#include <QDebug>
...
@@ -1313,7 +1313,7 @@ void HUD::saveImage()
...
@@ -1313,7 +1313,7 @@ void HUD::saveImage()
void
HUD
::
selectOfflineDirectory
()
void
HUD
::
selectOfflineDirectory
()
{
{
QString
fileName
=
QFileDialog
::
getExistingDirectory
(
this
,
tr
(
"Select image directory"
),
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
));
QString
fileName
=
QFileDialog
::
getExistingDirectory
(
this
,
tr
(
"Select image directory"
),
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
));
if
(
fileName
!=
""
)
{
if
(
fileName
!=
""
)
{
offlineDirectory
=
fileName
;
offlineDirectory
=
fileName
;
}
}
...
@@ -1392,7 +1392,7 @@ void HUD::saveImages(bool save)
...
@@ -1392,7 +1392,7 @@ void HUD::saveImages(bool save)
QFileDialog
dialog
(
this
);
QFileDialog
dialog
(
this
);
dialog
.
setFileMode
(
QFileDialog
::
DirectoryOnly
);
dialog
.
setFileMode
(
QFileDialog
::
DirectoryOnly
);
imageLogDirectory
=
QFileDialog
::
getExistingDirectory
(
this
,
tr
(
"Select image log directory"
),
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
));
imageLogDirectory
=
QFileDialog
::
getExistingDirectory
(
this
,
tr
(
"Select image log directory"
),
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
));
qDebug
()
<<
"Logging to:"
<<
imageLogDirectory
;
qDebug
()
<<
"Logging to:"
<<
imageLogDirectory
;
...
...
src/ui/MAVLinkSettingsWidget.cc
View file @
3acd1ab7
...
@@ -30,7 +30,7 @@ This file is part of the QGROUNDCONTROL project
...
@@ -30,7 +30,7 @@ This file is part of the QGROUNDCONTROL project
#include <QFileInfo>
#include <QFileInfo>
#include <QFileDialog>
#include <QFileDialog>
#include <QMessageBox>
#include <QMessageBox>
#include <Q
DesktopService
s>
#include <Q
StandardPath
s>
#include "MAVLinkSettingsWidget.h"
#include "MAVLinkSettingsWidget.h"
#include "LinkManager.h"
#include "LinkManager.h"
...
@@ -154,7 +154,7 @@ void MAVLinkSettingsWidget::updateLogfileName(const QString& fileName)
...
@@ -154,7 +154,7 @@ void MAVLinkSettingsWidget::updateLogfileName(const QString& fileName)
void
MAVLinkSettingsWidget
::
chooseLogfileName
()
void
MAVLinkSettingsWidget
::
chooseLogfileName
()
{
{
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify MAVLink log file name"
),
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
),
tr
(
"MAVLink Logfile (*.mavlink);;"
));
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify MAVLink log file name"
),
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
),
tr
(
"MAVLink Logfile (*.mavlink);;"
));
if
(
!
fileName
.
endsWith
(
".mavlink"
))
if
(
!
fileName
.
endsWith
(
".mavlink"
))
{
{
...
...
src/ui/MainWindow.cc
View file @
3acd1ab7
...
@@ -970,7 +970,7 @@ void MainWindow::createCustomWidget()
...
@@ -970,7 +970,7 @@ void MainWindow::createCustomWidget()
void
MainWindow
::
loadCustomWidget
()
void
MainWindow
::
loadCustomWidget
()
{
{
QString
widgetFileExtension
(
".qgw"
);
QString
widgetFileExtension
(
".qgw"
);
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Specify Widget File Name"
),
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
),
tr
(
"QGroundControl Widget (*%1);;"
).
arg
(
widgetFileExtension
));
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Specify Widget File Name"
),
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
),
tr
(
"QGroundControl Widget (*%1);;"
).
arg
(
widgetFileExtension
));
if
(
fileName
!=
""
)
loadCustomWidget
(
fileName
);
if
(
fileName
!=
""
)
loadCustomWidget
(
fileName
);
}
}
void
MainWindow
::
loadCustomWidget
(
const
QString
&
fileName
,
int
view
)
void
MainWindow
::
loadCustomWidget
(
const
QString
&
fileName
,
int
view
)
...
...
src/ui/QGCDataPlot2D.cc
View file @
3acd1ab7
...
@@ -36,7 +36,7 @@ This file is part of the QGROUNDCONTROL project
...
@@ -36,7 +36,7 @@ This file is part of the QGROUNDCONTROL project
#include <QHBoxLayout>
#include <QHBoxLayout>
#include <QSvgGenerator>
#include <QSvgGenerator>
#include <QPrinter>
#include <QPrinter>
#include <Q
DesktopService
s>
#include <Q
StandardPath
s>
#include "QGCDataPlot2D.h"
#include "QGCDataPlot2D.h"
#include "ui_QGCDataPlot2D.h"
#include "ui_QGCDataPlot2D.h"
#include "MG.h"
#include "MG.h"
...
@@ -118,7 +118,7 @@ void QGCDataPlot2D::savePlot()
...
@@ -118,7 +118,7 @@ void QGCDataPlot2D::savePlot()
{
{
QString
fileName
=
"plot.svg"
;
QString
fileName
=
"plot.svg"
;
fileName
=
QFileDialog
::
getSaveFileName
(
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
"Export File Name"
,
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
),
this
,
"Export File Name"
,
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
),
"PDF Documents (*.pdf);;SVG Images (*.svg)"
);
"PDF Documents (*.pdf);;SVG Images (*.svg)"
);
if
(
fileName
.
isEmpty
())
if
(
fileName
.
isEmpty
())
return
;
return
;
...
@@ -138,7 +138,7 @@ void QGCDataPlot2D::savePlot()
...
@@ -138,7 +138,7 @@ void QGCDataPlot2D::savePlot()
// Abort if cancelled
// Abort if cancelled
if
(
msgBox
.
exec
()
==
QMessageBox
::
Cancel
)
return
;
if
(
msgBox
.
exec
()
==
QMessageBox
::
Cancel
)
return
;
fileName
=
QFileDialog
::
getSaveFileName
(
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
"Export File Name"
,
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
),
this
,
"Export File Name"
,
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
),
"PDF Documents (*.pdf);;SVG Images (*.svg)"
);
"PDF Documents (*.pdf);;SVG Images (*.svg)"
);
if
(
fileName
.
isEmpty
())
if
(
fileName
.
isEmpty
())
return
;
//Abort if cancelled
return
;
//Abort if cancelled
...
@@ -694,7 +694,7 @@ void QGCDataPlot2D::saveCsvLog()
...
@@ -694,7 +694,7 @@ void QGCDataPlot2D::saveCsvLog()
{
{
QString
fileName
=
"export.csv"
;
QString
fileName
=
"export.csv"
;
fileName
=
QFileDialog
::
getSaveFileName
(
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
"Export CSV File Name"
,
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
),
this
,
"Export CSV File Name"
,
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
),
"CSV file (*.csv);;Text file (*.txt)"
);
"CSV file (*.csv);;Text file (*.txt)"
);
if
(
fileName
.
isEmpty
())
if
(
fileName
.
isEmpty
())
return
;
//User cancelled
return
;
//User cancelled
...
@@ -720,7 +720,7 @@ void QGCDataPlot2D::saveCsvLog()
...
@@ -720,7 +720,7 @@ void QGCDataPlot2D::saveCsvLog()
// msgBox.setDefaultButton(QMessageBox::Ok);
// msgBox.setDefaultButton(QMessageBox::Ok);
// if(msgBox.exec() == QMessageBox::Cancel) break;
// if(msgBox.exec() == QMessageBox::Cancel) break;
// fileName = QFileDialog::getSaveFileName(
// fileName = QFileDialog::getSaveFileName(
// this, "Export CSV File Name", Q
DesktopServices::storageLocation(QDesktopService
s::DesktopLocation),
// this, "Export CSV File Name", Q
StandardPaths::writableLocation(QStandardPath
s::DesktopLocation),
// "CSV file (*.csv);;Text file (*.txt)");
// "CSV file (*.csv);;Text file (*.txt)");
// }
// }
...
...
src/ui/QGCMAVLinkLogPlayer.cc
View file @
3acd1ab7
#include <QFileDialog>
#include <QFileDialog>
#include <QMessageBox>
#include <QMessageBox>
#include <Q
DesktopService
s>
#include <Q
StandardPath
s>
#include <QtEndian>
#include <QtEndian>
#include "MainWindow.h"
#include "MainWindow.h"
...
@@ -22,7 +22,7 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(MAVLinkProtocol* mavlink, QWidget *pare
...
@@ -22,7 +22,7 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(MAVLinkProtocol* mavlink, QWidget *pare
binaryBaudRate
(
defaultBinaryBaudRate
),
binaryBaudRate
(
defaultBinaryBaudRate
),
isPlaying
(
false
),
isPlaying
(
false
),
currPacketCount
(
0
),
currPacketCount
(
0
),
lastLogDirectory
(
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
)),
lastLogDirectory
(
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
)),
ui
(
new
Ui
::
QGCMAVLinkLogPlayer
)
ui
(
new
Ui
::
QGCMAVLinkLogPlayer
)
{
{
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
...
...
src/ui/QGCStatusBar.cc
View file @
3acd1ab7
...
@@ -33,7 +33,7 @@ QGCStatusBar::QGCStatusBar(QWidget *parent) :
...
@@ -33,7 +33,7 @@ QGCStatusBar::QGCStatusBar(QWidget *parent) :
toggleLoggingButton
(
NULL
),
toggleLoggingButton
(
NULL
),
player
(
NULL
),
player
(
NULL
),
changed
(
true
),
changed
(
true
),
lastLogDirectory
(
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
))
lastLogDirectory
(
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
))
{
{
setObjectName
(
"QGC_STATUSBAR"
);
setObjectName
(
"QGC_STATUSBAR"
);
...
...
src/ui/designer/QGCToolWidget.cc
View file @
3acd1ab7
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include <QContextMenuEvent>
#include <QContextMenuEvent>
#include <QSettings>
#include <QSettings>
#include <QFileDialog>
#include <QFileDialog>
#include <Q
DesktopService
s>
#include <Q
StandardPath
s>
#include "QGCParamSlider.h"
#include "QGCParamSlider.h"
#include "QGCComboBox.h"
#include "QGCComboBox.h"
...
@@ -571,7 +571,7 @@ void QGCToolWidget::widgetRemoved()
...
@@ -571,7 +571,7 @@ void QGCToolWidget::widgetRemoved()
void
QGCToolWidget
::
exportWidget
()
void
QGCToolWidget
::
exportWidget
()
{
{
const
QString
widgetFileExtension
(
".qgw"
);
const
QString
widgetFileExtension
(
".qgw"
);
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify File Name"
),
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
),
tr
(
"QGroundControl Widget (*%1);;"
).
arg
(
widgetFileExtension
));
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify File Name"
),
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
),
tr
(
"QGroundControl Widget (*%1);;"
).
arg
(
widgetFileExtension
));
if
(
!
fileName
.
endsWith
(
widgetFileExtension
))
if
(
!
fileName
.
endsWith
(
widgetFileExtension
))
{
{
fileName
=
fileName
.
append
(
widgetFileExtension
);
fileName
=
fileName
.
append
(
widgetFileExtension
);
...
@@ -583,7 +583,7 @@ void QGCToolWidget::exportWidget()
...
@@ -583,7 +583,7 @@ void QGCToolWidget::exportWidget()
void
QGCToolWidget
::
importWidget
()
void
QGCToolWidget
::
importWidget
()
{
{
const
QString
widgetFileExtension
(
".qgw"
);
const
QString
widgetFileExtension
(
".qgw"
);
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Specify File Name"
),
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
),
tr
(
"QGroundControl Widget (*%1);;"
).
arg
(
widgetFileExtension
));
QString
fileName
=
QFileDialog
::
getOpenFileName
(
this
,
tr
(
"Specify File Name"
),
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
),
tr
(
"QGroundControl Widget (*%1);;"
).
arg
(
widgetFileExtension
));
loadSettings
(
fileName
);
loadSettings
(
fileName
);
}
}
...
...
src/ui/linechart/LinechartWidget.cc
View file @
3acd1ab7
...
@@ -43,7 +43,7 @@ This file is part of the PIXHAWK project
...
@@ -43,7 +43,7 @@ This file is part of the PIXHAWK project
#include <QColor>
#include <QColor>
#include <QPalette>
#include <QPalette>
#include <QFileDialog>
#include <QFileDialog>
#include <Q
DesktopService
s>
#include <Q
StandardPath
s>
#include <QMessageBox>
#include <QMessageBox>
#include "LinechartWidget.h"
#include "LinechartWidget.h"
...
@@ -454,7 +454,7 @@ void LinechartWidget::startLogging()
...
@@ -454,7 +454,7 @@ void LinechartWidget::startLogging()
// Let user select the log file name
// Let user select the log file name
//QDate date(QDate::currentDate());
//QDate date(QDate::currentDate());
// QString("./pixhawk-log-" + date.toString("yyyy-MM-dd") + "-" + QString::number(logindex) + ".log")
// QString("./pixhawk-log-" + date.toString("yyyy-MM-dd") + "-" + QString::number(logindex) + ".log")
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify log file name"
),
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
),
tr
(
"Logfile (*.log);;"
));
QString
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify log file name"
),
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
),
tr
(
"Logfile (*.log);;"
));
while
(
!
(
fileName
.
endsWith
(
".log"
))
&&
!
abort
&&
fileName
!=
""
)
{
while
(
!
(
fileName
.
endsWith
(
".log"
))
&&
!
abort
&&
fileName
!=
""
)
{
QMessageBox
msgBox
;
QMessageBox
msgBox
;
...
@@ -468,7 +468,7 @@ void LinechartWidget::startLogging()
...
@@ -468,7 +468,7 @@ void LinechartWidget::startLogging()
abort
=
true
;
abort
=
true
;
break
;
break
;
}
}
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify log file name"
),
Q
DesktopServices
::
storageLocation
(
QDesktopService
s
::
DesktopLocation
),
tr
(
"Logfile (*.log);;"
));
fileName
=
QFileDialog
::
getSaveFileName
(
this
,
tr
(
"Specify log file name"
),
Q
StandardPaths
::
writableLocation
(
QStandardPath
s
::
DesktopLocation
),
tr
(
"Logfile (*.log);;"
));
}
}
qDebug
()
<<
"SAVE FILE"
<<
fileName
;
qDebug
()
<<
"SAVE FILE"
<<
fileName
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment