#include "renderer.h"
#include "kthumb.h"
#include "projectlistview.h"
+#include "timecodedisplay.h"
#include "editclipcommand.h"
#include "editclipcutcommand.h"
#include "editfoldercommand.h"
void ProjectList::slotAddColorClip()
{
- if (!m_commandStack) {
+ if (!m_commandStack)
kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
- }
+
QDialog *dia = new QDialog(this);
Ui::ColorClip_UI dia_ui;
dia_ui.setupUi(dia);
dia->setWindowTitle(i18n("Color Clip"));
dia_ui.clip_name->setText(i18n("Color Clip"));
- dia_ui.clip_duration->setInputMask("");
- dia_ui.clip_duration->setValidator(m_timecode.validator());
- dia_ui.clip_duration->setText(m_timecode.reformatSeparators(KdenliveSettings::color_duration()));
+
+ TimecodeDisplay *t = new TimecodeDisplay(m_timecode);
+ t->setValue(KdenliveSettings::color_duration());
+ t->setTimeCodeFormat(false);
+ dia_ui.clip_durationBox->addWidget(t);
+ dia_ui.clip_color->setColor(KdenliveSettings::colorclipcolor());
+
if (dia->exec() == QDialog::Accepted) {
QString color = dia_ui.clip_color->color().name();
+ KdenliveSettings::setColorclipcolor(color);
color = color.replace(0, 1, "0x") + "ff";
QStringList groupInfo = getGroup();
- m_doc->slotCreateColorClip(dia_ui.clip_name->text(), color, dia_ui.clip_duration->text(), groupInfo.at(0), groupInfo.at(1));
+ m_doc->slotCreateColorClip(dia_ui.clip_name->text(), color, m_timecode.getTimecode(t->gentime()), groupInfo.at(0), groupInfo.at(1));
}
+ delete t;
delete dia;
}
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>ColorClip_UI</class>
- <widget class="QDialog" name="ColorClip_UI" >
- <property name="geometry" >
+ <widget class="QDialog" name="ColorClip_UI">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
- <width>286</width>
- <height>176</height>
+ <width>200</width>
+ <height>124</height>
</rect>
</property>
- <property name="windowTitle" >
+ <property name="windowTitle">
<string>Dialog</string>
</property>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="label_3" >
- <property name="text" >
+ <layout class="QGridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
<string>Name</string>
</property>
</widget>
</item>
- <item row="0" column="1" colspan="2" >
- <widget class="KLineEdit" name="clip_name" />
+ <item row="0" column="1">
+ <widget class="KLineEdit" name="clip_name"/>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label" >
- <property name="text" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
<string>Clip Color</string>
</property>
</widget>
</item>
- <item row="1" column="1" colspan="2" >
- <widget class="KColorButton" name="clip_color" >
- <property name="color" >
- <color>
- <red>0</red>
- <green>0</green>
- <blue>0</blue>
- </color>
- </property>
- </widget>
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="label_2" >
- <property name="text" >
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
<string>Duration</string>
</property>
</widget>
</item>
- <item row="2" column="1" colspan="2" >
- <widget class="KRestrictedLine" name="clip_duration" >
- <property name="inputMask" >
- <string>99:99:99:99; </string>
+ <item row="4" column="0" colspan="3">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
- <item row="3" column="2" >
+ <item row="2" column="1">
+ <layout class="QHBoxLayout" name="clip_durationBox"/>
+ </item>
+ <item row="1" column="1">
+ <widget class="KColorCombo" name="clip_color"/>
+ </item>
+ <item row="3" column="1">
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>31</height>
</property>
</spacer>
</item>
- <item row="4" column="0" colspan="3" >
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
</layout>
</widget>
<customwidgets>
- <customwidget>
- <class>KColorButton</class>
- <extends>QPushButton</extends>
- <header>kcolorbutton.h</header>
- </customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
</customwidget>
<customwidget>
- <class>KRestrictedLine</class>
- <extends>KLineEdit</extends>
- <header>krestrictedline.h</header>
+ <class>KColorCombo</class>
+ <extends>QComboBox</extends>
+ <header>kcolorcombo.h</header>
</customwidget>
</customwidgets>
<resources/>
<receiver>ColorClip_UI</receiver>
<slot>accept()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
<receiver>ColorClip_UI</receiver>
<slot>reject()</slot>
<hints>
- <hint type="sourcelabel" >
+ <hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
- <hint type="destinationlabel" >
+ <hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>