diff options
| author | Alexander Valavanis <valavanisalex@gmail.com> | 2018-03-04 23:18:09 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2018-03-04 23:18:09 +0000 |
| commit | ace52f0b8ac77a8abd63facf02ef329b0aeedd0c (patch) | |
| tree | fae09520c99ec740aea5a3de3fd689275142dfc3 /src/inkview.cpp | |
| parent | ui/monitor: Fix const qualification (diff) | |
| download | inkscape-ace52f0b8ac77a8abd63facf02ef329b0aeedd0c.tar.gz inkscape-ace52f0b8ac77a8abd63facf02ef329b0aeedd0c.zip | |
Inkview: Split options code out
Diffstat (limited to 'src/inkview.cpp')
| -rw-r--r-- | src/inkview.cpp | 65 |
1 files changed, 1 insertions, 64 deletions
diff --git a/src/inkview.cpp b/src/inkview.cpp index 5b27e9168..f3e5ccdfc 100644 --- a/src/inkview.cpp +++ b/src/inkview.cpp @@ -33,7 +33,6 @@ #include <libxml/tree.h> -#include <glibmm.h> #include <glibmm/i18n.h> #include "document.h" @@ -45,69 +44,7 @@ #include "inkgc/gc-core.h" #include "io/sys.h" #include "svg-view-slideshow.h" - - - - - -/** - * \brief Set of command-line options for Inkview - */ -class InkviewOptionsGroup : public Glib::OptionGroup -{ -public: - // list of all input filenames; - // this list contains all arguments that are not recognized as an option (so needs to be checked) - Glib::OptionGroup::vecustrings filenames; - - bool fullscreen = false; // whether to launch in fullscreen mode - bool recursive = false; // whether to search folders for SVG files recursively - int timer = 0; // time (in seconds) after which the next image of the slideshow is automatically loaded - double scale = 1; // scale factor for images - // (currently only applied to the first image - others are resized to window dimensions) - - InkviewOptionsGroup() : Glib::OptionGroup(N_("Inkscape Options"), - N_("Default program options")) - { - // Entry for the "fullscreen" option - Glib::OptionEntry entry_fullscreen; - entry_fullscreen.set_short_name('f'); - entry_fullscreen.set_long_name("fullscreen"); - entry_fullscreen.set_description(N_("Launch in fullscreen mode")); - add_entry(entry_fullscreen, fullscreen); - - // Entry for the "recursive" option - Glib::OptionEntry entry_recursive; - entry_recursive.set_short_name('r'); - entry_recursive.set_long_name("recursive"); - entry_recursive.set_description(N_("Search folders recursively")); - add_entry(entry_recursive, recursive); - - // Entry for the "timer" option - Glib::OptionEntry entry_timer; - entry_timer.set_short_name('t'); - entry_timer.set_long_name("timer"); - entry_timer.set_arg_description(N_("NUM")); - entry_timer.set_description(N_("Change image every NUM seconds")); - add_entry(entry_timer, timer); - - // Entry for the "scale" option - Glib::OptionEntry entry_scale; - entry_scale.set_short_name('s'); - entry_scale.set_long_name("scale"); - entry_scale.set_arg_description(N_("NUM")); - entry_scale.set_description(N_("Scale image by factor NUM")); - add_entry(entry_scale, scale); - - // Entry for the remaining non-option arguments - Glib::OptionEntry entry_args; - entry_args.set_long_name(G_OPTION_REMAINING); - entry_args.set_arg_description(N_("FILES/FOLDERS…")); - - add_entry(entry_args, filenames); - } -}; - +#include "inkview-options-group.h" /** get a list of valid SVG files from a list of strings */ std::vector<Glib::ustring> get_valid_files(std::vector<Glib::ustring> filenames, bool recursive = false, bool first_iteration = false) |
