]> git.sesse.net Git - kdenlive/blob - src/projectsettings.cpp
Start of project settings dialog
[kdenlive] / src / projectsettings.cpp
1 /***************************************************************************
2  *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20 #include <QDir>
21
22 #include <KStandardDirs>
23 #include <KDebug>
24
25
26 #include "profilesdialog.h"
27 #include "projectsettings.h"
28
29 ProjectSettings::ProjectSettings(QWidget * parent): QDialog(parent), m_isCustomProfile(false)
30 {
31   m_view.setupUi(this);
32
33   QStringList profilesNames = ProfilesDialog::getProfileNames();
34   m_view.profiles_list->addItems(profilesNames);
35
36   slotUpdateDisplay();
37   connect(m_view.profiles_list, SIGNAL(currentIndexChanged( int )), this, SLOT(slotUpdateDisplay()));
38 }
39
40
41 void ProjectSettings::slotUpdateDisplay()
42 {
43   QString currentProfile = m_view.profiles_list->currentText();
44   QMap< QString, QString > values = ProfilesDialog::getSettingsForProfile(currentProfile);
45   m_view.p_size->setText(values.value("width") + "x" + values.value("height"));
46   m_view.p_fps->setText(values.value("frame_rate_num") + "/" + values.value("frame_rate_den"));
47   m_view.p_aspect->setText(values.value("sample_aspect_num") + "/" + values.value("sample_aspect_den"));
48   m_view.p_display->setText(values.value("display_aspect_num") + "/" + values.value("display_aspect_den"));
49   if (values.value("progressive").toInt() == 0) m_view.p_progressive->setText(i18n("Interlaced"));
50   else m_view.p_progressive->setText(i18n("Progressive"));
51 }
52
53
54 #include "projectsettings.moc"
55
56