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
0872125d
Commit
0872125d
authored
Jun 09, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move video save path to standard location
parent
6dc95c6b
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
48 deletions
+20
-48
AppSettings.cc
src/Settings/AppSettings.cc
+15
-0
AppSettings.h
src/Settings/AppSettings.h
+3
-0
VideoSettings.cc
src/Settings/VideoSettings.cc
+0
-11
VideoSettings.h
src/Settings/VideoSettings.h
+0
-4
VideoReceiver.cc
src/VideoStreaming/VideoReceiver.cc
+2
-2
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+0
-31
No files found.
src/Settings/AppSettings.cc
View file @
0872125d
...
...
@@ -48,6 +48,7 @@ const char* AppSettings::parameterDirectory = "Parameters";
const
char
*
AppSettings
::
telemetryDirectory
=
"Telemetry"
;
const
char
*
AppSettings
::
missionDirectory
=
"Missions"
;
const
char
*
AppSettings
::
logDirectory
=
"Logs"
;
const
char
*
AppSettings
::
videoDirectory
=
"Video"
;
AppSettings
::
AppSettings
(
QObject
*
parent
)
:
SettingsGroup
(
appSettingsGroupName
,
QString
()
/* root settings group */
,
parent
)
...
...
@@ -109,6 +110,7 @@ void AppSettings::_checkSavePathDirectories(void)
savePathDir
.
mkdir
(
telemetryDirectory
);
savePathDir
.
mkdir
(
missionDirectory
);
savePathDir
.
mkdir
(
logDirectory
);
savePathDir
.
mkdir
(
videoDirectory
);
}
}
...
...
@@ -295,6 +297,19 @@ QString AppSettings::logSavePath(void)
return
fullPath
;
}
QString
AppSettings
::
videoSavePath
(
void
)
{
QString
fullPath
;
QString
path
=
savePath
()
->
rawValue
().
toString
();
if
(
!
path
.
isEmpty
()
&&
QDir
(
path
).
exists
())
{
QDir
dir
(
path
);
return
dir
.
filePath
(
videoDirectory
);
}
return
fullPath
;
}
Fact
*
AppSettings
::
autoLoadMissions
(
void
)
{
if
(
!
_autoLoadMissionsFact
)
{
...
...
src/Settings/AppSettings.h
View file @
0872125d
...
...
@@ -43,6 +43,7 @@ public:
Q_PROPERTY
(
QString
parameterSavePath
READ
parameterSavePath
NOTIFY
savePathsChanged
)
Q_PROPERTY
(
QString
telemetrySavePath
READ
telemetrySavePath
NOTIFY
savePathsChanged
)
Q_PROPERTY
(
QString
logSavePath
READ
logSavePath
NOTIFY
savePathsChanged
)
Q_PROPERTY
(
QString
videoSavePath
READ
videoSavePath
NOTIFY
savePathsChanged
)
Q_PROPERTY
(
QString
planFileExtension
MEMBER
planFileExtension
CONSTANT
)
Q_PROPERTY
(
QString
missionFileExtension
MEMBER
missionFileExtension
CONSTANT
)
...
...
@@ -74,6 +75,7 @@ public:
QString
parameterSavePath
(
void
);
QString
telemetrySavePath
(
void
);
QString
logSavePath
(
void
);
QString
videoSavePath
(
void
);
static
MAV_AUTOPILOT
offlineEditingFirmwareTypeFromFirmwareType
(
MAV_AUTOPILOT
firmwareType
);
static
MAV_TYPE
offlineEditingVehicleTypeFromVehicleType
(
MAV_TYPE
vehicleType
);
...
...
@@ -114,6 +116,7 @@ public:
static
const
char
*
telemetryDirectory
;
static
const
char
*
missionDirectory
;
static
const
char
*
logDirectory
;
static
const
char
*
videoDirectory
;
signals:
void
savePathsChanged
(
void
);
...
...
src/Settings/VideoSettings.cc
View file @
0872125d
...
...
@@ -22,7 +22,6 @@ const char* VideoSettings::videoSettingsGroupName = "Video";
const
char
*
VideoSettings
::
videoSourceName
=
"VideoSource"
;
const
char
*
VideoSettings
::
udpPortName
=
"VideoUDPPort"
;
const
char
*
VideoSettings
::
rtspUrlName
=
"VideoRTSPUrl"
;
const
char
*
VideoSettings
::
videoSavePathName
=
"VideoSavePath"
;
const
char
*
VideoSettings
::
videoAspectRatioName
=
"VideoAspectRatio"
;
const
char
*
VideoSettings
::
videoGridLinesName
=
"VideoGridLines"
;
const
char
*
VideoSettings
::
showRecControlName
=
"ShowRecControl"
;
...
...
@@ -38,7 +37,6 @@ VideoSettings::VideoSettings(QObject* parent)
,
_videoSourceFact
(
NULL
)
,
_udpPortFact
(
NULL
)
,
_rtspUrlFact
(
NULL
)
,
_videoSavePathFact
(
NULL
)
,
_videoAspectRatioFact
(
NULL
)
,
_gridLinesFact
(
NULL
)
,
_showRecControlFact
(
NULL
)
...
...
@@ -106,15 +104,6 @@ Fact* VideoSettings::rtspUrl(void)
return
_rtspUrlFact
;
}
Fact
*
VideoSettings
::
videoSavePath
(
void
)
{
if
(
!
_videoSavePathFact
)
{
_videoSavePathFact
=
_createSettingsFact
(
videoSavePathName
);
}
return
_videoSavePathFact
;
}
Fact
*
VideoSettings
::
aspectRatio
(
void
)
{
if
(
!
_videoAspectRatioFact
)
{
...
...
src/Settings/VideoSettings.h
View file @
0872125d
...
...
@@ -22,7 +22,6 @@ public:
Q_PROPERTY
(
Fact
*
videoSource
READ
videoSource
CONSTANT
)
Q_PROPERTY
(
Fact
*
udpPort
READ
udpPort
CONSTANT
)
Q_PROPERTY
(
Fact
*
rtspUrl
READ
rtspUrl
CONSTANT
)
Q_PROPERTY
(
Fact
*
videoSavePath
READ
videoSavePath
CONSTANT
)
Q_PROPERTY
(
Fact
*
aspectRatio
READ
aspectRatio
CONSTANT
)
Q_PROPERTY
(
Fact
*
gridLines
READ
gridLines
CONSTANT
)
Q_PROPERTY
(
Fact
*
showRecControl
READ
showRecControl
CONSTANT
)
...
...
@@ -32,7 +31,6 @@ public:
Fact
*
videoSource
(
void
);
Fact
*
udpPort
(
void
);
Fact
*
rtspUrl
(
void
);
Fact
*
videoSavePath
(
void
);
Fact
*
aspectRatio
(
void
);
Fact
*
gridLines
(
void
);
Fact
*
showRecControl
(
void
);
...
...
@@ -44,7 +42,6 @@ public:
static
const
char
*
videoSourceName
;
static
const
char
*
udpPortName
;
static
const
char
*
rtspUrlName
;
static
const
char
*
videoSavePathName
;
static
const
char
*
videoAspectRatioName
;
static
const
char
*
videoGridLinesName
;
static
const
char
*
showRecControlName
;
...
...
@@ -59,7 +56,6 @@ private:
SettingsFact
*
_videoSourceFact
;
SettingsFact
*
_udpPortFact
;
SettingsFact
*
_rtspUrlFact
;
SettingsFact
*
_videoSavePathFact
;
SettingsFact
*
_videoAspectRatioFact
;
SettingsFact
*
_gridLinesFact
;
SettingsFact
*
_showRecControlFact
;
...
...
src/VideoStreaming/VideoReceiver.cc
View file @
0872125d
...
...
@@ -469,7 +469,7 @@ gboolean VideoReceiver::_onBusMessage(GstBus* bus, GstMessage* msg, gpointer dat
#if defined(QGC_GST_STREAMING)
void
VideoReceiver
::
_cleanupOldVideos
()
{
QString
savePath
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
videoSettings
()
->
videoSavePath
()
->
rawValue
().
toString
();
QString
savePath
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
appSettings
()
->
videoSavePath
();
QDir
videoDir
=
QDir
(
savePath
);
videoDir
.
setFilter
(
QDir
::
Files
|
QDir
::
Readable
|
QDir
::
NoSymLinks
|
QDir
::
Writable
);
videoDir
.
setSorting
(
QDir
::
Time
);
...
...
@@ -523,7 +523,7 @@ void VideoReceiver::startRecording(void)
return
;
}
QString
savePath
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
videoSettings
()
->
videoSavePath
()
->
rawValue
().
toString
();
QString
savePath
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
appSettings
()
->
videoSavePath
();
if
(
savePath
.
isEmpty
())
{
qgcApp
()
->
showMessage
(
tr
(
"Unabled to record video. Video save path must be specified in Settings."
));
return
;
...
...
src/ui/preferences/GeneralSettings.qml
View file @
0872125d
...
...
@@ -37,7 +37,6 @@ QGCView {
property
Fact
_appFontPointSize
:
QGroundControl
.
settingsManager
.
appSettings
.
appFontPointSize
property
real
_labelWidth
:
ScreenTools
.
defaultFontPixelWidth
*
15
property
real
_editFieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
30
property
Fact
_videoPath
:
QGroundControl
.
settingsManager
.
videoSettings
.
videoSavePath
property
Fact
_mapProvider
:
QGroundControl
.
settingsManager
.
flightMapSettings
.
mapProvider
property
Fact
_mapType
:
QGroundControl
.
settingsManager
.
flightMapSettings
.
mapType
...
...
@@ -640,36 +639,6 @@ QGCView {
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
settingsManager
.
videoSettings
.
videoSavePath
.
visible
&&
QGroundControl
.
videoManager
.
isGStreamer
QGCLabel
{
anchors.baseline
:
videoBrowse
.
baseline
text
:
qsTr
(
"
Save Path:
"
)
enabled
:
promptSaveLog
.
checked
}
QGCLabel
{
anchors.baseline
:
videoBrowse
.
baseline
text
:
_videoPath
.
value
===
""
?
qsTr
(
"
<not set>
"
)
:
_videoPath
.
value
}
QGCButton
{
id
:
videoBrowse
text
:
"
Browse
"
onClicked
:
videoDialog
.
openForLoad
()
QGCFileDialog
{
id
:
videoDialog
title
:
"
Choose a location to save video files.
"
folder
:
"
file://
"
+
_videoPath
.
value
selectFolder
:
true
onAcceptedForLoad
:
{
_videoPath
.
value
=
file
}
}
}
}
}
}
...
...
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