From: keescook Date: Sat, 16 Dec 2006 04:30:23 +0000 (+0000) Subject: Clean up internal Python/Perl dialog text; link against the python dynamic library X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5eafac1adbe055014ece10b5c33df29a82289c8d;p=inkscape.git Clean up internal Python/Perl dialog text; link against the python dynamic library --- diff --git a/configure.ac b/configure.ac index e4bed1609..61d5a8d1c 100644 --- a/configure.ac +++ b/configure.ac @@ -406,7 +406,7 @@ if test "x$with_python" = "xyes"; then if test "$?" -gt "0"; then with_python="no" else - checkPYTHON_LIBS=`python -c "import distutils.sysconfig ; print '%s/%s %s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LIBRARY'),distutils.sysconfig.get_config_var('LIBS'))" 2>/dev/null` + checkPYTHON_LIBS=`python -c "import distutils.sysconfig ; print '%s/%s %s' % (distutils.sysconfig.get_config_var('LIBPL'),distutils.sysconfig.get_config_var('LDLIBRARY'),distutils.sysconfig.get_config_var('LIBS'))" 2>/dev/null` if test "$?" -gt "0"; then with_python="no" else @@ -860,11 +860,13 @@ Configuration: LDFLAGS: ${LDFLAGS} Use Xft font database: ${xft_ok} - Use gnome-vfs: ${gnome_vfs} + Use gnome-vfs: ${gnome_vfs} Use openoffice files: ${ij} Use MMX optimizations: ${use_mmx_asm} Use relocation support: ${enable_binreloc} - Enable LittleCms: ${enable_lcms} - Enable Inkboard: ${with_inkboard} - Enable SSL in Inkboard: ${with_inkboard_ssl} + Internal Python: ${with_python} + Internal Perl: ${with_perl} + Enable LittleCms: ${enable_lcms} + Enable Inkboard: ${with_inkboard} + Enable SSL in Inkboard: ${with_inkboard_ssl} " 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