Allow user to select between PAL and NTSC profiles for export, fixes:

http://www.kdenlive.org:80/mantis/view.php?id=300

svn path=/branches/KDE4/; revision=2625
parent f9514dc1
......@@ -36,7 +36,7 @@ const int RenderRole = GroupRole + 3;
const int ParamsRole = GroupRole + 4;
const int EditableRole = GroupRole + 5;
RenderWidget::RenderWidget(QWidget * parent): QDialog(parent), m_standard("PAL") {
RenderWidget::RenderWidget(QWidget * parent): QDialog(parent) {
m_view.setupUi(this);
m_view.buttonDelete->setIcon(KIcon("trash-empty"));
m_view.buttonDelete->setToolTip(i18n("Delete profile"));
......@@ -72,6 +72,7 @@ RenderWidget::RenderWidget(QWidget * parent): QDialog(parent), m_standard("PAL")
connect(m_view.guide_end, SIGNAL(activated(int)), this, SLOT(slotCheckStartGuidePosition()));
connect(m_view.guide_start, SIGNAL(activated(int)), this, SLOT(slotCheckEndGuidePosition()));
connect(m_view.format_selection, SIGNAL(activated(int)), this, SLOT(refreshView()));
m_view.buttonStart->setEnabled(false);
m_view.guides_box->setVisible(false);
......@@ -349,7 +350,9 @@ void RenderWidget::slotExport() {
}
void RenderWidget::setDocumentStandard(QString std) {
m_standard = std;
if (std == "PAL") m_view.format_selection->setCurrentIndex(0);
else m_view.format_selection->setCurrentIndex(1);
refreshView();
}
......@@ -367,11 +370,15 @@ void RenderWidget::refreshView() {
for (int i = 0; i < m_view.size_list->count(); i++) {
sizeItem = m_view.size_list->item(i);
std = sizeItem->data(StandardRole).toString();
if (!std.isEmpty() && !std.contains(m_standard, Qt::CaseInsensitive)) sizeItem->setHidden(true);
else if (sizeItem->data(GroupRole) == group) {
sizeItem->setHidden(false);
if (!firstSelected) m_view.size_list->setCurrentItem(sizeItem);
firstSelected = true;
if (sizeItem->data(GroupRole) == group) {
if (!std.isEmpty()) {
if (std.contains("PAL", Qt::CaseInsensitive)) sizeItem->setHidden(m_view.format_selection->currentIndex() != 0);
else if (std.contains("NTSC", Qt::CaseInsensitive)) sizeItem->setHidden(m_view.format_selection->currentIndex() != 1);
} else {
sizeItem->setHidden(false);
if (!firstSelected) m_view.size_list->setCurrentItem(sizeItem);
firstSelected = true;
}
} else sizeItem->setHidden(true);
}
......
......@@ -49,7 +49,6 @@ private slots:
private:
Ui::RenderWidget_UI m_view;
QString m_standard;
void parseProfiles(QString group = QString(), QString profile = QString());
void parseFile(QString exportFile, bool editable);
......
......@@ -40,55 +40,7 @@
<string>Templates</string>
</attribute>
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Format</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>165</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2" >
<widget class="QToolButton" name="buttonInfo" >
<property name="text" >
<string>I</string>
</property>
</widget>
</item>
<item row="0" column="3" >
<widget class="QToolButton" name="buttonSave" >
<property name="text" >
<string>S</string>
</property>
</widget>
</item>
<item row="0" column="4" >
<widget class="QToolButton" name="buttonEdit" >
<property name="text" >
<string>E</string>
</property>
</widget>
</item>
<item row="0" column="5" >
<widget class="QToolButton" name="buttonDelete" >
<property name="text" >
<string>D</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="6" >
<item row="1" column="0" colspan="7" >
<widget class="QSplitter" name="splitter_3" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
......@@ -124,17 +76,69 @@
</widget>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Format</string>
</property>
</widget>
</item>
<item row="0" column="5" >
<widget class="QToolButton" name="buttonEdit" >
<property name="text" >
<string>E</string>
</property>
</widget>
</item>
<item row="0" column="6" >
<widget class="QToolButton" name="buttonDelete" >
<property name="text" >
<string>D</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>165</width>
<height>24</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="4" >
<widget class="QToolButton" name="buttonSave" >
<property name="text" >
<string>S</string>
</property>
</widget>
</item>
<item row="0" column="3" >
<widget class="QToolButton" name="buttonInfo" >
<property name="text" >
<string>I</string>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="KComboBox" name="format_selection" >
<item>
<property name="text" >
<string>PAL</string>
</property>
</item>
<item>
<property name="text" >
<string>NTSC</string>
</property>
</item>
</widget>
</item>
</layout>
<zorder>label_3</zorder>
<zorder>format_list</zorder>
<zorder>size_list</zorder>
<zorder>advanced_params</zorder>
<zorder>buttonEdit</zorder>
<zorder>buttonDelete</zorder>
<zorder>horizontalSpacer_2</zorder>
<zorder>buttonSave</zorder>
<zorder>buttonInfo</zorder>
<zorder>advanced_params</zorder>
</widget>
</widget>
</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment