From 895e4f8c8be48a0a8d112d14618335f26aa9232d Mon Sep 17 00:00:00 2001 From: "Gergely POLONKAI (W00d5t0ck)" Date: Tue, 17 Sep 2013 13:28:07 +0200 Subject: [PATCH] Added the skeleton of command-line opening * It does nothing at the moment * --help output already reflects the file opening possibility --- src/ag-app.c | 12 +++++++++++- src/astrognome.c | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ag-app.c b/src/ag-app.c index a228827..c52ca04 100644 --- a/src/ag-app.c +++ b/src/ag-app.c @@ -165,6 +165,15 @@ startup(GApplication *gapp) setup_accelerators(app); } +static void +ag_app_open(GApplication *gapp, GFile **files, gint n_files, const gchar *hint) +{ + gint i; + + for (i = 0; i < n_files; i++) { + } +} + AgApp * ag_app_new(void) { @@ -175,7 +184,7 @@ ag_app_new(void) app = g_object_new(AG_TYPE_APP, "application-id", "eu.polonkai.gergely.Astrognome", - "flags", G_APPLICATION_FLAGS_NONE, + "flags", G_APPLICATION_HANDLES_OPEN, "register-session", TRUE, NULL); @@ -193,5 +202,6 @@ ag_app_class_init(AgAppClass *klass) GApplicationClass *application_class = G_APPLICATION_CLASS(klass); application_class->startup = startup; + application_class->open = ag_app_open; } diff --git a/src/astrognome.c b/src/astrognome.c index 02a425a..a468f8f 100644 --- a/src/astrognome.c +++ b/src/astrognome.c @@ -76,7 +76,7 @@ main(int argc, char *argv[]) option_quit = FALSE, option_new_window = FALSE; - if (!gtk_init_with_args(&argc, &argv, NULL, options, GETTEXT_PACKAGE, &err)) { + if (!gtk_init_with_args(&argc, &argv, _("[FILEā€¦]"), options, GETTEXT_PACKAGE, &err)) { g_printerr("%s\n", err->message); return EXIT_FAILURE;