Added option --new-window to remotely open a new window.

This commit is contained in:
Gergely Polonkai 2013-09-17 09:32:51 +02:00
parent b7d248e91e
commit 7b88879736

View File

@ -15,10 +15,12 @@
GtkBuilder *builder; GtkBuilder *builder;
static gboolean option_quit; static gboolean option_quit;
static gboolean option_version; static gboolean option_version;
static gboolean option_new_window;
static GOptionEntry options[] = { static GOptionEntry options[] = {
{ "version", 'v', 0, G_OPTION_ARG_NONE, &option_version, N_("Display version and exit"), NULL }, { "new-window", 'n', 0, G_OPTION_ARG_NONE, &option_new_window, N_("Opens a new Astrognome window"), NULL },
{ "quit", 'q', 0, G_OPTION_ARG_NONE, &option_quit, N_("Quit any running Astrognome"), 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 } { NULL }
}; };
@ -42,7 +44,11 @@ struct print_data {
static void static void
run_action(AgApp *app, gboolean is_remote) 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); ag_app_quit(app);
} else if (is_remote) { } else if (is_remote) {
ag_app_raise(app); ag_app_raise(app);