From: Jean-Baptiste Mardelle Date: Tue, 19 Feb 2008 23:22:10 +0000 (+0000) Subject: improve Kdenlive Settings dialog X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a66d246dab4a56bc1fe709fe37d46f7978108d9e;p=kdenlive improve Kdenlive Settings dialog svn path=/branches/KDE4/; revision=1879 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf662357..0e8e10a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -71,6 +71,7 @@ set(kdenlive_SRCS parameterplotter.cpp profilesdialog.cpp projectsettings.cpp + kdenlivesettingsdialog.cpp ) kde4_add_kcfg_files(kdenlive_SRCS GENERATE_MOC kdenlivesettings.kcfgc ) diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp new file mode 100644 index 00000000..f640a811 --- /dev/null +++ b/src/kdenlivesettingsdialog.cpp @@ -0,0 +1,73 @@ +/*************************************************************************** + * 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 * + ***************************************************************************/ + +#include + +#include +#include + +#include "profilesdialog.h" +#include "kdenlivesettings.h" +#include "kdenlivesettingsdialog.h" + +KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(parent, "settings", KdenliveSettings::self()) +{ + + QWidget *page1 = new QWidget; + m_configMisc = new Ui::ConfigMisc_UI( ); + m_configMisc->setupUi(page1); + addPage( page1, i18n("Misc"), "misc" ); + + QWidget *page2 = new QWidget; + m_configEnv = new Ui::ConfigEnv_UI( ); + m_configEnv->setupUi(page2); + m_configEnv->kcfg_mltpath->setMode(KFile::Directory); + + //WARNING: the 2 lines below should not be necessary, but does not work without it... + m_configEnv->kcfg_mltpath->setPath(KdenliveSettings::mltpath()); + m_configEnv->kcfg_rendererpath->setPath(KdenliveSettings::rendererpath()); + addPage( page2, i18n("Environnement"), "env" ); + + QStringList profilesNames = ProfilesDialog::getProfileNames(); + m_configMisc->profiles_list->addItems(profilesNames); + + //User edited the configuration - update your local copies of the + //configuration data + + slotUpdateDisplay(); + connect(m_configMisc->profiles_list, SIGNAL(currentIndexChanged( int )), this, SLOT(slotUpdateDisplay())); +} + + +void KdenliveSettingsDialog::slotUpdateDisplay() +{ + QString currentProfile = m_configMisc->profiles_list->currentText(); + QMap< QString, QString > values = ProfilesDialog::getSettingsForProfile(currentProfile); + m_configMisc->p_size->setText(values.value("width") + "x" + values.value("height")); + m_configMisc->p_fps->setText(values.value("frame_rate_num") + "/" + values.value("frame_rate_den")); + m_configMisc->p_aspect->setText(values.value("sample_aspect_num") + "/" + values.value("sample_aspect_den")); + m_configMisc->p_display->setText(values.value("display_aspect_num") + "/" + values.value("display_aspect_den")); + if (values.value("progressive").toInt() == 0) m_configMisc->p_progressive->setText(i18n("Interlaced")); + else m_configMisc->p_progressive->setText(i18n("Progressive")); +} + + +#include "kdenlivesettingsdialog.moc" + + diff --git a/src/kdenlivesettingsdialog.h b/src/kdenlivesettingsdialog.h new file mode 100644 index 00000000..ae684c61 --- /dev/null +++ b/src/kdenlivesettingsdialog.h @@ -0,0 +1,51 @@ +/*************************************************************************** + * 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 * + ***************************************************************************/ + + +#ifndef KDENLIVESETTINGSDIALOG_H +#define KDENLIVESETTINGSDIALOG_H + +#include + +#include + +#include "ui_configmisc_ui.h" +#include "ui_configenv_ui.h" + +class KdenliveSettingsDialog : public KConfigDialog +{ + Q_OBJECT + + public: + KdenliveSettingsDialog(QWidget * parent = 0); + + private slots: + void slotUpdateDisplay(); + + private: + Ui::ConfigEnv_UI* m_configEnv; + Ui::ConfigMisc_UI* m_configMisc; + QStringList m_mltProfilesList; + QStringList m_customProfilesList; + bool m_isCustomProfile; +}; + + +#endif + diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 663b952b..a5559672 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -46,8 +46,7 @@ #include "mainwindow.h" #include "kdenlivesettings.h" -#include "ui_configmisc_ui.h" -#include "ui_configenv_ui.h" +#include "kdenlivesettingsdialog.h" #include "initeffects.h" #include "profilesdialog.h" #include "projectsettings.h" @@ -481,25 +480,7 @@ void MainWindow::slotPreferences() // KConfigDialog didn't find an instance of this dialog, so lets // create it : - KConfigDialog* dialog = new KConfigDialog(this, "settings", - KdenliveSettings::self()); - - QWidget *page1 = new QWidget; - Ui::ConfigMisc_UI* confWdg = new Ui::ConfigMisc_UI( ); - confWdg->setupUi(page1); - dialog->addPage( page1, i18n("Misc"), "misc" ); - - QWidget *page2 = new QWidget; - Ui::ConfigEnv_UI* confWdg2 = new Ui::ConfigEnv_UI( ); - confWdg2->setupUi(page2); - confWdg2->kcfg_mltpath->setMode(KFile::Directory); - - //WARNING: the 2 lines below should not be necessary, but does not work without it... - confWdg2->kcfg_mltpath->setPath(KdenliveSettings::mltpath()); - confWdg2->kcfg_rendererpath->setPath(KdenliveSettings::rendererpath()); - dialog->addPage( page2, i18n("Environnment"), "env" ); - //User edited the configuration - update your local copies of the - //configuration data + KdenliveSettingsDialog* dialog = new KdenliveSettingsDialog(this); connect( dialog, SIGNAL(settingsChanged()), this, SLOT(updateConfiguration()) ); dialog->show(); diff --git a/src/widgets/configmisc_ui.ui b/src/widgets/configmisc_ui.ui index b4eab508..6291c093 100644 --- a/src/widgets/configmisc_ui.ui +++ b/src/widgets/configmisc_ui.ui @@ -5,20 +5,17 @@ 0 0 - 316 - 117 + 369 + 241 - - Form - - + - Default durations + Default Durations - + @@ -36,14 +33,14 @@ - + Image clips - + 99:99:99:99; @@ -54,11 +51,97 @@ + + + Default Profile + + + + + + Profile + + + + + + + + + + + + Size: + + + + + + + 720x576 + + + + + + + Frame rate: + + + + + + + 25/1 + + + + + + + Aspect ratio: + + + + + + + 59/54 + + + + + + + Display ratio: + + + + + + + 4/3 + + + + + + + + + Interlaced + + + + + + + Qt::Vertical - + 20 40 @@ -69,6 +152,11 @@ + + KComboBox + QComboBox +
kcombobox.h
+
KRestrictedLine KLineEdit