[strings] rotate desktop background
Submitted by Adam Dingle
Link to original bug (#715762)
Description
---- Reported by adam@yorba.org 2010-01-20 09:11:00 -0800 ----
Original Redmine bug id: 1296
Original URL: http://redmine.yorba.org/issues/1296
Searchable id: yorba-bug-1296
Original author: Adam Dingle
Original description:
It would be cool if Shotwell could change my desktop background to be a random photo from my library once per day (or other user-configurable interval).
---- Additional Comments From shotwell-maint@gnome.bugs 2013-05-01 11:41:00 -0700 ----
History
Comment 1
Updated by Bengt Thuree over 3 years ago
Perhaps having a separate small gnome applet that ties into the shotwell database, and replaces the desktop background based on this applets preferences (or possible shotwells).
For instance.
Changing photo every X minutes
Rating (from – to)
Tags (0 – multiple tags)
Size (all sizes, exactly as desktop size, …)
Order (random, reversed, etc)
Date (from – to)
Just my two cents
Comment 2
Updated by Bengt Thuree over 3 years ago
Ok adding another two cents.
Needs to consider multiuser, so probably would only connect to the shotwell database when asked and then generate it's own text file with photos to load etc.
Rescan the database upon requests.
Comment 3
Updated by Jim Nelson about 3 years ago
perezk at #2628 (closed) has some other notes about how this might work.
Comment 4
Updated by Maxim - about 3 years ago
I've just attach patch that implements this feature. Here are a few details.
How to use
-
Select two or more photos any way you like (for example, but clicking on a tag or by restricting shown photos to those marked by 5 stars only; the do Select All by Ctrl-A).
-
Go to File -> Set as Desktop Slideshow…
-
A dialog will appear where you can adjust the time each photo will be shown on the desktop background
-
Clock OK.
-
Done
You can configure background style (default is Zoom) as usual using standard Gnome background dialog.
How it works
-
This patch will generate file ~/.shotwell/wallpaper/wallpaper.xml in the fashion of /usr/share/backgrounds/cosmos/background-1.xml
-
It will also automatically export any altered photo to ~/.shotwell/wallpaper/, optimized for your current screen resolution
Technical details (from code point of view)
Implementation is pretty straight-forward. Since I lack vala skills, I have to say that I may have made some obvious mistakes. Since this feature is important to me, I'm willing to work on any problems with my patch and drive it to successful integration.
A few things probably worth mentioning:
-
set_background_slideshow() usually executes pretty fast so it does not display progress dialog for at least one second in order to avoid flickering; after that, if there still is some work to do, progress dialog is displayed.
-
Right now a rotated image does not seem to has_alterations(), which is why it is not exported and therefore is displayed incorrectly.
-
I also provided Russian translation for new stuff and a few old that didn't have entries in ru.po
Comment 5
Updated by Adam Dingle about 3 years ago
- Priority set to High
Comment 6
Updated by Adam Dingle about 3 years ago
- Subject changed from rotate desktop background to [strings] rotate desktop background
Comment 7
Updated by Jim Nelson about 3 years ago
- Status changed from Open to Review
- Assignee changed from Anonymous to Maxim -
perezk,
Great to see this patch. This is a cool, cool feature.
Few things:
- Thank you for the translations, however we prefer translations come in via a separate channel. Vera is our translations guru; when I commit I'll forward on your changes to her. They'll be committed separately.
- Really like how the menu item changes name and functionality depending on how many photos are selected.
- In CollectionPage.on_set_background(), we can no longer rely on the fact that all the items are Photos; they may be Videos now. Both descend from a common ancestor, MediaSource. So, when you cast from get_selected_at().get_source(), you should verify it's a photo before continuing. The “as†keyword is helpful here:
Photo? photo = get_source() as Photo;
if (photo == null)
return;
Also, I realize that this code doesn't exist in trunk, i.e. it's a bug. But since we're changing this, might as well change that as well. B-)
- Regarding the dialog, since the value being changed isn't really a continuous value but discrete chunks (1 second, 15 seconds, one day, etc.) doesn't it make sense to use a dropdown menu or a series of radio buttons? Given the number of values, I would say a dropdown makes more sense.
- The problem you see with has_alterations() is that it's specific to transformations that must be expressed in the image itself (i.e. must be re-encoded to reflect them on export). Orientation/rotation can be modified via a metadata field that does not require re-encoding. For your purposes, you want to use has_transformations().
-- Jim
Comment 8
Updated by Jim Nelson about 3 years ago
One more thing: You should svn up and merge your patch. We're going into heavy bug-fixing mode right now and trunk should start getting more active.
Comment 9
Updated by Bengt Thuree about 3 years ago
Just wanted to say that I am really looking forward to see this one hit trunk :)
Definitely another thing to get me to skip my current system and start using Shotwell.
Love that you use the GNOME method, although it might be some issues for KDE perhaps or?
Comment 10
Updated by Maxim - about 3 years ago
In CollectionPage.on_set_background(), we can no longer rely on the fact that all the items are …
Not sure I understand this: on_set_background() can only be called if there are no videos selected. update_actions() takes care of this. Or you meant that we should allow “Set as Background†even if there are videos in selection and just filter them out afterwards?
Regarding the dialog, since the value being changed isn't really a continuous value but discrete chunks (1 second, 15 seconds, one day, etc.) doesn't it make sense to use a dropdown menu or a series of radio buttons? Given the number of values, I would say a dropdown makes more sense.
I don't feel like making a dropdown menu because
-
it requires one more mouse click than a slider;
-
it feels natural that time value is a horizontal scale – almost everywhere when you see a diagram, time is on X-axis. My horizontal scale represent this X-axis and I hope improves intuitive understanding of what that scale is for it.
In spirit of eating the cake and having it, I'll re-make the scale so that they update value [almost] continuously.
The problem you see with has_alterations() is that it's specific to transformations that must be expressed in the image itself (i.e. must be re- encoded to reflect them on export). Orientation/rotation can be modified via a metadata field that does not require re-encoding. For your purposes, you want to use has_transformations().
Doesn't look like it. Either the code that makes what you describe here is not in the trunk, or I am missing something (again). In fact, has_transformations() essentially is a part of has_alterations() and if the latter is false, the former must also be false (and it is according to my tests).
Comment 11
Updated by Jim Nelson about 3 years ago
Regarding on_set_background(), yes, the GtkAction is supposed to catch that, but as a policy we do simply sanity checking in our event handlers and quietly bail out if anything is amiss. This is purely defensive programming due to the logic enabling/disabling the action being separate from the action handler itself.
We can live with the slider, but I think what's bothersome is that is appears as a continuous movement for discrete values. For example, if I move it to “1 dayâ€, I can wiggle left and right, but it's not a little less or a little more than a day, it's always one day. Could you add tick marks to the slider and have it jump from mark to mark? That would make more sense.
Also, note that the GNOME interface guidelines want the dialog's title to match the menu item label (“Set as Desktop Backgroundâ€). Something we also noticed: it'd be nice if there was a little more white space in the dialog box separating the controls. You might consult the GNOME HIG for examples: http://library.gnome.org/devel/hig-book/stable/design-window.html.en#layout- dialogs
Finally, you are correct, I was writing my comments about has_transformations() last night a bit bleary eyed and didn't put it all together. has_transformations() returns true if the image is altered; has_alterations() returns true if there are transformations or any updated metadata. Since the concern for the desktop background is purely related to the image, I still think you only want to use has_transformations(). The only reason I can imaging exporting an untransformed image is to scale it down for the desktop manager to save CPU when loading, decoding, and scaling the image. (That might be reason enough, now that I think about it.)
Another bug I discovered: If the user selects RAW files, the desktop manager won't rotate them. RAW files will need to be exported.
Comment 12
Updated by Maxim - about 3 years ago
OK, I think I took into account all your concerns.
Here's description of difference wrt to previous patch:
-
Dialog now has the same title as menu item (“Set as Desktop Slideshow…†)
-
Increased space between elements according to Gnome HIG (I hope)
-
If .raw file is encountered, it is always exported first
-
Time slider remains, but now it updates time almost continuously (within reasonable boundaries, i.e. you can't specify exact time 3 hours 1 minute and 56 seconds, just 3 hours)
-
All videos in the collection for background slideshow are filtered out silently
-
Removed all translations
Comment 13
Updated by Adam Dingle about 3 years ago
@perezk,
thanks for this latest patch. Jim (the Shotwell tech lead) is out today, but I expect he'll be able to look at your patch tomorrow. I have just a few comments on its functionality:
- GNOME dialogs are supposed to have the same name as the menu item which invokes them, but without the ellipsis (“…â€). So the title should actually be “Set as Desktop Slideshowâ€.
- In on_delay_scale_value_changed(), you can't simply concatenate a number with a word like “minutesâ€, because plural forms in many languages change depending on the particular number. You need to use ngettext() in this situation. Seehttp://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms. Once you've done this, the slider will display correct plurals like “1 minute†rather than “1 minutesâ€.
Otherwise this is looking good. Our string freeze for Shotwell 0.8 is this Wednesday, which means that's the last day to commit any code changes which involve new strings (like this one). It would be great if you could make a new patch iteration addressing the points above and send it to us by the end of Tuesday.
Comment 14
Updated by Maxim - almost 3 years ago
Both problems you mentioned fixed in this updated patch.
Comment 15
Updated by Jim Nelson almost 3 years ago
- Status changed from Review to 5
- Resolution set to fixed
- % Done changed from 0 to 100
Committed. I made some changes to how the XML file was generated and to use the Exporter object. Thanks!
r2380
Comment 16
Updated by Maxim - almost 3 years ago
Thanks for integrating this!
I have a few concerns, though:
-
shotwell now exports all selected photos, not only altered; it takes forever on a slow machine and of course it eats up hdd space (not a lot, but still);
-
export progress dialog is now displayed immediately and if there are only a few photos to export, it only appears to show nothing and to disappear again in a flicker of second;
-
in “Set as Desktop Background†dialog, time is displayed as “1 minuteâ€, “1 hourâ€, but “one dayâ€; this better be consistent – “one minute/hour†or “1 dayâ€.
Problems mentioned above did not exist in my diffs, so I volunteer to fix them provided that you too consider those to be problems rather than features.
Thing I didn't think of before:
- if there are two different photos selected with the same file name, they will overwrite each other during export to one folder. This obviously needs to be fixed.
Comment 17
Updated by Adam Dingle almost 3 years ago
- Status changed from 5 to 4
-
Resolution deleted (
<strike>
_fixed_</strike>
) - % Done changed from 100 to 0
Comment 18
Updated by Jim Nelson almost 3 years ago
- Status changed from 4 to 5
- Resolution set to fixed
- % Done changed from 0 to 100
Replying to [comment:17 perezk]:
– shotwell now exports all selected photos, not only altered; it takes forever on a slow machine and of course it eats up hdd space (not a lot, but still);
This is done because I noticed that large photos (>= 8 megapixels) were taking a long time to render for display on the desktop and spiking the CPU. By exporting all the images at desktop size, it avoids the scaling time. Yes, it takes longer to prepare the files, but that's a one-time cost compared to having your system periodically going busy. (More noticeable when the slideshow is running frequently, obviously, but if we're allowing 5 second intervals, we should be prepared for them.)
If the worry is about disk space, then yes, we could reconsider this algorithm. But, as we worked through on the diff, if the photo is modified or not supported by GDK (i.e. RAW), we'll need to export it anyway. There's an additional problem I was working around: the GNOME desktop does not respect the EXIF rotation flag, meaning that portrait-oriented photos are displayed on their side (#1297 (closed)). Exporting them scaled solves this problem as well.
– export progress dialog is now displayed immediately and if there are only a few photos to export, it only appears to show nothing and to disappear again in a flicker of second;
This is a separate issue and should be ticketed separately. What I wanted to avoid was yet another hand-coded export progress dialog box and instead use common code. I've ticketed this here: #2874 (closed)
– in “Set as Desktop Background†dialog, time is displayed as “1 minuteâ€, “1 hourâ€, but “one dayâ€; this better be consistent – “one minute/hour†or “1 dayâ€.
I see the bug -- it actually only manifests itself at the upper end, “one dayâ€. I've corrected this: r2389
– if there are two different photos selected with the same file name, they will overwrite each other during export to one folder. This obviously needs to be fixed.
This is ticketed at #2608 (closed). Again, rather than fix this in every instance that export is required, I'd rather correct it in common code.
If you find other problems, please ticket them separately. Thanks.
Comment 19
Updated by Charles Lindsay 7 months ago
- Status changed from 5 to Fixed
--- Bug imported by chaz@yorba.org 2013-11-25 21:42 UTC ---
This bug was previously known as bug 1296 at http://redmine.yorba.org/show_bug.cgi?id=1296 Imported an attachment (id=261544) Imported an attachment (id=261545)
Unknown Component Using default product and component set in Parameters Unknown version " in product shotwell. Setting version to "!unspecified". 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: RESOLVED FIXED