* No more tabs by default
* small UI fixes
svn path=/branches/KDE4/; revision=2388
+void EffectStackView::clear() {
+ ui.effectlist->clear();
+ ui.buttonDel->setEnabled(false);
+ ui.buttonSave->setEnabled(false);
+ ui.buttonReset->setEnabled(false);
+ ui.buttonUp->setEnabled(false);
+ ui.buttonDown->setEnabled(false);
+}
+
#include "effectstackview.moc"
#include "effectstackview.moc"
public:
EffectStackView(QWidget *parent = 0);
void raiseWindow(QWidget*);
public:
EffectStackView(QWidget *parent = 0);
void raiseWindow(QWidget*);
private:
Ui::EffectStack_UI ui;
ClipItem* clipref;
private:
Ui::EffectStack_UI ui;
ClipItem* clipref;
void setUrl(KUrl url);
QDomElement documentInfoXml();
void setProfilePath(QString path);
void setUrl(KUrl url);
QDomElement documentInfoXml();
void setProfilePath(QString path);
- /** Set to true if document needs saving, false otherwise */
- void setModified(bool mod);
const QString&getFreeClipId();
/** does the document need saving */
bool isModified() const;
const QString&getFreeClipId();
/** does the document need saving */
bool isModified() const;
public slots:
void slotCreateTextClip(QString group, const QString &groupId);
public slots:
void slotCreateTextClip(QString group, const QString &groupId);
+ /** Set to true if document needs saving, false otherwise */
+ void setModified(bool mod = true);
private slots:
void slotAutoSave();
private slots:
void slotAutoSave();
<default>true</default>
</entry>
<default>true</default>
</entry>
+ <entry name="activatetabs" type="Bool">
+ <label>Create a new tab when opening a document.</label>
+ <default>false</default>
+ </entry>
+
<entry name="color_duration" type="String">
<label>Default color clip duration.</label>
<default>00:00:05:00</default>
<entry name="color_duration" type="String">
<label>Default color clip duration.</label>
<default>00:00:05:00</default>
m_timelineArea->setTabBarHidden(true);
QToolButton *closeTabButton = new QToolButton;
m_timelineArea->setTabBarHidden(true);
QToolButton *closeTabButton = new QToolButton;
- connect(closeTabButton, SIGNAL(clicked()), this, SLOT(slotRemoveTab()));
+ connect(closeTabButton, SIGNAL(clicked()), this, SLOT(closeCurrentDocument()));
closeTabButton->setIcon(KIcon("tab-close"));
closeTabButton->adjustSize();
closeTabButton->setToolTip(i18n("Close the current tab"));
closeTabButton->setIcon(KIcon("tab-close"));
closeTabButton->adjustSize();
closeTabButton->setToolTip(i18n("Close the current tab"));
KStandardAction::open(this, SLOT(openFile()),
actionCollection());
KStandardAction::open(this, SLOT(openFile()),
actionCollection());
- KStandardAction::save(this, SLOT(saveFile()),
- actionCollection());
+ m_saveAction = KStandardAction::save(this, SLOT(saveFile()),
+ actionCollection());
KStandardAction::saveAs(this, SLOT(saveFileAs()),
actionCollection());
KStandardAction::saveAs(this, SLOT(saveFileAs()),
actionCollection());
}
void MainWindow::activateDocument() {
}
void MainWindow::activateDocument() {
+ if (m_timelineArea->currentWidget() == NULL) return;
TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
KdenliveDoc *currentDoc = currentTab->document();
connectDocumentInfo(currentDoc);
connectDocument(currentTab, currentDoc);
}
TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
KdenliveDoc *currentDoc = currentTab->document();
connectDocumentInfo(currentDoc);
connectDocument(currentTab, currentDoc);
}
-void MainWindow::slotRemoveTab() {
+void MainWindow::closeCurrentDocument() {
QWidget *w = m_timelineArea->currentWidget();
// closing current document
int ix = m_timelineArea->currentIndex() + 1;
QWidget *w = m_timelineArea->currentWidget();
// closing current document
int ix = m_timelineArea->currentIndex() + 1;
m_timelineArea->setCurrentIndex(ix);
TrackView *tabToClose = (TrackView *) w;
KdenliveDoc *docToClose = tabToClose->document();
m_timelineArea->setCurrentIndex(ix);
TrackView *tabToClose = (TrackView *) w;
KdenliveDoc *docToClose = tabToClose->document();
+ if (docToClose && docToClose->isModified()) {
+ switch (KMessageBox::warningYesNoCancel(this, i18n("Save changes to document ?"))) {
+ case KMessageBox::Yes :
+ // save document here. If saving fails, return false;
+ saveFile();
+ break;
+ case KMessageBox::Cancel :
+ return;
+ default:
+ break;
+ }
+ }
m_timelineArea->removeTab(m_timelineArea->indexOf(w));
if (m_timelineArea->count() == 1) m_timelineArea->setTabBarHidden(true);
delete docToClose;
delete w;
m_timelineArea->removeTab(m_timelineArea->indexOf(w));
if (m_timelineArea->count() == 1) m_timelineArea->setTabBarHidden(true);
delete docToClose;
delete w;
+ if (m_timelineArea->count() == 0) m_activeDocument = NULL;
}
void MainWindow::saveFileAs(const QString &outputFileName) {
}
void MainWindow::saveFileAs(const QString &outputFileName) {
void MainWindow::openFile(const KUrl &url) {
// Check for backup file
void MainWindow::openFile(const KUrl &url) {
// Check for backup file
QList<KAutoSaveFile *> staleFiles = KAutoSaveFile::staleFiles(url);
if (!staleFiles.isEmpty()) {
if (KMessageBox::questionYesNo(this,
QList<KAutoSaveFile *> staleFiles = KAutoSaveFile::staleFiles(url);
if (!staleFiles.isEmpty()) {
if (KMessageBox::questionYesNo(this,
+ if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
}
void MainWindow::recoverFiles(QList<KAutoSaveFile *> staleFiles) {
}
void MainWindow::recoverFiles(QList<KAutoSaveFile *> staleFiles) {
+ if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
foreach(KAutoSaveFile *stale, staleFiles) {
/*if (!stale->open(QIODevice::QIODevice::ReadOnly)) {
// show an error message; we could not steal the lockfile
foreach(KAutoSaveFile *stale, staleFiles) {
/*if (!stale->open(QIODevice::QIODevice::ReadOnly)) {
// show an error message; we could not steal the lockfile
m_activeDocument->setProfilePath(profile);
KdenliveSettings::setCurrent_profile(profile);
KdenliveSettings::setProject_fps(m_activeDocument->fps());
m_activeDocument->setProfilePath(profile);
KdenliveSettings::setCurrent_profile(profile);
KdenliveSettings::setProject_fps(m_activeDocument->fps());
- setCaption(m_activeDocument->description());
+ setCaption(m_activeDocument->description(), m_activeDocument->isModified());
m_monitorManager->resetProfiles(m_activeDocument->timecode());
if (m_renderWidget) m_renderWidget->setDocumentStandard(m_activeDocument->getDocumentStandard());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
m_monitorManager->resetProfiles(m_activeDocument->timecode());
if (m_renderWidget) m_renderWidget->setDocumentStandard(m_activeDocument->getDocumentStandard());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
void MainWindow::slotUpdateDocumentState(bool modified) {
setCaption(m_activeDocument->description(), modified);
void MainWindow::slotUpdateDocumentState(bool modified) {
setCaption(m_activeDocument->description(), modified);
+ m_saveAction->setEnabled(modified);
if (modified) {
m_timelineArea->setTabTextColor(m_timelineArea->currentIndex(), palette().color(QPalette::Link));
m_timelineArea->setTabIcon(m_timelineArea->currentIndex(), KIcon("document-save"));
if (modified) {
m_timelineArea->setTabTextColor(m_timelineArea->currentIndex(), palette().color(QPalette::Link));
m_timelineArea->setTabIcon(m_timelineArea->currentIndex(), KIcon("document-save"));
if (m_activeTimeline) {
disconnect(m_projectMonitor, SIGNAL(renderPosition(int)), m_activeTimeline, SLOT(moveCursorPos(int)));
disconnect(m_projectMonitor, SIGNAL(durationChanged(int)), m_activeTimeline, SLOT(setDuration(int)));
if (m_activeTimeline) {
disconnect(m_projectMonitor, SIGNAL(renderPosition(int)), m_activeTimeline, SLOT(moveCursorPos(int)));
disconnect(m_projectMonitor, SIGNAL(durationChanged(int)), m_activeTimeline, SLOT(setDuration(int)));
+ disconnect(m_projectList, SIGNAL(projectModified()), m_activeDocument, SLOT(setModified()));
disconnect(m_activeDocument, SIGNAL(addProjectClip(DocClipBase *)), m_projectList, SLOT(slotAddClip(DocClipBase *)));
disconnect(m_activeDocument, SIGNAL(addProjectFolder(const QString, const QString &, bool, bool)), m_projectList, SLOT(slotAddFolder(const QString, const QString &, bool, bool)));
disconnect(m_activeDocument, SIGNAL(signalDeleteProjectClip(const QString &)), m_projectList, SLOT(slotDeleteClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(addProjectClip(DocClipBase *)), m_projectList, SLOT(slotAddClip(DocClipBase *)));
disconnect(m_activeDocument, SIGNAL(addProjectFolder(const QString, const QString &, bool, bool)), m_projectList, SLOT(slotAddFolder(const QString, const QString &, bool, bool)));
disconnect(m_activeDocument, SIGNAL(signalDeleteProjectClip(const QString &)), m_projectList, SLOT(slotDeleteClip(const QString &)));
disconnect(effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
disconnect(transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
disconnect(effectStack, SIGNAL(reloadEffects()), this, SLOT(slotReloadEffects()));
disconnect(transitionConfig, SIGNAL(transitionUpdated(Transition *, QDomElement)), trackView->projectView() , SLOT(slotTransitionUpdated(Transition *, QDomElement)));
disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor()));
}
m_activeDocument->setRenderer(NULL);
disconnect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
}
m_activeDocument->setRenderer(NULL);
disconnect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
m_monitorManager->resetProfiles(doc->timecode());
m_projectList->setDocument(doc);
connect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
m_monitorManager->resetProfiles(doc->timecode());
m_projectList->setDocument(doc);
connect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
+ connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
//m_overView->scale(m_overView->width() / trackView->duration(), m_overView->height() / (50 * trackView->tracksNumber()));
//m_overView->fitInView(m_overView->itemAt(0, 50), Qt::KeepAspectRatio);
//m_overView->scale(m_overView->width() / trackView->duration(), m_overView->height() / (50 * trackView->tracksNumber()));
//m_overView->fitInView(m_overView->itemAt(0, 50), Qt::KeepAspectRatio);
- setCaption(doc->description());
+ setCaption(doc->description(), doc->isModified());
+ m_saveAction->setEnabled(doc->isModified());
m_activeDocument = doc;
}
m_activeDocument = doc;
}
QAction *m_buttonRazorTool;
QAction *m_buttonSnap;
QActionGroup *m_toolGroup;
QAction *m_buttonRazorTool;
QAction *m_buttonSnap;
QActionGroup *m_toolGroup;
QSlider *m_zoomSlider;
StatusBarMessageLabel *m_messageLabel;
QSlider *m_zoomSlider;
StatusBarMessageLabel *m_messageLabel;
void slotZoomIn();
void slotZoomOut();
void slotFitZoom();
void slotZoomIn();
void slotZoomOut();
void slotFitZoom();
+ void closeCurrentDocument();
void slotDeleteTimelineClip();
void slotAddClipMarker();
void slotDeleteClipMarker();
void slotDeleteTimelineClip();
void slotAddClipMarker();
void slotDeleteClipMarker();
Nepomuk::Resource f(clip->clipUrl().path());
if (f.isValid()) f.setDescription(properties.value("description"));
}
Nepomuk::Resource f(clip->clipUrl().path());
if (f.isValid()) f.setDescription(properties.value("description"));
}
+ emit projectModified();
void slotUpdateClipProperties(ProjectItem *item, QMap <QString, QString> properties);
//void slotShowMenu(const QPoint &pos);
void slotUpdateClipProperties(ProjectItem *item, QMap <QString, QString> properties);
//void slotShowMenu(const QPoint &pos);
signals:
void clipSelected(DocClipBase *);
void getFileProperties(const QDomElement&, const QString &);
void receivedClipDuration(const QString &, int);
void showClipProperties(DocClipBase *);
signals:
void clipSelected(DocClipBase *);
void getFileProperties(const QDomElement&, const QString &);
void receivedClipDuration(const QString &, int);
void showClipProperties(DocClipBase *);
+ void projectModified();
void Render::stop() {
if (m_mltConsumer && !m_mltConsumer->is_stopped()) {
kDebug() << "///////////// RENDER STOPPED: " << m_name;
void Render::stop() {
if (m_mltConsumer && !m_mltConsumer->is_stopped()) {
kDebug() << "///////////// RENDER STOPPED: " << m_name;
- //m_mltConsumer->set("refresh", 0);
+ m_isBlocked = true;
+ m_mltConsumer->set("refresh", 0);
m_mltConsumer->stop();
}
kDebug() << "///////////// RENDER STOP2-------";
m_mltConsumer->stop();
}
kDebug() << "///////////// RENDER STOP2-------";
<x>0</x>
<y>0</y>
<width>369</width>
<x>0</x>
<y>0</y>
<width>369</width>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4" >
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4" >
- <item row="2" column="0" >
+ <item row="3" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Default Durations</string>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Default Durations</string>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
- <item row="3" column="0" >
+ <item row="4" column="0" >
<widget class="QGroupBox" name="properties" >
<property name="title" >
<string>Default Profile</string>
<widget class="QGroupBox" name="properties" >
<property name="title" >
<string>Default Profile</string>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
- <item row="4" column="0" >
+ <item row="5" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
<property name="text" >
<string>Crash recovery (automatic backup)</string>
</property>
<property name="text" >
<string>Crash recovery (automatic backup)</string>
</property>
- <property name="checked" >
- <bool>true</bool>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QCheckBox" name="kcfg_activatetabs" >
+ <property name="text" >
+ <string>Open projects in new tabs</string>
</property>
</widget>
</item>
</property>
</widget>
</item>