Blob Blame History Raw
From f51140b80a0925d2d69b15030a7f8d54c2276832 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Wed, 24 Dec 2014 09:53:49 +0100
Subject: [PATCH] Try to run freerouting by its JPackage launcher script

It's a sin to touch the Java tool by its JAR file in Fedora.
---
 pcbnew/dialogs/dialog_freeroute_exchange.cpp | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/pcbnew/dialogs/dialog_freeroute_exchange.cpp b/pcbnew/dialogs/dialog_freeroute_exchange.cpp
index 7b057f6..4207d4e 100644
--- a/pcbnew/dialogs/dialog_freeroute_exchange.cpp
+++ b/pcbnew/dialogs/dialog_freeroute_exchange.cpp
@@ -71,7 +71,10 @@ void DIALOG_FREEROUTE::MyInit()
     SetFocus();
     m_freeRouterFound = false;
 
-    wxFileName fileName( FindKicadFile( wxT( "freeroute.jar" ) ), wxPATH_UNIX );
+    wxFileName fileName( FindKicadFile( wxT( "freerouting" ) ), wxPATH_UNIX );
+
+    if( !fileName.FileExists() )
+        fileName.Assign ( FindKicadFile( wxT( "freeroute.jar" ) ), wxPATH_UNIX );
 
     if( fileName.FileExists() )
         m_freeRouterFound = true;
@@ -126,8 +129,22 @@ void DIALOG_FREEROUTE::OnLaunchButtonClick( wxCommandEvent& event )
             return;
     }
 
-    wxFileName jarfileName( FindKicadFile( wxT( "freeroute.jar" ) ), wxPATH_UNIX );
-    wxString command;
+    wxFileName jarfileName( FindKicadFile( wxT( "freerouting" ) ), wxPATH_UNIX );
+    wxString command = wxT( "" );
+
+    if( jarfileName.FileExists() )
+    {
+        command << wxChar( '"' ) << jarfileName.GetFullPath() << wxChar( '"' );
+        // add option to load the .dsn file
+        command << wxT( " -de " );
+        // add *.dsn full filename (quoted):
+        command << wxChar( '"' ) << dsnFile << wxChar( '"' );
+
+        ProcessExecute( command );
+        return;
+    } else {
+        jarfileName.Assign ( FindKicadFile( wxT( "freeroute.jar" ) ), wxPATH_UNIX );
+    }
 
     // Find the Java application on Windows.
     // Colud be no more needed since we now have to run only java, not java web start
-- 
2.5.0