After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 716339 - Cannot delete a picture with Shotwell Photo Viewer
Cannot delete a picture with Shotwell Photo Viewer
Status: RESOLVED OBSOLETE
Product: shotwell
Classification: Other
Component: viewer-mode
unspecified
Other All
: High enhancement
: ---
Assigned To: Shotwell Maintainers
Shotwell Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-30 10:53 UTC by Shotwell Maintainers
Modified: 2020-04-19 06:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Charles Lindsay 2013-11-25 21:45:17 UTC


---- Reported by shotwell-maint@gnome.bugs 2010-06-30 03:53:00 -0700 ----

Original Redmine bug id: 2231
Original URL: http://redmine.yorba.org/issues/2231
Searchable id: yorba-bug-2231
Original author: Yann -
Original description:

Shotwell 0.60, on Ubuntu 10.04 (with Shotwell PPA)

-open a picture with Shotwell Photo Viewer

-press the “Delete†key -> no effect

-look into the Shotwell Photo Viewer menus -> no way to delete the picture

Expected behavior :

-open a picture with Shotwell Photo Viewer

-press the “Delete†key -> the picture goes to Trash

-look into the Shotwell Photo Viewer menus -> there should be a “Move to Trash†entry (in the Edition menu for example)

That is the only missing function that makes me keep the Eye Of Gnome as my
default viewer instead of Shotwell Photo Viewer.

Keep on rocking !

Related issues:
duplicated by shotwell - Feature #7645: Delete an picture in the photo viewer (Duplicate)
duplicated by shotwell - 7677: Can't delete photo on Fedora (Duplicate)



---- Additional Comments From shotwell-maint@gnome.bugs 2013-11-09 01:02:00 -0800 ----

### History

####

#1

Updated by Adam Dingle over 3 years ago

  * **Priority** deleted (<strike>_High_</strike>)

Unlikely for 0.7 at this point; dropping to medium.

####

#2

Updated by Yann - over 3 years ago

hi adam, thank you for your answer.

Indeed i'm a little surprised (I thought that was just a basic feature that
had been forgotten).

Is there something blocking ? (maybe the trash of the Shotwell Photo Manager)

Is there something I can help for this ?

####

#3

Updated by Adam Dingle over 3 years ago

Yann,

there's nothing blocking the development of this feature – we're just on a
tight development schedule for 0.7 and have dropped this feature from the list
we think we have time to implement (hence the change in priority to medium).
If you're interested in working on this, feel free to assign the bug to
yourself and to attach a patch to this ticket when ready. The deletion should
display a confirmation dialog. That dialog will contain a new string, so if
you want this feature to be in 0.7 you'll need to submit a patch before next
Thursday July 29, which is our planned string freeze date for 0.7. If you
don't want to work on this yourself, I'm still hopeful we'll be able to
implement this for 0.8.

####

#4

Updated by Yann - over 3 years ago

I just looked at the tracker's list of bugs marked “highâ€, and now I
understand your point ;)

I know a little bit of C, so I looked at the code, but could not even find the
file for the Photo Viewer… I think the best I can do is trying to find a
French programmer to help !

Good luck for the 0.7, I think the import from F-spot will be an appreciated
feature for Ubuntu users.

####

#5

Updated by Jim Nelson over 3 years ago

Just to jump in here, the UI for the Photo Viewer is found in PhotoPage.vala
in the class DirectPhotoPage. Technically the Photo Viewer is a form of the
EditingHostPage, which allows the user to view and edit a photo. There are
other classes involved, but that should get you (or anyone else interested in
this ticket) going.

####

#6

Updated by Yann - over 3 years ago

Thank you Jim.

The closest behavior I found is the (17th line of

http://trac.yorba.org/browser/shotwell/trunk/ui/trash.ui )

that opens a “Delete†confirmation window with 3 buttons (“Cancelâ€,
“Only deleteâ€, “Put the file in the trashâ€).

Maybe this could be copy/paste in the “Edit†menu which is used by
http://trac.yorba.org/browser/shotwell/trunk/src/PhotoPage.vala ?

####

#7

Updated by Jim Nelson over 3 years ago

That's not really an appropriate dialog for a Photo Viewer delete operation --
that dialog makes reference to removing from the library, which is not a Photo
Viewer concept. We would need a separate dialog that confirms whether or not
to move the photo to the desktop trash. But the code to hook up the Gtk.Action
to the menu item and the Delete key would otherwise be very much like the code
you pointed out.

And, of course, if the user chooses Yes, the photo needs to be actually
deleted -- File.trash() is what you're looking for here, as I recall.

####

#8

Updated by Yann - over 3 years ago

Thanks again !

I think I found the menu called by the Photo Viewer :
http://trac.yorba.org/browser/shotwell/trunk/ui/direct.ui , so if I don't
mistake, we just need to insert something like between line 19 and 20 , and
set the function Delete_from_viewer to call -- File.trash()

am I right ?

####

#9

Updated by Jim Nelson over 3 years ago

That's the gist of it.

####

#10

Updated by Adam Dingle about 3 years ago

  * **Priority** set to _High_

####

#11

Updated by Adam Dingle about 3 years ago

  * **Priority** deleted (<strike>_High_</strike>)

####

#12

Updated by Helmut Fedder over 2 years ago

+1 for this feature.

The first task I usually have when sorting new photos is to delete the photos
that I don't wont to keep.

Currently, for this, I have to

1. identify the filename in the window title

2. alt-tab to file browser

3. find the file in the file browser by its name

4. delete the file

5. alt-tab to shotwell

6. click on forward / backward

7. when stepping through photos, I get black screens with 'missing file'

This could be simplified to one click by providing a 'delete' action.

Cheers, Helmut

####

#13

Updated by Adam Dingle about 1 year ago

  * **Description** updated (diff)
  * **Priority** changed from _Low_ to _Normal_

####

#14

Updated by Mahendra Tallur 4 months ago

Hi ! Is this feature still considered ? IMHO, this is extremely important :-)

Some distros, like Fedora, only provide Shotwell (and not eog) as a pictures
viewer, by default. It's very fustrating when you have to go back & forth to
the filemanager to remove unwanted pictures.

Thanks again to the devs for the great work,

best regards.

####

#15

Updated by Philippe Vigneau 4 months ago

This functionality seems to be done : you can delete a photo by putting it to
shotwell trash. Then if you want to remove it from your hard disk, you just
have to empty your shotwell trash...

####

#16

Updated by Mahendra Tallur 4 months ago

Philippe VIGNEAU wrote:

> This functionality seems to be done : you can delete a photo by putting it
to shotwell trash. Then if you want to remove it from your hard disk, you just
have to empty your shotwell trash...

Thanks for the reply !

I see : I guess the problem is that some people (like me) and also some
distros (like Fedora) use Shotwell as a standalone image viewer (and not
necessarily like a pictures manager), instead of Eye of Gnome for instance.
(Shotwell is faster - does pre-fetching - and more feature-complete).

When just using Shotwell as a "viewer" (managing pictures oneself), it's very
important to be able to delete pictures directly (move them to system trash
and not to Shotwell trash).

I guess those 2 features kind of conflict because there are 2 trashes, which
explains Shotwell team's choice not to include this. Could this at least be
optional ? Or using a different keystroke ? (like : Ctrl-Del to move to system
trash directly ?). Or could there be an option in the preferences to chose
between the Shotwell or system trash ?

Thanks a lot ! Well, I guess I don't fit in the regular Shotwell use case :-)

####

#17

Updated by Jim Nelson 4 months ago

This is a feature we'd like to add to the Shotwell Photo Viewer; if we didn't,
we'd have closed the ticket.

####

#18

Updated by Philippe Vigneau 4 months ago

Jim, what should be the behaviour once the photo was deleted ?

--> next photo if available ?  
--> if no next photo available ?

####

#19

Updated by Jim Nelson 4 months ago

  * **Category** set to _viewer-mode_

Good questions. If another photo is available, yes, the viewer should move to
that one.

If no more photos are available ... that's more difficult. The photo viewer
was designed to display a photo at all times; it has no "empty" state. It
could exit if no photos are available, but that's not a good user experience.
I think the only option at that point is to display a FileChooser for the user
to select a new photo to view. If they press Cancel, the viewer exits.

####

#20

Updated by Yann - 3 months ago

hi

After deleting a photo, I would expect the viewer to:

1) display next photo if available

2) if no next photo, display the previous photo.

3) if no more photo in the current folder, display either a FileChooser or a
"No more photo in the current folder" message.

Hope this helps.

####

#21

Updated by Philippe Vigneau 2 months ago

I've tried to make this feature but I don't know how to update the
DirectPhotoSourceCollection DirectPhoto.global after the deletion...

####

#22

Updated by Jim Nelson 2 months ago

In order to encourage mass removal, DataCollection uses an iterator-style
system called Marker. You need to use `DirectPhoto.global.mark(photo`), which
returns a Marker object. Then call `DirectPhoto.global.remove_marked(marker)`.

####

#23

Updated by Philippe Vigneau about 1 month ago

it's OK for the previous question

another question (sorry !) :

after choosing a new file, how is it possible to redo a
monitor.start_discovery with the new directory ?

####

#24

Updated by Jim Nelson about 1 month ago

Shotwell should restart discovery if you select a new directory in Edit ->
Preferences.

If it doesn't, let us know, but it definitely should restart discovery by
closing and opening Shotwell again.

####

#25

Updated by Philippe Vigneau about 1 month ago

sorry I'm completely lost on what to do after opening a new file : how do I
update the view ?

####

#26

Updated by Jim Nelson about 1 month ago

Ignore my last comment; I forgot that this ticket is about the Shotwell Photo
Viewer, which doesn't have Edit -> Preferences.

Which view do you want to update? It might be best if you simply attached a
diff or some code here (even pseudo-code) explaining what you're trying to do
and where you're getting stuck.

####

#27

Updated by Philippe Vigneau about 1 month ago

tried this :

    
    
        private void on_file_open() {
            on_save();
    
            Gtk.FileChooserDialog open_dialog = new Gtk.FileChooserDialog(_("Import From Folder"), null,
                Gtk.FileChooserAction.OPEN, Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL, 
                Gtk.Stock.OK, Gtk.ResponseType.OK);
            open_dialog.set_local_only(false);
            open_dialog.set_select_multiple(false);
            open_dialog.set_current_folder(current_save_dir.get_path());
    
            int response = open_dialog.run();
    
            if (response == Gtk.ResponseType.OK) {
                File choosed_file = open_dialog.get_file();
                    debug("File choosed : %s", choosed_file.get_path());
                debug("View count : %d", get_view().get_count());
                debug("view_controller count : %d", view_controller.get_count());
                Direct.preconfigure(choosed_file);
                DirectPhoto.init(choosed_file);
                initial_file = choosed_file;
                view_controller = new DirectViewCollection();
                current_save_dir = choosed_file.get_parent();
    
                debug("View count : %d", get_view().get_count());
                debug("view_controller count : %d", view_controller.get_count());
            }
    
            open_dialog.destroy();
        }
    

and I get from the logs :

V 8341 2013-10-15 14:06:01 [DBG] DirectPhotoPage.vala:588: View count : 3

V 8341 2013-10-15 14:06:01 [DBG] DirectPhotoPage.vala:589: File choosed :
/home/test/Photos/2013/07/23/RAW_CANON_1DSM3.CR2

V 8341 2013-10-15 14:06:01 [DBG] DirectPhotoPage.vala:590: view_controller
count : 3

V 8341 2013-10-15 14:06:02 [DBG] DirectPhotoPage.vala:602: View count : 3

V 8341 2013-10-15 14:06:02 [DBG] DirectPhotoPage.vala:603: view_controller
count : 1

the view count should have been set to 1

####

#28

Updated by Jim Nelson about 1 month ago

You shouldn't be creating a new DirectViewCollection; you need to manipulate
the one you've already got built into the Page (i.e. get_view()). That's where
you should be removing DirectPhotos.

####

#29

Updated by anatoly techtonik 13 days ago

  * **Target version** set to _0.16.0_

Now that Shotwell is in Fedora by default, is it possible to raise priority of
this bug? Current way of removing photo from **viewer** described in comment
#12 is a huge usability fail for a default photo viewer.

####

#30

Updated by anatoly techtonik 13 days ago

  * **Keywords** changed from _viewer delete_ to _viewer delete ux_



--- Bug imported by chaz@yorba.org 2013-11-25 21:45 UTC  ---

This bug was previously known as _bug_ 2231 at http://redmine.yorba.org/show_bug.cgi?id=2231

Unknown milestone "unknown in product shotwell. 
   Setting to default milestone for this product, "---".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.
Resolution set on an open status.
   Dropping resolution 

Comment 1 techtonik 2013-11-26 03:58:10 UTC
The priority should be raised.
Comment 2 techtonik 2013-11-26 20:26:42 UTC
Thanks.
Comment 3 Rafael Luik 2013-12-21 06:03:04 UTC
+1

Missing Delete to quickly delete the pic currently in view coming from Windows.
Comment 4 akronix5 2015-05-01 16:04:59 UTC
+1, it shouldn't be that difficult but it is that useful.
Comment 5 logos88 2015-08-19 08:35:19 UTC
+1 for me to delete an image with the "supr" key is something essential when I am looking my photos and I want to discard some of them.
Comment 6 SteveH 2015-11-18 11:22:49 UTC
Same issue with 0.20.0 with Mint 17.2

I just wanted to comment that for me this is a killer problem-everyone takes duff photos from time to time (or even often in my case).  So I use a photoviewer first to skim through the new photos and delete a load of them.  

I particularly installed Shotwell because it handles RAW (.dng) files well, unlike gnome etc.  But if it really doesn't do this fundamental job then I will have to try again, which I understand isn't a mortal blow for you, but I am so surprised.   0.20.0 is the latest suitable I think (yorba repository)

Thanks
Comment 7 akronix5 2016-07-13 11:16:38 UTC
Is anybody assigned to have it done?
I could try to do it by myself.
Comment 8 Jens Georg 2016-07-13 13:26:38 UTC
(In reply to akronix5 from comment #7)
> Is anybody assigned to have it done?
> I could try to do it by myself.

No. Feel free :) Preferred way is to submit the patch here in Bugzilla
Comment 9 akronix5 2016-07-13 13:35:17 UTC
Great!

Assign me it to me ;D I hope to have some time soon to implement this.
Comment 10 Jens Georg 2016-10-04 10:34:09 UTC
Btw, there seems to be some starting code available in https://git.gnome.org/browse/shotwell/commit/?h=bug/2231-viewer-delete&id=c298a04e78968cdf3b82b4a728bf58f205915641 - not sure how well that applies to current code base.
Comment 11 André Klapper 2016-10-24 09:39:25 UTC
akronix5: Any code progress to share? :)
Comment 12 akronix5 2016-10-24 09:41:38 UTC
No..I'm very sorry but I haven't had time enough to dedicate to this :(
Comment 13 Jens Georg 2020-04-19 06:56:58 UTC
Tracked as https://gitlab.gnome.org/GNOME/shotwell/-/issues/130