diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2018-11-25 17:31:30 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2018-11-25 17:31:30 +0000 |
| commit | 4ccd87725f22c8ea5fff4ef865b11e3c564d7520 (patch) | |
| tree | 87dd8ba211f412a12d7d68eb2fa4f210f2493f07 /src/inkscape-application.cpp | |
| parent | Remove unused variable. (diff) | |
| download | inkscape-4ccd87725f22c8ea5fff4ef865b11e3c564d7520.tar.gz inkscape-4ccd87725f22c8ea5fff4ef865b11e3c564d7520.zip | |
Add file export actions.
Diffstat (limited to 'src/inkscape-application.cpp')
| -rw-r--r-- | src/inkscape-application.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/inkscape-application.cpp b/src/inkscape-application.cpp index 7b3200dae..0a46e57dd 100644 --- a/src/inkscape-application.cpp +++ b/src/inkscape-application.cpp @@ -22,6 +22,7 @@ #include "desktop.h" // Access to window #include "actions/actions-base.h" // Actions +#include "actions/actions-output.h" // Actions #include "actions/actions-selection.h" // Actions #ifdef WITH_DBUS @@ -61,7 +62,8 @@ InkscapeApplication::InkscapeApplication() Glib::set_application_name(N_("Inkscape - A Vector Drawing Program")); // After gettext() init. // ======================== Actions ========================= - add_actions_base(this); // actions that are GUI independent + add_actions_base(this); // actions that are GUI independent + add_actions_output(this); // actions for file export add_actions_selection(this); // actions for object selection // ====================== Command Line ====================== @@ -330,15 +332,27 @@ InkscapeApplication::parse_actions(const Glib::ustring& input, action_vector_t& if (gtype) { // With value. Glib::VariantType type = action_ptr->get_parameter_type(); - if (type.get_string() == "s") { + if (type.get_string() == "b") { + bool b = false; + if (value == "0" || value == "true" || value.empty()) { + b = true; + } else if (value =="1" || value == "false") { + b = false; + } else { + std::cerr << "InkscapeApplication::parse_actions: Invalid boolean value: " << action << ":" << value << std::endl; + } + std::cout << "parse_actions boolean: " << value << ":" << std::boolalpha << b << std::endl; action_vector.push_back( - std::make_pair( action, Glib::Variant<Glib::ustring>::create(value) )); + std::make_pair( action, Glib::Variant<bool>::create(b))); } else if (type.get_string() == "i") { action_vector.push_back( std::make_pair( action, Glib::Variant<int>::create(std::stoi(value)))); } else if (type.get_string() == "d") { action_vector.push_back( std::make_pair( action, Glib::Variant<double>::create(std::stod(value)))); + } else if (type.get_string() == "s") { + action_vector.push_back( + std::make_pair( action, Glib::Variant<Glib::ustring>::create(value) )); } else { std::cerr << "InkscapeApplication::parse_actions: unhandled action value: " << action << ": " << type.get_string() << std::endl; |
