]> git.sesse.net Git - kdenlive/commitdiff
correctly update capture folder when it changes:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 12 Mar 2009 12:37:19 +0000 (12:37 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Thu, 12 Mar 2009 12:37:19 +0000 (12:37 +0000)
http://www.kdenlive.org:80/mantis/view.php?id=712

svn path=/trunk/kdenlive/; revision=3141

src/kdenlivesettingsdialog.cpp
src/kdenlivesettingsdialog.h
src/mainwindow.cpp
src/recmonitor.cpp
src/recmonitor.h

index b43bb4345f8bb986e2b7bb0bc9171d9303b3d792..630b788cfdf3bdc2b9ae7c57b0c1407a873534a1 100644 (file)
@@ -26,6 +26,7 @@
 #include <kopenwithdialog.h>
 #include <KConfigDialogManager>
 #include <kde_file.h>
+#include <KIO/NetAccess>
 
 #include <QDir>
 #include <QTimer>
@@ -65,6 +66,7 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(
     m_configEnv.capturefolderurl->lineEdit()->setObjectName("kcfg_capturefolder");
     page2 = addPage(p2, i18n("Environment"), "terminal");
 
+    m_captureFolder = KdenliveSettings::capturefolder();
     QWidget *p4 = new QWidget;
     m_configCapture.setupUi(p4);
     page4 = addPage(p4, i18n("Capture"), "audio-card");
@@ -378,6 +380,12 @@ void KdenliveSettingsDialog::updateSettings() {
         resetProfile = true;
     }
 
+    if (m_configEnv.capturefolderurl->text() != KdenliveSettings::capturefolder()) {
+        kDebug() << "/// CAPT FOLDER UPDATED";
+        KdenliveSettings::setCapturefolder(m_configEnv.capturefolderurl->text());
+        emit updateCaptureFolder();
+    }
+
     value = m_configCapture.kcfg_rmd_alsa_device->itemData(m_configCapture.kcfg_rmd_alsa_device->currentIndex()).toString();
     if (value != KdenliveSettings::rmd_alsadevicename()) {
         KdenliveSettings::setRmd_alsadevicename(value);
@@ -427,6 +435,7 @@ void KdenliveSettingsDialog::slotUpdateDisplay() {
 }
 
 
+
 #include "kdenlivesettingsdialog.moc"
 
 
index 4594064ab39c5a6d792cd937ba889bc398a9672c..6ebf2becc18eb37874e163eacfbbc5818feb6f6f 100644 (file)
@@ -78,12 +78,14 @@ private:
     QString m_defaultProfile;
     QString m_defaultPath;
     KProcess m_readProcess;
+    QString m_captureFolder;
     void initDevices();
 
 signals:
     void customChanged();
     void doResetProfile();
     void updatePreviewSettings();
+    void updateCaptureFolder();
 };
 
 
index cacf172ac9a24b94ba95fc2eb3cc5bcfc56616a4..6c57b06079b6c328d1ef4daf7ea696518b43aad9 100644 (file)
@@ -1728,6 +1728,7 @@ void MainWindow::slotPreferences(int page, int option) {
     connect(dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(updateConfiguration()));
     connect(dialog, SIGNAL(doResetProfile()), m_monitorManager, SLOT(slotResetProfiles()));
     connect(dialog, SIGNAL(updatePreviewSettings()), this, SLOT(slotUpdatePreviewSettings()));
+    connect(dialog, SIGNAL(updateCaptureFolder()), m_recMonitor, SLOT(slotUpdateCaptureFolder()));
     //connect(dialog, SIGNAL(updatePreviewSettings()), this, SLOT(slotUpdatePreviewSettings()));
     dialog->show();
     if (page != -1) dialog->showPage(page, option);
index 5d9749ebce1c71dba61696816721dfbd20fce1a9..4c52775774c2fb8f0a67e82ceb7ed346806947aa 100644 (file)
@@ -126,6 +126,11 @@ void RecMonitor::slotConfigure() {
     emit showConfigDialog(4, ui.device_selector->currentIndex());
 }
 
+void RecMonitor::slotUpdateCaptureFolder() {
+    if (captureProcess) captureProcess->setWorkingDirectory(KdenliveSettings::capturefolder());
+    slotVideoDeviceChanged(ui.device_selector->currentIndex());
+}
+
 void RecMonitor::slotVideoDeviceChanged(int ix) {
     switch (ix) {
     case SCREENGRAB:
index d4a3953ac38be3b78c5847f9eac471d564d6291b..a9ff801838284a322ec0ce60b632a05fe1709fbb 100644 (file)
@@ -98,6 +98,7 @@ public slots:
     void start();
     void activateRecMonitor();
     void slotPlay();
+    void slotUpdateCaptureFolder();
 
 signals:
     void renderPosition(int);