# HG changeset patch # User John W. Eaton # Date 1391027315 18000 # Node ID 1e148ecdeedddebbc532a44c9f73600263f8fb91 # Parent 4c064d3d27509492df7c0bac9401f1de6603936e# Parent a9cec5517d9255fa7ea35cd9d41384f434ab83ae maint: Periodic merge of gui-release to default. diff -r 4c064d3d2750 -r 1e148ecdeedd configure.ac --- a/configure.ac Mon Jan 27 09:50:53 2014 -0800 +++ b/configure.ac Wed Jan 29 15:28:35 2014 -0500 @@ -2719,9 +2719,14 @@ case $host_os in *darwin*) ## Qt might be installed in framework - QT_LDFLAGS="`$PKG_CONFIG --libs-only-other QtCore QtGui QtNetwork | tr ' ' '\n' | $GREP -e '-F' | uniq | tr '\n' ' '`" - QT_LIBS="`$PKG_CONFIG --libs-only-other QtCore QtGui QtNetwork | tr ' ' '\n' | $GREP -v -e '-F' | uniq | tr '\n' ' '`" - AM_CONDITIONAL([AMCOND_LINK_ALL_DEPS], [test $link_all_deps = yes || test -n $QT_LDFLAGS]) + if test -z "$QT_LIBS"; then + QT_LDFLAGS="`$PKG_CONFIG --libs-only-other QtCore QtGui QtNetwork | tr ' ' '\n' | $GREP -e '-F' | uniq | tr '\n' ' '`" + QT_LIBS="`$PKG_CONFIG --libs-only-other QtCore QtGui QtNetwork | tr ' ' '\n' | $GREP -v -e '-F' | uniq | tr '\n' ' '`" + ## Enabling link_all_deps works around libtool's imperfect handling + ## of the -F flag + AM_CONDITIONAL([AMCOND_LINK_ALL_DEPS], + [test $link_all_deps = yes || test -n "$QT_LDFLAGS"]) + fi ;; esac diff -r 4c064d3d2750 -r 1e148ecdeedd doc/interpreter/Makefile.am --- a/doc/interpreter/Makefile.am Mon Jan 27 09:50:53 2014 -0800 +++ b/doc/interpreter/Makefile.am Wed Jan 29 15:28:35 2014 -0500 @@ -59,8 +59,8 @@ $(top_srcdir)/examples/addtwomatrices.cc \ $(top_srcdir)/examples/celldemo.cc \ $(top_srcdir)/examples/embedded.cc \ - $(top_srcdir)/examples/fortdemo.cc \ - $(top_srcdir)/examples/fortsub.f \ + $(top_srcdir)/examples/fortrandemo.cc \ + $(top_srcdir)/examples/fortransub.f \ $(top_srcdir)/examples/funcdemo.cc \ $(top_srcdir)/examples/globaldemo.cc \ $(top_srcdir)/examples/helloworld.cc \ diff -r 4c064d3d2750 -r 1e148ecdeedd doc/interpreter/debug.txi --- a/doc/interpreter/debug.txi Mon Jan 27 09:50:53 2014 -0800 +++ b/doc/interpreter/debug.txi Wed Jan 29 15:28:35 2014 -0500 @@ -44,10 +44,10 @@ There are two basic means of interrupting the execution of an Octave script. These are breakpoints (@pxref{Breakpoints}), discussed in the next -section and interruption based on some condition. +section, and interruption based on some condition. Octave supports three means to stop execution based on the values set in -the functions @code{debug_on_interrupt}, @code{debug_on_warning} and +the functions @code{debug_on_interrupt}, @code{debug_on_warning}, and @code{debug_on_error}. @DOCSTRING(debug_on_interrupt) @@ -59,13 +59,13 @@ @node Leaving Debug Mode @section Leaving Debug Mode -To leave the debug mode, use either @code{dbcont} -or @code{return}. +Use either @code{dbcont} or @code{return} to leave the debug mode and +continue the normal execution of the script. @DOCSTRING(dbcont) -To quit debug mode and return directly to the prompt @code{dbquit} -should be used instead +To quit debug mode and return directly to the prompt without executing +any additional code use @code{dbquit}. @DOCSTRING(dbquit) @@ -75,21 +75,21 @@ @node Breakpoints @section Breakpoints -Breakpoints can be set in any Octave function, using the @code{dbstop} +Breakpoints can be set in any m-file function by using the @code{dbstop} function. @DOCSTRING(dbstop) @noindent Breakpoints in class methods are also supported (e.g., -@code{dbstop("@@class/method")}). However, breakpoints cannot be set in -built-in functions (e.g., @code{sin}, etc.) or dynamically loaded function +@code{dbstop ("@@class/method")}). However, breakpoints cannot be set in +built-in functions (e.g., @code{sin}, etc.) or dynamically loaded functions (i.e., oct-files). -To set a breakpoint immediately on entering a function, the breakpoint -should be set to line 1. The leading comment block will be ignored and -the breakpoint will be set to the first executable statement in the -function. For example: +To set a breakpoint immediately upon entering a function use line number 1, or +omit the line number entirely and just give the function name. When setting +the breakpoint Octave will ignore the leading comment block, and the breakpoint +will be set on the first executable statement in the function. For example: @example @group @@ -101,7 +101,7 @@ @noindent Note that the return value of @code{29} means that the breakpoint was effectively set to line 29. The status of breakpoints in a function can -be queried with the @code{dbstatus} function. +be queried with @code{dbstatus}. @DOCSTRING(dbstatus) @@ -113,12 +113,6 @@ @DOCSTRING(dbclear) @noindent -These functions can be used together to clear all the breakpoints in a -particular function. For example: - -@example -dbclear ("asind", dbstatus ("asind")); -@end example A breakpoint may also be set in a subfunction. For example, if a file contains the functions @@ -135,8 +129,7 @@ @end example @noindent -then a breakpoint can be set at the start of the subfunction directly -with +then a breakpoint can be set at the start of the subfunction directly with @example @group @@ -145,8 +138,14 @@ @end group @end example -Note that @code{filemarker} returns a character that marks the -subfunctions from the file containing them. +Note that @code{filemarker} returns the character that marks subfunctions from +the file containing them. Unless the default has been changed this character +is @samp{>}. Thus, a quicker and more normal way to set the breakpoint would +be + +@example +dbstop func1>func2 +@end example Another simple way of setting a breakpoint in an Octave script is the use of the @code{keyboard} function. @@ -154,16 +153,16 @@ @DOCSTRING(keyboard) @noindent -The @code{keyboard} function is typically placed in a script at the -point where the user desires that the execution be stopped. It -automatically sets the running script into the debug mode. +The @code{keyboard} function is placed in a script at the point where the user +desires that the execution be stopped. It automatically sets the running +script into the debug mode. @node Debug Mode @section Debug Mode There are three additional support functions that allow the user to -interrogate where in the execution of a script Octave entered the debug -mode and to print the code in the script surrounding the point where +find out where in the execution of a script Octave entered the debug +mode, and to print the code in the script surrounding the point where Octave entered debug mode. @DOCSTRING(dbwhere) @@ -182,14 +181,21 @@ @DOCSTRING(dbstep) -When in debug mode the @key{RETURN} will execute the last entered command. +When in debug mode the @key{RETURN} key will execute the last entered command. This is useful, for example, after hitting a breakpoint and entering -@code{dbstep}. After that one can advance line by line through the code +@code{dbstep} once. After that, one can advance line by line through the code with only a single key stroke. @node Call Stack @section Call Stack +The function being debugged may be the leaf node of a series of function calls. +After examining values in the current subroutine it may turn out that the +problem occurred in earlier pieces of code. Use @code{dbup} and @code{dbdown} +to move up and down through the series of function calls to locate where +variables first took on the wrong values. @code{dbstack} shows the entire +series of function calls and at what level debugging is currently taking place. + @DOCSTRING(dbstack) @DOCSTRING(dbup) diff -r 4c064d3d2750 -r 1e148ecdeedd doc/interpreter/external.txi --- a/doc/interpreter/external.txi Mon Jan 27 09:50:53 2014 -0800 +++ b/doc/interpreter/external.txi Wed Jan 29 15:28:35 2014 -0500 @@ -1037,14 +1037,14 @@ given in the following example, where the C++ wrapper is @example -@EXAMPLEFILE(fortdemo.cc) +@EXAMPLEFILE(fortrandemo.cc) @end example @noindent and the Fortran function is @example -@EXAMPLEFILE(fortsub.f) +@EXAMPLEFILE(fortransub.f) @end example This example demonstrates most of the features needed to link to an @@ -1054,13 +1054,13 @@ @example @group -mkoctfile fortdemo.cc fortsub.f -[b, s] = fortdemo (1:3) +mkoctfile fortrandemo.cc fortransub.f +[b, s] = fortrandemo (1:3) @result{} b = 1.00000 0.50000 0.33333 s = There are 3 values in the input vector -[b, s] = fortdemo (0:3) -error: fortdemo: fortsub: divide by zero +[b, s] = fortrandemo (0:3) +error: fortrandemo: fortransub: divide by zero @end group @end example @@ -1712,12 +1712,11 @@ @example @group -myfeval ("sin", 1) a = myfeval ("sin", 1) -@result{} Hello, World! - I have 2 inputs and 1 outputs - I'm going to call the interpreter function sin - a = 0.84147 +@result{} Starting file myfeval.mex + I have 2 inputs and 1 outputs + I'm going to call the interpreter function sin + a = 0.84147 @end group @end example @@ -1811,8 +1810,7 @@ This is the norm of the matrix: 34.4952 - +$ @end group @end example - diff -r 4c064d3d2750 -r 1e148ecdeedd doc/interpreter/linalg.txi --- a/doc/interpreter/linalg.txi Mon Jan 27 09:50:53 2014 -0800 +++ b/doc/interpreter/linalg.txi Wed Jan 29 15:28:35 2014 -0500 @@ -20,10 +20,19 @@ @chapter Linear Algebra @cindex linear algebra -This chapter documents the linear algebra functions of Octave. -Reference material for many of these functions may be found in -Golub and Van Loan, @cite{Matrix Computations, 2nd Ed.}, Johns Hopkins, -1989, and in the @cite{@sc{lapack} Users' Guide}, SIAM, 1992. +This chapter documents the linear algebra functions provided in Octave. +Reference material for many of these functions may be found in Golub and +Van Loan, @cite{Matrix Computations, 2nd Ed.}, Johns Hopkins, 1989, and +in the @cite{@sc{lapack} Users' Guide}, SIAM, 1992. The +@cite{@sc{lapack} Users' Guide} is available at: +@cite{http://www.netlib.org/lapack/lug/} + +A common text for engineering courses is G. Strang, @cite{Linear Algebra +and Its Applications, 4th Edition}. It has become a widespread reference +for linear algebra. An alternative is P. Lax @cite{Linear Algebra and +Its Applications}, and also is a good choice. It claims to be suitable +for high school students with substantial mathematical interests as well +as first-year undergraduates. @menu * Techniques Used for Linear Algebra:: @@ -37,18 +46,18 @@ @section Techniques Used for Linear Algebra @cindex linear algebra, techniques -Octave includes a polymorphic solver, that selects an appropriate -matrix factorization depending on the properties of the matrix itself. -Generally, the cost of determining the matrix type is small relative to -the cost of factorizing the matrix itself, but in any case the matrix -type is cached once it is calculated, so that it is not re-determined -each time it is used in a linear equation. +Octave includes a polymorphic solver that selects an appropriate matrix +factorization depending on the properties of the matrix itself. +Generally, the cost of determining the matrix type is small relative to +the cost of factorizing the matrix itself. In any case the matrix type +is cached once it is calculated so that it is not re-determined each +time it is used in a linear equation. -The selection tree for how the linear equation is solve or a matrix -inverse is form is given by +The selection tree for how the linear equation is solved or a matrix +inverse is formed is given by: @enumerate 1 -@item If the matrix is upper or lower triangular sparse a forward or +@item If the matrix is upper or lower triangular sparse use a forward or backward substitution using the @sc{lapack} xTRTRS function, and goto 4. @c Permuted triangular matrices currently disabled in the code @@ -76,10 +85,10 @@ used with care. It should be noted that the test for whether a matrix is a candidate for -Cholesky@tie{}factorization, performed above and by the @code{matrix_type} -function, does not give a certainty that the matrix is +Cholesky@tie{}factorization, performed above, and by the @code{matrix_type} +function, does not make certain that the matrix is Hermitian. However, the attempt to factorize the matrix will quickly -flag a non-Hermitian matrix. +detect a non-Hermitian matrix. @node Basic Matrix Functions @section Basic Matrix Functions diff -r 4c064d3d2750 -r 1e148ecdeedd examples/Makefile.am --- a/examples/Makefile.am Mon Jan 27 09:50:53 2014 -0800 +++ b/examples/Makefile.am Wed Jan 29 15:28:35 2014 -0500 @@ -34,8 +34,8 @@ addtwomatrices.cc \ celldemo.cc \ embedded.cc \ - fortdemo.cc \ - fortsub.f \ + fortrandemo.cc \ + fortransub.f \ funcdemo.cc \ globaldemo.cc \ helloworld.cc \ diff -r 4c064d3d2750 -r 1e148ecdeedd examples/fortdemo.cc --- a/examples/fortdemo.cc Mon Jan 27 09:50:53 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -#include -#include - -extern "C" -{ - F77_RET_T - F77_FUNC (fortsub, FORTSUB) - (const int&, double*, F77_CHAR_ARG_DECL F77_CHAR_ARG_LEN_DECL); -} - -DEFUN_DLD (fortdemo, args, , "Fortran Demo") -{ - octave_value_list retval; - int nargin = args.length (); - - if (nargin != 1) - print_usage (); - else - { - NDArray a = args(0).array_value (); - if (! error_state) - { - double *av = a.fortran_vec (); - octave_idx_type na = a.numel (); - OCTAVE_LOCAL_BUFFER (char, ctmp, 128); - - F77_XFCN (fortsub, FORTSUB, - (na, av, ctmp F77_CHAR_ARG_LEN (128))); - - retval(1) = std::string (ctmp); - retval(0) = a; - } - } - return retval; -} diff -r 4c064d3d2750 -r 1e148ecdeedd examples/fortrandemo.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/fortrandemo.cc Wed Jan 29 15:28:35 2014 -0500 @@ -0,0 +1,35 @@ +#include +#include + +extern "C" +{ + F77_RET_T + F77_FUNC (fortransub, FORTSUB) + (const int&, double*, F77_CHAR_ARG_DECL F77_CHAR_ARG_LEN_DECL); +} + +DEFUN_DLD (fortrandemo, args, , "Fortran Demo") +{ + octave_value_list retval; + int nargin = args.length (); + + if (nargin != 1) + print_usage (); + else + { + NDArray a = args(0).array_value (); + if (! error_state) + { + double *av = a.fortran_vec (); + octave_idx_type na = a.numel (); + OCTAVE_LOCAL_BUFFER (char, ctmp, 128); + + F77_XFCN (fortransub, FORTSUB, + (na, av, ctmp F77_CHAR_ARG_LEN (128))); + + retval(1) = std::string (ctmp); + retval(0) = a; + } + } + return retval; +} diff -r 4c064d3d2750 -r 1e148ecdeedd examples/fortransub.f --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/fortransub.f Wed Jan 29 15:28:35 2014 -0500 @@ -0,0 +1,21 @@ + subroutine fortransub (n, a, s) + implicit none + character*(*) s + real*8 a(*) + integer*4 i, n, ioerr + do i = 1, n + if (a(i) .eq. 0d0) then + call xstopx ('fortransub: divide by zero') + else + a(i) = 1d0 / a(i) + endif + enddo + write (unit = s, fmt = '(a,i3,a,a)', iostat = ioerr) + $ 'There are ', n, + $ ' values in the input vector', char(0) + if (ioerr .ne. 0) then + call xstopx ('fortransub: error writing string') + endif + return + end + diff -r 4c064d3d2750 -r 1e148ecdeedd examples/fortsub.f --- a/examples/fortsub.f Mon Jan 27 09:50:53 2014 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ - subroutine fortsub (n, a, s) - implicit none - character*(*) s - real*8 a(*) - integer*4 i, n, ioerr - do i = 1, n - if (a(i) .eq. 0d0) then - call xstopx ('fortsub: divide by zero') - else - a(i) = 1d0 / a(i) - endif - enddo - write (unit = s, fmt = '(a,i3,a,a)', iostat = ioerr) - $ 'There are ', n, - $ ' values in the input vector', char(0) - if (ioerr .ne. 0) then - call xstopx ('fortsub: error writing string') - endif - return - end - diff -r 4c064d3d2750 -r 1e148ecdeedd examples/mex_demo.c --- a/examples/mex_demo.c Mon Jan 27 09:50:53 2014 -0800 +++ b/examples/mex_demo.c Wed Jan 29 15:28:35 2014 -0500 @@ -10,13 +10,13 @@ // // To compile this file, type the command // -// mkoctfile mex_demo.c +// mkoctfile --mex mex_demo.c // // from within Octave or from the shell prompt. This will create a file // called mex_demo.mex that can be loaded by Octave. To test the mex_demo.mex // file, start Octave and type the command // -// [d] = mex_demo ("easy as", 1, 2, 3) +// d = mex_demo ("easy as", 1, 2, 3) // // at the Octave prompt. Octave should respond by printing // diff -r 4c064d3d2750 -r 1e148ecdeedd examples/myfeval.c --- a/examples/myfeval.c Mon Jan 27 09:50:53 2014 -0800 +++ b/examples/myfeval.c Wed Jan 29 15:28:35 2014 -0500 @@ -6,7 +6,7 @@ { char *str; - mexPrintf ("Hello, World!\n"); + mexPrintf ("Starting file myfeval.mex\n"); mexPrintf ("I have %d inputs and %d outputs\n", nrhs, nlhs); @@ -17,7 +17,11 @@ mexPrintf ("I'm going to call the function %s\n", str); - mexCallMATLAB (nlhs, plhs, nrhs-1, (mxArray*)prhs+1, str); + if (nlhs == 0) + nlhs = 1; // Octave's automatic 'ans' variable + + /* Cast prhs just to get rid of 'const' qualifier and stop compile warning */ + mexCallMATLAB (nlhs, plhs, nrhs-1, (mxArray**)prhs+1, str); mxFree (str); } diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/languages/be_BY.ts --- a/libgui/languages/be_BY.ts Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/languages/be_BY.ts Wed Jan 29 15:28:35 2014 -0500 @@ -898,7 +898,7 @@ - Print To File ... + Print To File... Друк у файл... @@ -2065,7 +2065,7 @@ - Find Files ... + Find Files... Шукаць файлы... @@ -2111,6 +2111,11 @@ + Search Directory... + Шукаць каталог... + + + Find Files... Шукаць файлы... diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/languages/de_DE.ts --- a/libgui/languages/de_DE.ts Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/languages/de_DE.ts Wed Jan 29 15:28:35 2014 -0500 @@ -525,8 +525,8 @@ - Find Files ... - Dateien suchen ... + Find Files... + Dateien suchen... @@ -571,9 +571,14 @@ + Search Directory... + Verzeichnis suchen... + + + Find Files... Dateien suchen... - Suche Dateien... + Dateien suchen... @@ -914,7 +919,7 @@ Browse... - Suche ... + Suche... @@ -1024,7 +1029,7 @@ Searching... - Suche ... + Suche... diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/languages/en_US.ts --- a/libgui/languages/en_US.ts Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/languages/en_US.ts Wed Jan 29 15:28:35 2014 -0500 @@ -508,7 +508,7 @@ - Find Files ... + Find Files... @@ -554,6 +554,11 @@ + Search Directory... + + + + Find Files... diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/languages/es_ES.ts --- a/libgui/languages/es_ES.ts Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/languages/es_ES.ts Wed Jan 29 15:28:35 2014 -0500 @@ -508,8 +508,8 @@ - Find Files ... - Buscar archivos ... + Find Files... + Buscar archivos... @@ -554,6 +554,11 @@ + Search Directory... + Buscar directorio... + + + Find Files... Buscar archivos... diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/languages/fr_FR.ts --- a/libgui/languages/fr_FR.ts Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/languages/fr_FR.ts Wed Jan 29 15:28:35 2014 -0500 @@ -524,7 +524,7 @@ - Find Files ... + Find Files... Rechercher des fichiers... @@ -570,6 +570,11 @@ + Search Directory... + Rechercher dans le répertoire... + + + Find Files... Rechercher des fichiers... diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/languages/nl_NL.ts --- a/libgui/languages/nl_NL.ts Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/languages/nl_NL.ts Wed Jan 29 15:28:35 2014 -0500 @@ -897,7 +897,7 @@ - Print To File ... + Print To File... Druk af naar bestand... @@ -2063,8 +2063,8 @@ - Find Files ... - Zoek bestanden ... + Find Files... + Zoek bestanden... @@ -2109,6 +2109,11 @@ + Search Directory... + Zoek in map... + + + Find Files... Zoek bestanden... @@ -2453,7 +2458,7 @@ Browse... - Bladeren ... + Bladeren... diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/languages/pt_BR.ts --- a/libgui/languages/pt_BR.ts Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/languages/pt_BR.ts Wed Jan 29 15:28:35 2014 -0500 @@ -388,7 +388,7 @@ Goto line - Vá para linha... + Vá para linha @@ -522,7 +522,7 @@ - Find Files ... + Find Files... Buscar Arquivos... @@ -554,20 +554,25 @@ Set Octave directory - Definir o diretório do Octave + Escolher o diretório do Octave Set Octave directroy to current browser directory - Definir diretório do Octave igual ao diretório atual no navegador + Configurar o diretório do Octave igual ao diretório atual no navegador Show Home Directory - Exibir diretório pessoal + Exibir Diretório Pessoal + Search Directory... + Buscar no Diretório... + + + Find Files... Buscar Arquivos... @@ -629,7 +634,7 @@ Set Current Directory - Definir Diretório Atual + Escolher Diretório Atual @@ -679,7 +684,7 @@ Set directory of file browser - Definir diretório do Navegador de Arquivos + Escolher diretório do Navegador de Arquivos @@ -743,9 +748,9 @@ You can find more information about each of these by visiting <a href="http://octave.org/support.html">http://octave.org/support.html</a> (opens in external browser).</p> </body></html> <html><body> -<p>Esperamos que o Octave seja uma ferramenta últil.</p> -<p>Se encontrar problemas, existem várias maneiras de pedir ajuda incluindo suporte comercial, lista de email, wiki, e outros canais de suporte da comunidade. -Você pode encontrar mais informações sobre cada um deles visitando <a href="http://octave.org/support.html">http://octave.org/support.html</a> (opens in external browser).</p> +<p>Esperamos que você ache o Octave uma ferramenta útil.</p> +<p>Se encontrar dificuldades, existem várias formas de obter assistência, incluindo suporte comercial, listas de email, wiki, e outros canais de suporte comunitários. +Você pode encontrar mais informações sobre cada um deles visitando <a href="http://octave.org/support.html">http://octave.org/support.html</a> (link abre em navegador externo).</p> </body></html> @@ -831,7 +836,7 @@ &More... - &Mais... + &Mais opções... @@ -846,7 +851,7 @@ Search &backward - Buscar de trás para frente + Buscar de &trás para frente @@ -1109,7 +1114,7 @@ </body></html> <html><body> <p>Parece que você está usando a interface gráfica pela primeira vez neste computador. -Clique em próximo para criar um arquivo de configuração e lançar o Octave.</p> +Clique em 'Avançar' para criar um arquivo de configuração e iniciar o Octave.</p> <p>O arquivo de configuração é armazenado em<br>%1.</p> </body></html> @@ -1119,7 +1124,7 @@ Load Workspace - Carregar Ambiente de Trabalho... + Carregar Ambiente de Trabalho @@ -1180,7 +1185,7 @@ Save Workspace As - Salvar Ambiente de Trabalho Como... + Salvar Ambiente de Trabalho Como @@ -1286,7 +1291,7 @@ Load Workspace... - Carregar ambiente de trabalho... + Carregar Ambiente de Trabalho... @@ -1777,7 +1782,7 @@ <html><head/><body><p>Select font, font size (as a difference from the default size), font style (<b>b</b>old, <b>i</b>talic, <b>u</b>nderline), text color and background color (for the latter, the color pink (255,0,255) is a placeholder for the default background color).</p></body></html> - <html><head/><body><p>Selecionar fonte, tamanho da fonte (como uma diferença do tamanho padrão), estilo da fonte (<b>n</b>egrito, <b>i</b>tálico, <b>s</b>ublinhado), cor de texto e cor de fundo (a cor rosa (255,0,255) é a cor de fundo padrão).</p></body></html> + <html><head/><body><p>Selecionar fonte, tamanho da fonte (variacão com relacão ao tamanho padrão), estilo da fonte (<b>n</b>egrito, <b>i</b>tálico, <b>s</b>ublinhado), cor da fonte e cor de fundo (a cor rosa (255,0,255) é a cor de fundo padrão).</p></body></html> diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/languages/pt_PT.ts --- a/libgui/languages/pt_PT.ts Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/languages/pt_PT.ts Wed Jan 29 15:28:35 2014 -0500 @@ -1191,7 +1191,7 @@ - Find Files ... + Find Files... Procurar Ficheiros... @@ -1237,6 +1237,11 @@ + Search Directory... + Procurar no directório... + + + Find Files... Encontrar Ficheiros... diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/languages/ru_RU.ts --- a/libgui/languages/ru_RU.ts Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/languages/ru_RU.ts Wed Jan 29 15:28:35 2014 -0500 @@ -524,7 +524,7 @@ - Find Files ... + Find Files... Найти файлы... @@ -570,6 +570,11 @@ + Search Directory... + + + + Find Files... Найти файлы... diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/languages/uk_UA.ts --- a/libgui/languages/uk_UA.ts Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/languages/uk_UA.ts Wed Jan 29 15:28:35 2014 -0500 @@ -1174,7 +1174,7 @@ - Find Files ... + Find Files... @@ -1220,6 +1220,11 @@ + Search Directory... + + + + Find Files... diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/src/dialog.cc --- a/libgui/src/dialog.cc Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/src/dialog.cc Wed Jan 29 15:28:35 2014 -0500 @@ -491,8 +491,20 @@ for (int i = 0; i < string_result.size (); i++) string_result[i] = QFileInfo (string_result[i]).fileName (); + path = directory ().absolutePath (); - path = directory ().absolutePath (); + // if not showing only dirs, add end slash for the path component + if (testOption (QFileDialog::ShowDirsOnly) == false) + path = path + "/"; + else + { + // if name was provided in uigetdir, add to path + if (string_result.size() > 0) + path = path + "/" + string_result[0]; + } + + // convert to native slashes + path = QDir::toNativeSeparators (path); QStringList name_filters = nameFilters (); idx = name_filters.indexOf (selectedNameFilter ()) + 1; diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/src/files-dock-widget.cc --- a/libgui/src/files-dock-widget.cc Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/src/files-dock-widget.cc Wed Jan 29 15:28:35 2014 -0500 @@ -477,12 +477,23 @@ QMenu menu (this); QModelIndex index = _file_tree_view->indexAt (mpos); - //QAbstractItemModel *m = _file_tree_view->model (); if (index.isValid ()) { QFileInfo info = _file_system_model->fileInfo (index); + QItemSelectionModel *m = _file_tree_view->selectionModel (); + QModelIndexList sel = m->selectedRows (); + + // check if item at mouse position is seleccted + if (! sel.contains (index)) + { // is not selected -> clear actual selection and select this item + m->setCurrentIndex(index, + QItemSelectionModel::Clear | QItemSelectionModel::Select | + QItemSelectionModel::Rows); + } + + // construct the context menu depending on item menu.addAction (QIcon (":/actions/icons/fileopen.png"), tr ("Open"), this, SLOT (contextmenu_open (bool))); @@ -506,26 +517,28 @@ tr ("Set Current Directory"), this, SLOT (contextmenu_setcurrentdir (bool))); menu.addSeparator (); - menu.addAction (tr ("Find Files ..."), this, + menu.addAction (QIcon (":/actions/icons/findf.png"), + tr ("Find Files..."), this, SLOT (contextmenu_findfiles (bool))); } menu.addSeparator (); - menu.addAction (tr ("Rename"), this, SLOT (contextmenu_rename (bool))); - menu.addAction (QIcon (":/actions/icons/editdelete.png"), tr ("Delete"), - this, SLOT (contextmenu_delete (bool))); + menu.addAction (tr ("Rename..."), this, SLOT (contextmenu_rename (bool))); + menu.addAction (QIcon (":/actions/icons/editdelete.png"), + tr ("Delete..."), this, SLOT (contextmenu_delete (bool))); if (info.isDir ()) { menu.addSeparator (); menu.addAction (QIcon (":/actions/icons/filenew.png"), - tr ("New File"), + tr ("New File..."), this, SLOT (contextmenu_newfile (bool))); menu.addAction (QIcon (":/actions/icons/folder_new.png"), - tr ("New Directory"), + tr ("New Directory..."), this, SLOT (contextmenu_newdir (bool))); } + // show the menu menu.exec (_file_tree_view->mapToGlobal (mpos)); } @@ -540,7 +553,14 @@ for ( QModelIndexList::iterator it = rows.begin (); it != rows.end (); it++) { - item_double_clicked (*it); + QFileInfo file = _file_system_model->fileInfo (*it); + if (file.exists ()) + { + if (file.isFile ()) + emit open_file (file.absoluteFilePath ()); + else + set_current_directory (file.absoluteFilePath ()); + } } } diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/src/m-editor/file-editor-interface.h --- a/libgui/src/m-editor/file-editor-interface.h Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/src/m-editor/file-editor-interface.h Wed Jan 29 15:28:35 2014 -0500 @@ -61,6 +61,8 @@ virtual void set_focus () = 0; + virtual void empty_script (bool, bool) = 0; + public slots: virtual void request_new_file (const QString& command = QString ()) = 0; virtual void request_new_script (const QString& command = QString ()) = 0; diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/src/m-editor/file-editor.cc Wed Jan 29 15:28:35 2014 -0500 @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -1547,5 +1548,67 @@ _redo_action->setEnabled (have_tabs); } +// empty_script determines whether we have to create an empty script +// 1. At startup, when the editor has to be (really) visible +// (Here we can not use the visibility changed signal) +// 2. When the editor becomes visible when octave is running +void +file_editor::empty_script (bool startup, bool visible) +{ + bool real_visible; + + if (startup) + real_visible = isVisible (); + else + real_visible = visible; + + if (! real_visible || _tab_widget->count () > 0) + return; + + if (startup && ! isFloating ()) + { + // check is editor is really visible or hidden between tabbed widgets + QList tab_list = main_win ()->findChildren(); + + bool in_tab = false; + int i = 0; + while ((i < tab_list.count ()) && (! in_tab)) + { + QTabBar *tab = tab_list.at (i); + i++; + + int j = 0; + while ((j < tab->count ()) && (! in_tab)) + { + // check all tabs for the editor + if (tab->tabText (j) == windowTitle ()) + { + // editor is in this tab widget + in_tab = true; + int top = tab->currentIndex (); + if (top > -1 && tab->tabText (top) == windowTitle ()) + real_visible = true; // and is the current tab + else + return; // not current tab -> not visible + } + j++; + } + } + } + + request_new_file (""); +} + +// This slot is a reimplementation of the virtual slot in octave_dock_widget. +// We need this for creating an empty script when the editor has no open files +// and is made visible +void +file_editor::handle_visibility (bool visible) + { + empty_script (false, visible); + + if (visible && ! isFloating ()) + focus (); + } #endif diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/src/m-editor/file-editor.h --- a/libgui/src/m-editor/file-editor.h Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/src/m-editor/file-editor.h Wed Jan 29 15:28:35 2014 -0500 @@ -58,6 +58,8 @@ void handle_exit_debug_mode (void); void check_actions (void); + void empty_script (bool startup, bool visible); + signals: void fetab_settings_changed (const QSettings *settings); @@ -172,6 +174,8 @@ // Tells the ditor to dis- or enable some shortcuts void set_shortcuts (bool set_shortcuts); + void handle_visibility (bool visible); + protected slots: void copyClipboard (); diff -r 4c064d3d2750 -r 1e148ecdeedd libgui/src/main-window.cc --- a/libgui/src/main-window.cc Mon Jan 27 09:50:53 2014 -0800 +++ b/libgui/src/main-window.cc Wed Jan 29 15:28:35 2014 -0500 @@ -1010,6 +1010,9 @@ { foreach (octave_dock_widget *widget, dock_widget_list ()) widget->connect_visibility_changed (); + + // Main window completely shown, determine whether to create an empty script + editor_window->empty_script (true, false); } void diff -r 4c064d3d2750 -r 1e148ecdeedd libinterp/corefcn/ls-mat4.cc --- a/libinterp/corefcn/ls-mat4.cc Mon Jan 27 09:50:53 2014 -0800 +++ b/libinterp/corefcn/ls-mat4.cc Wed Jan 29 15:28:35 2014 -0500 @@ -585,5 +585,5 @@ else gripe_wrong_type_arg ("save", tc, false); - return os; + return ! os.fail (); } diff -r 4c064d3d2750 -r 1e148ecdeedd libinterp/corefcn/urlwrite.cc --- a/libinterp/corefcn/urlwrite.cc Mon Jan 27 09:50:53 2014 -0800 +++ b/libinterp/corefcn/urlwrite.cc Wed Jan 29 15:28:35 2014 -0500 @@ -418,7 +418,7 @@ url_transfer curl = url_transfer (url, ofile); - if (! curl.is_valid ()) + if (curl.is_valid ()) { curl.http_action (param, method); diff -r 4c064d3d2750 -r 1e148ecdeedd libinterp/octave-value/ov-cell.cc --- a/libinterp/octave-value/ov-cell.cc Mon Jan 27 09:50:53 2014 -0800 +++ b/libinterp/octave-value/ov-cell.cc Wed Jan 29 15:28:35 2014 -0500 @@ -780,7 +780,7 @@ bool b = save_ascii_data (os, o_val, CELL_ELT_TAG, false, 0); if (! b) - return os; + return ! os.fail (); } } else @@ -802,7 +802,7 @@ bool b = save_ascii_data (os, o_val, CELL_ELT_TAG, false, 0); if (! b) - return os; + return ! os.fail (); } os << "\n"; diff -r 4c064d3d2750 -r 1e148ecdeedd libinterp/octave-value/ov-class.cc --- a/libinterp/octave-value/ov-class.cc Mon Jan 27 09:50:53 2014 -0800 +++ b/libinterp/octave-value/ov-class.cc Wed Jan 29 15:28:35 2014 -0500 @@ -1251,7 +1251,7 @@ bool b = save_ascii_data (os, val, m.key (i), false, 0); if (! b) - return os; + return ! os.fail (); i++; } @@ -1380,7 +1380,7 @@ bool b = save_binary_data (os, val, m.key (i), "", 0, save_as_floats); if (! b) - return os; + return ! os.fail (); i++; } diff -r 4c064d3d2750 -r 1e148ecdeedd libinterp/octave-value/ov-fcn-handle.cc --- a/libinterp/octave-value/ov-fcn-handle.cc Mon Jan 27 09:50:53 2014 -0800 +++ b/libinterp/octave-value/ov-fcn-handle.cc Wed Jan 29 15:28:35 2014 -0500 @@ -380,7 +380,7 @@ p = vars.begin (); p != vars.end (); p++) { if (! save_ascii_data (os, p->varval (0), p->name (), false, 0)) - return os; + return ! os.fail (); } } } @@ -556,7 +556,7 @@ { if (! save_binary_data (os, p->varval (0), p->name (), "", 0, save_as_floats)) - return os; + return ! os.fail (); } } } diff -r 4c064d3d2750 -r 1e148ecdeedd libinterp/octave-value/ov-struct.cc --- a/libinterp/octave-value/ov-struct.cc Mon Jan 27 09:50:53 2014 -0800 +++ b/libinterp/octave-value/ov-struct.cc Wed Jan 29 15:28:35 2014 -0500 @@ -769,7 +769,7 @@ bool b = save_ascii_data (os, val, key, false, 0); if (! b) - return os; + return ! os.fail (); } return true; @@ -894,7 +894,7 @@ bool b = save_binary_data (os, val, key, "", 0, save_as_floats); if (! b) - return os; + return ! os.fail (); } return true; @@ -1471,7 +1471,7 @@ bool b = save_ascii_data (os, val, key, false, 0); if (! b) - return os; + return ! os.fail (); } return true; @@ -1555,7 +1555,7 @@ bool b = save_binary_data (os, val, key, "", 0, save_as_floats); if (! b) - return os; + return ! os.fail (); } return true; diff -r 4c064d3d2750 -r 1e148ecdeedd scripts/help/__makeinfo__.m --- a/scripts/help/__makeinfo__.m Mon Jan 27 09:50:53 2014 -0800 +++ b/scripts/help/__makeinfo__.m Wed Jan 29 15:28:35 2014 -0500 @@ -129,10 +129,10 @@ ## Take action depending on output type switch (lower (output_type)) case "plain text" - cmd = sprintf ("%s --no-headers --no-warn --force --no-validate %s", + cmd = sprintf ("%s --no-headers --no-warn --force --no-validate --output=- %s", makeinfo_program (), name); case "html" - cmd = sprintf ("%s --no-headers --html --no-warn --no-validate --force %s", + cmd = sprintf ("%s --no-headers --html --no-warn --no-validate --force --output=- %s", makeinfo_program (), name); otherwise error ("__makeinfo__: unsupported output type: '%s'", output_type); diff -r 4c064d3d2750 -r 1e148ecdeedd scripts/miscellaneous/debug.m --- a/scripts/miscellaneous/debug.m Mon Jan 27 09:50:53 2014 -0800 +++ b/scripts/miscellaneous/debug.m Wed Jan 29 15:28:35 2014 -0500 @@ -37,9 +37,13 @@ ## Report the current file and line number where execution is stopped. ## ## @item dbtype -## List the function where execution is currently stopped, enumerating +## Display the code of the function being debugged, enumerating ## the line numbers. ## +## @item dblist +## List 10 lines of code centered around the line number where execution is +## stopped. +## ## @item dbstep ## @itemx dbnext ## Execute (step) one or more lines, follow execution into (step into) a diff -r 4c064d3d2750 -r 1e148ecdeedd scripts/plot/util/graphics_toolkit.m --- a/scripts/plot/util/graphics_toolkit.m Mon Jan 27 09:50:53 2014 -0800 +++ b/scripts/plot/util/graphics_toolkit.m Wed Jan 29 15:28:35 2014 -0500 @@ -66,6 +66,10 @@ endif endif + if (! any (strcmp (available_graphics_toolkits (), name))) + error ("graphics_toolkit: %s toolkit is not available", name); + endif + if (! any (strcmp (loaded_graphics_toolkits (), name))) feval (["__init_", name, "__"]); if (! any (strcmp (loaded_graphics_toolkits (), name))) diff -r 4c064d3d2750 -r 1e148ecdeedd scripts/testfun/assert.m --- a/scripts/testfun/assert.m Mon Jan 27 09:50:53 2014 -0800 +++ b/scripts/testfun/assert.m Wed Jan 29 15:28:35 2014 -0500 @@ -56,7 +56,7 @@ function assert (cond, varargin) - if (nargin == 0 || nargin > 3) + if (nargin == 0) print_usage (); endif @@ -84,8 +84,10 @@ expected = varargin{1}; if (nargin < 3) tol = 0; + elseif (nargin == 3) + tol = varargin{2}; else - tol = varargin{2}; + print_usage (); endif ## Add to list as the errors accumulate. If empty at end then no errors. @@ -396,6 +398,8 @@ %!error assert ([1,0,1]) %!error assert ([1;1;0]) %!error assert ([1,0;1,1]) +%!error <2-part error> assert (false, "%s %s", "2-part", "error") +%!error <2-part error> assert (false, "TST:msg_id", "%s %s", "2-part", "error") ## scalars %!error assert (3, [3,3]) diff -r 4c064d3d2750 -r 1e148ecdeedd src/shared-fcns.h --- a/src/shared-fcns.h Mon Jan 27 09:50:53 2014 -0800 +++ b/src/shared-fcns.h Wed Jan 29 15:28:35 2014 -0500 @@ -23,6 +23,7 @@ #if defined (__WIN32__) && ! defined (_POSIX_VERSION) #include +#include #ifdef _MSC_VER #define popen _popen