Commit 5f2b14fc authored by Sashmita Raghav's avatar Sashmita Raghav
Browse files

Add button in timeline toolbar to enable subtitle editing

parent a5ceebf6
......@@ -280,6 +280,8 @@
<Separator />
<Action name="timeline_preview_button" />
<Action name="audiomixer_button" />
<Separator />
<Action name="subtitle_tool" />
</ToolBar>
<ToolBar name="extraToolBar" >
<text>Extra Toolbar</text>
......
......@@ -24,6 +24,7 @@
#include "bin/projectclip.h"
#include "bin/projectfolder.h"
#include "bin/projectitemmodel.h"
#include "bin/model/subtitlemodel.hpp"
#include "core.h"
#include "dialogs/clipcreationdialog.h"
#include "dialogs/kdenlivesettingsdialog.h"
......@@ -1104,6 +1105,12 @@ void MainWindow::setupActions()
m_timeFormatButton->setToolButtonPopupMode(QToolButton::InstantPopup);
addAction(QStringLiteral("timeline_timecode"), m_timeFormatButton);
m_buttonSubtitleEditTool = new QAction(QIcon::fromTheme(QStringLiteral("input-keyboard")), i18n("Edit Subtitle tool"), this);
m_buttonSubtitleEditTool->setCheckable(true);
m_buttonSubtitleEditTool->setChecked(false);
addAction(QStringLiteral("subtitle_tool"), m_buttonSubtitleEditTool);
connect(m_buttonSubtitleEditTool, &QAction::triggered, this, &MainWindow::slotEditSubtitle);
// create tools buttons
m_buttonSelectTool = new QAction(QIcon::fromTheme(QStringLiteral("cursor-arrow")), i18n("Selection tool"), this);
// toolbar->addAction(m_buttonSelectTool);
......@@ -4114,6 +4121,13 @@ void MainWindow::slotActivateTarget()
getCurrentTimeline()->controller()->assignCurrentTarget(action->data().toInt());
}
void MainWindow::slotEditSubtitle()
{
std::shared_ptr<SubtitleModel> m_subtitleModel;
m_subtitleModel.reset(new SubtitleModel(getMainTimeline()->controller()->tractor(),this));
pCore->currentDoc()->initializeSubtitles(m_subtitleModel);
}
#ifdef DEBUG_MAINW
#undef DEBUG_MAINW
#endif
......@@ -225,6 +225,7 @@ private:
QAction *m_playZone;
QAction *m_loopClip;
QAction *m_proxyClip;
QAction *m_buttonSubtitleEditTool;
QString m_theme;
KIconLoader *m_iconLoader;
KToolBar *m_timelineToolBar;
......@@ -496,6 +497,7 @@ private slots:
void slotActivateVideoTrackSequence();
/** @brief Select target for current track */
void slotActivateTarget();
void slotEditSubtitle();
signals:
Q_SCRIPTABLE void abortRenderJob(const QString &url);
......
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