#include <QIcon>
#include <QMenu>
#include <QProcess>
+#include <QScrollBar>
#include <QHeaderView>
#include <QInputDialog>
#include <QtConcurrentRun>
/*QString style = "QToolButton {background-color: %1;border-style: outset;border-width: 2px;
border-radius: 5px;border-color: beige;}";*/
- KColorScheme scheme(palette().currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
+ m_timeLine = new QTimeLine(500, this);
+ QObject::connect(m_timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(slotTimeLineChanged(qreal)));
+ QObject::connect(m_timeLine, SIGNAL(finished()), this, SLOT(slotTimeLineFinished()));
+ hide();
+}
+
+const QString SmallInfoLabel::getStyleSheet(const QPalette &p)
+{
+ KColorScheme scheme(p.currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
QColor bg = scheme.background(KColorScheme::LinkBackground).color();
QColor fg = scheme.foreground(KColorScheme::LinkText).color();
QString style = QString("QPushButton {padding:2px;background-color: rgb(%1, %2, %3);border-radius: 4px;border: none;color: rgb(%4, %5, %6)}").arg(bg.red()).arg(bg.green()).arg(bg.blue()).arg(fg.red()).arg(fg.green()).arg(fg.blue());
fg = scheme.foreground(KColorScheme::ActiveText).color();
style.append(QString("\nQPushButton:hover {padding:2px;background-color: rgb(%1, %2, %3);border-radius: 4px;border: none;color: rgb(%4, %5, %6)}").arg(bg.red()).arg(bg.green()).arg(bg.blue()).arg(fg.red()).arg(fg.green()).arg(fg.blue()));
- setStyleSheet(style);
- m_timeLine = new QTimeLine(500, this);
- QObject::connect(m_timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(slotTimeLineChanged(qreal)));
- QObject::connect(m_timeLine, SIGNAL(finished()), this, SLOT(slotTimeLineFinished()));
- hide();
+ return style;
}
void SmallInfoLabel::slotTimeLineChanged(qreal value)
// small info button for pending jobs
m_infoLabel = new SmallInfoLabel(this);
+ m_infoLabel->setStyleSheet(SmallInfoLabel::getStyleSheet(palette()));
connect(this, SIGNAL(jobCount(int)), m_infoLabel, SLOT(slotSetJobCount(int)));
m_jobsMenu = new QMenu(this);
connect(m_jobsMenu, SIGNAL(aboutToShow()), this, SLOT(slotPrepareJobsMenu()));
frame->setLayout(box);
layout->addWidget(frame);
- m_listView = new ProjectListView;
+ m_listView = new ProjectListView(this);
layout->addWidget(m_listView);
#if KDE_IS_VERSION(4,7,0)
item->referencedClip()->setPlaceHolder(true);
item->setProperty("file_hash", QString());
} else if (t == IMAGE) {
- clip->getProducer()->set("force_reload", 1);
+ //clip->getProducer() clip->getProducer()->set("force_reload", 1);
}
QDomElement e = item->toXml();
emit projectModified();
EditClipCommand *command = new EditClipCommand(this, clip->clipId(), oldprops, newprops, false);
m_commandStack->push(command);
+ QTimer::singleShot(100, this, SLOT(slotCheckScrolling()));
}
}
}
}
+void ProjectList::slotCheckScrolling()
+{
+ m_listView->scrollToItem(m_listView->currentItem());
+}
+
void ProjectList::slotContextMenu(const QPoint &pos, QTreeWidgetItem *item)
{
bool enable = item ? true : false;
l->addWidget(c);
l->addStretch(5);
f->setLayout(l);
- KFileDialog *d = new KFileDialog(KUrl("kfiledialog:///clipfolder"), dialogFilter, kapp->activeWindow(), f);
+ QPointer<KFileDialog> d = new KFileDialog(KUrl("kfiledialog:///clipfolder"), dialogFilter, kapp->activeWindow(), f);
d->setOperationMode(KFileDialog::Opening);
d->setMode(KFile::Files);
if (d->exec() == QDialog::Accepted) {
if (!m_commandStack)
kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
- QDialog *dia = new QDialog(this);
+ QPointer<QDialog> dia = new QDialog(this);
Ui::ColorClip_UI dia_ui;
dia_ui.setupUi(dia);
dia->setWindowTitle(i18n("Color Clip"));
QMap <QString, QString> properties;
properties.insert("name", dia->clipName());
- int begin = dia->begin();
- if (begin > 0)
- properties.insert("resource", dia->selectedPath() + "?" + QString::number(begin));
- else
- properties.insert("resource", dia->selectedPath());
+ properties.insert("resource", dia->selectedPath());
properties.insert("in", "0");
properties.insert("out", QString::number(m_doc->getFramePos(dia->clipDuration()) * dia->imageCount()));
properties.insert("ttl", QString::number(m_doc->getFramePos(dia->clipDuration())));
properties.insert("luma_file", dia->lumaFile());
properties.insert("softness", QString::number(dia->softness()));
properties.insert("animation", dia->animation());
- properties.insert("begin", QString::number(dia->begin()));
m_doc->slotCreateSlideshowClipFile(properties, groupInfo.at(0), groupInfo.at(1));
}
const QString path = m_doc->projectFolder().path(KUrl::AddTrailingSlash) + "titles/";
QStringList templateFiles = QDir(path).entryList(filter, QDir::Files);
- QDialog *dia = new QDialog(this);
+ QPointer<QDialog> dia = new QDialog(this);
Ui::TemplateClip_UI dia_ui;
dia_ui.setupUi(dia);
for (int i = 0; i < templateFiles.size(); ++i)
QString timeIn = Timecode::getStringTimecode(in, clipFps, true);
QString timeOut = Timecode::getStringTimecode(duration, clipFps, true);
- QDialog *d = new QDialog(this);
+ QPointer<QDialog> d = new QDialog(this);
Ui::CutJobDialog_UI ui;
ui.setupUi(d);
ui.extra_params->setVisible(false);
else {
destination = item->clipUrl().directory();
}
- ClipStabilize *d = new ClipStabilize(destination, ids.count(), filterName);
+ QPointer<ClipStabilize> d = new ClipStabilize(destination, ids.count(), filterName);
if (d->exec() == QDialog::Accepted) {
processClipJob(ids, d->destination(), d->autoAddClip(), d->params(), d->desc());
}
discardJobs(id);
}
+void ProjectList::updatePalette()
+{
+ m_infoLabel->setStyleSheet(SmallInfoLabel::getStyleSheet(QApplication::palette()));
+ m_listView->updateStyleSheet();
+}
+
#include "projectlist.moc"