Bug 455704 - Wishlist: add command line options to force file opening in tab or in new window
Summary: Wishlist: add command line options to force file opening in tab or in new window
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 22.04.2
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-21 09:14 UTC by Sergio
Modified: 2024-08-03 10:02 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio 2022-06-21 09:14:40 UTC
SUMMARY

Please consider adding a command line option to force the opening of the document(s) passed on the command line in a tab of an existing okular instance or in a new window. E.g. `okular --new-tab file.pdf` or `okular --new-window file.pdf`.  

Rationale:

This eases opening 2 documents in separated windows that can be placed side to side for comparing them, even if as a general setting one prefers having the "open new files in tabs" option set.
Comment 1 andreas.naumann 2022-06-21 18:28:10 UTC
I have some questions to that feature request:

1. How should new-window behave with multiple files? open all files in the new instance and one tab per file in case "use-tabs" is enabled? (if use-tabs is disabled, okular will use multiple instances/windows anyway) or should it open one window per file? 
  I suggest to call the option "new-instance" and then open all files in tabs. If "use-tabs" is disabled then "new-instance" will have no effect.

2. If the users want to use tab, they can enable them. Thus, I see no real use in "--new-tab". 

3. Instead of "--new-tab", I would prefer something like "--target <okular-dbus-name>" . That flag would open all files in new tabs of the specified instance. Does that qualify for another feature request?
Comment 2 Sergio 2023-11-10 14:58:08 UTC
Late answer to the questions:

> 1. How should new-window behave with multiple files? 
> open all files in the new instance and one tab per file in case "use-tabs" is enabled?
> (if use-tabs is disabled, okular will use multiple instances/windows anyway) or should it open
> one window per file?
> I suggest to call the option "new-instance" and then open all files in tabs.
> If "use-tabs" is disabled then "new-instance" will have no effect.

100% in agreement. `--new-instance` is a better name and all files passed on that command line should open in tabs of the new instance.

> 2. If the users want to use tab, they can enable them. Thus, I see no real use in "--new-tab".

In fact, you are right.

>  3. Instead of "--new-tab", I would prefer something like "--target <okular-dbus-name>" .
> That flag would open all files in new tabs of the specified instance.

Nice idea
Comment 3 Sergio 2024-08-03 10:02:09 UTC
Wonder if at least the `--new-instance` parameter could be introduced.
Currently, there is this undocumented behavior so that if you want a new instance you can call `okular` without any parameters. In this case, even if an okular instance is already open, rather than "rising its windows" the invocation causes a new okular instance to be opened. At this point, you need to open files in it via menus and dialogs though.