Show preview of the filename in the save settings
ClosedPublic

Authored by davidre on Mar 14 2019, 11:45 PM.

Details

Summary

Shows the a preview of the configured filename template on the save settings page. I'm not sure about the placement of the label but the functionality should be there. This also again includes a small refactor to access the placeholder replacement from outside of the ExportManager.
BUG: 381175

Test Plan

Diff Detail

Repository
R166 Spectacle
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidre created this revision.Mar 14 2019, 11:45 PM
Restricted Application added a project: Spectacle. · View Herald TranscriptMar 14 2019, 11:45 PM
davidre requested review of this revision.Mar 14 2019, 11:45 PM
davidre edited the test plan for this revision. (Show Details)Mar 14 2019, 11:46 PM
davidre added a reviewer: VDG.

Overall nice idea

src/Gui/SettingsDialog/SaveOptionsPage.cpp
216

Not sure about the explicit label "Preview of filename"

ngraham added inline comments.
src/Gui/SettingsDialog/SaveOptionsPage.cpp
216

"Filename preview"

Also, let's format the filename in a monospaced font. Here's how you'd do that:

xi18nc("@info", "Preview of filename: <filename>%1.%2</filename>", filename, mSaveImageFormat->currentText().toLower())

davidre edited the summary of this revision. (Show Details)Mar 16 2019, 11:24 AM
davidre updated this revision to Diff 54009.Mar 16 2019, 11:30 AM
  • Show preview in typewriter font
davidre marked 2 inline comments as done.Mar 16 2019, 11:30 AM
davidre edited the test plan for this revision. (Show Details)
meven added a subscriber: meven.Mar 16 2019, 11:58 AM

Very nice !

I would suggest you to position the preview right below the filename field, above the placeholder section.
It would make it visually clearer what it is for and easier to use.

Very nice !

I would suggest you to position the preview right below the filename field, above the placeholder section.
It would make it visually clearer what it is for and easier to use.

Yeah, that could work.

davidre updated this revision to Diff 54025.Mar 16 2019, 5:22 PM
  • Move preview up
davidre edited the test plan for this revision. (Show Details)Mar 16 2019, 5:22 PM

I'm thinking of dropping the "Filename" now and just having "Preview:". For comparison:

meven added a comment.Mar 16 2019, 5:48 PM

I'm thinking of dropping the "Filename" now and just having "Preview:". For comparison:

I would be in favor as well since the context is clear now the preview is near the pattern.

davidre updated this revision to Diff 54040.Mar 16 2019, 8:24 PM
  • Drop explicit mention of 'Filename' in Label
davidre edited the test plan for this revision. (Show Details)Mar 16 2019, 8:25 PM

You could even make Preview: a left label in the formlayout, so everything would align nicely. :)

davidre updated this revision to Diff 54055.Mar 17 2019, 7:10 AM
  • Use form layout for filename preview
davidre edited the test plan for this revision. (Show Details)Mar 17 2019, 7:10 AM

Looks good! Just one little thing...

src/Gui/SettingsDialog/SaveOptionsPage.h
59

Indentation

davidre updated this revision to Diff 54131.Mar 17 2019, 6:45 PM
  • Fix indentation
ngraham requested changes to this revision.Mar 17 2019, 9:40 PM
ngraham added inline comments.
src/Gui/SettingsDialog/SaveOptionsPage.cpp
126

One more thing I missed, sorry: you don't need to add a space after the colon in the string. The formLayout ensures that there's adequate space automatically (and keeps all the colons aligned vertically).

This revision now requires changes to proceed.Mar 17 2019, 9:40 PM
davidre updated this revision to Diff 54179.Mar 18 2019, 8:56 AM
  • Remove space
davidre marked an inline comment as done.Mar 18 2019, 8:58 AM
ngraham accepted this revision.Mar 18 2019, 9:00 AM

Perfect. Thanks for another nice patch!

This revision is now accepted and ready to land.Mar 18 2019, 9:00 AM
This revision was automatically updated to reflect the committed changes.