tabifyDockWidget(m_clipMonitorDock, m_recMonitorDock);
#endif
setCentralWidget(m_timelineArea);
-
-
setupGUI();
+ // Find QDockWidget tab bars and show / hide widget title bars on right click
+ QList <QTabBar *> tabs = findChildren<QTabBar *>();
+ for (int i = 0; i < tabs.count(); i++) {
+ tabs.at(i)->setContextMenuPolicy(Qt::CustomContextMenu);
+ connect(tabs.at(i), SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(slotSwitchTitles()));
+ }
+
/*ScriptingPart* sp = new ScriptingPart(this, QStringList());
guiFactory()->addClient(sp);*/
m_timelineContextMenu->addAction(actionCollection()->action("delete_space"));
m_timelineContextMenu->addAction(actionCollection()->action(KStandardAction::name(KStandardAction::Paste)));
+ m_timelineContextClipMenu->addAction(actionCollection()->action("edit_clip_duration"));
m_timelineContextClipMenu->addAction(actionCollection()->action("delete_timeline_clip"));
m_timelineContextClipMenu->addAction(actionCollection()->action("group_clip"));
m_timelineContextClipMenu->addAction(actionCollection()->action("ungroup_clip"));
//TODO: re-enable custom effects menu when it is implemented
m_timelineContextClipMenu->addMenu(m_customEffectsMenu);
+ m_timelineContextTransitionMenu->addAction(actionCollection()->action("edit_clip_duration"));
m_timelineContextTransitionMenu->addAction(actionCollection()->action("delete_timeline_clip"));
m_timelineContextTransitionMenu->addAction(actionCollection()->action(KStandardAction::name(KStandardAction::Copy)));
m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
slotConnectMonitors();
+ // Disable drop B frames, see Kdenlive issue #1330, see also kdenlivesettingsdialog.cpp
+ KdenliveSettings::setDropbframes(false);
+
// Open or create a file. Command line argument passed in Url has
// precedence, then "openlastproject", then just a plain empty file.
// If opening Url fails, openlastproject will _not_ be used.
m_projectList->setRenderer(m_projectMonitor->render);
//connect(m_projectList, SIGNAL(receivedClipDuration(const QString &)), this, SLOT(slotUpdateClip(const QString &)));
+ connect(m_projectList, SIGNAL(deleteProjectClips(QStringList, QMap<QString, QString>)), this, SLOT(slotDeleteProjectClips(QStringList, QMap<QString, QString>)));
connect(m_projectList, SIGNAL(showClipProperties(DocClipBase *)), this, SLOT(slotShowClipProperties(DocClipBase *)));
connect(m_projectList, SIGNAL(showClipProperties(QList <DocClipBase *>, QMap<QString, QString>)), this, SLOT(slotShowClipProperties(QList <DocClipBase *>, QMap<QString, QString>)));
connect(m_projectList, SIGNAL(getFileProperties(const QDomElement, const QString &, int, bool)), m_projectMonitor->render, SLOT(getFileProperties(const QDomElement, const QString &, int, bool)));
KNS3::standardAction(i18n("Download New Project Profiles..."), this, SLOT(slotGetNewMltProfileStuff()), actionCollection(), "get_new_mlt_profiles");
+ KNS3::standardAction(i18n("Download New Title Templates..."), this, SLOT(slotGetNewTitleStuff()), actionCollection(), "get_new_titles");
+
KAction* wizAction = new KAction(KIcon("configure"), i18n("Run Config Wizard"), this);
collection->addAction("run_wizard", wizAction);
connect(wizAction, SIGNAL(triggered(bool)), this, SLOT(slotRunWizard()));
ungroupClip->setData("ungroup_clip");
connect(ungroupClip, SIGNAL(triggered(bool)), this, SLOT(slotUnGroupClips()));
+ KAction* editClipDuration = new KAction(KIcon("measure"), i18n("Edit Duration"), this);
+ collection->addAction("edit_clip_duration", editClipDuration);
+ connect(editClipDuration, SIGNAL(triggered(bool)), this, SLOT(slotEditClipDuration()));
+
KAction* insertOvertwrite = new KAction(KIcon(), i18n("Insert Clip Zone in Timeline (Overwrite)"), this);
insertOvertwrite->setShortcut(Qt::Key_V);
collection->addAction("overwrite_to_in_point", insertOvertwrite);
showTimeline->setChecked(true);
connect(showTimeline, SIGNAL(triggered(bool)), this, SLOT(slotShowTimeline(bool)));
+ QAction *showTitleBar = new KAction(i18n("Show Title Bars"), this);
+ collection->addAction("show_titlebars", showTitleBar);
+ showTitleBar->setCheckable(true);
+ connect(showTitleBar, SIGNAL(triggered(bool)), this, SLOT(slotShowTitleBars(bool)));
+ showTitleBar->setChecked(KdenliveSettings::showtitlebars());
+
/*QAction *maxCurrent = new KAction(i18n("Maximize Current Widget"), this);
collection->addAction("maximize_current", maxCurrent);
maxCurrent->setCheckable(true);
m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeDocument->tracksList());
m_effectStack->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode());
+ m_projectList->updateProjectFormat(m_activeDocument->timecode());
if (m_renderWidget) m_renderWidget->setProfile(m_activeDocument->mltProfile());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
//m_activeDocument->clipManager()->resetProducersList(m_projectMonitor->render->producersList());
if (updateFps) m_activeTimeline->updateProjectFps();
m_activeDocument->setModified(true);
m_commandStack->activeStack()->clear();
+ //Update the mouse position display so it will display in DF/NDF format by default based on the project setting.
+ slotUpdateMousePosition(0);
// We need to desactivate & reactivate monitors to get a refresh
//m_monitorManager->switchMonitors();
}
m_activeTimeline->updateProjectFps();
m_activeDocument->checkProjectClips();
if (KdenliveSettings::dropbframes()) slotUpdatePreviewSettings();
-
+ //Update the mouse position display so it will display in DF/NDF format by default based on the project setting.
+ slotUpdateMousePosition(0);
// set tool to select tool
m_buttonSelectTool->setChecked(true);
}
}
}
+void MainWindow::slotEditClipDuration()
+{
+ if (m_activeTimeline) {
+ m_activeTimeline->projectView()->editClipDuration();
+ }
+}
+
void MainWindow::slotAddProjectClip(KUrl url)
{
if (m_activeDocument)
}
EditClipCommand *command = new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newprops, true);
m_activeDocument->commandStack()->push(command);
- m_activeTimeline->projectView()->slotUpdateClip(clip->getId());
+ //m_activeTimeline->projectView()->slotUpdateClip(clip->getId());
m_activeDocument->setModified(true);
}
delete dia_ui;
return entries.size();
}
+void MainWindow::slotGetNewTitleStuff()
+{
+ if (getNewStuff("kdenlive_titles.knsrc") > 0) {
+ TitleWidget::refreshTitleTemplates();
+ }
+}
+
void MainWindow::slotGetNewLumaStuff()
{
if (getNewStuff("kdenlive_wipes.knsrc") > 0) {
KdenliveSettings::setFrametimecode(ix == 1);
m_clipMonitor->updateTimecodeFormat();
m_projectMonitor->updateTimecodeFormat();
+ m_activeTimeline->projectView()->clearSelection();
}
void MainWindow::slotRemoveFocus()
if (interface && interface->isServiceRegistered("org.kde.ksmserver")) {
QDBusInterface smserver("org.kde.ksmserver", "/KSMServer", "org.kde.KSMServerInterface");
smserver.call("logout", 1, 2, 2);
+ } else if (interface && interface->isServiceRegistered("org.gnome.SessionManager")) {
+ QDBusInterface smserver("org.gnome.SessionManager", "/org/gnome/SessionManager", "org.gnome.SessionManager");
+ smserver.call("Shutdown");
}
}
m_activeTimeline->projectView()->insertClipCut(m_clipMonitor->activeClip(), info.at(1).toInt(), info.at(2).toInt());
}
+
+void MainWindow::slotDeleteProjectClips(QStringList ids, QMap<QString, QString> folderids)
+{
+ for (int i = 0; i < ids.size(); ++i) {
+ m_activeTimeline->slotDeleteClip(ids.at(i));
+ }
+ m_activeDocument->clipManager()->slotDeleteClips(ids);
+ if (!folderids.isEmpty()) m_projectList->deleteProjectFolder(folderids);
+
+}
+
+void MainWindow::slotShowTitleBars(bool show)
+{
+ if (show) {
+ m_effectStackDock->setTitleBarWidget(0);
+ m_clipMonitorDock->setTitleBarWidget(0);
+ m_projectMonitorDock->setTitleBarWidget(0);
+ m_recMonitorDock->setTitleBarWidget(0);
+ m_effectListDock->setTitleBarWidget(0);
+ m_transitionConfigDock->setTitleBarWidget(0);
+ m_projectListDock->setTitleBarWidget(0);
+ m_undoViewDock->setTitleBarWidget(0);
+ } else {
+ if (!m_effectStackDock->isFloating()) m_effectStackDock->setTitleBarWidget(new QWidget(this));
+ if (!m_clipMonitorDock->isFloating()) m_clipMonitorDock->setTitleBarWidget(new QWidget(this));
+ if (!m_projectMonitorDock->isFloating()) m_projectMonitorDock->setTitleBarWidget(new QWidget(this));
+ if (!m_recMonitorDock->isFloating()) m_recMonitorDock->setTitleBarWidget(new QWidget(this));
+ if (!m_effectListDock->isFloating()) m_effectListDock->setTitleBarWidget(new QWidget(this));
+ if (!m_transitionConfigDock->isFloating()) m_transitionConfigDock->setTitleBarWidget(new QWidget(this));
+ if (!m_projectListDock->isFloating()) m_projectListDock->setTitleBarWidget(new QWidget(this));
+ if (!m_undoViewDock->isFloating()) m_undoViewDock->setTitleBarWidget(new QWidget(this));
+ }
+ KdenliveSettings::setShowtitlebars(show);
+}
+
+void MainWindow::slotSwitchTitles()
+{
+ slotShowTitleBars(!KdenliveSettings::showtitlebars());
+}
+
#include "mainwindow.moc"