From 7b88879736ef7c3d8d579e7e1b6a0c8d32f1b811 Mon Sep 17 00:00:00 2001 From: "Gergely POLONKAI (W00d5t0ck)" Date: Tue, 17 Sep 2013 09:32:51 +0200 Subject: [PATCH] Added option --new-window to remotely open a new window. --- src/astrognome.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/astrognome.c b/src/astrognome.c index 19cef32..a13fc52 100644 --- a/src/astrognome.c +++ b/src/astrognome.c @@ -15,10 +15,12 @@ GtkBuilder *builder; static gboolean option_quit; static gboolean option_version; +static gboolean option_new_window; static GOptionEntry options[] = { - { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version, N_("Display version and exit"), NULL }, - { "quit", 'q', 0, G_OPTION_ARG_NONE, &option_quit, N_("Quit any running Astrognome"), NULL }, + { "new-window", 'n', 0, G_OPTION_ARG_NONE, &option_new_window, N_("Opens a new Astrognome window"), NULL }, + { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version, N_("Display version and exit"), NULL }, + { "quit", 'q', 0, G_OPTION_ARG_NONE, &option_quit, N_("Quit any running Astrognome"), NULL }, { NULL } }; @@ -42,7 +44,11 @@ struct print_data { static void run_action(AgApp *app, gboolean is_remote) { - if (option_quit) { + if (option_new_window) { + if (is_remote) { + ag_app_new_window(app); + } + } else if (option_quit) { ag_app_quit(app); } else if (is_remote) { ag_app_raise(app);