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 461447 - Add option to select tag icon from file
Add option to select tag icon from file
Status: RESOLVED FIXED
Product: f-spot
Classification: Other
Component: Tags
0.3.x
Other All
: Normal enhancement
: ---
Assigned To: F-spot maintainers
F-spot maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-29 10:52 UTC by Jeroen Hoek
Modified: 2007-10-09 13:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Set a default icon when you create a new tag (1.60 KB, text/x-patch)
2007-09-23 03:21 UTC, Miguel Aguero
  Details
Proposed solution - WIP - TagCommands (small patch) (2.33 KB, patch)
2007-09-23 09:21 UTC, Declan McGrath
none Details | Review
Proposed solution - WIP - f-spot.glade (not cleaned up) (208.60 KB, patch)
2007-09-23 09:22 UTC, Declan McGrath
none Details | Review
Cleaned up the previous patch. Ready for review. (3.58 KB, patch)
2007-09-23 10:29 UTC, Declan McGrath
none Details | Review
Cleaned up the previous patch. Ready for review. (3.49 KB, patch)
2007-09-23 10:30 UTC, Declan McGrath
none Details | Review
Cleaned up the previous patch (for TagCommands.cs). (3.17 KB, patch)
2007-09-24 10:22 UTC, Declan McGrath
needs-work Details | Review
Combined Glade plus TagCommands.cs with implemented recommendations (6.56 KB, patch)
2007-09-28 10:58 UTC, Declan McGrath
committed Details | Review

Description Jeroen Hoek 2007-07-29 10:52:38 UTC
New tags can be set to have a stock icon, or a scaled down photo from the catelogue. I propose a third option which lets the user select an image from his files. Such images could be custom-made icons or downloaded images that have no place in the photo catelogue.
Comment 1 Stephane Delcroix 2007-09-12 14:13:00 UTC
tagged as gnome-love, easy to implement
Comment 2 Miguel Aguero 2007-09-23 03:21:03 UTC
Created attachment 96039 [details]
Set a default icon when you create a new tag

In this patch, when you create a new tag set a default icon. If the new tag is a child tag, take the icon from parent tag
Comment 3 Maxxer 2007-09-23 06:09:49 UTC
Miguel, this patch is off topic :-)

And BTW I don't think it was needed. Some people prefer NOT to have icons associated to tags.
Comment 4 Declan McGrath 2007-09-23 09:21:12 UTC
Created attachment 96046 [details] [review]
Proposed solution - WIP - TagCommands (small patch)

This is a working solution to the problem. I must test it more however and internationalise it. Please do not yet review.
Comment 5 Declan McGrath 2007-09-23 09:22:57 UTC
Created attachment 96047 [details] [review]
Proposed solution - WIP - f-spot.glade (not cleaned up)

This is the accompanying glade file to my previous patch. I have yet to pick through it and tidy it up. Please do not yet review.
Comment 6 Declan McGrath 2007-09-23 10:29:43 UTC
Created attachment 96049 [details] [review]
Cleaned up the previous patch. Ready for review.

This is a cleaned up version of the previous patch I supplied and is ready for review. It also requires the associated glade file to be patched in.
Comment 7 Declan McGrath 2007-09-23 10:30:23 UTC
Created attachment 96050 [details] [review]
Cleaned up the previous patch. Ready for review.

This is a cleaned up version of the previous patch I supplied and is ready for review. It also requires the associated TagCommands file to be patched in.
Comment 8 Maxxer 2007-09-23 20:39:55 UTC
Working for me, great.

Just my 2 personal notes:
1. I'd remove the hints you added over the file chooser and the standard stock icons. The hint showing in the upper part is visible only if there are no pictures attached to the tag, so it doesn't take more space. I think the help is a better place for those infos.
2. The texts at 1. made the window taller, and it isn't fitting in my monitor (1280x800, the highest resolution of my laptop), thus I cannot see the end of the stock icons and the ok/cancel buttons.
Comment 9 Declan McGrath 2007-09-24 09:36:52 UTC
(In reply to comment #8)
> Working for me, great.
> 
> Just my 2 personal notes:
> 1. I'd remove the hints you added over the file chooser and the standard stock
> icons. The hint showing in the upper part is visible only if there are no
> pictures attached to the tag, so it doesn't take more space. I think the help
> is a better place for those infos.
> 2. The texts at 1. made the window taller, and it isn't fitting in my monitor
> (1280x800, the highest resolution of my laptop), thus I cannot see the end of
> the stock icons and the ok/cancel buttons.
> 

Sure thing. Will make those changes.
Comment 10 Declan McGrath 2007-09-24 10:22:02 UTC
Created attachment 96109 [details] [review]
Cleaned up the previous patch (for TagCommands.cs). 

I have removed the aforementioned text in this TagCommands.cs patch. You will still need the glade patch that is already attached to this bug. Ready for review.
Comment 11 Maxxer 2007-09-24 22:48:15 UTC
Ok, fine to me. Seems to work great!
Comment 12 Stephane Delcroix 2007-09-26 12:53:41 UTC
It looks fine (but not tested yet).

Some comments though:
- you set LocalOnly to false for the FileChooser but then you try to access the LocalPath of the Uri. It may fail if a non-local uri was selected. Instead, I recommend to use a code like this to load a pixbuf from an image. This way, you'll have raw support for free ;)

Pixbuf pixbuf
using (ImageFile img = ImageFile.Create(uri_to_open)) {
      pixbuf = img.Load ();
}

- check the identation of the code (nitpicking)
- genrate your patches with "svn diff > mypatch". So you can have only one patch, even for multiple files
Comment 13 Declan McGrath 2007-09-28 10:58:55 UTC
Created attachment 96321 [details] [review]
Combined Glade plus TagCommands.cs with implemented recommendations

I have updated the code to implement the suggestions. Some comments

a.) I have implemented 2 using statements as otherwise external_image was not null on leaving method - and using is more efficient than Dispose(). Also I imagine that the nature of PixbufUtils.TagIconFromPixbuf () means that it is safe to dispose of the external_image as it is a transformed version that will be assigned to PreviewPixbuf anyway. Please advise if incorrect.
b.) Hope the 'FSpot.ImageFile.Create(new Uri(external_photo_chooser.Uri))' is the correct way to form a network safe Uri - couldn't find much doco on how to correctly implement this
c.) Only one patch file needed now
d.) I've tried to follow the recommended indentation - let me know if there is still any probs.

Other than that, all the best and happy hacking!
Dec
Comment 14 Stephane Delcroix 2007-10-09 13:06:10 UTC
committed in r3416