Code

Uniconvertor import extension changes for Win32 - Fixes LP# 197617
authorozmikepittman <ozmikepittman@users.sourceforge.net>
Tue, 29 Apr 2008 12:50:31 +0000 (12:50 +0000)
committerozmikepittman <ozmikepittman@users.sourceforge.net>
Tue, 29 Apr 2008 12:50:31 +0000 (12:50 +0000)
share/extensions/ccx_input.inx
share/extensions/cdr2svg.sh
share/extensions/cdr_input.inx
share/extensions/cdt_input.inx
share/extensions/cgm_input.inx
share/extensions/cmx_input.inx
share/extensions/sk1_input.inx
share/extensions/wmf_input.inx
src/extension/dependency.cpp
src/main.cpp

index 3ed4a2dbef52e3bde990c2970e81b0f363f3a541..d40d4ae3cc9007bfed78ddd4da7522704e324330 100644 (file)
@@ -3,7 +3,7 @@
     <_name>Corel DRAW Compressed Exchange files input</_name>
     <id>org.inkscape.input.ccx</id>
     <dependency type="executable" location="path">uniconv</dependency>
-    <dependency type="executable" location="extensions">cdr2svg.sh</dependency>
+    <dependency type="executable" location="extensions">uniconv-ext.py</dependency>
     <input>
         <extension>.ccx</extension>
         <mimetype>application/x-xccx</mimetype>
@@ -11,6 +11,6 @@
         <_filetypetooltip>Open compressed exchange files saved in Corel DRAW</_filetypetooltip>
     </input>
     <script>
-        <command reldir="extensions">cdr2svg.sh</command>
+        <command reldir="extensions" interpreter="python">uniconv-ext.py</command>
     </script>
 </inkscape-extension>
index 73059a60f0d577b9d15f0b390e72458db42506d5..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100755 (executable)
@@ -1,11 +0,0 @@
-#! /bin/sh
-rc=0
-TMPDIR="${TMPDIR-/tmp}"
-TEMPFILENAME=`mktemp 2>/dev/null || echo "$TMPDIR/$$"`
-TEMPFILENAME=${TEMPFILENAME}.svg
-
-uniconv "$1" "${TEMPFILENAME}" > /dev/null 2>&1 || rc=1
-
-cat < "${TEMPFILENAME}" || rc=1
-rm -f "${TEMPFILENAME}"
-exit $rc
index 7feeedf8737134a25755ea8951b52d71f40fa3e3..7a25ffcf48f4d48df815e55538287db191087a5e 100644 (file)
@@ -3,7 +3,7 @@
     <_name>Corel DRAW Input</_name>
     <id>org.inkscape.input.cdr</id>
     <dependency type="executable" location="path">uniconv</dependency>
-    <dependency type="executable" location="extensions">cdr2svg.sh</dependency>
+    <dependency type="executable" location="extensions">uniconv-ext.py</dependency>
     <input>
         <extension>.cdr</extension>
         <mimetype>image/x-xcdr</mimetype>
@@ -12,6 +12,6 @@
         <output_extension>org.inkscape.output.cdr</output_extension>
     </input>
     <script>
-        <command reldir="extensions">cdr2svg.sh</command>
+        <command reldir="extensions" interpreter="python">uniconv-ext.py</command>
     </script>
 </inkscape-extension>
index 698b37deea2c2e99ebd60fb147db21b332308ba5..66b58bb9bb30bf684355aca2e8bd7b4e0520f2fe 100644 (file)
@@ -3,7 +3,7 @@
     <_name>Corel DRAW templates input</_name>
     <id>org.inkscape.input.cdt</id>
     <dependency type="executable" location="path">uniconv</dependency>
-    <dependency type="executable" location="extensions">cdr2svg.sh</dependency>
+    <dependency type="executable" location="extensions">uniconv-ext.py</dependency>
     <input>
         <extension>.cdt</extension>
         <mimetype>application/x-xcdt</mimetype>
@@ -11,6 +11,6 @@
         <_filetypetooltip>Open files saved in Corel DRAW 7-13</_filetypetooltip>
     </input>
     <script>
-        <command reldir="extensions">cdr2svg.sh</command>
+        <command reldir="extensions" interpreter="python">uniconv-ext.py</command>
     </script>
 </inkscape-extension>
index 82b5265309ad4577a3f34048922c9cf118467b6a..fba7eef96106391bd4e26e1b1a4d70305c2d1da9 100644 (file)
@@ -3,7 +3,7 @@
     <_name>Computer Graphics Metafile files input</_name>
     <id>org.inkscape.input.cgm</id>
     <dependency type="executable" location="path">uniconv</dependency>
-    <dependency type="executable" location="extensions">cdr2svg.sh</dependency>
+    <dependency type="executable" location="extensions">uniconv-ext.py</dependency>
     <input>
         <extension>.cgm</extension>
         <mimetype>application/x-xcgm</mimetype>
@@ -11,6 +11,6 @@
         <_filetypetooltip>Open Computer Graphics Metafile files</_filetypetooltip>
     </input>
     <script>
-        <command reldir="extensions">cdr2svg.sh</command>
+        <command reldir="extensions" interpreter="python">uniconv-ext.py</command>
     </script>
 </inkscape-extension>
index b4500102dc003a87711660fd47c8065c0b8c5bb0..b72959d6a5b9549f884d534712d548ecffa9706c 100644 (file)
@@ -3,7 +3,7 @@
     <_name>Corel DRAW Presentation Exchange files input</_name>
     <id>org.inkscape.input.cmx</id>
     <dependency type="executable" location="path">uniconv</dependency>
-    <dependency type="executable" location="extensions">cdr2svg.sh</dependency>
+    <dependency type="executable" location="extensions">uniconv-ext.py</dependency>
     <input>
         <extension>.cmx</extension>
         <mimetype>application/x-xcmx</mimetype>
@@ -11,6 +11,6 @@
         <_filetypetooltip>Open presentation exchange files saved in Corel DRAW</_filetypetooltip>
     </input>
     <script>
-        <command reldir="extensions">cdr2svg.sh</command>
+        <command reldir="extensions" interpreter="python">uniconv-ext.py</command>
     </script>
 </inkscape-extension>
index 4a02f94f5208446a2dbf5a60c9322efdc919a259..3a84746579c3ec09ebda365899ccd6af88ad1064 100644 (file)
@@ -3,7 +3,7 @@
     <_name>sK1 vector graphics files input</_name>
     <id>org.inkscape.input.sk1</id>
     <dependency type="executable" location="path">uniconv</dependency>
-    <dependency type="executable" location="extensions">cdr2svg.sh</dependency>
+    <dependency type="executable" location="extensions">uniconv-ext.py</dependency>
     <input>
         <extension>.sk1</extension>
         <mimetype>application/x-xsk1</mimetype>
@@ -11,6 +11,6 @@
         <_filetypetooltip>Open files saved in sK1 vector graphics editor</_filetypetooltip>
     </input>
     <script>
-        <command reldir="extensions">cdr2svg.sh</command>
+        <command reldir="extensions" interpreter="python">uniconv-ext.py</command>
     </script>
 </inkscape-extension>
index 401657d7665b3253aee9c922973b4d7e760f6bf6..4b2f6b2a3cfc89f26a1228f69de0bf8e4196029d 100644 (file)
@@ -3,7 +3,7 @@
     <_name>Windows Metafile Input</_name>
     <id>org.inkscape.input.wmf</id>
     <dependency type="executable" location="path">uniconv</dependency>
-    <dependency type="executable" location="extensions">cdr2svg.sh</dependency>
+    <dependency type="executable" location="extensions">uniconv-ext.py</dependency>
     <input>
         <extension>.wmf</extension>
         <mimetype>application/x-wmf</mimetype>
@@ -11,6 +11,6 @@
         <_filetypetooltip>A popular graphics file format for clipart</_filetypetooltip>
     </input>
     <script>
-        <command reldir="extensions">cdr2svg.sh</command>
+        <command reldir="extensions" interpreter="python">uniconv-ext.py</command>
     </script>
 </inkscape-extension>
index 4396017fac4b0fe199ce1c95c605bb2d34a7ac60..de656201c4dea7b783eee2c9d76d66eeb77c9ee7 100644 (file)
@@ -213,17 +213,29 @@ Dependency::check (void) const
                             g_free(orig_path);
                             return TRUE;
                         }
+
                         // give it a 2nd try with ".exe" added
-                        gchar * final_name_exe = g_strdup_printf ("%s.exe", final_name);                        
+                        gchar * final_name_exe = g_strdup_printf("%s.exe", final_name);                        
                         if (Glib::file_test(final_name_exe, filetest)) {
                             g_free(final_name);
                             g_free(final_name_exe);
                             g_free(orig_path);
                             return TRUE;
                         }
+                        g_free(final_name_exe);
+
+                        // and a 3rd try with ".cmd" added (mainly for UniConvertor)
+                        gchar * final_name_cmd = g_strdup_printf("%s.cmd", final_name);
+                        if (Glib::file_test(final_name_cmd, filetest)) {
+                            g_free(final_name);
+                            g_free(final_name_cmd);
+                            g_free(orig_path);
+                            return TRUE;
+                        }
+                        g_free(final_name_cmd);
 
+                        // give up
                         g_free(final_name);
-                        g_free(final_name_exe);
                     }
 
                     g_free(orig_path);
index bf1662c3121e06a047d35907be7f04307f9b2fde..eafa07c539e8657495b2999d0d4f3e6d1036e94f 100644 (file)
@@ -440,6 +440,8 @@ static int _win32_set_inkscape_env(char *argv0)
     tmp += szFullPath;
     tmp += "python;";
     tmp += szFullPath;
+    tmp += "python\\Scripts;";  // for uniconv.cmd
+    tmp += szFullPath;
     tmp += "perl";
     if(oldenv != NULL) {
         tmp += ";";