# HG changeset patch # User John W. Eaton # Date 1389036896 18000 # Node ID 1af5ee5f30762ef01e7a5f4899058d7f7987c681 # Parent cda4bd2fd0c09e1a3287cf990d991488c045404b# Parent 9a0f996a358ad53ca95818ac69f76170c3f76a97 maint: Periodic merge of gui-release to default. diff -r cda4bd2fd0c0 -r 1af5ee5f3076 configure.ac --- a/configure.ac Fri Jan 03 20:55:33 2014 -0500 +++ b/configure.ac Mon Jan 06 14:34:56 2014 -0500 @@ -1,19 +1,19 @@ dnl Process this file with autoconf to produce a configure script. dnl dnl Copyright (C) 1993-2013 John W. Eaton -### +### ### 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 ### . @@ -50,7 +50,7 @@ OCTAVE_CANONICAL_HOST AC_DEFINE(OCTAVE_SOURCE, 1, [Define to 1 if this is Octave.]) - + AC_USE_SYSTEM_EXTENSIONS ### Make configure args available for other uses. @@ -450,7 +450,7 @@ ;; esac]) -AC_DEFINE_UNQUOTED(FLOAT_TRUNCATE, [$ac_float_truncate], +AC_DEFINE_UNQUOTED(FLOAT_TRUNCATE, [$ac_float_truncate], [Define to volatile if you need to truncate intermediate FP results.]) ### Determine extra CFLAGS that may be necessary for Octave. @@ -990,7 +990,7 @@ ## Make sure we only get -I, -L, and -l flags. Some Graphics/ImageMagick++ ## packages add extra flags that are useful when building ## Graphics/ImageMagick++ extentions. These extra flags break the - ## Octave build. + ## Octave build. MAGICK_CPPFLAGS=`$PKG_CONFIG --cflags-only-I $magick++` MAGICK_LDFLAGS=`$PKG_CONFIG --libs-only-L $magick++` MAGICK_LIBS=`$PKG_CONFIG --libs-only-l $magick++` @@ -1051,7 +1051,7 @@ if test -z "$x_libraries"; then AC_CHECK_LIB([X11], XrmInitialize, [X11_LIBS="-lX11"], [X11_LIBS=]) elif test $x_libraries != "NONE"; then - AC_CHECK_LIB([X11], XrmInitialize, + AC_CHECK_LIB([X11], XrmInitialize, [X11_LIBS="-L$x_libraries -lX11"], [X11_LIBS=], "-L$x_libraries") fi AC_SUBST(X11_LIBS) @@ -1225,7 +1225,7 @@ warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled." else AC_DEFINE(HAVE_FLTK, 1, [Define to 1 if FLTK is available.]) - fi + fi if test -z "$warn_fltk_opengl"; then GRAPHICS_CFLAGS="$FLTK_CFLAGS" @@ -1381,7 +1381,7 @@ ### Check for the qrupdate library -## No need to adjust FFLAGS because only link is attempted. +## No need to adjust FFLAGS because only link is attempted. ## Must supply proper LIBS, however. save_LIBS="$LIBS" LIBS="$LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS" @@ -1516,7 +1516,7 @@ [suitesparseconfig SuiteSparse], [], [], [$xtra_libs]) case $ac_cv_search_SuiteSparse_time in - -l*) + -l*) UMFPACK_LIBS="$UMFPACK_LIBS $ac_cv_search_SuiteSparse_time" ;; no) @@ -1634,13 +1634,13 @@ FPICFLAG= ;; esac - SHLEXT=dylib + SHLEXT=dylib SHLLIB='$(SHLEXT)' SHLEXT_VER='$(version).$(SHLEXT)' SHLLIB_VER='$(version).$(SHLLIB)' NO_OCT_FILE_STRIP=true SONAME_FLAGS='-install_name $(octlibdir)/$@' - library_path_var=DYLD_LIBRARY_PATH + library_path_var=DYLD_LIBRARY_PATH ;; *-*-cygwin*) CPICFLAG= @@ -1651,7 +1651,7 @@ SHLBINPRE=cyg SHLEXT=dll SHLLIB=dll.a - SHLBIN=dll + SHLBIN=dll DL_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc" SH_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base" SONAME_FLAGS='-Wl,--out-implib=$(patsubst $(SHLPRE)%,$(LIBPRE)%,$@).a' @@ -2132,7 +2132,7 @@ AC_FUNC_ALLOCA ## Does the C compiler support Automake subdir-objects option? -AM_PROG_CC_C_O +AM_PROG_CC_C_O ### gnulib initialization: part 2 ### After all include and path modifications have taken place @@ -2241,7 +2241,7 @@ [Define to 1 if _USE_MATH_DEFINES is required to get math constants like M_LN2.]) CPPFLAGS="$CPPFLAGS -D_USE_MATH_DEFINES" fi -fi +fi if test $octave_cv_header_math_defines = yes; then AC_DEFINE(HAVE_MATH_DEFINES, 1, @@ -2293,7 +2293,7 @@ AC_FUNC_CLOSEDIR_VOID -## Check return type of matherr() +## Check return type of matherr() AC_CACHE_CHECK([for struct exception in math.h], [octave_cv_func_matherr_type], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -2310,7 +2310,7 @@ AC_DEFINE(EXCEPTION_IN_MATH, 1, [Define to 1 if math.h declares struct exception for matherr().]) fi - + ## Signal stuff. AC_CHECK_DECLS([sys_siglist], [], [], @@ -2340,7 +2340,7 @@ AM_CONDITIONAL([AMCOND_BUILD_DOCS], [test -n "$DOCDIR"]) ### Maybe add -Wall, -W, and -Wshadow to compiler flags now that we're -### done feature testing. +### done feature testing. GCC_EXTRA_FLAGS="-Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual" @@ -2562,7 +2562,7 @@ fi if test -z "$JAVA_LDPATH"; then - ## Nothing found. Try Java again using bootpath argument. + ## Nothing found. Try Java again using bootpath argument. JAVA_TMP_LDPATH=`$JAVA -classpath ${srcdir}/build-aux OctJavaQry JAVA_BOOTPATH` JAVA_TMP_LDPATH="${JAVA_TMP_LDPATH} ${JAVA_TMP_LDPATH}/client ${JAVA_TMP_LDPATH}/server" for dir in $JAVA_TMP_LDPATH; do @@ -2595,7 +2595,7 @@ : # libjvm found else JAVA_LDPATH="" - fi + fi fi if test -z "$JAVA_LDPATH"; then @@ -2635,7 +2635,7 @@ ## Verify jni.h include file exists. JNI_PATH=`echo $JAVA_CPPFLAGS | $SED -e 's/-I//g'` have_jni=no - for dir in $JNI_PATH; do + for dir in $JNI_PATH; do if test -f "${dir}/jni.h"; then have_jni=yes; break; fi done if test $have_jni = yes; then @@ -2704,7 +2704,7 @@ AC_CHECK_TOOLS(RCC, [rcc-qt5 rcc-qt4 rcc]) AC_CHECK_TOOLS(LRELEASE, [lrelease-qt5 lrelease-qt4 lrelease]) if test -n "$MOC" && test -n "$UIC" && test -n "$RCC" && test -n "$LRELEASE"; then - AC_DEFINE(HAVE_QT, 1, + AC_DEFINE(HAVE_QT, 1, [Define to 1 if Qt is available (libraries, developer header files, utility programs (moc, uic, rcc, and lrelease))]) else warn_gui="Qt utility programs moc, uic, rcc, and lrelease not found -- disabling GUI" @@ -2723,10 +2723,11 @@ if test $build_gui = yes; then OCTAVE_CHECK_QFONT_MONOSPACE OCTAVE_CHECK_FUNC_SETPLACEHOLDERTEXT + OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE fi if test $build_gui = yes; then - ## Check for Qscintilla library which is used in the GUI editor. + ## Check for Qscintilla library which is used in the GUI editor. AC_CACHE_CHECK([whether Qscintilla library is installed], [octave_cv_lib_qscintilla], [save_CPPFLAGS="$CPPFLAGS" @@ -2756,7 +2757,7 @@ ## other regular Qt libraries. QT_LIBS="$QT_LIBS -lqscintilla2" OCTAVE_CHECK_VERSION_2_6_0 - AC_DEFINE(HAVE_QSCINTILLA, 1, + AC_DEFINE(HAVE_QSCINTILLA, 1, [Define to 1 if the QScintilla library and header files are available]) save_CPPFLAGS="$CPPFLAGS" @@ -2823,7 +2824,7 @@ AC_CONFIG_FILES([ oct-conf-post.h:oct-conf-post.in.h - Makefile + Makefile doc/Makefile doc/doxyhtml/Makefile doc/doxyhtml/Doxyfile diff -r cda4bd2fd0c0 -r 1af5ee5f3076 doc/interpreter/Makefile.am --- a/doc/interpreter/Makefile.am Fri Jan 03 20:55:33 2014 -0500 +++ b/doc/interpreter/Makefile.am Mon Jan 06 14:34:56 2014 -0500 @@ -32,6 +32,7 @@ dist_man_MANS = \ mkoctfile.1 \ + octave-cli.1 \ octave-config.1 \ octave.1 diff -r cda4bd2fd0c0 -r 1af5ee5f3076 doc/interpreter/contributors.in --- a/doc/interpreter/contributors.in Fri Jan 03 20:55:33 2014 -0500 +++ b/doc/interpreter/contributors.in Mon Jan 06 14:34:56 2014 -0500 @@ -133,7 +133,7 @@ Mumit Khan Paul Kienzle Aaron A. King -Erik Kjelsson +Erik Kjellson Arno J. Klaassen Alexander Klein Geoffrey Knauth diff -r cda4bd2fd0c0 -r 1af5ee5f3076 doc/interpreter/errors.txi --- a/doc/interpreter/errors.txi Fri Jan 03 20:55:33 2014 -0500 +++ b/doc/interpreter/errors.txi Mon Jan 06 14:34:56 2014 -0500 @@ -176,6 +176,22 @@ @end group @end example +@noindent +Alternatively, the output of the @code{lasterror} function can be found +in a variable indicated immediately after the @code{catch} keyword, as +in the example below showing how to redirect an error as a warning: + +@example +@group +try + @dots{} +catch err + warning(err.identifier, err.message); + @dots{} +end_try_catch +@end group +@end example + @DOCSTRING(lasterror) @DOCSTRING(lasterr) diff -r cda4bd2fd0c0 -r 1af5ee5f3076 doc/interpreter/mkoctfile.1 --- a/doc/interpreter/mkoctfile.1 Fri Jan 03 20:55:33 2014 -0500 +++ b/doc/interpreter/mkoctfile.1 Mon Jan 06 14:34:56 2014 -0500 @@ -28,7 +28,7 @@ .fi .. .\" -------------------------------------------------------------------- -.TH MKOCTFILE 1 "4 February 2011" "GNU Octave" +.TH MKOCTFILE 1 "3 January 2014" "GNU Octave" .SH NAME mkoctfile \- Compile dynamic-load modules for GNU Octave .SH SYNOPSIS @@ -140,11 +140,11 @@ .a library file .Ve .RE -.SH "SEE ALSO" -octave (1). .SH AUTHOR John W. Eaton This manual page was contributed by Dirk Eddelbuettel for the Debian GNU/Linux distribution but may be used by others. +.SH "SEE ALSO" +octave (1). diff -r cda4bd2fd0c0 -r 1af5ee5f3076 doc/interpreter/octave-cli.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/interpreter/octave-cli.1 Mon Jan 06 14:34:56 2014 -0500 @@ -0,0 +1,86 @@ +.\" Copyright (C) 1996-2014 John W. Eaton +.\" +.\" 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 +.\" . +.\" -------------------------------------------------------------------- +.de Vb \" (V)erbatim (b)egin. Use fixed width font and no justification +.ft CW +.nf +.. +.de Ve \" (V)erbatim (e)nd. Return to regular font and justification +.ft R +.fi +.. +.\" -------------------------------------------------------------------- +.TH OCTAVE-CLI 1 "03 January 2014" "GNU Octave" +.SH NAME +octave-cli \- A high-level interactive language for numerical computations. +.SH SYNOPSIS +\fBoctave-cli\fP [\fIoptions\fP]... [\fIfile\fP] +.SH DESCRIPTION +Octave is a high-level language, primarily intended for numerical +computations. It provides a convenient command line interface for +solving linear and nonlinear problems numerically. \fBoctave-cli\fP +has been compiled without any GUI support (Qt) which makes it smaller +than the default \fBoctave\fP executable, but also limits it to +providing just the command line interface (CLI). +.SH OPTIONS +The complete set of command-line options for \fBoctave-cli\fP is available +by running the following command from the shell. +.Vb + + octave-cli \-\-help +.Ve +.SH DOCUMENTATION +The primary documentation for Octave is written using Texinfo, the GNU +documentation system, which allows the same source files to be used to +produce online and printed versions of the manual. +.PP +You can read the online copy of the Octave documentation by issuing +the following command from within Octave. +.Vb + + octave:1> doc + +.Ve +The Info files may also be read with a stand-alone program such as +\fBinfo\fP or \fBxinfo\fP. HTML, Postscript, or PDF versions of the +documentation are installed on many systems as well. +.SH BUGS +The Octave project maintains a bug tracker at http://bugs.octave.org. +Before submitting a new item please read the instructions at +http://www.octave.org/bugs.html on how to submit a useful report. +.SH FILES +Upon startup Octave looks for four initialization files. Each file +may contain any number of valid Octave commands. +.TP +\fIoctave-home\fP/share/octave/site/m/startup/octaverc +Site-wide initialization file which changes options for all users. +\fIoctave-home\fP is the directory where Octave was installed such as +\fB/usr/local\fP. +.TP +\fIoctave-home\fP/share/octave/\fIversion\fP/m/startup/octaverc +Site-wide initialization file for Octave version \fIversion\fP. +.TP +~/.octaverc +User's personal initialization file. +.TP +\&\.octaverc +Project-specific initialization file located in the current directory. +.SH AUTHOR +John W. Eaton +.SH SEE ALSO +octave (1) diff -r cda4bd2fd0c0 -r 1af5ee5f3076 doc/interpreter/octave-config.1 --- a/doc/interpreter/octave-config.1 Fri Jan 03 20:55:33 2014 -0500 +++ b/doc/interpreter/octave-config.1 Mon Jan 06 14:34:56 2014 -0500 @@ -28,7 +28,7 @@ .fi .. .\" -------------------------------------------------------------------- -.TH OCTAVE-CONFIG 1 "4 February 2011" "GNU Octave" +.TH OCTAVE-CONFIG 1 "3 January 2014" "GNU Octave" .SH NAME octave-config - GNU Octave component and library information retrieval .SH SYNOPSIS @@ -81,3 +81,5 @@ This manual page was contributed by Dirk Eddelbuettel for the Debian GNU/Linux distribution but may be used by others. +.SH "SEE ALSO" +octave (1). diff -r cda4bd2fd0c0 -r 1af5ee5f3076 doc/interpreter/stmt.txi --- a/doc/interpreter/stmt.txi Fri Jan 03 20:55:33 2014 -0500 +++ b/doc/interpreter/stmt.txi Mon Jan 06 14:34:56 2014 -0500 @@ -815,16 +815,17 @@ point of the error and the statement to restore the value would not be executed. +In addition to unwind_protect, Octave supports another form of +exception handling, the @code{try} block. + + @node The try Statement @section The try Statement @cindex @code{try} statement @cindex @code{catch} @cindex @code{end_try_catch} -In addition to unwind_protect, Octave supports another limited form of -exception handling. - -The general form of a @code{try} block looks like this: +The original form of a @code{try} block looks like this: @example @group @@ -841,14 +842,27 @@ Octave expressions or commands. The statements in @var{cleanup} are only executed if an error occurs in @var{body}. -No warnings or error messages are printed while @var{body} is -executing. If an error does occur during the execution of @var{body}, -@var{cleanup} can use the function @code{lasterr} to access the text -of the message that would have been printed. This is the same -as @code{eval (@var{try}, @var{catch})} but it is more efficient since -the commands do not need to be parsed each time the @var{try} and -@var{catch} statements are evaluated. @xref{Errors and Warnings}, for more -information about the @code{lasterr} function. +No warnings or error messages are printed while @var{body} is executing. +If an error does occur during the execution of @var{body}, @var{cleanup} +can use the functions @code{lasterr} or @code{lasterror} to access the +text of the message that would have been printed, as well as its +identifier. The alternative form, + +@example +@group +try + @var{body} +catch @var{err} + @var{cleanup} +end_try_catch +@end group +@end example + +@noindent +will automatically store the output of @code{lasterror} in the structure +@var{err}. @xref{Errors and Warnings} for more information about the +@code{lasterr} and @code{lasterror} functions. + @node Continuation Lines @section Continuation Lines diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libgui/src/icons/widget-close-light.png Binary file libgui/src/icons/widget-close-light.png has changed diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libgui/src/icons/widget-dock-light.png Binary file libgui/src/icons/widget-dock-light.png has changed diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libgui/src/icons/widget-undock-light.png Binary file libgui/src/icons/widget-undock-light.png has changed diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Fri Jan 03 20:55:33 2014 -0500 +++ b/libgui/src/m-editor/file-editor.cc Mon Jan 06 14:34:56 2014 -0500 @@ -871,6 +871,12 @@ _tool_bar->setMovable (true); _tab_widget = new QTabWidget (editor_widget); _tab_widget->setTabsClosable (true); +#ifdef HAVE_QTABWIDGET_SETMOVABLE + _tab_widget->setMovable (true); +#endif + _tab_widget->setStyleSheet ("QTabBar::tab {max-height: 4ex; }"); + + QAction *new_action = new QAction (QIcon (":/actions/icons/filenew.png"), tr ("&New File"), _tool_bar); diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libgui/src/module.mk --- a/libgui/src/module.mk Fri Jan 03 20:55:33 2014 -0500 +++ b/libgui/src/module.mk Mon Jan 06 14:34:56 2014 -0500 @@ -71,6 +71,9 @@ src/icons/widget-close.png \ src/icons/widget-dock.png \ src/icons/widget-undock.png \ + src/icons/widget-close-light.png \ + src/icons/widget-dock-light.png \ + src/icons/widget-undock-light.png \ src/icons/zoom-in.png \ src/icons/zoom-out.png diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libgui/src/octave-dock-widget.cc --- a/libgui/src/octave-dock-widget.cc Fri Jan 03 20:55:33 2014 -0500 +++ b/libgui/src/octave-dock-widget.cc Mon Jan 06 14:34:56 2014 -0500 @@ -65,16 +65,18 @@ _dock_button->setFocusPolicy (Qt::NoFocus); _dock_button->setIconSize (QSize (12,12)); - QAction *close_action = new QAction + _close_action = new QAction (QIcon (":/actions/icons/widget-close.png"), "", this ); - close_action-> setToolTip (tr ("Hide widget")); - connect (close_action, SIGNAL (triggered (bool)), + _close_action-> setToolTip (tr ("Hide widget")); + connect (_close_action, SIGNAL (triggered (bool)), this, SLOT (change_visibility (bool))); _close_button = new QToolButton (this); - _close_button->setDefaultAction (close_action); + _close_button->setDefaultAction (_close_action); _close_button->setFocusPolicy (Qt::NoFocus); _close_button->setIconSize (QSize (12,12)); + _icon_color = ""; + QHBoxLayout *h_layout = new QHBoxLayout (); h_layout->addStretch (100); h_layout->addWidget (_dock_button); @@ -146,6 +148,7 @@ QHBoxLayout* h_layout = static_cast (titleBarWidget ()->layout ()); QLabel *label = new QLabel (title); + label->setStyleSheet ("background: transparent;"); h_layout->insertWidget (0,label); #endif setWindowTitle (title); @@ -170,7 +173,7 @@ // remove parent and adjust the (un)dock icon setParent (0, Qt::Window); - _dock_action->setIcon (QIcon (":/actions/icons/widget-dock.png")); + _dock_action->setIcon (QIcon (":/actions/icons/widget-dock"+_icon_color+".png")); _dock_action->setToolTip (tr ("Dock widget")); // restore the last geometry( when floating @@ -183,7 +186,7 @@ setWindowFlags (Qt::Window); QString css = styleSheet (); - css.replace ("widget-undock.png","widget-dock.png"); + css.replace ("widget-undock","widget-dock"); setStyleSheet (css); #endif @@ -223,7 +226,7 @@ setParent (_parent); // adjust the (un)dock icon - _dock_action->setIcon (QIcon (":/actions/icons/widget-undock.png")); + _dock_action->setIcon (QIcon (":/actions/icons/widget-undock"+_icon_color+".png")); _dock_action->setToolTip (tr ("Undock widget")); #else @@ -232,7 +235,7 @@ setWindowFlags (Qt::Widget); QString css = styleSheet (); - css.replace ("widget-dock.png","widget-undock.png"); + css.replace ("widget-dock","widget-undock"); setStyleSheet (css); #endif @@ -276,10 +279,11 @@ QString css; QString css_button; QString dock_icon; + if (_floating) - dock_icon = "widget-dock.png"; + dock_icon = "widget-dock"; else - dock_icon = "widget-undock.png"; + dock_icon = "widget-undock"; if (settings->value ("DockWidgets/widget_title_custom_style",false).toBool ()) { @@ -292,35 +296,41 @@ QColor bg_color = settings->value ("Dockwidgets/title_bg_color", default_var).value (); - QString bg_icon = QString ("transparent"); - if (bg_color.lightness () < 128) - bg_icon = fg_color.name (); + int r, g, b; + QColor bg_color_light = bg_color.lighter (); + + bg_color.getRgb (&r, &g, &b); + if (r+g+b < 400) + _icon_color = "-light"; + else + _icon_color = ""; + + QString background = + QString ("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," + " stop: 0 %1, stop: 0.75 %2, stop: 0.9 %2, stop: 1.0 %1);"). + arg (bg_color_light.name ()). + arg (bg_color.name ()); #if defined (Q_OS_WIN32) - css = QString ("background: %1; color: %2 ;"). - arg (bg_color.name ()). - arg (fg_color.name ()); - css_button = QString ("background: %3; border: 0px;").arg (bg_icon); + css = background + QString (" color: %1 ;").arg (fg_color.name ()); #else - css = QString ("QDockWidget::title { background: %1;" + css = QString ("QDockWidget::title { " + background + " text-align: center left;" " padding: 0px 0px 0px 4px;}\n" - "QDockWidget { color: %2 ; " - " titlebar-close-icon: url(:/actions/icons/widget-close.png);" - " titlebar-normal-icon: url(:/actions/icons/"+dock_icon+"); }" + "QDockWidget { color: %1 ; " + " titlebar-close-icon: url(:/actions/icons/widget-close%2.png);" + " titlebar-normal-icon: url(:/actions/icons/"+dock_icon+"%2); }" "QDockWidget::close-button," - "QDockWidget::float-button { background: %3; border: 0px;}" + "QDockWidget::float-button { border: 0px;}" ). - arg (bg_color.name ()). arg (fg_color.name ()). - arg (bg_icon); + arg (_icon_color); #endif } else { #if defined (Q_OS_WIN32) css = QString (""); - css_button = QString ("background: transparent; border: 0px;"); #else css = QString ("QDockWidget::title { text-align: center left;" " padding: 0px 0px 0px 4px;}" @@ -335,8 +345,11 @@ #if defined (Q_OS_WIN32) _title_widget->setStyleSheet (css); + css_button = QString ("background: transparent; border: 0px;"); _dock_button->setStyleSheet (css_button); _close_button->setStyleSheet (css_button); + _dock_action->setIcon (QIcon (":/actions/icons/"+dock_icon+_icon_color+".png")); + _close_action->setIcon (QIcon (":/actions/icons/widget-close"+_icon_color+".png")); #else setStyleSheet (css); #endif diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libgui/src/octave-dock-widget.h --- a/libgui/src/octave-dock-widget.h Fri Jan 03 20:55:33 2014 -0500 +++ b/libgui/src/octave-dock-widget.h Mon Jan 06 14:34:56 2014 -0500 @@ -110,13 +110,15 @@ private: QMainWindow *_parent; // store the parent since we are reparenting to 0 - QAction *_dock_action; bool _floating; + QString _icon_color; #if defined (Q_OS_WIN32) QWidget *_title_widget; QToolButton *_dock_button; QToolButton *_close_button; + QAction *_dock_action; + QAction *_close_action; #endif }; diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libgui/src/resource.qrc --- a/libgui/src/resource.qrc Fri Jan 03 20:55:33 2014 -0500 +++ b/libgui/src/resource.qrc Mon Jan 06 14:34:56 2014 -0500 @@ -67,5 +67,8 @@ icons/widget-close.png icons/widget-dock.png icons/widget-undock.png + icons/widget-close-light.png + icons/widget-dock-light.png + icons/widget-undock-light.png diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Fri Jan 03 20:55:33 2014 -0500 +++ b/libinterp/corefcn/error.cc Mon Jan 06 14:34:56 2014 -0500 @@ -2011,6 +2011,12 @@ return Vlast_error_id; } +octave_map +last_error_stack (void) +{ + return Vlast_error_stack; +} + std::string last_warning_message (void) { diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libinterp/corefcn/error.h --- a/libinterp/corefcn/error.h Fri Jan 03 20:55:33 2014 -0500 +++ b/libinterp/corefcn/error.h Mon Jan 06 14:34:56 2014 -0500 @@ -26,6 +26,7 @@ #include #include +class octave_map; class octave_value_list; class unwind_protect; @@ -137,6 +138,7 @@ // Helper functions to pass last error and warning messages and ids extern OCTINTERP_API std::string last_error_message (void); extern OCTINTERP_API std::string last_error_id (void); +extern OCTINTERP_API octave_map last_error_stack (void); extern OCTINTERP_API std::string last_warning_message (void); extern OCTINTERP_API std::string last_warning_id (void); diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libinterp/corefcn/jit-typeinfo.cc --- a/libinterp/corefcn/jit-typeinfo.cc Fri Jan 03 20:55:33 2014 -0500 +++ b/libinterp/corefcn/jit-typeinfo.cc Mon Jan 06 14:34:56 2014 -0500 @@ -916,7 +916,7 @@ bool jit_operation::signature_cmp -::operator() (const signature_vec *lhs, const signature_vec *rhs) +::operator() (const signature_vec *lhs, const signature_vec *rhs) const { const signature_vec& l = *lhs; const signature_vec& r = *rhs; diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libinterp/corefcn/jit-typeinfo.h --- a/libinterp/corefcn/jit-typeinfo.h Fri Jan 03 20:55:33 2014 -0500 +++ b/libinterp/corefcn/jit-typeinfo.h Mon Jan 06 14:34:56 2014 -0500 @@ -372,7 +372,7 @@ struct signature_cmp { - bool operator() (const signature_vec *lhs, const signature_vec *rhs); + bool operator() (const signature_vec *lhs, const signature_vec *rhs) const; }; typedef std::map diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libinterp/corefcn/max.cc diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libinterp/parse-tree/lex.h --- a/libinterp/parse-tree/lex.h Fri Jan 03 20:55:33 2014 -0500 +++ b/libinterp/parse-tree/lex.h Mon Jan 06 14:34:56 2014 -0500 @@ -270,9 +270,9 @@ input_line_number (1), current_input_column (1), bracketflag (0), braceflag (0), looping (0), defining_func (0), looking_at_function_handle (0), - block_comment_nesting_level (0), token_count (0), - current_input_line (), comment_text (), help_text (), - string_text (), string_line (0), string_column (0), + block_comment_nesting_level (0), command_arg_paren_count (0), + token_count (0), current_input_line (), comment_text (), + help_text (), string_text (), string_line (0), string_column (0), fcn_file_name (), fcn_file_full_name (), looking_at_object_index (), parsed_function_name (), pending_local_variables (), symtab_context (), nesting_level (), tokens () @@ -397,6 +397,9 @@ // nestng level for blcok comments. int block_comment_nesting_level; + // Parenthesis count for command argument parsing. + int command_arg_paren_count; + // Count of tokens recognized by this lexer since initialized or // since the last reset. size_t token_count; diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Fri Jan 03 20:55:33 2014 -0500 +++ b/libinterp/parse-tree/lex.ll Mon Jan 06 14:34:56 2014 -0500 @@ -232,6 +232,27 @@ } \ while (0) +// When a command argument boundary is detected, push out the +// current argument being built. This one seems like a good +// candidate for a function call. + +#define COMMAND_ARG_FINISH \ + do \ + { \ + if (curr_lexer->string_text.empty ()) \ + break; \ + \ + int retval = curr_lexer->handle_token (curr_lexer->string_text, \ + SQ_STRING); \ + \ + curr_lexer->string_text = ""; \ + curr_lexer->command_arg_paren_count = 0; \ + \ + yyless (0); \ + \ + return retval; \ + } \ + while (0) static bool Vdisplay_tokens = false; @@ -283,54 +304,129 @@ // Help and other command-style functions. %} -{NL} { - curr_lexer->lexer_debug ("{NL}"); +%{ +// Commands can be continued on a second line using the ellipsis. +// If an argument is in construction, it is completed. +%} + +(\.\.\.)[^\r\n]*{NL} { + curr_lexer->lexer_debug ("(\\.\\.\\.)[^\\r\\n]*{NL}"); + + COMMAND_ARG_FINISH; + + curr_lexer->input_line_number++; + curr_lexer->current_input_column = 1; + + HANDLE_STRING_CONTINUATION; + } + +%{ +// Commands normally end at the end of a line or a semicolon. +%} + +({CCHAR}[^\r\n]*)?{NL} { + curr_lexer->lexer_debug ("({CCHAR}[^\\r\\n]*)?{NL}"); + + COMMAND_ARG_FINISH; curr_lexer->input_line_number++; curr_lexer->current_input_column = 1; - curr_lexer->looking_for_object_index = false; curr_lexer->at_beginning_of_statement = true; - curr_lexer->pop_start_state (); - return curr_lexer->count_token ('\n'); + return curr_lexer->handle_token ('\n'); + } + +[\,\;] { + curr_lexer->lexer_debug( "[\\,\\;]" ); + + if (yytext[0] != ',' || curr_lexer->command_arg_paren_count == 0) + { + COMMAND_ARG_FINISH; + curr_lexer->looking_for_object_index = false; + curr_lexer->at_beginning_of_statement = true; + curr_lexer->pop_start_state (); + return curr_lexer->handle_token (yytext[0]); + } + else + curr_lexer->string_text += yytext; + + curr_lexer->current_input_column += yyleng; } -[\;\,] { - curr_lexer->lexer_debug ("[\\;\\,]"); - - curr_lexer->looking_for_object_index = false; - curr_lexer->at_beginning_of_statement = true; - - curr_lexer->pop_start_state (); - - if (strcmp (yytext, ",") == 0) - return curr_lexer->handle_token (','); - else - return curr_lexer->handle_token (';'); +%{ +// Unbalanced parentheses serve as pseudo-quotes: they are included in +// the final argument string, but they cause parentheses and quotes to +// be slurped into that argument as well. +%} + +[\(\[\{]+ { + curr_lexer->lexer_debug ("[\\(\\[\\{]+"); + + curr_lexer->command_arg_paren_count += yyleng; + curr_lexer->string_text += yytext; + curr_lexer->current_input_column += yyleng; } +[\)\]\}]+ { + curr_lexer->lexer_debug ("[\\)\\]\\}]+"); + + curr_lexer->command_arg_paren_count -= yyleng; + curr_lexer->string_text += yytext; + curr_lexer->current_input_column += yyleng; +} + +%{ +// Handle quoted strings. Quoted strings that are not separated by +// whitespace from other argument text are combined with that previous +// text. For instance, +// +// command 'text1'"text2" +// +// has a single argument text1text2, not two separate arguments. +// That's why we must test to see if we are in command argument mode +// when processing the end of a string. +%} + [\"\'] { curr_lexer->lexer_debug ("[\\\"\\']"); - curr_lexer->at_beginning_of_statement = false; - - curr_lexer->current_input_column++; - - curr_lexer->begin_string (yytext[0] == '"' - ? DQ_STRING_START : SQ_STRING_START); + if (curr_lexer->command_arg_paren_count == 0) + curr_lexer->begin_string (yytext[0] == '"' + ? DQ_STRING_START : SQ_STRING_START); + else + curr_lexer->string_text += yytext; + + curr_lexer->current_input_column += yyleng; } -[^#% \t\r\n\;\,\"\'][^ \t\r\n\;\,]*{S}* { - curr_lexer->lexer_debug ("[^#% \\t\\r\\n\\;\\,\\\"\\'][^ \\t\\r\\n\\;\\,]*{S}*"); - - std::string tok = strip_trailing_whitespace (yytext); - - curr_lexer->looking_for_object_index = false; - curr_lexer->at_beginning_of_statement = false; - - return curr_lexer->handle_token (tok, SQ_STRING); +%{ +// In standard command argument processing, whitespace separates +// arguments. In the presence of unbalanced parentheses, it is +// incorporated into the argument. +%} + +{S}+ { + curr_lexer->lexer_debug ("{S}+"); + + if (curr_lexer->command_arg_paren_count == 0) + COMMAND_ARG_FINISH; + else + curr_lexer->string_text += yytext; + + curr_lexer->current_input_column += yyleng; + } + +%{ +// Everything else is slurped into the command arguments. +%} + +([\.]|[^#% \t\r\n\,\;\"\'\(\[\{\}\]\)]+) { + curr_lexer->lexer_debug ("[^#% \\t\\r\\n\\.\\,\\;\\\"\\'\\(\\[\\{\\}\\]\\)]+"); + + curr_lexer->string_text += yytext; + curr_lexer->current_input_column += yyleng; } {S}* { @@ -678,17 +774,20 @@ curr_lexer->pop_start_state (); - curr_lexer->looking_for_object_index = true; - curr_lexer->at_beginning_of_statement = false; - - curr_lexer->push_token (new token (DQ_STRING, - curr_lexer->string_text, - curr_lexer->string_line, - curr_lexer->string_column)); - - curr_lexer->string_text = ""; - - return curr_lexer->count_token_internal (DQ_STRING); + if (curr_lexer->start_state() != COMMAND_START) + { + curr_lexer->looking_for_object_index = true; + curr_lexer->at_beginning_of_statement = false; + + curr_lexer->push_token (new token (DQ_STRING, + curr_lexer->string_text, + curr_lexer->string_line, + curr_lexer->string_column)); + + curr_lexer->string_text = ""; + + return curr_lexer->count_token_internal (DQ_STRING); + } } \\[0-7]{1,3} { @@ -861,17 +960,20 @@ curr_lexer->pop_start_state (); - curr_lexer->looking_for_object_index = true; - curr_lexer->at_beginning_of_statement = false; - - curr_lexer->push_token (new token (SQ_STRING, - curr_lexer->string_text, - curr_lexer->string_line, - curr_lexer->string_column)); - - curr_lexer->string_text = ""; - - return curr_lexer->count_token_internal (SQ_STRING); + if (curr_lexer->start_state() != COMMAND_START) + { + curr_lexer->looking_for_object_index = true; + curr_lexer->at_beginning_of_statement = false; + + curr_lexer->push_token (new token (SQ_STRING, + curr_lexer->string_text, + curr_lexer->string_line, + curr_lexer->string_column)); + + curr_lexer->string_text = ""; + + return curr_lexer->count_token_internal (SQ_STRING); + } } [^\'\n\r]+ { @@ -1851,6 +1953,7 @@ fcn_file_full_name = ""; looking_at_object_index.clear (); looking_at_object_index.push_front (false); + command_arg_paren_count = 0; while (! parsed_function_name.empty ()) parsed_function_name.pop (); @@ -3241,3 +3344,4 @@ return status; } + diff -r cda4bd2fd0c0 -r 1af5ee5f3076 libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Fri Jan 03 20:55:33 2014 -0500 +++ b/libinterp/parse-tree/pt-eval.cc Mon Jan 06 14:34:56 2014 -0500 @@ -943,6 +943,7 @@ err.assign ("message", last_error_message ()); err.assign ("identifier", last_error_id ()); + err.assign ("stack", last_error_stack ()); if (! error_state) ult.assign (octave_value::op_asn_eq, err); diff -r cda4bd2fd0c0 -r 1af5ee5f3076 m4/acinclude.m4 --- a/m4/acinclude.m4 Fri Jan 03 20:55:33 2014 -0500 +++ b/m4/acinclude.m4 Mon Jan 06 14:34:56 2014 -0500 @@ -454,6 +454,37 @@ fi ]) dnl +dnl Check whether the Qt QTabWidget::setMovable() function exists. +dnl This function was added in Qt 4.5. +dnl +AC_DEFUN([OCTAVE_CHECK_FUNC_QTABWIDGET_SETMOVABLE], [ + AC_CACHE_CHECK([whether Qt has the QTabWidget::setMovable() function], + [octave_cv_func_qtabwidget_setmovable], + [AC_LANG_PUSH(C++) + ac_octave_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$QT_CPPFLAGS $CPPFLAGS" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + class tab_widget : public QTabWidget + { + public: + tab_widget (QWidget *parent = 0) : QTabWidget (parent) { this->setMovable (true); } + ~tab_widget () {} + }; + ]], [[ + tab_widget tw; + ]])], + octave_cv_func_qtabwidget_setmovable=yes, + octave_cv_func_qtabwidget_setmovable=no) + CPPFLAGS="$ac_octave_save_CPPFLAGS" + AC_LANG_POP(C++) + ]) + if test $octave_cv_func_qtabwidget_setmovable = yes; then + AC_DEFINE(HAVE_QTABWIDGET_SETMOVABLE, 1, + [Define to 1 if Qt has the QTabWidget::setMovable() function.]) + fi +]) +dnl dnl Check whether HDF5 library has version 1.6 API functions. dnl AC_DEFUN([OCTAVE_CHECK_HDF5_HAS_VER_16_API], [ diff -r cda4bd2fd0c0 -r 1af5ee5f3076 scripts/pkg/private/fix_depends.m --- a/scripts/pkg/private/fix_depends.m Fri Jan 03 20:55:33 2014 -0500 +++ b/scripts/pkg/private/fix_depends.m Mon Jan 06 14:34:56 2014 -0500 @@ -29,7 +29,7 @@ deps = strtrim (ostrsplit (tolower (depends), ",")); deps_cell = cell (1, length (deps)); dep_pat = ... - '\s*(?\w+)+\s*(\(\s*(?[<>=]+)\s*(?\d+\.\d+(\.\d+)*)\s*\))*\s*'; + '\s*(?[-\w]+)\s*(\(\s*(?[<>=]+)\s*(?\d+\.\d+(\.\d+)*)\s*\))*\s*'; ## For each dependency. for i = 1:length (deps) diff -r cda4bd2fd0c0 -r 1af5ee5f3076 scripts/plot/util/close.m --- a/scripts/plot/util/close.m Fri Jan 03 20:55:33 2014 -0500 +++ b/scripts/plot/util/close.m Mon Jan 06 14:34:56 2014 -0500 @@ -105,5 +105,4 @@ %!error close ({"all"}) %!error close ("all_and_more") %!error close (-1) -%!error close "all" hid" - +%!error close all hid