changeset 17021:35a565fed4bd

preferences.m: Issue a warning if called and GUI is not running. * scripts/prefs/preferences.m: Issue a warning if called and GUI is not running.
author Rik <rik@octave.org>
date Fri, 19 Jul 2013 16:24:45 -0700
parents abe91fe896a8
children 960ac70ac8f3
files scripts/prefs/preferences.m
diffstat 1 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/prefs/preferences.m
+++ b/scripts/prefs/preferences.m
@@ -18,22 +18,17 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} preferences 
-## Display preferences settings for Octave.
-##
-## If in GUI mode, display using the preferences dialog, otherwise display
-## the preferences with the @code{edit} function.
-##
-## @seealso{getpref, setpref, addpref, rmpref}
+## Display the GUI preferences dialog window for Octave.
 ## @end deftypefn
 
 ## Author: John Donoghue
 ## Version: 0.01
 
 function preferences ()
-  if (! __octave_link_enabled__ ())
-    edit (prefsfile ());
+  if (isguirunning ())
+    __octave_link_show_preferences__ ();
   else
-    __octave_link_show_preferences__ ();
+    warning ("preferences: GUI must be running to use preferences dialog");
   endif
 endfunction