Use window title to suggest file names
Closed, ResolvedPublic

rominf created this task.Feb 21 2018, 10:57 AM
rominf triaged this task as Normal priority.

I already implemented windows title extraction and '%W' placeholder. Now I'm wondering how do I implement gui.

@rkflx Can you mock the GUI? I cannot find the solution that satisfies me.

This comment was removed by rominf.
rkflx added a comment.EditedFeb 21 2018, 12:46 PM

Wow, that was fast!

@rkflx Can you mock the GUI? I cannot find the solution that satisfies me.

Not sure what you have in mind, I attempt to answer anyway ;)

What's wrong with adding the placeholder as an additional option to the already existing placeholders? I guess the only caveat is that this applies only if you capture an actual window. Looking at your patch in D10709, that seems what you struggle with a bit, i.e. trying to provide options for both cases.

I wouldn't do that and just keep it simple in both UI and implementation. As a workaround for the caveat you could just use something like "Desktop", "Region" or "All Monitors" for the other cases. Or does Plasma even set a nice window name for itself? Apart from that (or as an additional %w?), returning an empty string in those cases would be fine too.

Also I noticed that the bug wants "Window title โ€” Application name", but you currently only have "Window Title". What about providing both, so you could do something like %W โ€“ %A? That would be flexible and should satisfy most needs.

As for whether to include the window title by default or not, let's postpone this discussion for a moment. (Although I wonder what other popular screenshot tools (also on other platforms) use as default filenames?)

@rkflx Not sure if I understand you correctly. Do you propose to expand '%W' to window caption if that was a window screenshot, and to "Desktop", "Region" and "All monitors" for the other cases?

rkflx added a comment.Feb 21 2018, 1:25 PM

It was just an idea, not sure if good in the end or not. I'm just trying to guess what you want to achieve and what it is you are currently unsatisfied about. Let's do it this way: You provide some example filenames you want to support for all different kind of options users can set in Spectacle, and then we can figure out how to best fit those into the config UI, where to make compromises etc.

Also you can look at how it's done in Gwenview's importer (gwenview_importer ., click on Settings), but I guess that would be material for a later patch anyway.

@rkflx, I agree with you. I changed the template to the one you've proposed.

I installed Greenshot on my laptop to see how does it save screenshots. It uses similar policy: "Greenshot" at the end for fullscreen screenshots (I don't like it, I would use just "Screenshot") and window's title for region screenshots. I think that our policy is even better.

What do you think?

rkflx added a comment.Feb 21 2018, 4:59 PM
In T8036#129542, @rkflx wrote:

Also you can look at how it's done in Gwenview's importer (gwenview_importer ., click on Settings), but I guess that would be material for a later patch anyway.

I made two new junior jobs out of this:
https://bugs.kde.org/show_bug.cgi?id=381175
https://bugs.kde.org/show_bug.cgi?id=390856

First come, first served, but make sure to add a note if you start working on something to avoid clashing again ;)