]> www.fi.muni.cz Git - evince.git/blobdiff - shell/main.c
Patch from Nickolay Shmyrev to fix the -p option, #170458
[evince.git] / shell / main.c
index b0a0b76a3afc5796b3ae6261fedeba931fecb1a6..827c6968ca1baac77ccc96afd6381d4664bf863c 100644 (file)
 #include "ev-job-queue.h"
 #include "ev-file-helpers.h"
 
+static char *page_label;
+
 static struct poptOption popt_options[] =
 {
+       { "page-label", 'p', POPT_ARG_STRING, &page_label, 0, N_("The page of the document to display."), N_("PAGE")},
        { NULL, 0, 0, NULL, 0, NULL, NULL }
 };
 
@@ -59,9 +62,14 @@ load_files (const char **files)
                window = GTK_WIDGET (ev_application_new_window (EV_APP));
                gtk_widget_show (window);
                ev_window_open (EV_WINDOW (window), uri);
+               
+               if (page_label != NULL)
+                       ev_window_open_page_label (EV_WINDOW (window), page_label);
 
                g_free (uri);
         }
+
+       g_free (page_label);
 }
 
 int