summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2007-03-01 07:14:33 +0000
committergouldtj <gouldtj@users.sourceforge.net>2007-03-01 07:14:33 +0000
commit4f1146924f797418854c2209c1107df73759ac48 (patch)
treeffa397501824d04cd3a40b240dc86b7743bc2c73 /src/main.cpp
parentr14582@tres: ted | 2007-02-28 19:07:35 -0800 (diff)
downloadinkscape-4f1146924f797418854c2209c1107df73759ac48.tar.gz
inkscape-4f1146924f797418854c2209c1107df73759ac48.zip
r14583@tres: ted | 2007-02-28 19:29:48 -0800
Selection is working too! (bzr r2479)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 9a6dc0b76..d9e3138f9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -389,7 +389,9 @@ struct poptOption options[] = {
#include <ui/view/view.h>
#include <desktop.h>
+#include <desktop-handles.h>
#include <helper/action.h>
+#include <selection.h>
class CmdLineAction {
gint _type;
@@ -415,19 +417,31 @@ public:
}
void doIt (Inkscape::UI::View::View * view) {
- printf("Doing: %s\n", _arg);
+ //printf("Doing: %s\n", _arg);
switch (_type) {
case SP_ARG_VERB: {
Inkscape::Verb * verb = Inkscape::Verb::getbyid(_arg);
if (verb == NULL) {
printf(_("Unable to find verb ID '%s' specified on the command line.\n"), _arg);
+ break;
}
SPAction * action = verb->get_action(view);
sp_action_perform(action, NULL);
break;
}
case SP_ARG_SELECT: {
+ SPDesktop * desktop = dynamic_cast<SPDesktop *>(view);
+ if (desktop == NULL) { break; }
+
+ SPDocument * doc = view->doc();
+ SPObject * obj = doc->getObjectById(_arg);
+ if (obj == NULL) {
+ printf("Unable to find node ID: '%s'\n", _arg);
+ break;
+ }
+ Inkscape::Selection * selection = sp_desktop_selection(desktop);
+ selection->add(obj, false);
break;
}
}