]> git.sesse.net Git - kdenlive/commitdiff
Add action to show / hide timeline
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 24 Mar 2009 09:57:52 +0000 (09:57 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 24 Mar 2009 09:57:52 +0000 (09:57 +0000)
svn path=/trunk/kdenlive/; revision=3179

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

index ea9294adc9e6de2cc21a3bf9436d97043865495d..3a57d142ef40415747962c3c94ad4371b63e64f9 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui name="kdenlive" version="39">
+<gui name="kdenlive" version="40">
   <ToolBar name="extraToolBar" >
     <text>Extra Toolbar</text>
        <Action name="project_render" />
       <Action name="mark_out" />
     </Menu>
     <Menu name="dockwindows" ><text>View</text>
+      <Action name="maximize_current" />
+      <Action name="show_timeline" />
     </Menu>
     <Menu name="settings" >
       <Action name="manage_profiles" />
index d5a9ab50a1508e6962fb85a0c5323bc970d7c11c..dfd61d78db8b18db4a3a1f4c4fa88bb176185263 100644 (file)
@@ -987,6 +987,19 @@ void MainWindow::setupActions() {
     pasteEffects->setData("paste_effects");
     connect(pasteEffects , SIGNAL(triggered()), this, SLOT(slotPasteEffects()));
 
+    QAction *showTimeline = new KAction(i18n("Show Timeline"), this);
+    collection->addAction("show_timeline", showTimeline);
+    showTimeline->setCheckable(true);
+    showTimeline->setChecked(true);
+    connect(showTimeline, SIGNAL(triggered(bool)), this, SLOT(slotShowTimeline(bool)));
+
+    /*QAction *maxCurrent = new KAction(i18n("Maximize Current Widget"), this);
+    collection->addAction("maximize_current", maxCurrent);
+    maxCurrent->setCheckable(true);
+    maxCurrent->setChecked(false);
+    connect(maxCurrent, SIGNAL(triggered(bool)), this, SLOT(slotMaximizeCurrent(bool)));*/
+
+
     m_closeAction = KStandardAction::close(this, SLOT(closeCurrentDocument()), collection);
 
     KStandardAction::quit(this, SLOT(queryQuit()), collection);
@@ -2415,5 +2428,31 @@ void MainWindow::slotDvdWizard(const QString &url, const QString &profile) {
     w->exec();
 }
 
+void MainWindow::slotShowTimeline(bool show) {
+    if (show == false) {
+        m_timelineState = saveState();
+        centralWidget()->setHidden(true);
+    } else {
+        centralWidget()->setHidden(false);
+        restoreState(m_timelineState);
+    }
+}
+
+void MainWindow::slotMaximizeCurrent(bool show) {
+    //TODO: is there a way to maximize current widget?
+    //if (show == true)
+    {
+        m_timelineState = saveState();
+        QWidget *par = focusWidget()->parentWidget();
+        while (par->parentWidget() && par->parentWidget() != this) {
+            par = par->parentWidget();
+        }
+        kDebug() << "CURRENT WIDGET: " << par->objectName();
+    }
+    /*else {
+    //centralWidget()->setHidden(false);
+    //restoreState(m_timelineState);
+    }*/
+}
 
 #include "mainwindow.moc"
index 2f3a865d7e57106b39efc4317bcd339160168c32..a24780e5d60b811525a2ee8cdcc911ff50847bc8 100644 (file)
@@ -193,6 +193,7 @@ private:
                    QActionGroup *actionGroup);
     void aboutPlugins();
     QStringList m_pluginFileNames;
+    QByteArray m_timelineState;
 
 public slots:
     void openFile(const KUrl &url);
@@ -297,6 +298,8 @@ private slots:
     void slotSplitAudio();
     void slotVideoOnly();
     void slotAudioOnly();
+    void slotShowTimeline(bool show);
+    void slotMaximizeCurrent(bool show);
 
 signals:
     Q_SCRIPTABLE void abortRenderJob(const QString &url);