mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Added Video Overlays Initialization on Windows builds with VLC
If video config file is not present copy a default one to be used as a model by the user. An empty video-layout.xml file disables video overlays Fixes #2525
This commit is contained in:
@@ -97,6 +97,7 @@
|
||||
<file>xml/charts.xml</file>
|
||||
<file>xml/metadata.xml</file>
|
||||
<file>xml/train-layout.xml</file>
|
||||
<file>xml/video-layout.xml</file>
|
||||
<file>xml/diary-layout.xml</file>
|
||||
<file>xml/analysis-layout.xml</file>
|
||||
<file>xml/home-layout.xml</file>
|
||||
|
||||
@@ -103,13 +103,19 @@ VideoWindow::VideoWindow(Context *context) :
|
||||
layout->addWidget(container);
|
||||
libvlc_media_player_set_hwnd (mp, (HWND)(container->winId()));
|
||||
|
||||
// Video Overlays Initialization: if video config file is not present
|
||||
// copy a default one to be used as a model by the user.
|
||||
// An empty video-layout.xml file disables video overlays
|
||||
QString filename = context->athlete->home->config().canonicalPath() + "/" + "video-layout.xml";
|
||||
QFileInfo finfo(filename);
|
||||
|
||||
if (finfo.exists())
|
||||
QFile file(filename);
|
||||
if (!file.exists())
|
||||
{
|
||||
file.setFileName(":/xml/video-layout.xml");
|
||||
file.copy(filename);
|
||||
QFile::setPermissions(filename, QFileDevice::ReadUser|QFileDevice::WriteUser);
|
||||
}
|
||||
if (file.exists())
|
||||
{
|
||||
QFile file(filename);
|
||||
|
||||
// clean previous layout
|
||||
foreach(MeterWidget* p_meterWidget, m_metersWidget)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user