aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2016-05-22 19:58:35 +0200
committerJean-Baptiste Mardelle <[email protected]>2016-05-22 19:58:35 +0200
commit6bce5f3edb19bbf4d4a48d0b45e02051cd5979ff (patch)
tree86af44c9ef4489a964dcc6398e4f7165be734299
parent4b6a7525998049e109adfd65476354d9a1bbf78a (diff)
Turn timeline preview button in a movable qaction that can be put in any toolbar
-rw-r--r--src/kdenliveui.rc4
-rw-r--r--src/mainwindow.cpp23
2 files changed, 18 insertions, 9 deletions
diff --git a/src/kdenliveui.rc b/src/kdenliveui.rc
index 5df3f46f..5c6ee92 100644
--- a/src/kdenliveui.rc
+++ b/src/kdenliveui.rc
@@ -1,5 +1,5 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="kdenlive" version="138" translationDomain="kdenlive">
+<kpartgui name="kdenlive" version="139" translationDomain="kdenlive">
<MenuBar>
<Menu name="file" >
<Action name="dvd_wizard" />
@@ -235,6 +235,8 @@
<Action name="remove_lift" />
<Separator />
<Action name="favorite_effects" />
+ <Separator />
+ <Action name="timeline_preview_button" />
</ToolBar>
<ToolBar name="extraToolBar" >
<text>Extra Toolbar</text>
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5ab8ffa..329b3f5 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -524,9 +524,19 @@ MainWindow::MainWindow(const QString &MltPath, const QUrl &Url, const QString &
toolButtonAction->setText(i18n("Favorite Effects"));
toolButtonAction->setIcon(KoIconUtils::themedIcon("favorite"));
toolButtonAction->setDefaultWidget(basketButton);
-
addAction(QStringLiteral("favorite_effects"), toolButtonAction);
connect(toolButtonAction, SIGNAL(triggered(bool)), basketButton, SLOT(showMenu()));
+
+ // Timeline preview button
+ MyToolButton *timelinePreview = new MyToolButton(this);
+ QMenu *tlMenu = new QMenu(this);
+ timelinePreview->setMenu(tlMenu);
+ connect(this, &MainWindow::setPreviewProgress, timelinePreview, &MyToolButton::setProgress);
+ QWidgetAction* previewButtonAction = new QWidgetAction(this);
+ previewButtonAction->setText(i18n("Timeline Preview"));
+ previewButtonAction->setIcon(KoIconUtils::themedIcon(QStringLiteral("player-time")));
+ previewButtonAction->setDefaultWidget(timelinePreview);
+
setupGUI();
/*ScriptingPart* sp = new ScriptingPart(this, QStringList());
@@ -598,11 +608,6 @@ MainWindow::MainWindow(const QString &MltPath, const QUrl &Url, const QString &
m_timelineToolBar->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_timelineToolBar, &QWidget::customContextMenuRequested, this, &MainWindow::showTimelineToolbarMenu);
- MyToolButton *timelinePreview = new MyToolButton(this);
- QMenu *tlMenu = new QMenu(this);
- timelinePreview->setMenu(tlMenu);
- connect(this, &MainWindow::setPreviewProgress, timelinePreview, &MyToolButton::setProgress);
-
QAction *prevRender = actionCollection()->action(QStringLiteral("prerender_timeline_zone"));
tlMenu->addAction(actionCollection()->action(QStringLiteral("stop_prerender_timeline")));
tlMenu->addAction(actionCollection()->action(QStringLiteral("set_render_timeline_zone")));
@@ -615,10 +620,12 @@ MainWindow::MainWindow(const QString &MltPath, const QUrl &Url, const QString &
autoRender->setChecked(KdenliveSettings::autopreview());
connect(autoRender, &QAction::triggered, this, &MainWindow::slotToggleAutoPreview);
tlMenu->addAction(autoRender);
-
timelinePreview->setDefaultAction(prevRender);
timelinePreview->setAutoRaise(true);
- m_timelineToolBar->addWidget(timelinePreview);
+ //m_timelineToolBar->addWidget(timelinePreview);
+
+ addAction(QStringLiteral("timeline_preview_button"), previewButtonAction);
+
//m_timelineToolBar->addAction(toolButtonAction);
/*QWidget *sep = new QWidget(this);