subsurface/core/settings/qPrefMedia.cpp
Victor Arvidsson 6886c9ccf8 Make the "Save dive data as subtitles" feature more configurable.
Previously, the subtitle generation was hardcoded, making it unsuitable
if you didn't want all of the displayed values. This has been replaced
by a format string that is configurable in the settings, using predefined
tags that are replaced with the values. The default value for this has
been set to (mostly) match the currently generated subtitle string. This
also provides a good starting point for users that want to modify the string.

Signed-off-by: Victor Arvidsson <victarv@gmail.com>
2024-10-27 01:37:04 +13:00

27 lines
960 B
C++

// SPDX-License-Identifier: GPL-2.0
#include "qPrefMedia.h"
#include "qPrefPrivate.h"
static const QString group = QStringLiteral("Media");
qPrefMedia *qPrefMedia::instance()
{
static qPrefMedia *self = new qPrefMedia;
return self;
}
void qPrefMedia::loadSync(bool doSync)
{
disk_extract_video_thumbnails(doSync);
disk_extract_video_thumbnails_position(doSync);
disk_ffmpeg_executable(doSync);
disk_subtitles_format_string(doSync);
disk_auto_recalculate_thumbnails(doSync);
disk_auto_recalculate_thumbnails(doSync);
}
HANDLE_PREFERENCE_BOOL(Media, "auto_recalculate_thumbnails", auto_recalculate_thumbnails);
HANDLE_PREFERENCE_BOOL(Media, "extract_video_thumbnails", extract_video_thumbnails);
HANDLE_PREFERENCE_INT(Media, "extract_video_thumbnails_position", extract_video_thumbnails_position);
HANDLE_PREFERENCE_TXT(Media, "ffmpeg_executable", ffmpeg_executable);
HANDLE_PREFERENCE_TXT(Media, "subtitles_format_string", subtitles_format_string);