From: <et...@us...> - 2012-06-24 05:16:32
|
Revision: 10677 http://octave.svn.sourceforge.net/octave/?rev=10677&view=rev Author: etienne Date: 2012-06-24 05:16:24 +0000 (Sun, 24 Jun 2012) Log Message: ----------- Fixes Modified Paths: -------------- trunk/octave-forge/main/vrml/inst/vrml_browse.m trunk/octave-forge/main/vrml/inst/vrml_set_browser.m Modified: trunk/octave-forge/main/vrml/inst/vrml_browse.m =================================================================== --- trunk/octave-forge/main/vrml/inst/vrml_browse.m 2012-06-24 04:18:55 UTC (rev 10676) +++ trunk/octave-forge/main/vrml/inst/vrml_browse.m 2012-06-24 05:16:24 UTC (rev 10677) @@ -32,7 +32,7 @@ ## 's' : Save a snapshot in files 'octave.snapshot.NNNN.ppm' ## 'q' : Quit ## -## WARNING : FreeWRL >0.25 (http://www.crc.ca/FreeWRL/) must be installed. +## WARNING: vrml_browse() only works if a vrml browser is available. See vrml_set_browser(). ## ## BUG : The vrml browser is not killed when octave exits. Sometimes the ## vrml browser does not get raised or gets raised improperly @@ -85,9 +85,11 @@ s = [s, vrml_Background("skyColor",[.7 .7 .9])]; end +if isempty (vrml_b_name) + vrml_set_browser(); +endif -vrml_b_name = "freewrl" ; -##vrml_b_name = "/home/etienne/bin/my_freewrl.sh"; +## vrml_b_name = "freewrl" ; ##b_opt = [out_option," ",bop," ",best_option," --server --snapb octave.snap "] ##; @@ -165,7 +167,7 @@ # #################################### # #################################### - # Eventually start browser ########### + # If needed, start browser ########### if vrml_b_pid <= 0 new_browser = 1 ; if verbose, Modified: trunk/octave-forge/main/vrml/inst/vrml_set_browser.m =================================================================== --- trunk/octave-forge/main/vrml/inst/vrml_set_browser.m 2012-06-24 04:18:55 UTC (rev 10676) +++ trunk/octave-forge/main/vrml/inst/vrml_set_browser.m 2012-06-24 05:16:24 UTC (rev 10677) @@ -35,7 +35,7 @@ ## function full_path = vrml_set_browser (proposed_browser_name) -global vrml_b_name; +global vrml_b_name = []; full_path = vrml_b_name; @@ -46,8 +46,11 @@ for i = 1:numel(browser_list) ## TODO: Test this under windows - [status, full_path] = system (sprintf ("which %s", b{i})); + [status, full_path] = system (sprintf ("which %s", browser_list{i})); if status != 1 + if full_path(length(full_path)) == "\n", + full_path = full_path(1:end-1); + end vrml_b_name = full_path; return; endif @@ -61,4 +64,7 @@ if status == 1 error (sprintf ("VRML browser `%s' is not available", proposed_browser_name)); endif +if full_path(length(full_path)) == "\n", + full_path = full_path(1:end-1); +end vrml_b_name = full_path; \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |