gentime.cpp
renderer.cpp
kdenlivedoc.cpp
+ projectlistview.cpp
trackview.cpp
docclipbase.cpp
timecode.cpp
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui name="kdenlive" version="4">
- <ToolBar name="mainToolBar" >
- <text>Main Toolbar</text>
+<gui name="kdenlive" version="5">
+ <ToolBar name="extraToolBar" >
+ <text>Extra Toolbar</text>
<Action name="clear" />
</ToolBar>
KCmdLineArgs::addCmdLineOptions(options); //new
KApplication app;
-
+
MainWindow* window = new MainWindow();
window->show();
m_timelineArea->setHoverCloseButton(true);
m_timelineArea->setTabReorderingEnabled(true);
connect(m_timelineArea, SIGNAL(currentChanged (int)), this, SLOT(activateDocument()));
- setCentralWidget(m_timelineArea);
m_monitorManager = new MonitorManager();
projectListDock->raise();
tabifyDockWidget (clipMonitorDock, projectMonitorDock);
+ setCentralWidget(m_timelineArea);
+ setupGUI(Default, "kdenliveui.rc");
connect(projectMonitorDock, SIGNAL(visibilityChanged (bool)), m_projectMonitor, SLOT(refreshMonitor(bool)));
connect(clipMonitorDock, SIGNAL(visibilityChanged (bool)), m_clipMonitor, SLOT(refreshMonitor(bool)));
connect(m_monitorManager, SIGNAL(raiseClipMonitor (bool)), this, SLOT(slotRaiseMonitor(bool)));
m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
+ setAutoSaveSettings();
newFile();
}
-
void MainWindow::slotRaiseMonitor(bool clipMonitor)
{
if (clipMonitor) clipMonitorDock->raise();
/*m_redo = m_commandStack->createRedoAction(actionCollection());
m_undo = m_commandStack->createUndoAction(actionCollection());*/
-
- setupGUI();
-
-
}
void MainWindow::newFile()
{
m_element = xml.cloneNode().toElement();
setSizeHint(0, QSize(65, 45));
- setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
+ setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
if (!m_element.isNull()) {
m_element.setAttribute("id", clipId);
QString cType = m_element.attribute("type", QString::null);
{
m_element = xml.cloneNode().toElement();
setSizeHint(0, QSize(65, 45));
- setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
+ setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
if (!m_element.isNull()) {
m_element.setAttribute("id", clipId);
QString cType = m_element.attribute("type", QString::null);
: QTreeWidgetItem(parent, strings, QTreeWidgetItem::UserType), m_element(QDomElement()), m_clipType(DocClipBase::NONE), m_clipId(-1), m_isGroup(true)
{
setSizeHint(0, QSize(65, 45));
- setFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
+ setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled);
setIcon(0, KIcon("folder"));
}
{
QWidget *vbox = new QWidget;
- listView = new QTreeWidget(this);;
+ listView = new ProjectListView(this);;
QVBoxLayout *layout = new QVBoxLayout;
m_clipIdCounter = 0;
QAction *addColorClip = addMenu->addAction (KIcon("document-new"), i18n("Add Color Clip"));
connect(addColorClip, SIGNAL(triggered()), this, SLOT(slotAddColorClip()));
- QAction *deleteClip = m_toolbar->addAction (KIcon("edit-delete"), i18n("Delete Clip"));
- connect(deleteClip, SIGNAL(triggered()), this, SLOT(slotRemoveClip()));
+ m_deleteAction = m_toolbar->addAction (KIcon("edit-delete"), i18n("Delete Clip"));
+ connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(slotRemoveClip()));
- QAction *editClip = m_toolbar->addAction (KIcon("document-properties"), i18n("Edit Clip"));
- connect(editClip, SIGNAL(triggered()), this, SLOT(slotEditClip()));
+ m_editAction = m_toolbar->addAction (KIcon("document-properties"), i18n("Edit Clip"));
+ connect(m_editAction, SIGNAL(triggered()), this, SLOT(slotEditClip()));
addButton->setDefaultAction( addClipButton );
listView->setHeaderLabels(headers);
listView->sortByColumn(1, Qt::AscendingOrder);
+ m_menu = new QMenu();
+ m_menu->addAction(addClipButton);
+ m_menu->addAction(addColorClip);
+ m_menu->addAction(m_editAction);
+ m_menu->addAction(m_deleteAction);
+ m_menu->insertSeparator(m_deleteAction);
+
connect(listView, SIGNAL(itemSelectionChanged()), this, SLOT(slotClipSelected()));
- //connect(listView, SIGNAL(itemDoubleClicked ( QTreeWidgetItem *, int )), this, SLOT(slotEditClip(QTreeWidgetItem *, int)));
+ connect(listView, SIGNAL(requestMenu ( const QPoint &, QTreeWidgetItem * )), this, SLOT(slotContextMenu(const QPoint &, QTreeWidgetItem *)));
listView->setItemDelegate(new ItemDelegate(listView));
}
+ProjectList::~ProjectList()
+{
+ delete m_menu;
+ delete m_toolbar;
+}
+
void ProjectList::setRenderer(Render *projectRender)
{
m_render = projectRender;
void ProjectList::slotEditClip()
{
+ kDebug()<<"//////////////////////////////////////// DBL CLK";
+}
+
+
+void ProjectList::slotEditClip(QTreeWidgetItem *item, int column)
+{
+ kDebug()<<"//////////////////////////////////////// DBL CLK";
+}
+
+void ProjectList::slotContextMenu( const QPoint &pos, QTreeWidgetItem *item )
+{
+ bool enable = false;
+ if (item) {
+ enable = true;
+ }
+ m_editAction->setEnabled(enable);
+ m_deleteAction->setEnabled(enable);
+ m_menu->popup(pos);
}
void ProjectList::slotRemoveClip()
#include "kdenlivedoc.h"
#include "renderer.h"
#include "timecode.h"
+#include "projectlistview.h"
class ProjectItem;
public:
ProjectList(QWidget *parent=0);
+ virtual ~ProjectList();
QDomElement producersList();
void setRenderer(Render *projectRender);
private:
- QTreeWidget *listView;
+ ProjectListView *listView;
KTreeWidgetSearchLine *searchView;
Render *m_render;
Timecode m_timecode;
double m_fps;
QToolBar *m_toolbar;
+ QMenu *m_menu;
KUndoStack *m_commandStack;
int m_clipIdCounter;
void selectItemById(const int clipId);
ProjectItem *getItemById(int id);
+ QAction *m_editAction;
+ QAction *m_deleteAction;
private slots:
void slotAddClip();
void slotEditClip();
void slotClipSelected();
void slotAddColorClip();
+ void slotEditClip(QTreeWidgetItem *, int);
+ void slotContextMenu( const QPoint &pos, QTreeWidgetItem * );
+ //void slotShowMenu(const QPoint &pos);
+
+
signals:
void clipSelected(const QDomElement &);
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+#include "projectlistview.h"
+
+
+ProjectListView::ProjectListView(QWidget *parent)
+ : QTreeWidget(parent)
+{
+
+}
+
+ProjectListView::~ProjectListView()
+{
+}
+
+void ProjectListView::contextMenuEvent ( QContextMenuEvent * event )
+{
+ emit requestMenu(event->globalPos(), itemAt(event->pos()));
+}
+
+
+#include "projectlistview.moc"
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+
+#ifndef PRJECTLISTVIEW_H
+#define PRJECTLISTVIEW_H
+
+#include <QTreeWidget>
+#include <QContextMenuEvent>
+
+class ProjectListView : public QTreeWidget
+{
+ Q_OBJECT
+
+ public:
+ ProjectListView(QWidget *parent=0);
+ virtual ~ProjectListView();
+
+ protected:
+ virtual void contextMenuEvent ( QContextMenuEvent * event );
+
+ public slots:
+
+
+ private:
+
+
+ private slots:
+
+ signals:
+ void requestMenu(const QPoint &, QTreeWidgetItem *);
+};
+
+#endif