summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/scriptdialog.cpp
diff options
context:
space:
mode:
authorKees Cook <kees@outflux.net>2006-12-16 04:30:23 +0000
committerkeescook <keescook@users.sourceforge.net>2006-12-16 04:30:23 +0000
commitdb9053e5201ebf92b81347000d04cef63ba7e8ce (patch)
treeb079c36b6cfd3af1befafdfc8a1028eeb39719a2 /src/ui/dialog/scriptdialog.cpp
parentredundant AC_MSG_RESULT (diff)
downloadinkscape-db9053e5201ebf92b81347000d04cef63ba7e8ce.tar.gz
inkscape-db9053e5201ebf92b81347000d04cef63ba7e8ce.zip
Clean up internal Python/Perl dialog text; link against the python dynamic library
(bzr r2094)
Diffstat (limited to 'src/ui/dialog/scriptdialog.cpp')
-rw-r--r--src/ui/dialog/scriptdialog.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/dialog/scriptdialog.cpp b/src/ui/dialog/scriptdialog.cpp
index 8cc8f88aa..a8c0286d6 100644
--- a/src/ui/dialog/scriptdialog.cpp
+++ b/src/ui/dialog/scriptdialog.cpp
@@ -98,6 +98,7 @@ class ScriptDialogImpl : public ScriptDialog
};
static char *defaultPythonCodeStr =
+#if defined(WITH_PYTHON)
"# This is a sample Python script.\n"
"# To run it, select 'Execute Python' from the File menu above.\n"
"desktop = inkscape.getDesktop()\n"
@@ -105,6 +106,21 @@ static char *defaultPythonCodeStr =
"document = desktop.getDocument()\n"
"document.hello()\n"
"dialogmanager.showAbout()\n"
+#elif defined(WITH_PERL)
+ "# This is a sample Perl script.\n"
+ "# To run it, select 'Execute Perl' from the File menu above.\n"
+ "my $desktop = $inkscape->getDesktop();\n"
+ "my $dialogmanager = $inkscape->getDialogManager();\n"
+ "my $document = $desktop->getDocument();\n"
+ "$document->hello();\n"
+ "$dialogmanager->showAbout();\n"
+#else
+ "# This is where you could type a script.\n"
+ "# However, no scripting languages have been compiled\n"
+ "# into Inkscape, so this window has no functionality.\n"
+ "# When compiling Inkscape, run \"configure\" with\n"
+ "# \"--with-python\" and/or \"--with-perl\".\n"
+#endif
"";
@@ -178,10 +194,14 @@ ScriptDialogImpl::ScriptDialogImpl()
menuBar.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_File"), fileMenu) );
fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_Clear"),
sigc::mem_fun(*this, &ScriptDialogImpl::clear) ) );
+#ifdef WITH_PYTHON
fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_Execute Python"),
sigc::mem_fun(*this, &ScriptDialogImpl::executePython) ) );
+#endif
+#ifdef WITH_PERL
fileMenu.items().push_back( Gtk::Menu_Helpers::MenuElem(_("_Execute Perl"),
sigc::mem_fun(*this, &ScriptDialogImpl::executePerl) ) );
+#endif
mainVBox->pack_start(menuBar, Gtk::PACK_SHRINK);
//### Set up the script field