[devhelp] main: new `--new-window' command line option



commit 59ba13a3d4ca5eb23e5c9beef213ee6ecb062b43
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Tue Jun 12 12:51:27 2012 +0200

    main: new `--new-window' command line option
    
    We also want to be able to create new windows from command line calls. This is
    implicit if Devhelp is not already running, but needs a special treatment
    otherwise.

 src/dh-main.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/dh-main.c b/src/dh-main.c
index 2dd3117..4b9c5c7 100644
--- a/src/dh-main.c
+++ b/src/dh-main.c
@@ -36,6 +36,7 @@
 #include "dh-window.h"
 #include "dh-assistant.h"
 
+static gboolean  option_new_window;
 static gchar    *option_search;
 static gchar    *option_search_assistant;
 static gboolean  option_quit;
@@ -43,6 +44,11 @@ static gboolean  option_focus_search;
 static gboolean  option_version;
 
 static GOptionEntry options[] = {
+        { "new-window", 'n',
+          0, G_OPTION_ARG_NONE, &option_new_window,
+          N_("Opens a new Devhelp window"),
+          NULL
+        },
         { "search", 's',
           0, G_OPTION_ARG_STRING, &option_search,
           N_("Search for a keyword"),
@@ -75,7 +81,10 @@ static void
 run_action (DhApp *application,
             gboolean is_remote)
 {
-        if (option_quit) {
+        if (option_new_window) {
+                if (is_remote)
+                        dh_app_new_window (application);
+        } else if (option_quit) {
                 dh_app_quit (application);
         } else if (option_search) {
                 dh_app_search (application, option_search);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]