monitoreditwidget.cpp
simplekeyframes/simpletimelinewidget.cpp
simplekeyframes/simplekeyframewidget.cpp
+ noteswidget.cpp
)
add_definitions(${KDE4_DEFINITIONS})
addedXml.appendChild(docproperties);
QDomElement docnotes = sceneList.createElement("documentnotes");
- QDomText value = sceneList.createTextNode(m_notesWidget->toPlainText());
+ QDomText value = sceneList.createTextNode(m_notesWidget->toHtml());
docnotes.appendChild(value);
addedXml.appendChild(docnotes);
m_notesDock = new QDockWidget(i18n("Project Notes"), this);
m_notesDock->setObjectName("notes_widget");
- m_notesWidget = new KTextEdit();
+ m_notesWidget = new NotesWidget();
+ connect(m_notesWidget, SIGNAL(insertNotesTimecode()), this, SLOT(slotInsertNotesTimecode()));
+ connect(m_notesWidget, SIGNAL(seekProject(int)), m_projectMonitor->render, SLOT(seekToFrame(int)));
+
m_notesWidget->setTabChangesFocus(true);
#if KDE_IS_VERSION(4,4,0)
m_notesWidget->setClickMessage(i18n("Enter your project notes here ..."));
m_projectList->updateProxyConfig();
}
+void MainWindow::slotInsertNotesTimecode()
+{
+ int frames = m_projectMonitor->render->seekPosition().frames(m_activeDocument->fps());
+ QString position = m_activeDocument->timecode().getTimecodeFromFrames(frames);
+ m_notesWidget->insertHtml("<a href=\"" + QString::number(frames) + "\">" + position + "</a> ");
+}
+
#include "mainwindow.moc"
#ifdef DEBUG_MAINW
#include "statusbarmessagelabel.h"
#include "dvdwizard.h"
#include "stopmotion/stopmotion.h"
+#include "noteswidget.h"
class KdenliveDoc;
class TrackView;
//KListWidget *m_effectList;
QDockWidget *m_notesDock;
- KTextEdit *m_notesWidget;
+ NotesWidget *m_notesWidget;
QDockWidget *m_effectStackDock;
EffectStackView *m_effectStack;
void slotDoAction(const QString& action_name);
/** @brief Update project because the use of proxy clips was enabled / disabled. */
void slotUpdateProxySettings();
-
+ /** @brief Insert current project's timecode into the notes widget. */
+ void slotInsertNotesTimecode();
signals:
Q_SCRIPTABLE void abortRenderJob(const QString &url);
};
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2008 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 "noteswidget.h"
+
+#include <KLocale>
+#include <KDebug>
+#include <QMenu>
+#include <QMouseEvent>
+
+
+NotesWidget::NotesWidget(QWidget * parent) :
+ KTextEdit(parent)
+{
+ connect(this, SIGNAL(aboutToShowContextMenu(QMenu *)), this, SLOT(slotFillNotesMenu(QMenu *)));
+ setMouseTracking(true);
+}
+
+void NotesWidget::slotFillNotesMenu(QMenu *menu)
+{
+ QAction *a = new QAction(i18n("Insert current timecode"), this);
+ connect(a, SIGNAL(triggered(bool)), this, SIGNAL(insertNotesTimecode()));
+ menu->insertAction(menu->actions().at(0), a);
+}
+
+void NotesWidget::mouseMoveEvent( QMouseEvent * e )
+{
+ QString anchor = anchorAt(e->pos());
+ if (anchor.isEmpty()) viewport()->setCursor(Qt::IBeamCursor);
+ else viewport()->setCursor(Qt::PointingHandCursor);
+}
+
+void NotesWidget::mousePressEvent( QMouseEvent * e )
+{
+ QString anchor = anchorAt(e->pos());
+ if (anchor.isEmpty()) {
+ KTextEdit::mousePressEvent(e);
+ return;
+ }
+ kDebug()<<"+++++++++\nCLICKED NACHOR: "<<anchor;
+ emit seekProject(anchor.toInt());
+ e->setAccepted(true);
+}
+
+NotesWidget::~NotesWidget()
+{
+}
+
+
+
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2011 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 NOTESWIDGET_H
+#define NOTESWIDGET_H
+
+#include <KTextEdit>
+
+/**
+ * @class NotesWidget
+ * @brief A small text editor to create project notes.
+ * @author Jean-Baptiste Mardelle
+ */
+
+class NotesWidget : public KTextEdit
+{
+ Q_OBJECT
+
+public:
+ NotesWidget(QWidget * parent = 0);
+ ~NotesWidget();
+
+protected:
+ virtual void mouseMoveEvent ( QMouseEvent * e );
+ virtual void mousePressEvent ( QMouseEvent * e );
+
+private slots:
+ void slotFillNotesMenu(QMenu *menu);
+
+private:
+
+signals:
+ void insertNotesTimecode();
+ void seekProject(int);
+};
+
+
+#endif
+
/** @brief Seeks the renderer clip to the given time. */
void seek(GenTime time);
void seek(int time);
- void seekToFrame(int pos);
void seekToFrameDiff(int diff);
int m_isBlocked;
void slotSplitView(bool doit);
void slotSwitchFullscreen();
void slotSetVolume(int volume);
+ void seekToFrame(int pos);
};
#endif