Bug 452017 - Feature to rename open PDF files with F2 keyboard shortcut
Summary: Feature to rename open PDF files with F2 keyboard shortcut
Status: ASSIGNED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Snap Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-29 03:47 UTC by Kevin Flynn
Modified: 2024-02-08 11:19 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
attachment-4183-0.html (1.24 KB, text/html)
2022-04-02 09:17 UTC, Kevin Flynn
Details
attachment-23276-0.html (1.92 KB, text/html)
2022-04-02 22:05 UTC, Kevin Flynn
Details
Rename with gwenview (59.47 KB, image/jpeg)
2024-01-24 17:43 UTC, Alexis-Emmanuel Haeringer
Details
Rename with Okular (54.10 KB, image/jpeg)
2024-01-24 17:44 UTC, Alexis-Emmanuel Haeringer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Flynn 2022-03-29 03:47:47 UTC
SUMMARY
Unlike SumatraPDF, Okular can't rename an open PDF file if you click F2 on your keyboard.
This is a nifty little feature that lets you view a document and rename it to a more human readable form (since PDFs usually come with horrible machine generated file names).

STEPS TO REPRODUCE
1. Open a PDF in Okular.
2. Click F2

OBSERVED RESULT
1. No rename dialog comes up.

EXPECTED RESULT
1. A rename dialog pops up that lets you rename the currently open file.

SOFTWARE/OS VERSIONS
All versions.

ADDITIONAL INFORMATION
Thank you so much for producing such a wonderful piece of software.
Comment 1 Nate Graham 2022-04-01 18:09:42 UTC
Seems reasonable to me. Gwenview lets you do this.
Comment 2 andreas.naumann 2022-04-01 18:26:39 UTC
Are you really talking about the filename, or the pdf title? 

If you are talking about the filename, than what is wrong with "save as" in the menu below file? On my system it has the shortcut "ctrl-shift-s". So, maybe the user could simply set a user-defined short cut for that?
Comment 3 Nate Graham 2022-04-01 19:19:20 UTC
I assume it's about renaming the file.

Save As creates a copy; renaming isn't the same thing.
Comment 4 andreas.naumann 2022-04-01 19:36:34 UTC
When I select "save as", I get a "save as"-dialoge. That dialog allows to save the file with a new name AND rename existing files. In particular, if I press F2 in the "save as" dialog, I get the "rename element" dialog for the current file.
Comment 5 andreas.naumann 2022-04-01 19:38:29 UTC
If you want to rename the file with shortcuts only, you can use ctrl+shift+S followed by F2.
Comment 6 Kevin Flynn 2022-04-02 03:52:24 UTC
(In reply to andreas.naumann from comment #5)
> If you want to rename the file with shortcuts only, you can use ctrl+shift+S
> followed by F2.

That doesn't rename a file, it only creates a new file with the name you want. The old file is still there with its old name.
Comment 7 Kevin Flynn 2022-04-02 03:54:14 UTC
Try using Okular in Ubuntu, there is no rename dialog.
Comment 8 andreas.naumann 2022-04-02 08:44:00 UTC
I tried my suggestion using
  * ubuntu version: 20.04 (LTS)
  * okular version (snap): 20.12.3

Using "file -> save as" shows the file dialog window of the system, this time the unity dialog. Here, I can only right click on the file name, and select rename. 

Thus you can rename the file, but I lack the shortcut. But that seems to be a lacking feature in unity, not in okular.
Comment 9 Kevin Flynn 2022-04-02 09:17:33 UTC
Created attachment 147889 [details]
attachment-4183-0.html

You are not renaming the file you are just saving a new file with a
different name

On Sat, 2 Apr 2022, 7:44 pm , <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=452017
>
> --- Comment #8 from andreas.naumann@kdemail.net ---
> I tried my suggestion using
>   * ubuntu version: 20.04 (LTS)
>   * okular version (snap): 20.12.3
>
> Using "file -> save as" shows the file dialog window of the system, this
> time
> the unity dialog. Here, I can only right click on the file name, and select
> rename.
>
> Thus you can rename the file, but I lack the shortcut. But that seems to
> be a
> lacking feature in unity, not in okular.
>
> --
> You are receiving this mail because:
> You reported the bug.
> You are on the CC list for the bug.
Comment 10 andreas.naumann 2022-04-02 09:52:18 UTC
(In reply to Kevin Flynn from comment #9)
> Created attachment 147889 [details]
> attachment-4183-0.html
> 
> You are not renaming the file you are just saving a new file with a
> different name
> 
> On Sat, 2 Apr 2022, 7:44 pm , <bugzilla_noreply@kde.org> wrote:
> 

Please keep in mind, that the rename option is selected in the file dialog. That the menu entry in okular is called "save as", and the window title is "save as", does not matter at all. 
Strictly speaking, I do NOT save the file with a new name. After renaming the file, you can close that dialog using esc, or in what way you like.

Please do, as stated and check the result.
Comment 11 andreas.naumann 2022-04-02 10:45:36 UTC
Using KDE allows to use the file-open dialog to achieve the same. Sadly, the file-open dialog in unity does not provide a rename, at least not in the live system of ubuntu-20.04.

The procedure would be:
1. start the "file open" dialog (using file -> open, or ctrl + O)
2. click the old file name in the file list using the right mouse button
3. select "rename" from the options
4. type the new file name

That procedure worked for me using KDE. There I can start typing the old name, until it is highlighted and press F2 for renaming.
Comment 12 Kevin Flynn 2022-04-02 22:05:03 UTC
Created attachment 147910 [details]
attachment-23276-0.html

Try the experience of pressing F2 in Sumatra PDF (in wine) or in Glenview.
It's more efficient and user-friendly.

On Sat, 2 Apr 2022, 9:45 pm , <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=452017
>
> andreas.naumann@kdemail.net changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |
> andreas.naumann@kdemail.net
>
> --- Comment #11 from andreas.naumann@kdemail.net ---
> Using KDE allows to use the file-open dialog to achieve the same. Sadly,
> the
> file-open dialog in unity does not provide a rename, at least not in the
> live
> system of ubuntu-20.04.
>
> The procedure would be:
> 1. start the "file open" dialog (using file -> open, or ctrl + O)
> 2. click the old file name in the file list using the right mouse button
> 3. select "rename" from the options
> 4. type the new file name
>
> That procedure worked for me using KDE. There I can start typing the old
> name,
> until it is highlighted and press F2 for renaming.
>
> --
> You are receiving this mail because:
> You reported the bug.
> You are on the CC list for the bug.
Comment 13 Alexis-Emmanuel Haeringer 2024-01-24 17:43:27 UTC
Created attachment 165193 [details]
Rename with gwenview
Comment 14 Alexis-Emmanuel Haeringer 2024-01-24 17:44:05 UTC
Created attachment 165194 [details]
Rename with Okular
Comment 15 Alexis-Emmanuel Haeringer 2024-01-24 17:44:49 UTC
Thanks I've just added F2 alternate shorcut to CTRL+S!

However, the rename action according to Gwenview offering the old name in the input field, instead of empty one.

For my part, intuitively, "save as" should have worked like "export as". And therefore would have allowed the creation of a second file.
Comment 16 Pratham Gandhi 2024-01-25 20:21:35 UTC
I'll have to agree with Kevin here. The use of the Save As dialogue just for renaming purposes seems like a very roundabout way of doing things. If a dialogue box says "Save As", I would expect to have to open it only for saving a new file based on an existing one (maybe with a different name), and not just close it after doing something in the dialog that was not directly intended.
Comment 17 Bug Janitor Service 2024-02-08 11:19:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/922