Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce named instances #1204

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pdf_viewer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,8 @@ int main(int argc, char* args[]) {
}

#ifndef SIOYEK_ANDROID
RunGuard guard("sioyek");
char* instance_name = get_argv_value(argc, args, "--instance-name");
RunGuard guard(instance_name ? instance_name : "sioyek");
if (!guard.isPrimary()) {
QStringList sent_args = convert_arguments(app.arguments());
bool should_wait = parser->isSet("wait-for-response");
Expand Down
3 changes: 3 additions & 0 deletions pdf_viewer/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,9 @@ QCommandLineParser* get_command_line_parser() {
//new_instance_option.setDescription("When opening a new file, create a new instance of sioyek.");
//parser->addOption(new_instance_option);

QCommandLineOption instance_name_option("instance-name", "Select a specific sioyek instance by name.", "name");
parser->addOption(instance_name_option);

QCommandLineOption new_window_option("new-window");
new_window_option.setDescription("Open the file in a new window but within the same sioyek instance (reuses the previous window if a sioyek window with the same file already exists).");
parser->addOption(new_window_option);
Expand Down
4 changes: 4 additions & 0 deletions resources/sioyek.1
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,10 @@ is set in a preference file (see below), then open a tutorial PDF.

Displays version information
.HP
.B --instance-name

Select a specific sioyek instance by name.
.HP
.B --new-window

Open the file in a new window but within the same sioyek instance.
Expand Down
Loading