lib/rabbit/command/rabbit.rb in rabbit-2.1.2 vs lib/rabbit/command/rabbit.rb in rabbit-2.1.3

- old
+ new

@@ -1,6 +1,6 @@ -# Copyright (C) 2004-2013 Kouhei Sutou <kou@cozmixng.org> +# Copyright (C) 2004-2014 Kouhei Sutou <kou@cozmixng.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. @@ -83,10 +83,11 @@ options.allotted_time = ENV["RABBIT_ALLOTTED_TIME"] options.base = nil options.source_type = :auto options.full_screen = false options.index_mode = false + options.initial_slide = 0 options.geometry = nil options.width = 800 options.height = 600 options.paper_width = nil options.paper_height = nil @@ -212,11 +213,17 @@ _("Toggle index mode."), "(#{options.index_mode ? 'on' : 'off'})") do |bool| options.index_mode = bool end + parser.on("--initial-slide=N", Integer, + _("Show the Nth slide. (zero-based)"), + "(#{options.initial_slide})") do |n| + options.initial_slide = n + end + parser.category _("Size") parser.on("-g", "--geometry=GEOMETRY", _("Set window geometry [GEOMETRY]."), _("Format: WIDTHxHEIGHT+X+Y"), @@ -853,20 +860,20 @@ if @options.show_native_window_id and native_window.respond_to?(:xid) @logger.info(_("Window ID: %d") % native_window.xid) end apply_theme_if_need(frame) parse(frame, source, !Utils.windows?) + canvas.move_to_if_can(@options.initial_slide) canvas.activate("ToggleIndexMode") if @options.index_mode front = make_front(canvas) setup_druby(front) if @options.use_druby setup_soap(front) if @options.use_soap setup_xmlrpc(front) if @options.use_xmlrpc Gtk.main true - false end def do_server ::Rabbit.gui_init