]> git.sesse.net Git - kdenlive/commitdiff
space bar to play timeline
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 3 Mar 2008 22:11:04 +0000 (22:11 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 3 Mar 2008 22:11:04 +0000 (22:11 +0000)
svn path=/branches/KDE4/; revision=1993

src/kdenliveui.rc
src/mainwindow.cpp
src/monitor.h
src/monitormanager.cpp
src/monitormanager.h

index 6e16288d34afc722f9dddf967b7ec191442c4c88..60ea6ab142623b0f17b539ea2ce0511517a1052e 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui name="kdenlive" version="8">
+<gui name="kdenlive" version="9">
   <ToolBar name="extraToolBar" >
     <text>Extra Toolbar</text>
     <Action name="clear" />
       <Action name="project_settings" />
     </Menu>
 
+    <Menu name="monitor" ><text>Monitor</text>
+      <Action name="monitor_play" />
+    </Menu>
+
     <Menu name="settings" >
       <Action name="manage_profiles" />
     </Menu>
index d3b235d5ba3f8eebc34816393460e5008a731937..29a4fcb299f4cf30f5ad9630e3db1193a2aa2712 100644 (file)
@@ -233,7 +233,12 @@ void MainWindow::setupActions() {
     actionCollection()->addAction("project_settings", projectAction);
     connect(projectAction, SIGNAL(triggered(bool)), this, SLOT(slotEditProjectSettings()));
 
-
+    KAction* monitorPlay = new KAction(this);
+    monitorPlay->setText(i18n("Play"));
+    monitorPlay->setIcon(KIcon("media-playback-start"));
+    monitorPlay->setShortcut(Qt::Key_Space);
+    actionCollection()->addAction("monitor_play", monitorPlay);
+    connect(monitorPlay, SIGNAL(triggered(bool)), m_monitorManager, SLOT(slotPlay()));
 
     KStandardAction::quit(kapp, SLOT(quit()),
                           actionCollection());
@@ -480,7 +485,7 @@ void MainWindow::slotPreferences() {
     // KConfigDialog didn't find an instance of this dialog, so lets
     // create it :
     KdenliveSettingsDialog* dialog = new KdenliveSettingsDialog(this);
-    connect(dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(updateConfiguration()));
+    connect( dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(updateConfiguration()) );
     dialog->show();
 }
 
index ec1e98b8d2a34d19bab62837195b92e9d4e1ebc3..4e4f4c100b047a9244119d9df33fb98cc0d8ef99 100644 (file)
@@ -54,7 +54,6 @@ private:
     bool m_isActive;
 
 private slots:
-    void slotPlay();
     void adjustRulerSize(int length);
     void seekCursor(int pos);
     void rendererStopped(int pos);
@@ -72,6 +71,7 @@ public slots:
     void stop();
     void start();
     void activateMonitor();
+    void slotPlay();
 
 signals:
     void renderPosition(int);
index e42d7eb74e08c91d228cb101622596c70e35570b..0d6ff685e0f8159cace4296e5d691cd93532781e 100644 (file)
@@ -75,4 +75,9 @@ void MonitorManager::activateMonitor(QString name) {
     m_activeMonitor = name;
 }
 
+void MonitorManager::slotPlay() {
+    if (m_activeMonitor == "clip") m_clipMonitor->slotPlay();
+    else m_projectMonitor->slotPlay();
+}
+
 #include "monitormanager.moc"
index 129a49f0b944489d6b2da3cede995d8e371df8ef..7de762067d6defff04e93f600f02183d843de707 100644 (file)
@@ -37,6 +37,7 @@ public:
 
 public slots:
     void activateMonitor(QString name = QString::null);
+    void slotPlay();
 
 private:
     Monitor *m_clipMonitor;