Commit 13ae5abe authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Export guides: remember last used format, add reset button to restore default settings

parent bfbbaec2
Pipeline #207362 passed with stage
in 11 minutes and 9 seconds
......@@ -8,6 +8,7 @@
#include "bin/model/markerlistmodel.hpp"
#include "core.h"
#include "kdenlivesettings.h"
#include "kdenlive_debug.h"
#include <KMessageWidget>
......@@ -34,7 +35,7 @@ ExportGuidesDialog::ExportGuidesDialog(const MarkerListModel *model, const GenTi
offsetTimeSpinbox->setTimecode(Timecode(Timecode::HH_MM_SS_FF, pCore->getCurrentFps()));
const QString defaultFormat(YT_FORMAT);
formatEdit->setText(defaultFormat);
formatEdit->setText(KdenliveSettings::exportGuidesFormat().isEmpty() ? defaultFormat : KdenliveSettings::exportGuidesFormat());
static std::array<QColor, 9> markerTypes = model->markerTypes;
QPixmap pixmap(32, 32);
......@@ -71,10 +72,18 @@ ExportGuidesDialog::ExportGuidesDialog(const MarkerListModel *model, const GenTi
clipboard->setText(this->generatedContent->toPlainText());
});
connect(buttonReset, &QAbstractButton::clicked, [this, defaultFormat]() {
formatEdit->setText(defaultFormat);
updateContentByModel();
});
adjustSize();
}
ExportGuidesDialog::~ExportGuidesDialog() {}
ExportGuidesDialog::~ExportGuidesDialog()
{
KdenliveSettings::setExportGuidesFormat(formatEdit->text());
}
GenTime ExportGuidesDialog::offsetTime() const
{
......
......@@ -231,6 +231,10 @@
<label>Default frame width for proxy clips.</label>
<default>640</default>
</entry>
<entry name="enforceLowerTrackCompositing" type="Bool">
<label>Should the lower video track also be composited.</label>
<default>false</default>
</entry>
<entry name="proxyextension" type="String">
<label>File extension for proxy clips.</label>
<default></default>
......@@ -617,6 +621,11 @@
<default>true</default>
</entry>
<entry name="exportGuidesFormat" type="String">
<label>Default format for guides export</label>
<default></default>
</entry>
</group>
......
......@@ -14,13 +14,20 @@
<string>Marker</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="1">
<widget class="QPlainTextEdit" name="generatedContent">
<property name="readOnly">
<item row="2" column="1">
<widget class="QLineEdit" name="formatEdit"/>
</item>
<item row="4" column="0" colspan="3">
<widget class="KMessageWidget" name="messageWidget">
<property name="closeButtonVisible">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>Formatted chapter marker text will be generated here.</string>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Offset:</string>
</property>
</widget>
</item>
......@@ -31,32 +38,36 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="markerTypeComboBox">
<property name="editable">
<bool>false</bool>
<item row="5" column="1" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="currentText">
<string>Any</string>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
<property name="currentIndex">
<number>0</number>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QPlainTextEdit" name="generatedContent">
<property name="readOnly">
<bool>true</bool>
</property>
<property name="placeholderText">
<string>Formatted chapter marker text will be generated here.</string>
</property>
<item>
<property name="text">
<string>Any</string>
</property>
<property name="icon">
<iconset theme="edit-select-all">
<normaloff>.</normaloff>.</iconset>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<item row="2" column="2">
<widget class="QToolButton" name="buttonReset">
<property name="toolTip">
<string>Reset</string>
</property>
<property name="text">
<string>Marker Type:</string>
<string>...</string>
</property>
<property name="icon">
<iconset theme="edit-reset"/>
</property>
</widget>
</item>
......@@ -67,34 +78,36 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="KMessageWidget" name="messageWidget" native="true">
<property name="closeButtonVisible" stdset="0">
<bool>false</bool>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Marker Type:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="formatEdit"/>
</item>
<item row="5" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="0" column="1" colspan="2">
<widget class="QComboBox" name="markerTypeComboBox">
<property name="editable">
<bool>false</bool>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
<property name="currentText">
<string>Any</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Offset:</string>
<property name="currentIndex">
<number>0</number>
</property>
<item>
<property name="text">
<string>Any</string>
</property>
<property name="icon">
<iconset theme="edit-select-all">
<normaloff>.</normaloff>.</iconset>
</property>
</item>
</widget>
</item>
<item row="1" column="1">
<item row="1" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="offsetTimeComboBox">
......@@ -129,7 +142,7 @@
<customwidgets>
<customwidget>
<class>KMessageWidget</class>
<extends>QWidget</extends>
<extends>QFrame</extends>
<header>kmessagewidget.h</header>
</customwidget>
<customwidget>
......
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