changeset 11583:c4c2cd67c440

Fixes for ui file functions, bug#32190
author Kai Habel <kai.habel@gmx.de>
date Thu, 20 Jan 2011 20:31:30 +0100
parents 21dec063e89f
children cda4aa780d58
files scripts/ChangeLog scripts/plot/uigetdir.m scripts/plot/uigetfile.m scripts/plot/uiputfile.m src/ChangeLog src/DLD-FUNCTIONS/__init_fltk__.cc
diffstat 6 files changed, 23 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Thu Jan 20 10:47:43 2011 -0800
+++ b/scripts/ChangeLog	Thu Jan 20 20:31:30 2011 +0100
@@ -1,3 +1,10 @@
+2010-01-20  Petr Mikulik  <mikulik@physics.muni.cz>
+
+	* plot/uigetdir.m: Use correct variable name for argument check.
+	Remove unneeded white spaces.
+	* plot/uigetfile.m, plot/uiputfile.m: Remove unneeded white spaces.
+	Bug #32190.
+
 2011-01-20  John W. Eaton  <jwe@octave.org>
 
 	* plot/ginput.m, plot/gnuplot_drawnow.m, plot/uiputfile.m,
--- a/scripts/plot/uigetdir.m	Thu Jan 20 10:47:43 2011 -0800
+++ b/scripts/plot/uigetdir.m	Thu Jan 20 20:31:30 2011 +0100
@@ -33,11 +33,10 @@
     print_usage ();
   endif
 
-  if (!ischar(init_path) || !ischar(name))
+  if (!ischar(init_path) || !ischar(dialog_name))
     error ("uigetdir: INIT_PATH and DIALOG_NAME must be string arguments");
   endif
   
-
   if (any (strcmp (available_graphics_toolkits (), "fltk")))
       if (!isdir (init_path))
         init_path = fileparts (init_path);
@@ -49,6 +48,5 @@
 
 endfunction
 
-
-%!demo 
+%!demo
 %! uigetdir(pwd, "Select Directory")
--- a/scripts/plot/uigetfile.m	Thu Jan 20 10:47:43 2011 -0800
+++ b/scripts/plot/uigetfile.m	Thu Jan 20 20:31:30 2011 +0100
@@ -43,7 +43,7 @@
 ## in the second column.
 ## Example: @code{uigetfile (@{"*.ext", "My Description";"*.xyz",
 ## "XYZ-Format"@})}
-## 
+##
 ## The filter string can also contain a semicolon separated list of filter
 ## extensions.
 ## Example: @code{uigetfile (@{"*.gif;*.png;*.jpg", "Supported Picture
@@ -57,7 +57,7 @@
 ## The screen position of the GUI dialog can be set using the "Position" key
 ## and a 2-element vector containing the pixel coordinates.
 ## Two or more files can be selected when setting the "Multiselect" key to "on".
-## In that case @var{fname} is a cell array containing the files. 
+## In that case @var{fname} is a cell array containing the files.
 ## @end deftypefn
 
 ## Author: Kai Habel
@@ -129,7 +129,7 @@
       for i = stridx : 2 : nargin
         prop = varargin{i};
         val = varargin{i + 1};
-        if (strncmp (tolower (prop), "position", 8)) 
+        if (strncmp (tolower (prop), "position", 8))
           if (ismatrix (val) && length(val) == 2)
             outargs{4} = val;
           else
@@ -151,12 +151,11 @@
   endif
 
   if (any (cellfun(@(x)strcmp (x, "fltk"), available_graphics_toolkits ())))
-    [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:});  
+    [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:});
   else
     error ("uigetfile: fltk graphics toolkit required.");
   endif
 
-         
 endfunction
 
 %!demo 
--- a/scripts/plot/uiputfile.m	Thu Jan 20 10:47:43 2011 -0800
+++ b/scripts/plot/uiputfile.m	Thu Jan 20 20:31:30 2011 +0100
@@ -55,7 +55,6 @@
 
 function [retfile, retpath, retindex] = uiputfile (varargin)
 
-
   if (nargin <= 3)
 
     defaultvals = {"All Files(*)", #FLTK File Filter
@@ -76,7 +75,7 @@
         outargs{3} = file_filter;
       endif
     endif
-    
+
     if (nargin > 1)
       outargs{2} = varargin{2};
     endif
@@ -90,12 +89,12 @@
   endif
 
   if (any (cellfun(@(x)strcmp (x, "fltk"), available_graphics_toolkits ())))
-    [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:});  
+    [retfile, retpath, retindex] = __fltk_uigetfile__ (outargs{:});
   else
     error ("uiputfile: fltk graphics toolkit required");
   endif
 
 endfunction
 
-%!demo 
+%!demo
 %! uiputfile({"*.gif;*.png;*.jpg", "Supported Picture Formats"})
--- a/src/ChangeLog	Thu Jan 20 10:47:43 2011 -0800
+++ b/src/ChangeLog	Thu Jan 20 20:31:30 2011 +0100
@@ -1,3 +1,9 @@
+2011-01-20  Kai Habel  <kai.habel@gmx.de>
+
+	* DLD-FUNCTIONS/__init_fltk__.cc (__fltk_uigetfile__): Append file
+	seperator to 2nd return value (file path).
+	Bug #32190.
+
 2011-01-20  John W. Eaton  <jwe@octave.org>
 
 	* oct-obj.h (octave_value_list::octave_value_list): Initialize
--- a/src/DLD-FUNCTIONS/__init_fltk__.cc	Thu Jan 20 10:47:43 2011 -0800
+++ b/src/DLD-FUNCTIONS/__init_fltk__.cc	Thu Jan 20 20:31:30 2011 +0100
@@ -2113,7 +2113,7 @@
         retval(0) = std::string(fc->value ());
       else
         {
-          retval(1) = std::string(fc->directory ());
+          retval(1) = std::string(fc->directory ()) + sep;
           retval(2) = fc->filter_value();
         }
     }