Bug 281785 - no prohibition warning while tagging thumbnail above preview
Summary: no prohibition warning while tagging thumbnail above preview
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Unclassified
Component: Tags-Engine (show other bugs)
Version: 4.0.0
Platform: Compiled Sources Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-11 07:53 UTC by Rinus Bakker
Modified: 2014-09-02 15:02 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.0.0


Attachments
Patch to make preview widget handle drag and drop feature (2.64 KB, patch)
2014-03-30 08:16 UTC, Shourya Singh Gupta
Details
Updated prev code, so that a confirmation KMenu appears before applying tag (1.86 KB, patch)
2014-04-02 17:23 UTC, Shourya Singh Gupta
Details
Merged the first two patches. (3.08 KB, patch)
2014-04-02 21:37 UTC, Shourya Singh Gupta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rinus Bakker 2011-09-11 07:53:56 UTC
Version:           2.1.0 (using KDE 4.7.0) 
OS:                Linux

If you drag a tag to the preview window a prohibition sign pops up
If you drag a tag to the thumbnails above the preview window you are asked if you want to apply etc and you choose yes, but no tag has been applied afterwards.


Reproducible: Always

Steps to Reproduce:
just as above

Actual Results:  
just as above

Expected Results:  
Either to tag should be applied or the prohibition signe should pop up. Not leaving you in the false presumption you have applied a tag to a picture
Comment 1 caulier.gilles 2011-12-16 12:41:47 UTC
Rinus,

This file still valid using digiKam 2.4 ?

Gilles Caulier
Comment 2 Shourya Singh Gupta 2014-02-26 17:44:41 UTC
Gilles Caulier

I think this bug no longer exists.Its working fine now.
Comment 3 caulier.gilles 2014-02-26 17:56:22 UTC
Shourya,

point 1/  If you drag a tag to the preview window a prohibition sign pops up

==> Still valid. preview widget do not handle tag D&D

Point 2/ If you drag a tag to the thumbnails above the preview window you are asked if you want to apply etc and you choose yes, but no tag has been applied afterwards.

==> Work fine here...

Gilles Caulier
Comment 4 Shourya Singh Gupta 2014-02-26 18:27:30 UTC
Gilles,

what are the ways you suggest , in which point(1) can be implemented ?
Comment 5 Shourya Singh Gupta 2014-02-26 18:34:02 UTC
I mean what are the ways in which I can make preview widget handle drag and drop feature ?
Comment 6 caulier.gilles 2014-02-26 22:36:40 UTC
To implement D&D tags support you need to add new methods in ImagePreviewView class as i do with Canvas class from Image Editor which support D&D. See :

void Canvas::dragEnterEvent(QDragEnterEvent* e)
void Canvas::dragMoveEvent(QDragMoveEvent* e)
void Canvas::dropEvent(QDropEvent* e)

Canvas is a little bit special, because it shared with Showfoto which do not support digiKam DB. There no DB handling in Canvas. Just a signal is emitted to parent editor instance to handle or not dropped data, accordingly with DB or not.

There is no need to reproduce the same scheme in ImagePreviewView than Canvas. You can directly handle Tags drop directly in this class with dropEvent(). The code to decode and branch action with tags is similar than this method : 

void ImageWindow::slotAddedDropedItems(QDropEvent* e)

In this code of course, all possible dropped data are managed. In case of tags, editor load image with relevant tags in thumbbar. It do not assign tags to current image (which is a wrong behavior in fact i think)...

Gilles Caulier
Comment 7 Shourya Singh Gupta 2014-03-29 18:46:27 UTC
tagmngrlistview.cpp also has dropEvent implemented to facilitate drag-n-drop feature. I think dropEvent in ImagePreviewView.cpp should also be implemented in similar way. Right ?
Comment 8 Shourya Singh Gupta 2014-03-29 18:52:44 UTC
I mean not same but somewhat like this
Comment 9 caulier.gilles 2014-03-29 21:09:32 UTC
Look in canvas implementation from Image editor. It use same parent class than ImagPreviewView, and D&D is implemented in git/master...

Gilles Caulier
Comment 10 Shourya Singh Gupta 2014-03-30 08:16:27 UTC
Created attachment 85839 [details]
Patch to make preview widget handle drag and drop feature
Comment 11 Shourya Singh Gupta 2014-04-02 17:23:28 UTC
Created attachment 85912 [details]
Updated prev code, so that a confirmation KMenu appears before applying tag

After a user drags and drops a tag on preview widget, a KMenu asks user 2 thing :
1) Assign Tags to This Item 
2)Cancel 
 If a user clicks on "Assign Tags to This Item" then only the tag is applied to the image.
Comment 12 Shourya Singh Gupta 2014-04-02 21:37:48 UTC
Created attachment 85919 [details]
Merged the first two patches.
Comment 13 caulier.gilles 2014-04-03 07:56:42 UTC
Git commit 45bf8a142d6c8ea92757ba054a02389e6a6074e7 by Gilles Caulier.
Committed on 03/04/2014 at 07:54.
Pushed by cgilles into branch 'master'.

apply patch #85919 from Shourya Singh Gupta to handle D&D operation with tags over preview canvas
FIXED-IN: 4.0.0

M  +54   -0    digikam/views/imagepreviewview.cpp
M  +7    -0    digikam/views/imagepreviewview.h

http://commits.kde.org/digikam/45bf8a142d6c8ea92757ba054a02389e6a6074e7