From 21cecb07093ae3cca9ae2940e3d4254dd0df1fe3 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Tue, 27 Jan 2009 19:56:42 +0000 Subject: [PATCH] Some config dialog cleanup svn path=/branches/KDE4/; revision=2991 --- src/kdenlivesettings.kcfg | 20 ++- src/kdenlivesettingsdialog.cpp | 47 +++--- src/kdenlivesettingsdialog.h | 5 +- src/widgets/configcapture_ui.ui | 280 ++++++++++++++++++-------------- src/widgets/configsdl_ui.ui | 2 +- 5 files changed, 193 insertions(+), 161 deletions(-) diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg index 1e979ea5..b49ce190 100644 --- a/src/kdenlivesettings.kcfg +++ b/src/kdenlivesettings.kcfg @@ -43,6 +43,11 @@ 2 + + + + + @@ -103,6 +108,11 @@ + + + + + false @@ -285,6 +295,11 @@ + + + + + @@ -378,11 +393,6 @@ hdv_1080_50i - - - - - true diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp index 7c5f7a00..cda84a8b 100644 --- a/src/kdenlivesettingsdialog.cpp +++ b/src/kdenlivesettingsdialog.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -42,6 +43,9 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog( m_configMisc.setupUi(p1); page1 = addPage(p1, i18n("Misc"), "configure"); + // Hide multi tab option until Kdenlive really supports it + m_configMisc.kcfg_activatetabs->setVisible(false); + QWidget *p3 = new QWidget; m_configDisplay.setupUi(p3); page3 = addPage(p3, i18n("Display"), "display"); @@ -106,8 +110,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog( connect(m_configEnv.kp_audio, SIGNAL(clicked()), this, SLOT(slotEditAudioApplication())); connect(m_configEnv.kp_player, SIGNAL(clicked()), this, SLOT(slotEditVideoApplication())); - - QMap profilesInfo = ProfilesDialog::getProfilesInfo(); QMapIterator i(profilesInfo); while (i.hasNext()) { @@ -116,11 +118,11 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog( } checkProfile(); + slotUpdateDisplay(); initDevices(); connect(m_configMisc.kcfg_profiles_list, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateDisplay())); - connect(m_configCapture.kcfg_rmd_capture_type, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateRmdRegionStatus())); slotUpdateRmdRegionStatus(); @@ -209,8 +211,8 @@ void KdenliveSettingsDialog::initDevices() { m_configSdl.kcfg_video_driver->addItem(i18n("Ascii art library"), "aalib"); // Fill the list of audio playback devices - m_configSdl.audio_device->addItem(i18n("Default"), QString()); - m_configCapture.rmd_alsa_device->addItem(i18n("Default"), QString()); + m_configSdl.kcfg_audio_device->addItem(i18n("Default"), QString()); + m_configCapture.kcfg_rmd_alsa_device->addItem(i18n("Default"), QString()); if (KStandardDirs::findExe("aplay") != QString::null) { m_readProcess.setOutputChannelMode(KProcess::OnlyStdoutChannel); m_readProcess.setProgram("aplay", QStringList() << "-l"); @@ -227,11 +229,11 @@ void KdenliveSettingsDialog::initDevices() { line = stream.readLine(); if (line.contains("playback")) { deviceId = line.section(":", 0, 0); - m_configSdl.audio_device->addItem(line.section(":", 1, 1), "plughw:" + QString::number(deviceId.section("-", 0, 0).toInt()) + "," + QString::number(deviceId.section("-", 1, 1).toInt())); + m_configSdl.kcfg_audio_device->addItem(line.section(":", 1, 1), "plughw:" + QString::number(deviceId.section("-", 0, 0).toInt()) + "," + QString::number(deviceId.section("-", 1, 1).toInt())); } if (line.contains("capture")) { deviceId = line.section(":", 0, 0); - m_configCapture.rmd_alsa_device->addItem(line.section(":", 1, 1), "plughw:" + QString::number(deviceId.section("-", 0, 0).toInt()) + "," + QString::number(deviceId.section("-", 1, 1).toInt())); + m_configCapture.kcfg_rmd_alsa_device->addItem(line.section(":", 1, 1), "plughw:" + QString::number(deviceId.section("-", 0, 0).toInt()) + "," + QString::number(deviceId.section("-", 1, 1).toInt())); } } file.close(); @@ -239,13 +241,15 @@ void KdenliveSettingsDialog::initDevices() { } if (!KdenliveSettings::audiodevicename().isEmpty()) { // Select correct alsa device - int ix = m_configSdl.audio_device->findData(KdenliveSettings::audiodevicename()); - if (ix > 0) m_configSdl.audio_device->setCurrentIndex(ix); + int ix = m_configSdl.kcfg_audio_device->findData(KdenliveSettings::audiodevicename()); + m_configSdl.kcfg_audio_device->setCurrentIndex(ix); + KdenliveSettings::setAudio_device(ix); } if (!KdenliveSettings::rmd_alsadevicename().isEmpty()) { // Select correct alsa device - int ix = m_configCapture.rmd_alsa_device->findData(KdenliveSettings::rmd_alsadevicename()); - if (ix > 0) m_configCapture.rmd_alsa_device->setCurrentIndex(ix); + int ix = m_configCapture.kcfg_rmd_alsa_device->findData(KdenliveSettings::rmd_alsadevicename()); + m_configCapture.kcfg_rmd_alsa_device->setCurrentIndex(ix); + KdenliveSettings::setRmd_alsa_device(ix); } } @@ -260,8 +264,8 @@ void KdenliveSettingsDialog::slotReadAudioDevices() { if (data.simplified().startsWith("card")) { QString card = data.section(":", 0, 0).section(" ", -1); QString device = data.section(":", 1, 1).section(" ", -1); - m_configSdl.audio_device->addItem(data.section(":", -1), "plughw:" + card + "," + device); - m_configCapture.rmd_alsa_device->addItem(data.section(":", -1), "plughw:" + card + "," + device); + m_configSdl.kcfg_audio_device->addItem(data.section(":", -1), "plughw:" + card + "," + device); + m_configCapture.kcfg_rmd_alsa_device->addItem(data.section(":", -1), "plughw:" + card + "," + device); } } } @@ -356,32 +360,19 @@ void KdenliveSettingsDialog::rebuildVideo4Commands() { } -// virtual protected -bool KdenliveSettingsDialog::isDefault() { - return KConfigDialog::isDefault(); -} - -// virtual protected -bool KdenliveSettingsDialog::hasChanged() { - kDebug() << "// // // KCONFIG hasChanged called: " << m_configMisc.kcfg_profiles_list->currentText() << ", " << m_defaultProfile; - - if (m_configMisc.kcfg_profiles_list->currentText() != m_defaultProfile) return true; - return KConfigDialog::hasChanged(); -} - void KdenliveSettingsDialog::updateSettings() { kDebug() << "// // // KCONFIG UPDATE called"; m_defaultProfile = m_configMisc.kcfg_profiles_list->currentText(); KdenliveSettings::setDefault_profile(m_defaultPath); bool resetProfile = false; - QString value = m_configSdl.audio_device->itemData(m_configSdl.audio_device->currentIndex()).toString(); + QString value = m_configSdl.kcfg_audio_device->itemData(m_configSdl.kcfg_audio_device->currentIndex()).toString(); if (value != KdenliveSettings::audiodevicename()) { KdenliveSettings::setAudiodevicename(value); resetProfile = true; } - value = m_configCapture.rmd_alsa_device->itemData(m_configCapture.rmd_alsa_device->currentIndex()).toString(); + 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); } diff --git a/src/kdenlivesettingsdialog.h b/src/kdenlivesettingsdialog.h index b9e45761..4594064a 100644 --- a/src/kdenlivesettingsdialog.h +++ b/src/kdenlivesettingsdialog.h @@ -41,10 +41,11 @@ public: ~KdenliveSettingsDialog(); void showPage(int page, int option); void checkProfile(); - bool hasChanged(); - bool isDefault(); + +protected slots: void updateSettings(); + private slots: void slotUpdateDisplay(); void rebuildVideo4Commands(); diff --git a/src/widgets/configcapture_ui.ui b/src/widgets/configcapture_ui.ui index 421ecee2..8591d380 100644 --- a/src/widgets/configcapture_ui.ui +++ b/src/widgets/configcapture_ui.ui @@ -45,7 +45,7 @@ - 2 + 0 @@ -305,29 +305,12 @@ - label_3 - label_14 - kcfg_video4adevice - label_9 - label_16 - label_11 - kcfg_video4encoding - label_12 - kcfg_video4aformat - kcfg_video4vformat - kcfg_video4vdevice - kcfg_video4capture - line_3 - label_4 - kcfg_video4size - label_6 - kcfg_video4rate Screen Grab - + @@ -357,6 +340,69 @@ QFrame::Raised + + + + + + Audio channels + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Audio frequency + + + + + + + + 48000 + + + + + 41000 + + + + + 32000 + + + + + 22500 + + + + + 11250 + + + + + + @@ -367,108 +413,63 @@ - - - - - - - Jack - - - - - - - Ports: + + + + + 0 + 0 + - - - - - + + Buffer - - - - + 999 - - + + - Buffer + Jack - - + + - Audio channels + Ports: - - - - - - - Audio frequency + + + + + 0 + 0 + - - - - - 48000 - - - - - 41000 - - - - - 32000 - - - - - 22500 - - - - - 11250 - - + + + + Buffer + - - - - Qt::Horizontal - - - - 40 - 20 - - - + + @@ -495,9 +496,53 @@ QFrame::Raised - + + + + + + + Follow mouse + + + + + + + Hide frame + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Offset + + + + + + 0 + 0 + + 1 @@ -508,6 +553,12 @@ + + + 0 + 0 + + 1 @@ -516,27 +567,6 @@ - - - - 5000 - - - - - - - 5000 - - - - - - - Offset - - - @@ -544,17 +574,17 @@ - - - - Follow mouse + + + + 5000 - - - - Hide frame + + + + 5000 @@ -645,7 +675,7 @@ kcfg_video4encoding kcfg_rmd_capture_audio radioButton_2 - rmd_alsa_device + kcfg_rmd_alsa_device kcfg_rmd_alsa_buffer kcfg_rmd_use_jack kcfg_rmd_jackports diff --git a/src/widgets/configsdl_ui.ui b/src/widgets/configsdl_ui.ui index cd1d086a..5163b817 100644 --- a/src/widgets/configsdl_ui.ui +++ b/src/widgets/configsdl_ui.ui @@ -69,7 +69,7 @@ - + -- 2.39.2