* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include <QApplication>
-#include <QHeaderView>
-#include <QAction>
+
+#include "projectlistview.h"
+#include "projectitem.h"
+#include "kdenlivesettings.h"
#include <KDebug>
#include <KMenu>
#include <KLocale>
-#include "projectitem.h"
-#include "projectlistview.h"
-#include "kdenlivesettings.h"
-
+#include <QApplication>
+#include <QHeaderView>
+#include <QAction>
ProjectListView::ProjectListView(QWidget *parent)
: QTreeWidget(parent), m_dragStarted(false) {
if (!KdenliveSettings::showdescriptioncolumn()) hideColumn(2);
if (!KdenliveSettings::showratingcolumn()) hideColumn(3);
- setIconSize(QSize(60, 40));
setSortingEnabled(true);
}
const QString text = model()->headerData(i, Qt::Horizontal).toString();
QAction* action = popup.addAction(text);
action->setCheckable(true);
- action->setChecked(!headerView->isSectionHidden(logicalIndex));
+ action->setChecked(!headerView->isSectionHidden(i));
action->setData(i);
}
if (!item) emit addClip();
else if (item->isGroup()) {
if ((columnAt(event->pos().x()) == 1)) QTreeWidget::mouseDoubleClickEvent(event);
- } else emit showProperties(item->referencedClip());
+ } else {
+ if ((columnAt(event->pos().x()) == 1) && (item->clipType() == SLIDESHOW || item->clipType() == TEXT || item->clipType() == COLOR)) QTreeWidget::mouseDoubleClickEvent(event);
+ else if ((columnAt(event->pos().x()) == 2)) QTreeWidget::mouseDoubleClickEvent(event);
+ else emit showProperties(item->referencedClip());
+ }
}
// virtual
}
const QList <QUrl> list = event->mimeData()->urls();
foreach(const QUrl &url, list) {
- emit addClip(url, groupName);
+ emit addClip(KUrl(url), groupName);
}
} else if (event->mimeData()->hasFormat("kdenlive/producerslist")) {
QTreeWidgetItem *parent = it->parent();
if (parent/* && ((ProjectItem *) it)->clipId() < 10000*/) {
kDebug() << "++ item parent: " << parent->text(1);
- clone = (ProjectItem*) parent->takeChild(parent->indexOfChild(it));
- if (clone) addTopLevelItem(clone);
+ clone = static_cast <ProjectItem*>(parent->takeChild(parent->indexOfChild(it)));
+ if (clone) {
+ addTopLevelItem(clone);
+ clone->clearProperty("groupname");
+ clone->clearProperty("groupid");
+ }
}
}
}
// virtual
void ProjectListView::mouseMoveEvent(QMouseEvent *event) {
- kDebug() << "// DRAG STARTED, MOUSE MOVED: ";
+ //kDebug() << "// DRAG STARTED, MOUSE MOVED: ";
if (!m_dragStarted) return;
if ((event->pos() - m_DragStartPosition).manhattanLength()
//mimeData->setText(ids.join(";")); //doc.toString());
//mimeData->setImageData(image);
drag->setMimeData(mimeData);
- drag->setPixmap(clickItem->icon(0).pixmap((int)(50 *16 / 9.0), 50));
+ drag->setPixmap(clickItem->icon(0).pixmap(iconSize()));
drag->setHotSpot(QPoint(0, 50));
- drag->start(Qt::MoveAction);
-
- //Qt::DropAction dropAction;
- //dropAction = drag->start(Qt::CopyAction | Qt::MoveAction);
-
- //Qt::DropAction dropAction = drag->exec();
-
+ Qt::DropAction dropAction = drag->exec(Qt::MoveAction);
}
//event->accept();
}
// virtual
void ProjectListView::dragMoveEvent(QDragMoveEvent * event) {
- QTreeWidgetItem * item = itemAt(event->pos());
event->setDropAction(Qt::IgnoreAction);
- //if (item) {
event->setDropAction(Qt::MoveAction);
if (event->mimeData()->hasText()) {
event->acceptProposedAction();
}
- //}
+ // stop playing because we get a crash otherwise when fetching the thumbnails
+ emit pauseMonitor();
}
QStringList ProjectListView::mimeTypes() const {