kdenlivesettingsdialog.cpp 65.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/***************************************************************************
 *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
 ***************************************************************************/

20
#include "kdenlivesettingsdialog.h"
Nicolas Carion's avatar
Nicolas Carion committed
21
#include "clipcreationdialog.h"
Nicolas Carion's avatar
linting    
Nicolas Carion committed
22
#include "core.h"
23
#include "dialogs/profilesdialog.h"
Nicolas Carion's avatar
Nicolas Carion committed
24
#include "encodingprofilesdialog.h"
25
#include "kdenlivesettings.h"
Nicolas Carion's avatar
linting    
Nicolas Carion committed
26
#include "profiles/profilemodel.hpp"
27
#include "profiles/profilerepository.hpp"
Nicolas Carion's avatar
Nicolas Carion committed
28
29
#include "profilesdialog.h"
#include "project/dialogs/profilewidget.h"
30
#include "renderer.h"
Nicolas Carion's avatar
Nicolas Carion committed
31
#include "utils/KoIconUtils.h"
32

Vincent Pinon's avatar
Vincent Pinon committed
33
34
35
#ifdef USE_V4L
#include "capture/v4lcapture.h"
#endif
36

Nicolas Carion's avatar
Nicolas Carion committed
37
#include "kdenlive_debug.h"
38
#include "klocalizedstring.h"
39
#include <KLineEdit>
Nicolas Carion's avatar
Nicolas Carion committed
40
#include <KMessageBox>
41
#include <KOpenWithDialog>
Nicolas Carion's avatar
Nicolas Carion committed
42
43
#include <KRun>
#include <KService>
44
#include <QDir>
45
#include <QThread>
Nicolas Carion's avatar
Nicolas Carion committed
46
#include <QTimer>
47

Nicolas Carion's avatar
Nicolas Carion committed
48
#include <fcntl.h>
49
#include <stdio.h>
Nicolas Carion's avatar
Nicolas Carion committed
50
#include <stdlib.h>
51
#include <unistd.h>
52

53
#ifdef USE_JOGSHUTTLE
54
55
#include "jogshuttle/jogaction.h"
#include "jogshuttle/jogshuttleconfig.h"
56
#include <QStandardPaths>
Nicolas Carion's avatar
Nicolas Carion committed
57
#include <linux/input.h>
58
#endif
59

Nicolas Carion's avatar
Nicolas Carion committed
60
KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString> &mappable_actions, bool gpuAllowed, QWidget *parent)
61
62
63
64
    : KConfigDialog(parent, QStringLiteral("settings"), KdenliveSettings::self())
    , m_modified(false)
    , m_shuttleModified(false)
    , m_mappable_actions(mappable_actions)
65
{
66
    KdenliveSettings::setV4l_format(0);
67
68
    QWidget *p1 = new QWidget;
    m_configMisc.setupUi(p1);
69
70
    m_page1 = addPage(p1, i18n("Misc"));
    m_page1->setIcon(KoIconUtils::themedIcon(QStringLiteral("configure")));
71

72
73
    // Hide avformat-novalidate trick, causes crash (bug #2205 and #2206)
    m_configMisc.kcfg_projectloading_avformatnovalidate->setVisible(false);
74

75
    m_configMisc.kcfg_use_exiftool->setEnabled(!QStandardPaths::findExecutable(QStringLiteral("exiftool")).isEmpty());
76

77
78
    QWidget *p8 = new QWidget;
    m_configProject.setupUi(p8);
79
    m_page8 = addPage(p8, i18n("Project Defaults"));
Nicolas Carion's avatar
Nicolas Carion committed
80
    auto *vbox = new QVBoxLayout;
81
82
83
    m_pw = new ProfileWidget(this);
    vbox->addWidget(m_pw);
    m_configProject.profile_box->setLayout(vbox);
84
    m_configProject.profile_box->setTitle(i18n("Select the default profile (preset)"));
85
    // Select profile
86
    m_pw->loadProfile(KdenliveSettings::default_profile().isEmpty() ? pCore->getCurrentProfile()->path() : KdenliveSettings::default_profile());
87
    connect(m_pw, &ProfileWidget::profileChanged, this, &KdenliveSettingsDialog::slotDialogModified);
88
    m_page8->setIcon(KoIconUtils::themedIcon(QStringLiteral("project-defaults")));
Laurent Montel's avatar
Laurent Montel committed
89
    connect(m_configProject.kcfg_generateproxy, &QAbstractButton::toggled, m_configProject.kcfg_proxyminsize, &QWidget::setEnabled);
90
    m_configProject.kcfg_proxyminsize->setEnabled(KdenliveSettings::generateproxy());
91
92
    m_configProject.projecturl->setMode(KFile::Directory);
    m_configProject.projecturl->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
Laurent Montel's avatar
Laurent Montel committed
93
    connect(m_configProject.kcfg_generateimageproxy, &QAbstractButton::toggled, m_configProject.kcfg_proxyimageminsize, &QWidget::setEnabled);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
94
    m_configProject.kcfg_proxyimageminsize->setEnabled(KdenliveSettings::generateimageproxy());
95

96
    QWidget *p3 = new QWidget;
97
    m_configTimeline.setupUi(p3);
98
99
    m_page3 = addPage(p3, i18n("Timeline"));
    m_page3->setIcon(KoIconUtils::themedIcon(QStringLiteral("video-display")));
100
101
102
103

    QWidget *p2 = new QWidget;
    m_configEnv.setupUi(p2);
    m_configEnv.mltpathurl->setMode(KFile::Directory);
104
105
106
107
108
    m_configEnv.mltpathurl->lineEdit()->setObjectName(QStringLiteral("kcfg_mltpath"));
    m_configEnv.rendererpathurl->lineEdit()->setObjectName(QStringLiteral("kcfg_rendererpath"));
    m_configEnv.ffmpegurl->lineEdit()->setObjectName(QStringLiteral("kcfg_ffmpegpath"));
    m_configEnv.ffplayurl->lineEdit()->setObjectName(QStringLiteral("kcfg_ffplaypath"));
    m_configEnv.ffprobeurl->lineEdit()->setObjectName(QStringLiteral("kcfg_ffprobepath"));
109
110
    int maxThreads = QThread::idealThreadCount();
    m_configEnv.kcfg_mltthreads->setMaximum(maxThreads > 2 ? maxThreads : 8);
111
    m_configEnv.tmppathurl->setMode(KFile::Directory);
112
    m_configEnv.tmppathurl->lineEdit()->setObjectName(QStringLiteral("kcfg_currenttmpfolder"));
113
    m_configEnv.capturefolderurl->setMode(KFile::Directory);
114
    m_configEnv.capturefolderurl->lineEdit()->setObjectName(QStringLiteral("kcfg_capturefolder"));
115
    m_configEnv.capturefolderurl->setEnabled(!KdenliveSettings::capturetoprojectfolder());
Laurent Montel's avatar
Laurent Montel committed
116
    connect(m_configEnv.kcfg_capturetoprojectfolder, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEnableCaptureFolder);
117
118
119
120
    // Library folder
    m_configEnv.libraryfolderurl->setMode(KFile::Directory);
    m_configEnv.libraryfolderurl->lineEdit()->setObjectName(QStringLiteral("kcfg_libraryfolder"));
    m_configEnv.libraryfolderurl->setEnabled(!KdenliveSettings::librarytodefaultfolder());
121
    m_configEnv.kcfg_librarytodefaultfolder->setToolTip(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/library"));
Laurent Montel's avatar
Laurent Montel committed
122
    connect(m_configEnv.kcfg_librarytodefaultfolder, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEnableLibraryFolder);
123

124
125
126
    // Mime types
    QStringList mimes = ClipCreationDialog::getExtensions();
    qSort(mimes);
Laurent Montel's avatar
Laurent Montel committed
127
    m_configEnv.supportedmimes->setPlainText(mimes.join(QLatin1Char(' ')));
128

129
130
    m_page2 = addPage(p2, i18n("Environment"));
    m_page2->setIcon(KoIconUtils::themedIcon(QStringLiteral("application-x-executable-script")));
131
132
133

    QWidget *p4 = new QWidget;
    m_configCapture.setupUi(p4);
134
135
    m_configCapture.tabWidget->removeTab(0);
    m_configCapture.tabWidget->removeTab(2);
136
#ifdef USE_V4L
137

138
    // Video 4 Linux device detection
Laurent Montel's avatar
Laurent Montel committed
139
    for (int i = 0; i < 10; ++i) {
Laurent Montel's avatar
Laurent Montel committed
140
        QString path = QStringLiteral("/dev/video") + QString::number(i);
141
        if (QFile::exists(path)) {
142
            QStringList deviceInfo = V4lCaptureHandler::getDeviceName(path);
143
144
145
146
            if (!deviceInfo.isEmpty()) {
                m_configCapture.kcfg_detectedv4ldevices->addItem(deviceInfo.at(0), path);
                m_configCapture.kcfg_detectedv4ldevices->setItemData(m_configCapture.kcfg_detectedv4ldevices->count() - 1, deviceInfo.at(1), Qt::UserRole + 1);
            }
147
148
149
        }
    }
    connect(m_configCapture.kcfg_detectedv4ldevices, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatev4lDevice()));
150
    connect(m_configCapture.kcfg_v4l_format, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatev4lCaptureProfile()));
Laurent Montel's avatar
Laurent Montel committed
151
    connect(m_configCapture.config_v4l, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEditVideo4LinuxProfile);
152
153

    slotUpdatev4lDevice();
154
#endif
155

156
157
    m_page4 = addPage(p4, i18n("Capture"));
    m_page4->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-record")));
158
    m_configCapture.tabWidget->setCurrentIndex(KdenliveSettings::defaultcapture());
Alberto Villa's avatar
Alberto Villa committed
159
#ifdef Q_WS_MAC
160
161
    m_configCapture.tabWidget->setEnabled(false);
    m_configCapture.kcfg_defaultcapture->setEnabled(false);
Alberto Villa's avatar
Alberto Villa committed
162
    m_configCapture.label->setText(i18n("Capture is not yet available on Mac OS X."));
163
#endif
164

165
166
    QWidget *p5 = new QWidget;
    m_configShuttle.setupUi(p5);
167
#ifdef USE_JOGSHUTTLE
168
    m_configShuttle.toolBtnReload->setIcon(KoIconUtils::themedIcon(QStringLiteral("view-refresh")));
Laurent Montel's avatar
Laurent Montel committed
169
    connect(m_configShuttle.kcfg_enableshuttle, &QCheckBox::stateChanged, this, &KdenliveSettingsDialog::slotCheckShuttle);
170
    connect(m_configShuttle.shuttledevicelist, SIGNAL(activated(int)), this, SLOT(slotUpdateShuttleDevice(int)));
Laurent Montel's avatar
Laurent Montel committed
171
    connect(m_configShuttle.toolBtnReload, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotReloadShuttleDevices);
172

Nicolas Carion's avatar
Nicolas Carion committed
173
    slotCheckShuttle(static_cast<int>(KdenliveSettings::enableshuttle()));
174
    m_configShuttle.shuttledisabled->hide();
175
176

    // Store the button pointers into an array for easier handling them in the other functions.
177
    // TODO: impl enumerator or live with cut and paste :-)))
178
179
    setupJogshuttleBtns(KdenliveSettings::shuttledevice());
#if 0
180
181
182
183
184
    m_shuttle_buttons.push_back(m_configShuttle.shuttle1);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle2);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle3);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle4);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle5);
185
186
187
188
189
    m_shuttle_buttons.push_back(m_configShuttle.shuttle6);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle7);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle8);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle9);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle10);
190
191
192
193
194
    m_shuttle_buttons.push_back(m_configShuttle.shuttle11);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle12);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle13);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle14);
    m_shuttle_buttons.push_back(m_configShuttle.shuttle15);
195
#endif
196

Nicolas Carion's avatar
Nicolas Carion committed
197
#else  /* ! USE_JOGSHUTTLE */
198
199
200
    m_configShuttle.kcfg_enableshuttle->hide();
    m_configShuttle.kcfg_enableshuttle->setDisabled(true);
#endif /* USE_JOGSHUTTLE */
201
202
    m_page5 = addPage(p5, i18n("JogShuttle"));
    m_page5->setIcon(KoIconUtils::themedIcon(QStringLiteral("jog-dial")));
203

204
205
    QWidget *p6 = new QWidget;
    m_configSdl.setupUi(p6);
206
    m_configSdl.reload_blackmagic->setIcon(KoIconUtils::themedIcon(QStringLiteral("view-refresh")));
Laurent Montel's avatar
Laurent Montel committed
207
    connect(m_configSdl.reload_blackmagic, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotReloadBlackMagic);
208

Nicolas Carion's avatar
Nicolas Carion committed
209
    // m_configSdl.kcfg_openglmonitors->setHidden(true);
210

211
212
    m_page6 = addPage(p6, i18n("Playback"));
    m_page6->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-playback-start")));
213

214
215
    QWidget *p7 = new QWidget;
    m_configTranscode.setupUi(p7);
216
217
218
    m_page7 = addPage(p7, i18n("Transcode"));
    m_page7->setIcon(KoIconUtils::themedIcon(QStringLiteral("edit-copy")));

Laurent Montel's avatar
Laurent Montel committed
219
220
221
222
    connect(m_configTranscode.button_add, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotAddTranscode);
    connect(m_configTranscode.button_delete, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotDeleteTranscode);
    connect(m_configTranscode.profiles_list, &QListWidget::itemChanged, this, &KdenliveSettingsDialog::slotDialogModified);
    connect(m_configTranscode.profiles_list, &QListWidget::currentRowChanged, this, &KdenliveSettingsDialog::slotSetTranscodeProfile);
223

Laurent Montel's avatar
Laurent Montel committed
224
225
226
227
228
    connect(m_configTranscode.profile_name, &QLineEdit::textChanged, this, &KdenliveSettingsDialog::slotEnableTranscodeUpdate);
    connect(m_configTranscode.profile_description, &QLineEdit::textChanged, this, &KdenliveSettingsDialog::slotEnableTranscodeUpdate);
    connect(m_configTranscode.profile_extension, &QLineEdit::textChanged, this, &KdenliveSettingsDialog::slotEnableTranscodeUpdate);
    connect(m_configTranscode.profile_parameters, &QPlainTextEdit::textChanged, this, &KdenliveSettingsDialog::slotEnableTranscodeUpdate);
    connect(m_configTranscode.profile_audioonly, &QCheckBox::stateChanged, this, &KdenliveSettingsDialog::slotEnableTranscodeUpdate);
229

Laurent Montel's avatar
Laurent Montel committed
230
    connect(m_configTranscode.button_update, &QAbstractButton::pressed, this, &KdenliveSettingsDialog::slotUpdateTranscodingProfile);
231

232
    m_configTranscode.profile_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 5);
Alberto Villa's avatar
Alberto Villa committed
233

Laurent Montel's avatar
Laurent Montel committed
234
235
    connect(m_configEnv.kp_image, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEditImageApplication);
    connect(m_configEnv.kp_audio, &QAbstractButton::clicked, this, &KdenliveSettingsDialog::slotEditAudioApplication);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
236

237
    loadEncodingProfiles();
238

239
    connect(m_configSdl.kcfg_audio_driver, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckAlsaDriver()));
240
    connect(m_configSdl.kcfg_audio_backend, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCheckAudioBackend()));
241
    initDevices();
242
    connect(m_configCapture.kcfg_grab_capture_type, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateGrabRegionStatus()));
243

244
    slotUpdateGrabRegionStatus();
245
    loadTranscodeProfiles();
246

Nicolas Carion's avatar
Nicolas Carion committed
247
    // HACK: check dvgrab version, because only dvgrab >= 3.3 supports
248
    //   --timestamp option without bug
249

250
    if (KdenliveSettings::dvgrab_path().isEmpty() || !QFile::exists(KdenliveSettings::dvgrab_path())) {
251
        QString dvgrabpath = QStandardPaths::findExecutable(QStringLiteral("dvgrab"));
252
        KdenliveSettings::setDvgrab_path(dvgrabpath);
253
    }
254

255
    // decklink profile
256
257
    QAction *act = new QAction(KoIconUtils::themedIcon(QStringLiteral("configure")), i18n("Configure profiles"), this);
    act->setData(4);
Laurent Montel's avatar
Laurent Montel committed
258
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
259
    m_configCapture.decklink_manageprofile->setDefaultAction(act);
260
    m_configCapture.decklink_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about")));
261
262
263
264
    m_configCapture.decklink_parameters->setVisible(false);
    m_configCapture.decklink_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
    m_configCapture.decklink_parameters->setPlainText(KdenliveSettings::decklink_parameters());
    connect(m_configCapture.kcfg_decklink_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDecklinkProfile()));
Laurent Montel's avatar
Laurent Montel committed
265
    connect(m_configCapture.decklink_showprofileinfo, &QAbstractButton::clicked, m_configCapture.decklink_parameters, &QWidget::setVisible);
266

267
    // ffmpeg profile
268
    m_configCapture.v4l_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about")));
269
270
271
    m_configCapture.v4l_parameters->setVisible(false);
    m_configCapture.v4l_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
    m_configCapture.v4l_parameters->setPlainText(KdenliveSettings::v4l_parameters());
272
273
274

    act = new QAction(KoIconUtils::themedIcon(QStringLiteral("configure")), i18n("Configure profiles"), this);
    act->setData(2);
Laurent Montel's avatar
Laurent Montel committed
275
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
276
    m_configCapture.v4l_manageprofile->setDefaultAction(act);
277
    connect(m_configCapture.kcfg_v4l_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateV4lProfile()));
Laurent Montel's avatar
Laurent Montel committed
278
    connect(m_configCapture.v4l_showprofileinfo, &QAbstractButton::clicked, m_configCapture.v4l_parameters, &QWidget::setVisible);
279

280
    // screen grab profile
281
    m_configCapture.grab_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about")));
282
283
284
    m_configCapture.grab_parameters->setVisible(false);
    m_configCapture.grab_parameters->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 4);
    m_configCapture.grab_parameters->setPlainText(KdenliveSettings::grab_parameters());
285
286
    act = new QAction(KoIconUtils::themedIcon(QStringLiteral("configure")), i18n("Configure profiles"), this);
    act->setData(3);
Laurent Montel's avatar
Laurent Montel committed
287
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
288
    m_configCapture.grab_manageprofile->setDefaultAction(act);
289
    connect(m_configCapture.kcfg_grab_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateGrabProfile()));
Laurent Montel's avatar
Laurent Montel committed
290
    connect(m_configCapture.grab_showprofileinfo, &QAbstractButton::clicked, m_configCapture.grab_parameters, &QWidget::setVisible);
Alberto Villa's avatar
Alberto Villa committed
291

292
    // Timeline preview
293
294
    act = new QAction(KoIconUtils::themedIcon(QStringLiteral("configure")), i18n("Configure profiles"), this);
    act->setData(1);
Laurent Montel's avatar
Laurent Montel committed
295
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
296
297
    m_configProject.preview_manageprofile->setDefaultAction(act);
    connect(m_configProject.kcfg_preview_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdatePreviewProfile()));
Laurent Montel's avatar
Laurent Montel committed
298
    connect(m_configProject.preview_showprofileinfo, &QAbstractButton::clicked, m_configProject.previewparams, &QWidget::setVisible);
299
300
301
302
303
304
305
306
    m_configProject.previewparams->setVisible(false);
    m_configProject.previewparams->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 3);
    m_configProject.previewparams->setPlainText(KdenliveSettings::previewparams());
    m_configProject.preview_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about")));
    m_configProject.preview_showprofileinfo->setToolTip(i18n("Show default timeline preview parameters"));
    m_configProject.preview_manageprofile->setIcon(KoIconUtils::themedIcon(QStringLiteral("configure")));
    m_configProject.preview_manageprofile->setToolTip(i18n("Manage timeline preview profiles"));
    m_configProject.kcfg_preview_profile->setToolTip(i18n("Select default timeline preview profile"));
307

308
    // proxy profile stuff
309
    m_configProject.proxy_showprofileinfo->setIcon(KoIconUtils::themedIcon(QStringLiteral("help-about")));
310
    m_configProject.proxy_showprofileinfo->setToolTip(i18n("Show default profile parameters"));
311
    m_configProject.proxy_manageprofile->setIcon(KoIconUtils::themedIcon(QStringLiteral("configure")));
312
313
    m_configProject.proxy_manageprofile->setToolTip(i18n("Manage proxy profiles"));
    m_configProject.kcfg_proxy_profile->setToolTip(i18n("Select default proxy profile"));
314
    m_configProject.proxyparams->setVisible(false);
315
    m_configProject.proxyparams->setMaximumHeight(QFontMetrics(font()).lineSpacing() * 3);
316
    m_configProject.proxyparams->setPlainText(KdenliveSettings::proxyparams());
317
318
319

    act = new QAction(KoIconUtils::themedIcon(QStringLiteral("configure")), i18n("Configure profiles"), this);
    act->setData(0);
Laurent Montel's avatar
Laurent Montel committed
320
    connect(act, &QAction::triggered, this, &KdenliveSettingsDialog::slotManageEncodingProfile);
321
322
    m_configProject.proxy_manageprofile->setDefaultAction(act);

Laurent Montel's avatar
Laurent Montel committed
323
    connect(m_configProject.proxy_showprofileinfo, &QAbstractButton::clicked, m_configProject.proxyparams, &QWidget::setVisible);
324
325
326
327
    connect(m_configProject.kcfg_proxy_profile, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateProxyProfile()));

    slotUpdateProxyProfile(-1);
    slotUpdateV4lProfile(-1);
328
    slotUpdateGrabProfile(-1);
329
    slotUpdateDecklinkProfile(-1);
330

331
332
    // enable GPU accel only if Movit is found
    m_configSdl.kcfg_gpu_accel->setEnabled(gpuAllowed);
333
    m_configSdl.kcfg_gpu_accel->setToolTip(i18n("GPU processing needs MLT compiled with Movit and Rtaudio modules"));
Alberto Villa's avatar
Alberto Villa committed
334

335
336
337
    Render::getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice);
    if (!Render::getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device)) {
        // No blackmagic card found
338
        m_configSdl.kcfg_external_display->setEnabled(false);
339
    }
340

341
    if (!KdenliveSettings::dvgrab_path().isEmpty()) {
Vincent Pinon's avatar
Vincent Pinon committed
342
        double dvgrabVersion = 0;
Nicolas Carion's avatar
Nicolas Carion committed
343
        auto *versionCheck = new QProcess;
344
        versionCheck->setProcessChannelMode(QProcess::MergedChannels);
345
        versionCheck->start(QStringLiteral("dvgrab"), QStringList() << QStringLiteral("--version"));
346
347
        if (versionCheck->waitForFinished()) {
            QString version = QString(versionCheck->readAll()).simplified();
Laurent Montel's avatar
Laurent Montel committed
348
            if (version.contains(QLatin1Char(' '))) {
349
                version = version.section(QLatin1Char(' '), -1);
350
            }
351
352
            dvgrabVersion = version.toDouble();

Nicolas Carion's avatar
Nicolas Carion committed
353
            // qCDebug(KDENLIVE_LOG) << "// FOUND DVGRAB VERSION: " << dvgrabVersion;
354
        }
355
        delete versionCheck;
356
357
358
359
360
        if (dvgrabVersion < 3.3) {
            KdenliveSettings::setFirewiretimestamp(false);
            m_configCapture.kcfg_firewiretimestamp->setEnabled(false);
        }
        m_configCapture.dvgrab_info->setText(i18n("dvgrab version %1 at %2", dvgrabVersion, KdenliveSettings::dvgrab_path()));
361
362
363
    } else {
        m_configCapture.dvgrab_info->setText(i18n("<strong><em>dvgrab</em> utility not found, please install it for firewire capture</strong>"));
    }
364
365
}

Laurent Montel's avatar
Laurent Montel committed
366
void KdenliveSettingsDialog::setupJogshuttleBtns(const QString &device)
367
{
368
369
    QList<KComboBox *> list;
    QList<QLabel *> list1;
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386

    list << m_configShuttle.shuttle1;
    list << m_configShuttle.shuttle2;
    list << m_configShuttle.shuttle3;
    list << m_configShuttle.shuttle4;
    list << m_configShuttle.shuttle5;
    list << m_configShuttle.shuttle6;
    list << m_configShuttle.shuttle7;
    list << m_configShuttle.shuttle8;
    list << m_configShuttle.shuttle9;
    list << m_configShuttle.shuttle10;
    list << m_configShuttle.shuttle11;
    list << m_configShuttle.shuttle12;
    list << m_configShuttle.shuttle13;
    list << m_configShuttle.shuttle14;
    list << m_configShuttle.shuttle15;

Nicolas Carion's avatar
Nicolas Carion committed
387
388
389
390
391
392
393
394
    list1 << m_configShuttle.label_2;  // #1
    list1 << m_configShuttle.label_4;  // #2
    list1 << m_configShuttle.label_3;  // #3
    list1 << m_configShuttle.label_7;  // #4
    list1 << m_configShuttle.label_5;  // #5
    list1 << m_configShuttle.label_6;  // #6
    list1 << m_configShuttle.label_8;  // #7
    list1 << m_configShuttle.label_9;  // #8
395
396
397
398
399
400
401
402
    list1 << m_configShuttle.label_10; // #9
    list1 << m_configShuttle.label_11; // #10
    list1 << m_configShuttle.label_12; // #11
    list1 << m_configShuttle.label_13; // #12
    list1 << m_configShuttle.label_14; // #13
    list1 << m_configShuttle.label_15; // #14
    list1 << m_configShuttle.label_16; // #15

403
    for (int i = 0; i < list.count(); ++i) {
404
405
406
        list[i]->hide();
        list1[i]->hide();
    }
407
#ifdef USE_JOGSHUTTLE
408
409
410
    if (!m_configShuttle.kcfg_enableshuttle->isChecked()) {
        return;
    }
411
412
    int keysCount = JogShuttle::keysCount(device);

413
    for (int i = 0; i < keysCount; ++i) {
414
415
416
417
418
419
420
421
422
        m_shuttle_buttons.push_back(list[i]);
        list[i]->show();
        list1[i]->show();
    }

    // populate the buttons with the current configuration. The items are sorted
    // according to the user-selected language, so they do not appear in random order.
    QMap<QString, QString> mappable_actions(m_mappable_actions);
    QList<QString> action_names = mappable_actions.keys();
423
    QList<QString>::Iterator iter = action_names.begin();
Nicolas Carion's avatar
Nicolas Carion committed
424
    // qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
425
    while (iter != action_names.end()) {
Nicolas Carion's avatar
Nicolas Carion committed
426
        // qCDebug(KDENLIVE_LOG) << *iter;
427
428
429
        ++iter;
    }

Nicolas Carion's avatar
Nicolas Carion committed
430
    // qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
431

432
    qSort(action_names);
433
434
    iter = action_names.begin();
    while (iter != action_names.end()) {
Nicolas Carion's avatar
Nicolas Carion committed
435
        // qCDebug(KDENLIVE_LOG) << *iter;
436
437
        ++iter;
    }
Nicolas Carion's avatar
Nicolas Carion committed
438
    // qCDebug(KDENLIVE_LOG) << "::::::::::::::::";
439
440
441
442
443

    // Here we need to compute the action_id -> index-in-action_names. We iterate over the
    // action_names, as the sorting may depend on the user-language.
    QStringList actions_map = JogShuttleConfig::actionMap(KdenliveSettings::shuttlebuttons());
    QMap<QString, int> action_pos;
Nicolas Carion's avatar
Nicolas Carion committed
444
    for (const QString &action_id : actions_map) {
445
446
447
448
449
450
451
452
453
454
        // This loop find out at what index is the string that would map to the action_id.
        for (int i = 0; i < action_names.size(); ++i) {
            if (mappable_actions[action_names.at(i)] == action_id) {
                action_pos[action_id] = i;
                break;
            }
        }
    }

    int i = 0;
Nicolas Carion's avatar
Nicolas Carion committed
455
    for (KComboBox *button : m_shuttle_buttons) {
456
457
458
        button->addItems(action_names);
        connect(button, SIGNAL(activated(int)), this, SLOT(slotShuttleModified()));
        ++i;
459
        if (i < actions_map.size()) {
460
            button->setCurrentIndex(action_pos[actions_map[i]]);
461
        }
462
    }
463
#endif
464
465
}

Nicolas Carion's avatar
Nicolas Carion committed
466
467
468
KdenliveSettingsDialog::~KdenliveSettingsDialog()
{
}
469

470
void KdenliveSettingsDialog::slotUpdateGrabRegionStatus()
471
{
472
    m_configCapture.region_group->setHidden(m_configCapture.kcfg_grab_capture_type->currentIndex() != 1);
473
}
474

475
476
477
478
479
void KdenliveSettingsDialog::slotEnableCaptureFolder()
{
    m_configEnv.capturefolderurl->setEnabled(!m_configEnv.kcfg_capturetoprojectfolder->isChecked());
}

480
481
482
483
484
void KdenliveSettingsDialog::slotEnableLibraryFolder()
{
    m_configEnv.libraryfolderurl->setEnabled(!m_configEnv.kcfg_librarytodefaultfolder->isChecked());
}

485
486
void KdenliveSettingsDialog::initDevices()
{
487
488
    // Fill audio drivers
    m_configSdl.kcfg_audio_driver->addItem(i18n("Automatic"), QString());
489
#ifndef Q_WS_MAC
490
491
    m_configSdl.kcfg_audio_driver->addItem(i18n("OSS"), "dsp");
    m_configSdl.kcfg_audio_driver->addItem(i18n("ALSA"), "alsa");
492
    m_configSdl.kcfg_audio_driver->addItem(i18n("PulseAudio"), "pulse");
493
494
495
    m_configSdl.kcfg_audio_driver->addItem(i18n("OSS with DMA access"), "dma");
    m_configSdl.kcfg_audio_driver->addItem(i18n("Esound daemon"), "esd");
    m_configSdl.kcfg_audio_driver->addItem(i18n("ARTS daemon"), "artsc");
496
#endif
497

498
    if (!KdenliveSettings::audiodrivername().isEmpty())
499
        for (int i = 1; i < m_configSdl.kcfg_audio_driver->count(); ++i) {
500
501
            if (m_configSdl.kcfg_audio_driver->itemData(i).toString() == KdenliveSettings::audiodrivername()) {
                m_configSdl.kcfg_audio_driver->setCurrentIndex(i);
Nicolas Carion's avatar
Nicolas Carion committed
502
                KdenliveSettings::setAudio_driver((uint)i);
503
504
            }
        }
505

506
    // Fill the list of audio playback / recording devices
507
    m_configSdl.kcfg_audio_device->addItem(i18n("Default"), QString());
508
    m_configCapture.kcfg_v4l_alsadevice->addItem(i18n("Default"), "default");
509
    if (!QStandardPaths::findExecutable(QStringLiteral("aplay")).isEmpty()) {
510
        m_readProcess.setOutputChannelMode(KProcess::OnlyStdoutChannel);
511
        m_readProcess.setProgram(QStringLiteral("aplay"), QStringList() << QStringLiteral("-l"));
Laurent Montel's avatar
Laurent Montel committed
512
        connect(&m_readProcess, &KProcess::readyReadStandardOutput, this, &KdenliveSettingsDialog::slotReadAudioDevices);
513
514
515
        m_readProcess.execute(5000);
    } else {
        // If aplay is not installed on the system, parse the /proc/asound/pcm file
516
        QFile file(QStringLiteral("/proc/asound/pcm"));
517
        if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
518
            QTextStream stream(&file);
519
            QString line = stream.readLine();
520
            QString deviceId;
521
            while (!line.isNull()) {
522
                if (line.contains(QStringLiteral("playback"))) {
Laurent Montel's avatar
Laurent Montel committed
523
                    deviceId = line.section(QLatin1Char(':'), 0, 0);
Nicolas Carion's avatar
Nicolas Carion committed
524
525
526
                    m_configSdl.kcfg_audio_device->addItem(line.section(QLatin1Char(':'), 1, 1),
                                                           "plughw:" + QString::number(deviceId.section(QLatin1Char('-'), 0, 0).toInt()) + QLatin1Char(',') +
                                                               QString::number(deviceId.section(QLatin1Char('-'), 1, 1).toInt()));
527
                }
528
                if (line.contains(QStringLiteral("capture"))) {
Laurent Montel's avatar
Laurent Montel committed
529
                    deviceId = line.section(QLatin1Char(':'), 0, 0);
Nicolas Carion's avatar
Nicolas Carion committed
530
531
532
                    m_configCapture.kcfg_v4l_alsadevice->addItem(line.section(QLatin1Char(':'), 1, 1).simplified(),
                                                                 "hw:" + QString::number(deviceId.section(QLatin1Char('-'), 0, 0).toInt()) + QLatin1Char(',') +
                                                                     QString::number(deviceId.section(QLatin1Char('-'), 1, 1).toInt()));
533
                }
534
                line = stream.readLine();
535
            }
536
            file.close();
537
538
539
        } else {
            qCDebug(KDENLIVE_LOG) << " / / / /CANNOT READ PCM";
        }
540
    }
541

542
543
    // Add pulseaudio capture option
    m_configCapture.kcfg_v4l_alsadevice->addItem(i18n("PulseAudio"), "pulse");
544

545
546
    if (!KdenliveSettings::audiodevicename().isEmpty()) {
        // Select correct alsa device
547
548
549
        int ix = m_configSdl.kcfg_audio_device->findData(KdenliveSettings::audiodevicename());
        m_configSdl.kcfg_audio_device->setCurrentIndex(ix);
        KdenliveSettings::setAudio_device(ix);
550
    }
Alberto Villa's avatar
Alberto Villa committed
551

552
553
554
555
556
557
558
    if (!KdenliveSettings::v4l_alsadevicename().isEmpty()) {
        // Select correct alsa device
        int ix = m_configCapture.kcfg_v4l_alsadevice->findData(KdenliveSettings::v4l_alsadevicename());
        m_configCapture.kcfg_v4l_alsadevice->setCurrentIndex(ix);
        KdenliveSettings::setV4l_alsadevice(ix);
    }

559
560
561
562
563
564
565
566
    m_configSdl.kcfg_audio_backend->addItem(i18n("SDL"), "sdl_audio");
    m_configSdl.kcfg_audio_backend->addItem(i18n("RtAudio"), "rtaudio");

    if (!KdenliveSettings::audiobackend().isEmpty()) {
        int ix = m_configSdl.kcfg_audio_backend->findData(KdenliveSettings::audiobackend());
        m_configSdl.kcfg_audio_backend->setCurrentIndex(ix);
        KdenliveSettings::setAudio_backend(ix);
    }
567
    m_configSdl.group_sdl->setEnabled(KdenliveSettings::audiobackend() == QLatin1String("sdl_audio"));
568

569
    loadCurrentV4lProfileInfo();
570
571
}

572
573
void KdenliveSettingsDialog::slotReadAudioDevices()
{
574
    QString result = QString(m_readProcess.readAllStandardOutput());
Nicolas Carion's avatar
Nicolas Carion committed
575
576
    // qCDebug(KDENLIVE_LOG) << "// / / / / / READING APLAY: ";
    // qCDebug(KDENLIVE_LOG) << result;
Laurent Montel's avatar
Laurent Montel committed
577
    const QStringList lines = result.split(QLatin1Char('\n'));
578
    for (const QString &devicestr : lines) {
Laurent Montel's avatar
Laurent Montel committed
579
        ////qCDebug(KDENLIVE_LOG) << "// READING LINE: " << data;
580
581
582
583
584
        if (!devicestr.startsWith(QLatin1Char(' ')) && devicestr.count(QLatin1Char(':')) > 1) {
            QString card = devicestr.section(QLatin1Char(':'), 0, 0).section(QLatin1Char(' '), -1);
            QString device = devicestr.section(QLatin1Char(':'), 1, 1).section(QLatin1Char(' '), -1);
            m_configSdl.kcfg_audio_device->addItem(devicestr.section(QLatin1Char(':'), -1).simplified(), "plughw:" + card + QLatin1Char(',') + device);
            m_configCapture.kcfg_v4l_alsadevice->addItem(devicestr.section(QLatin1Char(':'), -1).simplified(), "hw:" + card + QLatin1Char(',') + device);
585
        }
586
587
588
    }
}

589
590
void KdenliveSettingsDialog::showPage(int page, int option)
{
591
592
    switch (page) {
    case 1:
593
        setCurrentPage(m_page1);
594
595
        break;
    case 2:
596
        setCurrentPage(m_page2);
597
598
        break;
    case 3:
599
        setCurrentPage(m_page3);
600
601
        break;
    case 4:
602
        setCurrentPage(m_page4);
603
604
605
        m_configCapture.tabWidget->setCurrentIndex(option);
        break;
    case 5:
606
        setCurrentPage(m_page5);
607
        break;
608
609
610
611
612
613
614
615
    case 6:
        setCurrentPage(m_page6);
        break;
    case 7:
        setCurrentPage(m_page7);
        break;
    default:
        setCurrentPage(m_page1);
616
617
    }
}
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
618

619
620
void KdenliveSettingsDialog::slotEditAudioApplication()
{
621
    KService::Ptr service;
622
    QPointer<KOpenWithDialog> dlg = new KOpenWithDialog(QList<QUrl>(), i18n("Select default audio editor"), m_configEnv.kcfg_defaultaudioapp->text(), this);
623
624
    if (dlg->exec() == QDialog::Accepted) {
        service = dlg->service();
625
        m_configEnv.kcfg_defaultaudioapp->setText(KRun::binaryName(service->exec(), false));
626
    }
627

628
    delete dlg;
629
630
}

631
632
void KdenliveSettingsDialog::slotEditImageApplication()
{
633
    QPointer<KOpenWithDialog> dlg = new KOpenWithDialog(QList<QUrl>(), i18n("Select default image editor"), m_configEnv.kcfg_defaultimageapp->text(), this);
634
    if (dlg->exec() == QDialog::Accepted) {
Laurent Montel's avatar
Laurent Montel committed
635
        KService::Ptr service = dlg->service();
636
        m_configEnv.kcfg_defaultimageapp->setText(KRun::binaryName(service->exec(), false));
637
    }
638
    delete dlg;
639
640
}

641
642
void KdenliveSettingsDialog::slotCheckShuttle(int state)
{
643
#ifdef USE_JOGSHUTTLE
Nicolas Carion's avatar
Nicolas Carion committed
644
    m_configShuttle.config_group->setEnabled(state != 0);
645
    m_configShuttle.shuttledevicelist->clear();
646

647
648
    QStringList devNames = KdenliveSettings::shuttledevicenames();
    QStringList devPaths = KdenliveSettings::shuttledevicepaths();
649

650
651
652
    if (devNames.count() != devPaths.count()) {
        return;
    }
653
    for (int i = 0; i < devNames.count(); ++i) {
Nicolas Carion's avatar
Nicolas Carion committed
654
        m_configShuttle.shuttledevicelist->addItem(devNames.at(i), devPaths.at(i));
655
    }
Nicolas Carion's avatar
Nicolas Carion committed
656
    if (state != 0) {
657
        setupJogshuttleBtns(m_configShuttle.shuttledevicelist->itemData(m_configShuttle.shuttledevicelist->currentIndex()).toString());
658
    }
659
#endif /* USE_JOGSHUTTLE */
660
661
}

662
663
void KdenliveSettingsDialog::slotUpdateShuttleDevice(int ix)
{
664
#ifdef USE_JOGSHUTTLE
665
    QString device = m_configShuttle.shuttledevicelist->itemData(ix).toString();
Nicolas Carion's avatar
Nicolas Carion committed
666
    // KdenliveSettings::setShuttledevice(device);
667
    setupJogshuttleBtns(device);
668
    m_configShuttle.kcfg_shuttledevice->setText(device);
669
#endif /* USE_JOGSHUTTLE */
670
}
671

672
673
void KdenliveSettingsDialog::updateWidgets()
{
Nicolas Carion's avatar
Nicolas Carion committed
674
675
// Revert widgets to last saved state (for example when user pressed "Cancel")
// //qCDebug(KDENLIVE_LOG) << "// // // KCONFIG Revert called";
676
#ifdef USE_JOGSHUTTLE
677
678
    // revert jog shuttle device
    if (m_configShuttle.shuttledevicelist->count() > 0) {
679
680
681
682
683
684
        for (int i = 0; i < m_configShuttle.shuttledevicelist->count(); ++i) {
            if (m_configShuttle.shuttledevicelist->itemData(i) == KdenliveSettings::shuttledevice()) {
                m_configShuttle.shuttledevicelist->setCurrentIndex(i);
                break;
            }
        }
685
    }
686

687
688
689
690
691
    // Revert jog shuttle buttons
    QList<QString> action_names = m_mappable_actions.keys();
    qSort(action_names);
    QStringList actions_map = JogShuttleConfig::actionMap(KdenliveSettings::shuttlebuttons());
    QMap<QString, int> action_pos;
Nicolas Carion's avatar
Nicolas Carion committed
692
    for (const QString &action_id : actions_map) {
693
694
695
696
697
698
699
        // This loop find out at what index is the string that would map to the action_id.
        for (int i = 0; i < action_names.size(); ++i) {
            if (m_mappable_actions[action_names[i]] == action_id) {
                action_pos[action_id] = i;
                break;
            }
        }
700
701
    }
    int i = 0;
Nicolas Carion's avatar
Nicolas Carion committed
702
    for (KComboBox *button : m_shuttle_buttons) {
703
        ++i;
704
        if (i < actions_map.size()) {
705
            button->setCurrentIndex(action_pos[actions_map[i]]);
706
        }
707
    }
708
#endif /* USE_JOGSHUTTLE */
709
}
710

711
712
713
714
715
716
717
718
719
void KdenliveSettingsDialog::accept()
{
    if (m_pw->selectedProfile().isEmpty()) {
        KMessageBox::error(this, i18n("Please select a video profile"));
        return;
    }
    KConfigDialog::accept();
}

720
721
void KdenliveSettingsDialog::updateSettings()
{
722
    // Save changes to settings (for example when user pressed "Apply" or "Ok")
Laurent Montel's avatar
Laurent Montel committed
723
    // //qCDebug(KDENLIVE_LOG) << "// // // KCONFIG UPDATE called";
724
725
726
727
    if (m_pw->selectedProfile().isEmpty()) {
        KMessageBox::error(this, i18n("Please select a video profile"));
        return;
    }
728
    KdenliveSettings::setDefault_profile(m_pw->selectedProfile());
729
730

    bool resetProfile = false;
731
    bool updateCapturePath = false;
732
    bool updateLibrary = false;
Alberto Villa's avatar
Alberto Villa committed
733

734
    /*if (m_configShuttle.shuttledevicelist->count() > 0) {
735
736
    QString device = m_configShuttle.shuttledevicelist->itemData(m_configShuttle.shuttledevicelist->currentIndex()).toString();
    if (device != KdenliveSettings::shuttledevice()) KdenliveSettings::setShuttledevice(device);
737
    }*/
738

739
    // Capture default folder
740
741
742
743
744
    if (m_configEnv.kcfg_capturetoprojectfolder->isChecked() != KdenliveSettings::capturetoprojectfolder()) {
        KdenliveSettings::setCapturetoprojectfolder(m_configEnv.kcfg_capturetoprojectfolder->isChecked());
        updateCapturePath = true;
    }

745
746
    if (m_configProject.projecturl->url().toLocalFile() != KdenliveSettings::defaultprojectfolder()) {
        KdenliveSettings::setDefaultprojectfolder(m_configProject.projecturl->url().toLocalFile());
747
748
    }

749
750
    if (m_configEnv.capturefolderurl->url().toLocalFile() != KdenliveSettings::capturefolder()) {
        KdenliveSettings::setCapturefolder(m_configEnv.capturefolderurl->url().toLocalFile());
751
        updateCapturePath = true;
752
753
    }

754
755
756
757
758
759
    // Library default folder
    if (m_configEnv.kcfg_librarytodefaultfolder->isChecked() != KdenliveSettings::librarytodefaultfolder()) {
        KdenliveSettings::setLibrarytodefaultfolder(m_configEnv.kcfg_librarytodefaultfolder->isChecked());
        updateLibrary = true;
    }

760
761
    if (m_configEnv.libraryfolderurl->url().toLocalFile() != KdenliveSettings::libraryfolder()) {
        KdenliveSettings::setLibraryfolder(m_configEnv.libraryfolderurl->url().toLocalFile());
762
763
764
765
766
        if (!KdenliveSettings::librarytodefaultfolder()) {
            updateLibrary = true;
        }
    }

767
768
769
770
771
    if (m_configCapture.kcfg_dvgrabfilename->text() != KdenliveSettings::dvgrabfilename()) {
        KdenliveSettings::setDvgrabfilename(m_configCapture.kcfg_dvgrabfilename->text());
        updateCapturePath = true;
    }

772
    if (m_configCapture.kcfg_firewireformat->currentIndex() != KdenliveSettings::firewireformat()) {
773
774
775
776
        KdenliveSettings::setFirewireformat(m_configCapture.kcfg_firewireformat->currentIndex());
        updateCapturePath = true;
    }

777
    if (m_configCapture.kcfg_v4l_format->currentIndex() != KdenliveSettings::v4l_format()) {
778
779
780
        saveCurrentV4lProfile();
        KdenliveSettings::setV4l_format(0);
    }
781

782
    // Check if screengrab is fullscreen