view scripts/prefs/preferences.m @ 20834:27b333c88c8e

Overhaul m-files in prefs directory. Update docstrings, re-code to match Matlab behavior, put input validation first, add BIST tests. * addpref.m, getpref.m, ispref.m, preferences.m, rmpref.m, setpref.m: Update docstrings, re-code to match Matlab behavior, put input validation first, add BIST tests. * loadprefs.m, prefsfile.m, saveprefs.m: Update docstring. Remove ## note about testing. * saveprefs.m: Update docstring. Remove ## note about testing. Change function declaration to not return any value. * scripts/prefs/private/prefdir.m: Move file from scripts/prefs to private directory. Match variable names in doc to those in function. * module.mk: Change build system to find prefdir.m in private directory.
author Rik <rik@octave.org>
date Wed, 09 Dec 2015 12:01:31 -0800
parents 4197fc428c7d
children 516bb87ea72e
line wrap: on
line source

## Copyright (C) 2013-2015 John Donoghue
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING.  If not, see
## <http://www.gnu.org/licenses/>.

## -*- texinfo -*-
## @deftypefn {Command} {} preferences
## Display the GUI preferences dialog window for Octave.
## @end deftypefn

## Author: John Donoghue

function preferences ()

  if (isguirunning ())
    __octave_link_show_preferences__ ();
  else
    warning ("preferences: GUI must be running to use preferences dialog");
  endif

endfunction


%!test
%! if (isguirunning ())
%!   return;
%! endif
%! fail ("preferences ()", "warning", "GUI must be running");