Commit 593b864a authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Export guides: add info button listing possible keywords

parent fab80c85
Pipeline #207629 passed with stage
in 6 minutes and 46 seconds
......@@ -12,6 +12,7 @@
#include "kdenlive_debug.h"
#include <KMessageWidget>
#include <QAction>
#include <QClipboard>
#include <QDateTimeEdit>
#include <QFontDatabase>
......@@ -77,6 +78,27 @@ ExportGuidesDialog::ExportGuidesDialog(const MarkerListModel *model, const GenTi
updateContentByModel();
});
// fill info button menu
QMap<QString, QString> infoMenu;
infoMenu.insert(QStringLiteral("{{index}}"), i18n("Guide number"));
infoMenu.insert(QStringLiteral("{{realtimecode}}"), i18n("Guide position in HH:MM:SS:FF"));
infoMenu.insert(QStringLiteral("{{timecode}}"), i18n("Guide position in (HH:)MM.SS"));
infoMenu.insert(QStringLiteral("{{nexttimecode}}"), i18n("Next guide position in (HH:)MM.SS"));
infoMenu.insert(QStringLiteral("{{frame}}"), i18n("Guide position in frames"));
infoMenu.insert(QStringLiteral("{{comment}}"), i18n("Guide comment"));
QMapIterator<QString, QString> i(infoMenu);
QAction *a;
while (i.hasNext()) {
i.next();
a = new QAction(this);
a->setText(QString("%1 - %2").arg(i.value(), i.key()));
a->setData(i.key());
infoButton->addAction(a);
}
connect(infoButton, &QToolButton::triggered, [this](QAction *a) {
formatEdit->insert(a->data().toString());
updateContentByModel();
});
adjustSize();
}
......
......@@ -14,31 +14,98 @@
<string>Marker</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="1">
<item row="6" column="3">
<widget class="QToolButton" name="buttonReset">
<property name="toolTip">
<string>Reset</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="edit-reset">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
<item row="4" column="0" colspan="4">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Offset:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="offsetTimeComboBox">
<item>
<property name="text">
<string>Disabled</string>
</property>
</item>
<item>
<property name="text">
<string>Add</string>
</property>
</item>
<item>
<property name="text">
<string>Subtract</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="TimecodeDisplay" name="offsetTimeSpinbox" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLineEdit" name="formatEdit"/>
</item>
<item row="4" column="0" colspan="3">
<item row="9" column="0" colspan="4">
<widget class="KMessageWidget" name="messageWidget">
<property name="closeButtonVisible">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<item row="7" column="0" colspan="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Offset:</string>
<string>Exported:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_2">
<item row="6" column="2">
<widget class="QToolButton" name="infoButton">
<property name="text">
<string>Exported:</string>
<string>...</string>
</property>
<property name="icon">
<iconset theme="help-about">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="arrowType">
<enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2">
<item row="10" column="1" colspan="3">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
......@@ -48,7 +115,7 @@
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<item row="8" column="0" colspan="4">
<widget class="QPlainTextEdit" name="generatedContent">
<property name="readOnly">
<bool>true</bool>
......@@ -58,35 +125,34 @@
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="buttonReset">
<property name="toolTip">
<string>Reset</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset theme="edit-reset"/>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>Format:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Marker Type:</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<item row="2" column="1" colspan="3">
<widget class="QComboBox" name="markerTypeComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editable">
<bool>false</bool>
</property>
......@@ -107,36 +173,6 @@
</item>
</widget>
</item>
<item row="1" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="offsetTimeComboBox">
<item>
<property name="text">
<string>Disabled</string>
</property>
</item>
<item>
<property name="text">
<string>Add</string>
</property>
</item>
<item>
<property name="text">
<string>Subtract</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="TimecodeDisplay" name="offsetTimeSpinbox" native="true">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
......
Supports Markdown
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