+void KdenliveSettingsDialog::slotUpdateDisplay()
+{
+ QString currentProfile = m_configProject.kcfg_profiles_list->itemData(m_configProject.kcfg_profiles_list->currentIndex()).toString();
+ QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(currentProfile);
+ m_configProject.p_size->setText(values.value("width") + 'x' + values.value("height"));
+ m_configProject.p_fps->setText(values.value("frame_rate_num") + '/' + values.value("frame_rate_den"));
+ m_configProject.p_aspect->setText(values.value("sample_aspect_num") + '/' + values.value("sample_aspect_den"));
+ m_configProject.p_display->setText(values.value("display_aspect_num") + '/' + values.value("display_aspect_den"));
+ if (values.value("progressive").toInt() == 0)
+ m_configProject.p_progressive->setText(i18n("Interlaced"));
+ else
+ m_configProject.p_progressive->setText(i18n("Progressive"));
+ m_defaultProfile = m_configProject.kcfg_profiles_list->itemText(m_configProject.kcfg_profiles_list->currentIndex());
+ m_defaultPath = currentProfile;
+}
+
+void KdenliveSettingsDialog::slotCheckAlsaDriver()
+{
+ QString value = m_configSdl.kcfg_audio_driver->itemData(m_configSdl.kcfg_audio_driver->currentIndex()).toString();
+ m_configSdl.kcfg_audio_device->setEnabled(value == "alsa");
+}
+
+void KdenliveSettingsDialog::loadTranscodeProfiles()
+{
+ KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc");
+ KConfigGroup transConfig(config, "Transcoding");
+ // read the entries
+ m_configTranscode.profiles_list->blockSignals(true);
+ QMap< QString, QString > profiles = transConfig.entryMap();
+ QMapIterator<QString, QString> i(profiles);
+ while (i.hasNext()) {
+ i.next();
+ QTreeWidgetItem *item = new QTreeWidgetItem(m_configTranscode.profiles_list, QStringList() << i.key() << i.value());
+ item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
+ }
+ m_configTranscode.profiles_list->blockSignals(false);
+}
+
+void KdenliveSettingsDialog::saveTranscodeProfiles()
+{
+ KSharedConfigPtr config = KSharedConfig::openConfig("kdenlivetranscodingrc");
+ //KSharedConfigPtr config = KGlobal::config();
+ KConfigGroup transConfig(config, "Transcoding");
+ // read the entries
+ transConfig.deleteGroup();
+ int max = m_configTranscode.profiles_list->topLevelItemCount();
+ for (int i = 0; i < max; i++) {
+ QTreeWidgetItem *item = m_configTranscode.profiles_list->topLevelItem(i);
+ transConfig.writeEntry(item->text(0), item->text(1));
+ }
+ config->sync();
+}
+
+void KdenliveSettingsDialog::slotAddTranscode()
+{
+ QTreeWidgetItem *item = new QTreeWidgetItem(m_configTranscode.profiles_list, QStringList() << i18n("Name") << i18n("Parameters"));
+ item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable);
+ m_configTranscode.profiles_list->setCurrentItem(item);
+ m_configTranscode.profiles_list->editItem(item);
+ slotDialogModified();
+}
+
+void KdenliveSettingsDialog::slotDeleteTranscode()
+{
+ QTreeWidgetItem *item = m_configTranscode.profiles_list->currentItem();
+ if (item == NULL) return;
+ delete item;
+ slotDialogModified();
+}
+
+void KdenliveSettingsDialog::slotShuttleModified()
+{
+#ifndef NO_JOGSHUTTLE
+ QStringList actions;
+ actions << "monitor_pause"; // the Job rest position action.
+ foreach (KComboBox* button, m_shuttle_buttons) {
+ actions << m_mappable_actions[button->currentText()];
+ }
+ QString maps = JogShuttleConfig::actionMap(actions);
+ m_shuttleModified = KdenliveSettings::shuttlebuttons() != maps;
+#endif
+#if KDE_IS_VERSION(4,3,0)
+ KConfigDialog::updateButtons();
+#endif
+}
+
+void KdenliveSettingsDialog::slotDialogModified()
+{
+ m_modified = true;
+#if KDE_IS_VERSION(4,3,0)
+ KConfigDialog::updateButtons();
+#endif
+}
+
+//virtual
+bool KdenliveSettingsDialog::hasChanged()
+{
+ if (m_modified || m_shuttleModified) return true;
+ return KConfigDialog::hasChanged();
+}
+
+void KdenliveSettingsDialog::slotUpdatev4lDevice()
+{
+ QString device = m_configCapture.kcfg_detectedv4ldevices->itemData(m_configCapture.kcfg_detectedv4ldevices->currentIndex()).toString();
+ if (!device.isEmpty()) m_configCapture.kcfg_video4vdevice->setText(device);
+ QString size = m_configCapture.kcfg_detectedv4ldevices->itemData(m_configCapture.kcfg_detectedv4ldevices->currentIndex(), Qt::UserRole + 1).toString();
+ if (!size.isEmpty()) m_configCapture.kcfg_video4size->setText(size);
+ rebuildVideo4Commands();