Commit 7333e5d3 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Ensure subtitle track is always shown when adding a subtitle.

Fixes #1026
parent e4796e36
......@@ -141,11 +141,7 @@ void Core::initGUI(bool isAppImage, const QString &MltPath, const QUrl &Url, con
connect(m_mixerWidget, &MixerManager::updateRecVolume, m_capture.get(), &MediaCapture::setAudioVolume);
m_monitorManager = new MonitorManager(this);
connect(m_monitorManager, &MonitorManager::cleanMixer, m_mixerWidget, &MixerManager::clearMixers);
connect(m_subtitleWidget, &SubtitleEdit::addSubtitle, this, [this](const QString &text) {
if (m_guiConstructed && m_mainWindow->getCurrentTimeline()->controller()) {
m_mainWindow->getCurrentTimeline()->controller()->addSubtitle(-1, text);
}
});
connect(m_subtitleWidget, &SubtitleEdit::addSubtitle, m_mainWindow, &MainWindow::slotAddSubtitle);
connect(m_subtitleWidget, &SubtitleEdit::cutSubtitle, this, [this](int id, int cursorPos) {
if (m_guiConstructed && m_mainWindow->getCurrentTimeline()->controller()) {
m_mainWindow->getCurrentTimeline()->controller()->cutSubtitle(id, cursorPos);
......
......@@ -4348,13 +4348,13 @@ void MainWindow::slotEditSubtitle(QMap<QString, QString> subProperties)
}
}
void MainWindow::slotAddSubtitle()
void MainWindow::slotAddSubtitle(const QString &text)
{
if (pCore->getSubtitleModel() == nullptr || !KdenliveSettings::showSubtitles()) {
m_buttonSubtitleEditTool->setChecked(true);
slotEditSubtitle();
}
getCurrentTimeline()->controller()->addSubtitle();
getCurrentTimeline()->controller()->addSubtitle(-1, text);
}
void MainWindow::slotDisableSubtitle()
......
......@@ -314,6 +314,8 @@ public slots:
void slotDownloadResources();
void slotEditSubtitle(QMap<QString, QString> subProperties = {});
void slotTranscode(const QStringList &urls = QStringList());
/** @brief Add subtitle clip to timeline */
void slotAddSubtitle(const QString &text = QString());
private slots:
/** @brief Shows the shortcut dialog. */
......@@ -527,8 +529,6 @@ private slots:
void slotActivateVideoTrackSequence();
/** @brief Select target for current track */
void slotActivateTarget();
/** @brief Add subtitle clip to timeline */
void slotAddSubtitle();
/** @brief Enable/disable subtitle track */
void slotDisableSubtitle();
/** @brief Lock / unlock subtitle track */
......
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