Bug 358641 - Have Spectacle remember filename
Summary: Have Spectacle remember filename
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords: junior-jobs
: 383635 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-01-27 15:02 UTC by Albert
Modified: 2018-10-19 22:39 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In: 18.12.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Albert 2016-01-27 15:02:22 UTC
Previously, in ksnapshot, after taking the screenshot (in any mode) and saving with a specific filename (ie. screenshot.jpg), then taking a consecutive shot without closing the window, the filename would already be pre-populated in the "save as..." dialogue with a number attached (screenshot1.jpg, screenshot2.jpg, etc) remembering the base filename and file type.  
The current behavior resets filename to the one specified in the options (screenshot-yy-mm-dd-hh-mm-ss.png) forgetting both the base filename AND filetype.  
Please restore the original behavior as taking screenshots in a series for a related purpose should maintain the naming convention each time.

Reproducible: Always

Steps to Reproduce:
1.take screenshot, save with specific filename
2.take new screenshot using same window
3.go to save as... 

Actual Results:  
filename is reset to default

Expected Results:  
filename should maintain previous basename+number and file type
Comment 1 Trevor Parsons 2016-01-27 18:39:24 UTC
Spectacle should also default to opening the file-save dialog in the folder in which the previous screenshot was saved. In settings it could offer an override -- ie a radio button defaulting to "Save in last-used folder" but with the option to set it to "Always save in <user-defined folder>".

Albert mentions the number-incrementing feature which Ksnapshot used to implement when saving files (which is currently referred to as a serial number in Spectacle's 'Configure Save Options'). Ksnapshot would add a number to the end of the previous filename, and if the previous filename already contained a number, this would be incremented in the new suggested filename.

This was useful in many cases, but annoying in others.

For example, when I saved a screenshot as "live_blog_3.0_blog_edit_drafts_tab.png", and then took another screenshot, Ksnapshot would offer to save it as "live_blog_3.1_blog_edit_drafts_tab.png".

Ksnapshot assumed that any number within the filename was an existing serial number, even though it was in this case a software version number.

If the number incrementing feature is to be re-implemented in Spectacle, it would be good to make it a bit smarter -- e.g. perhaps it should only increment a number if it is at the end of the filename string (before the .png, .jpg etc), and not elsewhere in the filename string.

It would also be good to have the option to switch the number incrementing feature off, and just be presented with the previous filename.

Needless to say, Spectacle should then warn if the user attempts to save over an existing filename.
Comment 2 Quiralta 2016-02-18 19:37:02 UTC
Yep, this features are really missed from Spectacle, for example as I paint in Krita, I like to take snapshots of the process, with Ksnapshot, this was a breeze, In spectacle, for every screenshot one must manually add the name, file extension plus navigate to the desired folder. Its just not usable for my purposes and predefine a folder on the settings is not intuitive, I would have to change this every time a do a painting :D, I really hope this becomes a future feature.
Comment 3 Marcus Furlong 2016-07-05 04:48:20 UTC
Also having the same issue. It would be great if it would remember the last file extension used, and autoincrement if possible.  (Even just remembering the file extension would be a great usability fix)
Comment 4 Christian Herenz 2016-11-09 23:54:51 UTC
Yes - this is a big feature missing in spectacle compared to KSnapshot before.  Pleas
Comment 5 Nate Graham 2018-01-31 04:58:55 UTC
*** Bug 383635 has been marked as a duplicate of this bug. ***
Comment 6 null 2018-02-21 17:01:10 UTC
This needs some design work before work on this can start, but a quick idea would be to add a radio button:
() Use last filename (+number)
() Use template: ...
Comment 7 Albert 2018-06-28 23:19:22 UTC
After many months, I tried spectacle again, and almost everything is on par with ksnapshot, except this particular issue with the filename##

The new naming convention 
Screenshot_%Y%M%D_%H%m%S

is a workaround, since (in theory) you will never have a duplicate date/time.  However the original idea of having filename+[some number] that auto updates per screenshot doesnt seem to work.  

The only other thing is the ability to have multiple ksnapshot windows open (for different screenshot abilities that retain their settings) is lost.
Comment 8 Albert 2018-06-28 23:25:51 UTC
>>The only other thing is the ability to have multiple ksnapshot windows open (for different screenshot abilities that retain their settings) is lost.

nevermind that, it works when i switched to using "spectacle" as opposed to the org.kde.Spectacle dbus call in Shortcuts in System Settings
Comment 9 Emmanuel Revah 2018-07-04 21:22:23 UTC
I can only add that I've been sad (and lost trying out other programs) since Ksnapshot's easy file naming thing has left us.
Comment 10 Albert 2018-07-07 22:57:58 UTC
(In reply to Emmanuel Revah from comment #9)
> I can only add that I've been sad (and lost trying out other programs) since
> Ksnapshot's easy file naming thing has left us.

I was thinking that rather than the current 

"if filename exists, next time it will filename+(#+1)"

or the date format as shown above, perhaps dev can add another option %d or rather %Nd (where N is any number of 0s or none)
so that you can have the default format filename%ND.jpg (or whatever the user selects as file type)
since you already added the date format as a type, adding an integer shouldnt be too farfetched, right?
Comment 11 utecht 2018-08-28 13:47:20 UTC
I've submitted a patch to address this issue by making %Nd available when Spectacle composes the automatic file name: https://phabricator.kde.org/D15059
Comment 12 Nate Graham 2018-10-19 22:39:25 UTC
Git commit 754e1d3a92c13d9327f4dbf3ed9abb08083af7dd by Nate Graham, on behalf of Kyle Utecht.
Committed on 19/10/2018 at 22:34.
Pushed by ngraham into branch 'master'.

Add default file name token for (padded) sequential file numbering

Summary:
Default file name tokens %d will add an auto-incremented sequential file number when creating file names.
Numbering starts with 1. If the save directory has other files present with the same name (excluding
extension) but another number in the place of %d, the next number after that of the existing file will be
used to create the new file name.
The sequential number can be padded with %Nd where N is a number of total digits. If the padded token is
used in the
default file name, only file names with a number of the padded length or longer will be considered when
determining the next sequential number to use in the file name. For example, with the save name like
'Screenshot-%3d' and a save directory with only 'Screenshot-3,' the next generated file name will be
'Screenshot-001' since the existing file's number portion is not at least as long as the padded number
length.
Related: bug 373759
FIXED-IN: 18.12.0

Reviewers: alexeymin, ngraham

Reviewed By: alexeymin, ngraham

Subscribers: shubham, ngraham, alexeymin, #spectacle

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D16304

M  +47   -1    src/ExportManager.cpp
M  +4    -2    src/Gui/SettingsDialog/SaveOptionsPage.cpp
M  +3    -2    src/SpectacleConfig.cpp

https://commits.kde.org/spectacle/754e1d3a92c13d9327f4dbf3ed9abb08083af7dd