Skip to content
Permalink
Browse files

Drag & Drop for Thumbpreview improved

- Thumbpreview now allows for Copy/Move/Link selected files
- File Explorer allows pastes for copy/move
  • Loading branch information...
diemmarkus committed Aug 9, 2018
1 parent 92b68a3 commit 61d9f9a422707784620002731b407543f651a411
@@ -1259,10 +1259,14 @@ void DkThumbScene::showFile(const QString& filePath) {
if (filePath == QDir::currentPath() || filePath.isEmpty()) {
int sf = getSelectedFiles().size();

QString info;

if (sf > 1)
DkStatusBarManager::instance().setMessage(tr("%1 selected").arg(QString::number(sf)));
info = QString::number(sf) + tr(" selected");
else
DkStatusBarManager::instance().setMessage(tr("%1 images").arg(QString::number(mThumbLabels.size())));
info = QString::number(mThumbLabels.size()) + tr(" images");

DkStatusBarManager::instance().setMessage(tr("%1 | %2").arg(info, currentDir()));
}
else
DkStatusBarManager::instance().setMessage(QFileInfo(filePath).fileName());
@@ -1284,6 +1288,14 @@ void DkThumbScene::ensureVisible(QSharedPointer<DkImageContainerT> img) const {

}

QString DkThumbScene::currentDir() const {

if (mThumbs.empty() || !mThumbs[0])
return "";

return mThumbs[0]->fileInfo().absolutePath();
}

void DkThumbScene::toggleThumbLabels(bool show) {

DkSettingsManager::param().display().showThumbLabel = show;
@@ -1687,8 +1699,8 @@ void DkThumbsView::mouseMoveEvent(QMouseEvent *event) {
QDrag* drag = new QDrag(this);
drag->setMimeData(mimeData);
drag->setPixmap(pm);

drag->exec(Qt::CopyAction);
drag->exec(Qt::CopyAction | Qt::MoveAction | Qt::LinkAction, Qt::CopyAction);
}
}
}
@@ -237,6 +237,7 @@ class DllCoreExport DkThumbScene : public QGraphicsScene {
int findThumb(DkThumbLabel* thumb) const;
bool allThumbsSelected() const;
void ensureVisible(QSharedPointer<DkImageContainerT> img) const;
QString currentDir() const;

public slots:
void updateThumbLabels();
@@ -359,8 +359,6 @@ DkFileSystemModel::DkFileSystemModel(QObject* parent /* = 0 */) : QFileSystemMod
setRootPath(QDir::rootPath());
setNameFilters(DkSettingsManager::param().app().fileFilters);
setReadOnly(false);
//setSupportedDragActions(Qt::CopyAction | Qt::MoveAction);

}

// DkSortFileProxyModel --------------------------------------------------------------------
@@ -433,12 +431,12 @@ void DkExplorer::createLayout() {
sortModel = new DkSortFileProxyModel(this);
sortModel->setSourceModel(fileModel);
sortModel->setSortLocaleAware(true);

fileTree = new QTreeView(this);
fileTree->setSortingEnabled(true);
fileTree->setModel(sortModel);
fileTree->setDragEnabled(true);
//fileTree->setContextMenuPolicy(Qt::CustomContextMenu);
fileTree->setAcceptDrops(true);

// by default descendingOrder is set
fileTree->header()->setSortIndicator(0, Qt::AscendingOrder);
@@ -3234,5 +3232,3 @@ void DkTabEntryWidget::paintEvent(QPaintEvent *event) {
}

}


@@ -343,9 +343,6 @@ class DkFileSystemModel : public QFileSystemModel {

public:
DkFileSystemModel(QObject* parent = 0);

protected:

};

class DkSortFileProxyModel : public QSortFilterProxyModel {
@@ -73,7 +73,7 @@ IDI_ICON7 ICON ".\\img\\icons\\file-icon-raw.ic
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,11,0,2140
FILEVERSION 3,11,0,2156
PRODUCTVERSION 3,11,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
@@ -91,7 +91,7 @@ BEGIN
BEGIN
VALUE "CompanyName", "TU Wien"
VALUE "FileDescription", "nomacs - Image Lounge"
VALUE "FileVersion", "3.11.0.2140"
VALUE "FileVersion", "3.11.0.2156"
VALUE "InternalName", "nomacs.exe"
VALUE "LegalCopyright", "(C) 2011-2018, Markus Diem, Stefan Fiel, Florian Kleber"
VALUE "OriginalFilename", "nomacs.exe"

0 comments on commit 61d9f9a

Please sign in to comment.
You can’t perform that action at this time.