summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/preferences/preferences_defaults.cpp
diff options
context:
space:
mode:
authorGravatar willemferguson <willemferguson@zoology.up.ac.za>2019-12-08 11:30:16 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-12-25 02:57:42 +0900
commit2ac279d12953ad840ade1c08d0eff5c2f4adb0b9 (patch)
tree9f2d70f50cb910803e260fa9d3bdad2687d820ad /desktop-widgets/preferences/preferences_defaults.cpp
parent3e853e37a5b0b9509fb92b1ddb3031f117578fb9 (diff)
downloadsubsurface-2ac279d12953ad840ade1c08d0eff5c2f4adb0b9.tar.gz
Pereferences UI: add media tab
Remove the preference settings dealing with thumbnails (currently under General preferences and Profile preferences) and put them in a newly-created Media preference tab. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/preferences/preferences_defaults.cpp')
-rw-r--r--desktop-widgets/preferences/preferences_defaults.cpp50
1 files changed, 0 insertions, 50 deletions
diff --git a/desktop-widgets/preferences/preferences_defaults.cpp b/desktop-widgets/preferences/preferences_defaults.cpp
index e0df807b0..549475a23 100644
--- a/desktop-widgets/preferences/preferences_defaults.cpp
+++ b/desktop-widgets/preferences/preferences_defaults.cpp
@@ -47,46 +47,6 @@ void PreferencesDefaults::on_localDefaultFile_toggled(bool toggle)
ui->chooseFile->setEnabled(toggle);
}
-void PreferencesDefaults::checkFfmpegExecutable()
-{
- QString s = ui->ffmpegExecutable->text().trimmed();
-
- // If the user didn't provide a string they probably didn't intend to run ffmeg,
- // so let's not give an error message.
- if (s.isEmpty())
- return;
-
- // Try to execute ffmpeg. But wait at most 2 sec for startup and execution
- // so that the UI doesn't hang unnecessarily.
- QProcess ffmpeg;
- ffmpeg.start(s);
- if (!ffmpeg.waitForStarted(2000) || !ffmpeg.waitForFinished(3000))
- QMessageBox::warning(this, tr("Warning"), tr("Couldn't execute ffmpeg at given location. Thumbnailing will not work."));
-}
-
-void PreferencesDefaults::on_ffmpegFile_clicked()
-{
- QFileInfo fi(system_default_filename());
- QString ffmpegFileName = QFileDialog::getOpenFileName(this, tr("Select ffmpeg executable"));
-
- if (!ffmpegFileName.isEmpty()) {
- ui->ffmpegExecutable->setText(ffmpegFileName);
- checkFfmpegExecutable();
- }
-}
-
-void PreferencesDefaults::on_ffmpegExecutable_editingFinished()
-{
- checkFfmpegExecutable();
-}
-
-void PreferencesDefaults::on_extractVideoThumbnails_toggled(bool toggled)
-{
- ui->videoThumbnailPosition->setEnabled(toggled);
- ui->ffmpegExecutable->setEnabled(toggled);
- ui->ffmpegFile->setEnabled(toggled);
-}
-
void PreferencesDefaults::on_resetRememberedDCs_clicked()
{
qPrefDiveComputer::set_vendor1(QString());
@@ -125,13 +85,6 @@ void PreferencesDefaults::refreshSettings()
ui->btnUseDefaultFile->setEnabled(qPrefGeneral::default_file_behavior() == LOCAL_DEFAULT_FILE);
ui->chooseFile->setEnabled(qPrefGeneral::default_file_behavior() == LOCAL_DEFAULT_FILE);
- ui->videoThumbnailPosition->setEnabled(qPrefGeneral::extract_video_thumbnails());
- ui->ffmpegExecutable->setEnabled(qPrefGeneral::extract_video_thumbnails());
- ui->ffmpegFile->setEnabled(qPrefGeneral::extract_video_thumbnails());
-
- ui->extractVideoThumbnails->setChecked(qPrefGeneral::extract_video_thumbnails());
- ui->videoThumbnailPosition->setValue(qPrefGeneral::extract_video_thumbnails_position());
- ui->ffmpegExecutable->setText(qPrefGeneral::ffmpeg_executable());
ui->extraEnvironmentalDefault->setChecked(prefs.extraEnvironmentalDefault);
}
@@ -146,9 +99,6 @@ void PreferencesDefaults::syncSettings()
general->set_default_file_behavior(LOCAL_DEFAULT_FILE);
else if (ui->cloudDefaultFile->isChecked())
general->set_default_file_behavior(CLOUD_DEFAULT_FILE);
- general->set_extract_video_thumbnails(ui->extractVideoThumbnails->isChecked());
- general->set_extract_video_thumbnails_position(ui->videoThumbnailPosition->value());
- general->set_ffmpeg_executable(ui->ffmpegExecutable->text());
qPrefDisplay::set_divelist_font(ui->font->currentFont().toString());
qPrefDisplay::set_font_size(ui->fontsize->value());