aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2015-01-02 13:03:08 +0100
committerJean-Baptiste Mardelle <[email protected]>2015-01-02 13:03:08 +0100
commit8f263ba1a0a04a40be94211c014c18654b84b942 (patch)
treeb13d8a067df356d29335e949f7d4410cc18ecb93
parent3bfbaeaf35424667189aa752429febda1044e5a9 (diff)
Re-enable reload clip action
-rw-r--r--src/bin/bin.cpp21
-rw-r--r--src/mainwindow.cpp2
2 files changed, 14 insertions, 9 deletions
diff --git a/src/bin/bin.cpp b/src/bin/bin.cpp
index e49d365..2af5b40 100644
--- a/src/bin/bin.cpp
+++ b/src/bin/bin.cpp
@@ -211,7 +211,7 @@ void Bin::slotAddClip()
QString folderName;
QString folderId;
QModelIndex ix = m_proxyModel->selectionModel()->currentIndex();
- if (ix.isValid()) {
+ if (ix.isValid() && m_proxyModel->selectionModel()->isSelected(ix)) {
AbstractProjectItem *currentItem = static_cast<AbstractProjectItem *>(m_proxyModel->mapToSource(ix).internalPointer());
while (!currentItem->isFolder()) {
currentItem = currentItem->parent();
@@ -255,11 +255,16 @@ void Bin::slotDeleteClip()
void Bin::slotReloadClip()
{
- QModelIndex parent2 = m_proxyModel->selectionModel()->currentIndex();
- /*AbstractProjectItem *currentItem = static_cast<AbstractProjectItem *>(parent2.internalPointer());
- if (currentItem) {
- reloadClip(currentItem->clipId());
- }*/
+ QModelIndex ix = m_proxyModel->selectionModel()->currentIndex();
+ if (ix.isValid() && m_proxyModel->selectionModel()->isSelected(ix)) {
+ AbstractProjectItem *currentItem = static_cast<AbstractProjectItem *>(ix.internalPointer());
+ if (currentItem && !currentItem->isFolder()) {
+ reloadClip(currentItem->clipId());
+ QDomDocument doc;
+ QDomElement xml = currentItem->toXml(doc);
+ pCore->projectManager()->current()->renderer()->getFileProperties(xml, currentItem->clipId(), 150, true);
+ }
+ }
}
ProjectFolder *Bin::rootFolder()
@@ -342,7 +347,7 @@ void Bin::slotAddFolder()
QString folderId;
QModelIndex ix = m_proxyModel->selectionModel()->currentIndex();
ProjectFolder *parentFolder = m_rootFolder;
- if (ix.isValid()) {
+ if (ix.isValid() && m_proxyModel->selectionModel()->isSelected(ix)) {
AbstractProjectItem *currentItem = static_cast<AbstractProjectItem *>(m_proxyModel->mapToSource(ix).internalPointer());
while (!currentItem->isFolder()) {
currentItem = currentItem->parent();
@@ -586,7 +591,7 @@ void Bin::contextMenuEvent(QContextMenuEvent *event)
void Bin::slotRefreshClipProperties()
{
QModelIndex current = m_proxyModel->selectionModel()->currentIndex();
- if (current.isValid()) {
+ if (current.isValid() && m_proxyModel->selectionModel()->isSelected(current)) {
ProjectClip *clip = static_cast<ProjectClip *>(m_proxyModel->mapToSource(current).internalPointer());
if (clip && !clip->isFolder()) {
showClipProperties(clip);
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index de31d7a..18cb22f 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1148,7 +1148,7 @@ void MainWindow::setupActions()
deleteClip->setData("delete_clip");
deleteClip->setEnabled(false);
- QAction *reloadClip = addAction("reload_clip", i18n("Reload Clip"), m_projectList, SLOT(slotReloadClip()), QIcon::fromTheme("view-refresh"));
+ QAction *reloadClip = addAction("reload_clip", i18n("Reload Clip"), pCore->bin(), SLOT(slotReloadClip()), QIcon::fromTheme("view-refresh"));
reloadClip->setData("reload_clip");
reloadClip->setEnabled(false);