Commit d22080ee authored by Julius Künzel's avatar Julius Künzel
Browse files

Add display names for mlt's dynamical generated luma files

This also improves prettifys the display name for normal (not dynamicaly
generated) luma files and makes it translatable
parent 16dd7b41
Pipeline #77630 passed with stage
in 8 minutes and 39 seconds
......@@ -113,7 +113,8 @@ void ListParamWidget::slotRefresh()
m_list->addItem(i18n("None (Dissolve)"));
for (int j = 0; j < values.count(); ++j) {
const QString &entry = values.at(j);
m_list->addItem(values.at(j).section(QLatin1Char('/'), -1), entry);
const QString name = values.at(j).section(QLatin1Char('/'), -1);
m_list->addItem(pCore->nameForLumaFile(name), entry);
if (!entry.isEmpty() && (entry.endsWith(QLatin1String(".png")) || entry.endsWith(QLatin1String(".pgm")))) {
if (MainWindow::m_lumacache.contains(entry)) {
m_list->setItemIcon(j + 1, QPixmap::fromImage(MainWindow::m_lumacache.value(entry)));
......
......@@ -160,7 +160,7 @@ void UrlListParamWidget::slotRefresh()
// build ui list
for (const QString &value : qAsConst(values)) {
names.append(QUrl(value).fileName());
names.append(pCore->nameForLumaFile(QUrl(value).fileName()));
}
for (int i = 0; i < values.count(); i++) {
const QString &entry = values.at(i);
......
......@@ -242,6 +242,53 @@ void Core::buildLumaThumbs(const QStringList &values)
}
}
const QString Core::nameForLumaFile(const QString filename) {
static QMap<QString, QString> names;
names.insert("square2-bars.pgm", i18nc("Luma transition name", "Square 2 Bars"));
names.insert("checkerboard_small.pgm", i18nc("Luma transition name", "Checkerboard Small"));
names.insert("horizontal_blinds.pgm", i18nc("Luma transition name", "Horizontal Blinds"));
names.insert("radial.pgm", i18nc("Luma transition name", "Radial"));
names.insert("linear_x.pgm", i18nc("Luma transition name", "Linear X"));
names.insert("bi-linear_x.pgm", i18nc("Luma transition name", "Bi-Linear X"));
names.insert("linear_y.pgm", i18nc("Luma transition name", "Linear Y"));
names.insert("bi-linear_y.pgm", i18nc("Luma transition name", "Bi-Linear Y"));
names.insert("square.pgm", i18nc("Luma transition name", "Square"));
names.insert("square2.pgm", i18nc("Luma transition name", "Square 2"));
names.insert("cloud.pgm", i18nc("Luma transition name", "Cloud"));
names.insert("symmetric_clock.pgm", i18nc("Luma transition name", "Symmetric Clock"));
names.insert("radial-bars.pgm", i18nc("Luma transition name", "Radial Bars"));
names.insert("spiral.pgm", i18nc("Luma transition name", "Spiral"));
names.insert("spiral2.pgm", i18nc("Luma transition name", "Spiral 2"));
names.insert("curtain.pgm", i18nc("Luma transition name", "Curtain"));
names.insert("burst.pgm", i18nc("Luma transition name", "Burst"));
names.insert("clock.pgm", i18nc("Luma transition name", "Clock"));
names.insert("luma01.pgm", i18nc("Luma transition name", "Bar Horizontal"));
names.insert("luma02.pgm", i18nc("Luma transition name", "Bar Vertical"));
names.insert("luma03.pgm", i18nc("Luma transition name", "Barn Door Horizontal"));
names.insert("luma04.pgm", i18nc("Luma transition name", "Barn Door Vertical"));
names.insert("luma05.pgm", i18nc("Luma transition name", "Barn Door Diagonal SW-NE"));
names.insert("luma06.pgm", i18nc("Luma transition name", "Barn Door Diagonal NW-SE"));
names.insert("luma07.pgm", i18nc("Luma transition name", "Diagonal Top Left"));
names.insert("luma08.pgm", i18nc("Luma transition name", "Diagonal Top Right"));
names.insert("luma09.pgm", i18nc("Luma transition name", "Matrix Waterfall Horizontal"));
names.insert("luma10.pgm", i18nc("Luma transition name", "Matrix Waterfall Vertical"));
names.insert("luma11.pgm", i18nc("Luma transition name", "Matrix Snake Horizontal"));
names.insert("luma12.pgm", i18nc("Luma transition name", "Matrix Snake Parallel Horizontal"));
names.insert("luma13.pgm", i18nc("Luma transition name", "Matrix Snake Vertical"));
names.insert("luma14.pgm", i18nc("Luma transition name", "Matrix Snake Parallel Vertical"));
names.insert("luma15.pgm", i18nc("Luma transition name", "Barn V Up"));
names.insert("luma16.pgm", i18nc("Luma transition name", "Iris Circle"));
names.insert("luma17.pgm", i18nc("Luma transition name", "Double Iris"));
names.insert("luma18.pgm", i18nc("Luma transition name", "Iris Box"));
names.insert("luma19.pgm", i18nc("Luma transition name", "Box Bottom Right"));
names.insert("luma20.pgm", i18nc("Luma transition name", "Box Bottom Left"));
names.insert("luma21.pgm", i18nc("Luma transition name", "Box Right Center"));
names.insert("luma22.pgm", i18nc("Luma transition name", "Clock Top"));
return names.contains(filename) ? names.constFind(filename).value() : filename;
}
std::unique_ptr<Core> &Core::self()
{
if (!m_self) {
......
......@@ -314,6 +314,12 @@ public slots:
void displayBinLogMessage(const QString &text, int type, const QString &logInfo);
/** @brief Create small thumbnails for luma used in compositions */
void buildLumaThumbs(const QStringList &values);
/** @brief Try to find a display name for the given filename.
* This is espacally helpfull for mlt's dynamically created luma files without thumb (luma01.pgm, luma02.pgm,...),
* but also for others as the visible name translatable.
* @return The name that fits to the filename or if none is found the filename it self
*/
const QString nameForLumaFile(const QString filename);
/** @brief Set current project modified. */
void setDocumentModified();
/** @brief Show currently selected effect zone in timeline ruler. */
......
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