# HG changeset patch # User John W. Eaton # Date 1385833194 18000 # Node ID 4502d6d577d5af5d84704b8ec5316e36b8cca2ec # Parent 6762a6d2301070337eb9f4c0d5781a7ad40bd3f4# Parent 132667955f668260ef3cca008ac7c050fba2021a maint: Periodic merge of default to classdef diff -r 6762a6d23010 -r 4502d6d577d5 NEWS --- a/NEWS Tue Nov 26 12:38:46 2013 -0500 +++ b/NEWS Sat Nov 30 12:39:54 2013 -0500 @@ -1,10 +1,41 @@ Summary of important user-visible changes for version 3.8: --------------------------------------------------------- - ** A GUI is now available with Octave and is the default when starting - an interactive session. The original command line interface is also - available and can be entered by using the "--no-gui" option when - invoking Octave. + ** One of the biggest new features for Octave 3.8 is a graphical user + interface. It is the one thing that users have requested most + often over the last few years and now it is almost ready. But + because it is not quite as polished as we would like, we have + decided to wait until the 4.0.x release series before making the + GUI the default interface (until then, you can use the --force-gui + option to start the GUI). + + Given the length of time and the number of bug fixes and + improvements since the last major release Octave, we also decided + against delaying the release of all these new improvements any + longer just to perfect the GUI. So please enjoy the 3.8 release of + Octave and the preview of the new GUI. We beleive it is working + reasonably well, but we also know that there are some obvious rough + spots and many things that could be improved. + + WE NEED YOUR HELP. There are many ways that you can help us fix + the remaining problems, complete the GUI, and improve the overall + user experience for both novices and experts alike: + + * If you are a skilled software developer, you can help by + contributing your time to help with Octave's development. See + http://octave.org/get-involved.html for more information. + + * If Octave does not work properly, you are encouraged + report the problems you find. See http://octave.org/bugs.html + for more information about how to report problems. + + * Whether you are a user or developer, you can help to fund the + project. Octave development takes a lot of time and expertise. + Your contributions help to ensure that Octave will continue to + improve. See http://octave.org/donate.html for more details. + + We hope you find Octave to be useful. Please help us make it even + better for the future! ** Octave now uses OpenGL graphics by default with FLTK widgets. If OpenGL libraries or FLTK widgets are not available when Octave is diff -r 6762a6d23010 -r 4502d6d577d5 configure.ac --- a/configure.ac Tue Nov 26 12:38:46 2013 -0500 +++ b/configure.ac Sat Nov 30 12:39:54 2013 -0500 @@ -1141,7 +1141,7 @@ ## Check for fontconfig library warn_fontconfig="" - if test -z "$warn_freetype"; then + if test $native_graphics = yes; then PKG_CHECK_MODULES(FONTCONFIG, [fontconfig], [have_fontconfig=yes OPENGL_LIBS="$FONTCONFIG_LIBS $OPENGL_LIBS" @@ -1155,6 +1155,20 @@ OCTAVE_CONFIGURE_WARNING([warn_fontconfig]) fi + ## Check for Xft library (when using X11) + + warn_xft="" + if test $native_graphics = yes && test "$have_x" = yes; then + PKG_CHECK_MODULES(XFT, [xft], + [AC_DEFINE(HAVE_XFT, 1, [Define to 1 if Xft is present.])], + [warn_xft="Xft library not found. Native graphics will be disabled."]) + fi + + if test -n "$warn_xft"; then + native_graphics=no + OCTAVE_CONFIGURE_WARNING([warn_xft]) + fi + ## Check for FLTK (www.fltk.org) library AC_ARG_WITH([fltk-prefix], [ @@ -2462,7 +2476,7 @@ JAVA_HOME=`echo $JAVA_TMP_HOME | $SED -e 's|[[/\\]]bin[[/\\]]\?$||' | $SED -e 's|[[/\\]]jre[[/\\]]\?$||'` fi - case $host_os in + case $build_os in mingw* | msdosmsvc) ## Under Win32 platform, we want JAVA_HOME to be in MSYS format, that is ## without colon and backslashes, as it is also used as path separator. @@ -2470,14 +2484,8 @@ ## (e.g. C:\Program Files\Java\...). if test -n "$JAVA_HOME"; then JAVA_HOME=`cd "$JAVA_HOME" && pwd` - ## Maybe this will be useful in the future, as native Java won't - ## understand MSYS paths. - JAVA_HOME_NATIVE=`cd "$JAVA_HOME" && pwd -W` fi ;; - *) - JAVA_HOME_NATIVE="$JAVA_HOME" - ;; esac ## Amend search path for JAVAC and JAR. diff -r 6762a6d23010 -r 4502d6d577d5 libgui/languages/de_DE.ts --- a/libgui/languages/de_DE.ts Tue Nov 26 12:38:46 2013 -0500 +++ b/libgui/languages/de_DE.ts Sat Nov 30 12:39:54 2013 -0500 @@ -149,7 +149,7 @@ &%1 %2 - + &New File &Neue Datei @@ -309,7 +309,7 @@ &Suchen und Ersetzen - + Could not open file %1 for read: %2. @@ -338,7 +338,7 @@ %2. - + Go&to Line &Gehe zu Zeile @@ -376,7 +376,7 @@ file_editor_tab - + Goto line Gehe zu Zeile @@ -403,7 +403,7 @@ - + @@ -411,7 +411,7 @@ Octave Editor - + The file %1 is about to be closed but has been modified. @@ -422,7 +422,7 @@ %2 - + Octave Files (*.m);;All Files (*) Octave Dateien (*.m);;All Files (*) @@ -459,7 +459,7 @@ %2. - + Line: Zeile: @@ -469,7 +469,7 @@ Spalte: - + It seems that '%1' has been modified by another application. Do you want to reload it? Die Datei %1 wurde von einer anderen Anwendung verändert. Soll der neue Inhalt geladen werden? @@ -708,8 +708,8 @@ 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>Wir hoffen dass Du Octave nützlich findest.</p> -<p>Wenn Du auf Probleme stoßen solltest, gibt es eine Reihe von Wegen um Hilfe zu bekommen. Neben der Option kommerziellen Support zu erhalten, gibt es noch eine Mailingliste, ein Wiki und andere Community Support Channels +<p>Wir hoffen, dass Du Octave nützlich findest.</p> +<p>Wenn Du auf Probleme stoßen solltest, gibt es eine Reihe von Wegen um Hilfe zu bekommen. Neben der Option kommerziellen Support zu erhalten, gibt es noch eine Mailingliste, ein Wiki und andere Community Support Channels. Mehr über jede Möglichkeit findest Du im Internet unter <a href="http://octave.org/support.html">http://octave.org/support.html</a> (Wird im externen Browser geöffnet).</p> </body></html> @@ -734,9 +734,9 @@ <head/><body> <p>Für weitere Informationen über Octave:</p> <ul> -<li>Visit <a href="http://octave.org">http://octave.org</a> (Öffnet im externen Browser)</li> -<li>Online Dokumentation <a href="http://www.gnu.org/software/octave/doc/interpreter/index.html">html</a>- oder <a href="http://www.gnu.org/software/octave/octave.pdf">PDF</span></a>Dokument (Öffnet im externen Browser)</li> -<li>Öffnet den Dokumentations-Browser von Octave GUI mit Hilfe-Menü</li> +<li><a href="http://octave.org">http://octave.org</a> (Öffnet im externen Browser)</li> +<li>Online Dokumentation <a href="http://www.gnu.org/software/octave/doc/interpreter/index.html">html</a>- oder <a href="http://www.gnu.org/software/octave/octave.pdf">PDF</span></a>-Dokument (Öffnet im externen Browser)</li> +<li>Benutze den Dokumentations-Browser von Octave GUI im Hilfe-Menü</li> </ul> </body></html> @@ -1005,7 +1005,7 @@ Browse and search the command history. - Durchsuchen Sie die Befehlshistorie. + Durchsuchen der Befehlshistorie. @@ -1043,7 +1043,7 @@ Welcome to Octave! - Willkommen zu Octave! + Willkommen bei Octave! @@ -1063,8 +1063,8 @@ <p>The configuration file is stored in %1. If that file exists, you will not see this dialog when Octave starts.</p> </body></html> <html><body> -<p>Es scheint als ob die grafische Benutzerschnittstelle zum ersten Mal auf diesem Computer gestartet wurde. -Klicke auf 'weiter' um eine Konfigurationsdatei anzulegen und Octave zu starten.</p> +<p>Es scheint, dass die grafische Benutzerschnittstelle (GUI) zum ersten Mal auf diesem Computer gestartet wurde. +Klicke auf 'Weiter' um eine Konfigurationsdatei anzulegen und Octave zu starten.</p> <p>Die Konfigurationsdatei wird in %1 gespeichert. Falls diese Datei existiert, wird dieser Dialog nicht mehr angezeigt.</p> </body></html> @@ -1073,13 +1073,13 @@ main_window - + Load Workspace Lade Arbeitsumgebung - - + + About Octave Über Octave @@ -1144,13 +1144,13 @@ Einfügen - - + + Save Workspace As Arbeitsumgebung speichern als - + The release notes file '%1' is empty. Die Datei '%1' mit Versionshinweisen ist leer. @@ -1165,17 +1165,16 @@ Versionshinweise zu Octave - + Octave Community News - Neuigkeiten aus der Octave Gemeinschaft + Neuigkeiten aus der Octave Community - Set working directory - Arbeitsverzeichnis setzen + Arbeitsverzeichnis setzen - + Clear Clipboard Zwischenablage leeren @@ -1287,7 +1286,7 @@ Community News - Neuigkeiten der Gemeinschaft + Neuigkeiten der Community @@ -1305,7 +1304,8 @@ Ein Verzeichnis höher - + + Browse directories Verzeichnis suchen @@ -1379,7 +1379,7 @@ news_reader - + <html> <body> <p> @@ -1392,7 +1392,18 @@ </p> <p> <small><em>&mdash; The Octave Developers, - + <html> +<body> +<p> +Die Neuigkeiten aus der Octave Community scheinen nicht erreichbar zu sein. +</p> +<p> +Für die aktuellsten Neuigkeiten besuche +<a href="http://octave.org/community-news.html">http://octave.org/community-news.html</a> +sobald Du über eine Verbindung zum Internet verfügst (Link öffnet sich im externen Browser). +</p> +<p> +<small><em>&mdash; Die Entwickler von Octave, @@ -1409,7 +1420,19 @@ </p> <p> <small><em>&mdash; The Octave Developers, - + <html> +<body> +<p> +Die Verbindung zum Internet um aktuelle Neuigkeiten von der Octave Community anzuzeigen wurde deaktiviert. +</p> +<p> +Für aktuelle Neuigkeiten besuche +<a href="http://octave.org/community-news.html">http://octave.org/community-news.html</a> +sobald Du über eine Verbindung zum Internet verfügst (Link öffnet sich im externen Browser) +oder aktiviere die Internetverbindung in den Einstellungen unter Netzwerk. +</p> +<p> +<small><em>&mdash; Die Entwickler von Octave, @@ -1516,7 +1539,7 @@ resource_manager - + The settings file %1 does not exist and can not be created. @@ -1527,9 +1550,9 @@ Die Konfigurationsdatei %1 existiert nicht und kann nicht angelegt werden. -Stellen Sie sicher, daß Sie Lese- und Schreibrechte für +Stelle sicher, dass Du Lese- und Schreibrechte für %2 -besitzen. +besitzt. Die Octave Benutzeroberfläche muss jetzt geschlossen werden. @@ -1703,7 +1726,7 @@ <html><head/><body><p>Select font, font size (as a difference from the default size), font style (bold, italic, underline), 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>Auswahl von Schrift, Schriftgröße (als Differenz von der Standardgröße), Schriftstil (<b>f</b>ett, <b>k</b>ursiv, <b>u</b>nterstrichen), Text- und Hintergrundfarbe (für den Hintergrund ist die Farbe Pink (255,0,255) ein Platzhalter für die Standardfarbe)</p></body></html> @@ -1893,7 +1916,7 @@ Community News - Neuigkeiten der Gemeinschaft + Neuigkeiten der Community @@ -1918,7 +1941,12 @@ <p>You may also view the news by selecting the "Community News" item in the "Help" menu in the GUI, or by visiting <a href="http://octave.org/community-news.html">http://octave.org/community-news.html</a>.</p> </body></html> - + <html><body> +<p>Beim Start der Octave GUI kann die Octave Webseite auf aktuelle Neuigkeiten und Informationen über die Octave Community geprüft werden. +Die Überprüfung findet dann nur einmal am Tag statt und Neuigkeiten werden nur eingeblendet, wenn es seit der letzten Überprüfung etwas Neues gibt.</p> +<p>Du kannst dir die Neuigkeiten auch ansehen, indem Du den Punkt "Neuigkeiten der Community" im Menü auswählst oder folgende Internetseite besuchst: +<a href="http://octave.org/community-news.html">http://octave.org/community-news.html</a>.</p> +</body></html> @@ -1929,7 +1957,13 @@ <head/><body> <p>Allow Octave to connect to the Octave web site when it starts to display current news and information about the Octave community.</p> </body></html> - + <html><head> +<style> +a:link { text-decoration: underline; color: #0000ff; } +</style> +<head/><body> +<p>Erlaube Octave beim Programmstart eine Verbindung zur Octave Webseite herzustellen um aktuelle Neuigkeiten und Informationen über Octave anzuzeigen.</p> +</body></html> @@ -1958,7 +1992,7 @@ Welcome to GNU Octave - Willkommen zu GNU Octave + Willkommen bei GNU Octave @@ -2010,7 +2044,7 @@ View the variables in the active workspace. - Sehen Sie die Variablen ein, die sich in der aktiven Arbeitsumgebung befinden. + Variablen einsehen, die sich in der aktiven Arbeitsumgebung befinden. diff -r 6762a6d23010 -r 4502d6d577d5 libgui/src/icons/warning.png Binary file libgui/src/icons/warning.png has changed diff -r 6762a6d23010 -r 4502d6d577d5 libgui/src/main-window.cc --- a/libgui/src/main-window.cc Tue Nov 26 12:38:46 2013 -0500 +++ b/libgui/src/main-window.cc Sat Nov 30 12:39:54 2013 -0500 @@ -1150,6 +1150,8 @@ construct_tool_bar (); + construct_warning_bar (); + connect (qApp, SIGNAL (aboutToQuit ()), this, SLOT (prepare_to_exit ())); @@ -1771,6 +1773,167 @@ } void +main_window::construct_warning_bar (void) +{ + QSettings *settings = resource_manager::get_settings (); + + if (settings + && settings->value ("General/hide_new_gui_warning", false).toBool ()) + { + construct_gui_info_button (); + + return; + } + + _warning_bar = new QDockWidget (this); + _warning_bar->setAttribute (Qt::WA_DeleteOnClose); + + QFrame *box = new QFrame (_warning_bar); + + QLabel *icon = new QLabel (box); + QIcon warning_icon + = QIcon::fromTheme ("dialog-warning", + QIcon (":/actions/icons/warning.png")); + QPixmap icon_pixmap = warning_icon.pixmap (QSize (32, 32)); + icon->setPixmap (icon_pixmap); + + QTextBrowser *msg = new QTextBrowser (box); + msg->setOpenExternalLinks (true); + msg->setText + (tr ("You are using a release candidate of Octave's experimental GUI. " + "Octave is under continuous improvement and the GUI will be the " + "default interface for the 4.0 release. For more information, " + "select the \"Release Notes\" item in the \"Help\" menu of the GUI, " + "or visit http://octave.org.")); + + msg->setStyleSheet ("background-color: #ffd97f; color: black; margin 4px;"); + msg->setMinimumWidth (100); + msg->setMinimumHeight (60); + msg->setMaximumHeight (80); + msg->setSizePolicy (QSizePolicy (QSizePolicy::Expanding, + QSizePolicy::Minimum)); + + QPushButton *info_button = new QPushButton (tr ("More Info"), box); + QPushButton *hide_button = new QPushButton (tr ("Hide"), box); + + connect (info_button, SIGNAL (clicked ()), + this, SLOT (show_gui_info ())); + + connect (hide_button, SIGNAL (clicked ()), + this, SLOT (hide_warning_bar ())); + + QVBoxLayout *button_layout = new QVBoxLayout; + + button_layout->addWidget (info_button); + button_layout->addWidget (hide_button); + + QHBoxLayout *icon_and_message = new QHBoxLayout; + + icon_and_message->addWidget (icon); + icon_and_message->addSpacing (10); + icon_and_message->addWidget (msg); + icon_and_message->addSpacing (10); + icon_and_message->addLayout (button_layout); + + icon_and_message->setAlignment (hide_button, Qt::AlignTop); + + box->setFrameStyle (QFrame::Box); + box->setLineWidth (2); + box->setMaximumWidth (1000); + box->adjustSize (); + box->setLayout (icon_and_message); + + _warning_bar->setFeatures (QDockWidget::NoDockWidgetFeatures); + _warning_bar->setObjectName ("WarningToolBar"); + _warning_bar->setWidget (box); + + setCorner (Qt::TopLeftCorner, Qt::TopDockWidgetArea); + setCorner (Qt::TopRightCorner, Qt::TopDockWidgetArea); + + addDockWidget (Qt::TopDockWidgetArea, _warning_bar); +}; + +void +main_window::construct_gui_info_button (void) +{ + QIcon warning_icon + = QIcon::fromTheme ("dialog-warning", + QIcon (":/actions/icons/warning.png")); + + _gui_info_button + = new QPushButton (warning_icon, tr ("Experimental GUI Info")); + + _main_tool_bar->addWidget (_gui_info_button); + + connect (_gui_info_button, SIGNAL (clicked ()), + this, SLOT (show_gui_info ())); +} + +void +main_window::hide_warning_bar (void) +{ + QSettings *settings = resource_manager::get_settings (); + + if (settings) + { + settings->setValue ("General/hide_new_gui_warning", true); + + settings->sync (); + } + + removeDockWidget (_warning_bar); + + construct_gui_info_button (); +} + +void +main_window::show_gui_info (void) +{ + QString gui_info + (tr ("

A Note about Octave's New GUI

" + "

One of the biggest new features for Octave 3.8 is a graphical " + "user interface. It is the one thing that users have requested " + "most often over the last few years and now it is almost ready. " + "But because it is not quite as polished as we would like, we " + "have decided to wait until the 4.0.x release series before " + "making the GUI the default interface.

" + "

Given the length of time and the number of bug fixes and " + "improvements since the last major release Octave, we also " + "decided against delaying the release of all these new " + "improvements any longer just to perfect the GUI. So please " + "enjoy the 3.8 release of Octave and the preview of the new GUI. " + "We beleive it is working reasonably well, but we also know that " + "there are some obvious rough spots and many things that could be " + "improved.

" + "

We Need Your Help

" + "

There are many ways that you can help us fix the remaining " + "problems, complete the GUI, and improve the overall user " + "experience for both novices and experts alike (links will open " + "an external browser):

" + "

  • If you are a skilled software developer, you can " + "help by contributing your time to help " + "develop " + "Octave.
  • " + "
  • If Octave does not work properly, you are encouraged to " + "report problems " + "that you find.
  • " + "
  • Whether you are a user or developer, you can " + "help to fund the " + "project. " + "Octave development takes a lot of time and expertise. " + "Your contributions help to ensure that Octave will continue " + "to improve.

" + "

We hope you find Octave to be useful. Please help us make " + "it even better for the future!

")); + + QMessageBox gui_info_dialog (QMessageBox::Warning, + tr ("Experimental GUI Info"), + gui_info, QMessageBox::Close); + + gui_info_dialog.exec (); +} + +void main_window::construct_tool_bar (void) { _main_tool_bar = addToolBar ("Main"); diff -r 6762a6d23010 -r 4502d6d577d5 libgui/src/main-window.h --- a/libgui/src/main-window.h Tue Nov 26 12:38:46 2013 -0500 +++ b/libgui/src/main-window.h Sat Nov 30 12:39:54 2013 -0500 @@ -124,6 +124,9 @@ void exit (int status); void reset_windows (void); + void hide_warning_bar (void); + void show_gui_info (void); + void change_directory (const QString& dir); void browse_for_directory (void); void set_current_working_directory (const QString& dir); @@ -222,6 +225,9 @@ void construct_news_menu (QMenuBar *p); + void construct_warning_bar (void); + void construct_gui_info_button (void); + void construct_tool_bar (void); void establish_octave_link (void); @@ -293,6 +299,9 @@ QToolBar *_main_tool_bar; + QDockWidget *_warning_bar; + QPushButton *_gui_info_button; + QMenu *_debug_menu; QAction *_debug_continue; diff -r 6762a6d23010 -r 4502d6d577d5 libgui/src/module.mk --- a/libgui/src/module.mk Tue Nov 26 12:38:46 2013 -0500 +++ b/libgui/src/module.mk Sat Nov 30 12:39:54 2013 -0500 @@ -67,6 +67,7 @@ src/icons/terminal.png \ src/icons/undo.png \ src/icons/up.png \ + src/icons/warning.png \ src/icons/widget-close.png \ src/icons/widget-dock.png \ src/icons/widget-undock.png \ diff -r 6762a6d23010 -r 4502d6d577d5 libgui/src/octave-gui.cc --- a/libgui/src/octave-gui.cc Tue Nov 26 12:38:46 2013 -0500 +++ b/libgui/src/octave-gui.cc Sat Nov 30 12:39:54 2013 -0500 @@ -127,28 +127,35 @@ if (start_gui) { QApplication application (argc, argv); + QTranslator gui_tr, qt_tr, qsci_tr; - // Set the codec for all strings + // Set the codec for all strings (before wizard) QTextCodec::setCodecForCStrings (QTextCodec::codecForName ("UTF-8")); + // show wizard if this is the first run if (resource_manager::is_first_run ()) { + resource_manager::config_translators (&qt_tr, &qsci_tr, &gui_tr); // before wizard + application.installTranslator (&qt_tr); + application.installTranslator (&qsci_tr); + application.installTranslator (&gui_tr); + welcome_wizard welcomeWizard; if (welcomeWizard.exec () == QDialog::Rejected) exit (1); - } - - resource_manager::reload_settings (); - // install translators for the gui and qt text - QTranslator gui_tr, qt_tr, qsci_tr; + resource_manager::reload_settings (); // install settings file + } + else + { + resource_manager::reload_settings (); // get settings file - resource_manager::config_translators (&qt_tr, &qsci_tr, &gui_tr); - - application.installTranslator (&qt_tr); - application.installTranslator (&qsci_tr); - application.installTranslator (&gui_tr); + resource_manager::config_translators (&qt_tr, &qsci_tr, &gui_tr); // after settings + application.installTranslator (&qt_tr); + application.installTranslator (&qsci_tr); + application.installTranslator (&gui_tr); + } // update network-settings resource_manager::update_network_settings (); diff -r 6762a6d23010 -r 4502d6d577d5 libgui/src/resource-manager.cc --- a/libgui/src/resource-manager.cc Tue Nov 26 12:38:46 2013 -0500 +++ b/libgui/src/resource-manager.cc Sat Nov 30 12:39:54 2013 -0500 @@ -100,35 +100,33 @@ QString qt_trans_dir = QLibraryInfo::location (QLibraryInfo::TranslationsPath); + QString language = "SYSTEM"; // take system language per default + QSettings *settings = resource_manager::get_settings (); if (settings) { - // get the locale from the settings - QString language = settings->value ("language","SYSTEM").toString (); - - if (language == "SYSTEM") - language = QLocale::system ().name (); // get system wide locale + // get the locale from the settings if already available + language = settings->value ("language","SYSTEM").toString (); + } - // load the translator file for qt strings - loaded = qt_tr->load ("qt_" + language, qt_trans_dir); + if (language == "SYSTEM") + language = QLocale::system ().name (); // get system wide locale - if (!loaded) // try lower case - qt_tr->load ("qt_" + language.toLower (), qt_trans_dir); + // load the translator file for qt strings + loaded = qt_tr->load ("qt_" + language, qt_trans_dir); - // load the translator file for qscintilla settings - loaded = qsci_tr->load ("qscintilla_" + language, qt_trans_dir); + if (!loaded) // try lower case + qt_tr->load ("qt_" + language.toLower (), qt_trans_dir); - if (!loaded) // try lower case - qsci_tr->load ("qscintilla_" + language.toLower (), qt_trans_dir); + // load the translator file for qscintilla settings + loaded = qsci_tr->load ("qscintilla_" + language, qt_trans_dir); - // load the translator file for gui strings - gui_tr->load (language, get_gui_translation_dir ()); - } - else - { - // FIXME: Is this an error? If so, what should we do? - } + if (!loaded) // try lower case + qsci_tr->load ("qscintilla_" + language.toLower (), qt_trans_dir); + + // load the translator file for gui strings + gui_tr->load (language, get_gui_translation_dir ()); } bool diff -r 6762a6d23010 -r 4502d6d577d5 libgui/src/resource.qrc --- a/libgui/src/resource.qrc Tue Nov 26 12:38:46 2013 -0500 +++ b/libgui/src/resource.qrc Sat Nov 30 12:39:54 2013 -0500 @@ -63,6 +63,7 @@ icons/graphic_logo_WorkspaceView.png icons/graphic_logo_DocumentationDockWidget.png icons/graphic_logo_ReleaseWidget.png + icons/warning.png icons/widget-close.png icons/widget-dock.png icons/widget-undock.png diff -r 6762a6d23010 -r 4502d6d577d5 libinterp/corefcn/syscalls.cc --- a/libinterp/corefcn/syscalls.cc Tue Nov 26 12:38:46 2013 -0500 +++ b/libinterp/corefcn/syscalls.cc Sat Nov 30 12:39:54 2013 -0500 @@ -378,53 +378,71 @@ } /* -%!test -%! unix_sort = true; -%! cmd = {"sort", "-r"}; -%! if (ispc ()) -%! status = system ("sort /? 2>NUL 1>NUL"); -%! if (status == 0) -%! unix_sort = false; -%! cmd = {"sort", "/R"}; -%! endif -%! endif -%! [in, out, pid] = popen2 (cmd{:}); -%! if (isunix ()) + +%!test # UNIX-style test +%! if (isunix () || ismac ()) +%! [in, out, pid] = popen2 ("sort", "-r"); %! EAGAIN = errno ("EAGAIN"); -%! else -%! EAGAIN = errno ("EINVAL"); -%! endif -%! fputs (in, "these\nare\nsome\nstrings\n"); -%! fclose (in); -%! done = false; -%! str = {}; -%! idx = 0; -%! errs = 0; -%! do -%! if (! isunix ()) -%! errno (0); -%! endif -%! s = fgets (out); -%! if (ischar (s)) -%! idx++; -%! str{idx} = s; -%! elseif (errno () == EAGAIN) -%! fclear (out); -%! sleep (0.1); -%! if (++errs == 100) +%! fputs (in, "these\nare\nsome\nstrings\n"); +%! fclose (in); +%! done = false; +%! str = {}; +%! idx = 0; +%! errs = 0; +%! do +%! if (ismac ()) # FIXME: Is this necessary? +%! errno (0); +%! endif +%! s = fgets (out); +%! if (ischar (s)) +%! idx++; +%! str{idx} = s; +%! elseif (errno () == EAGAIN) +%! fclear (out); +%! sleep (0.1); +%! if (++errs == 100) +%! done = true; +%! endif +%! else %! done = true; %! endif -%! else -%! done = true; -%! endif -%! until (done) -%! fclose (out); -%! waitpid (pid); -%! if (unix_sort) +%! until (done) +%! fclose (out); +%! waitpid (pid); %! assert (str, {"these\n","strings\n","some\n","are\n"}); -%! else +%! endif + +%!test # Windows-style test +%! if (ispc () && ! isunix ()) +%! [in, out, pid] = popen2 ('C:\Windows\system32\sort.exe', "/R"); +%! EAGAIN = errno ("EINVAL"); +%! fputs (in, "these\r\nare\r\nsome\r\nstrings\r\n"); +%! fclose (in); +%! done = false; +%! str = {}; +%! idx = 0; +%! errs = 0; +%! do +%! errno (0); +%! s = fgets (out); +%! if (ischar (s)) +%! idx++; +%! str{idx} = s; +%! elseif (errno () == EAGAIN) +%! fclear (out); +%! sleep (0.1); +%! if (++errs == 100) +%! done = true; +%! endif +%! else +%! done = true; +%! endif +%! until (done) +%! fclose (out); +%! waitpid (pid); %! assert (str, {"these\r\n","strings\r\n","some\r\n","are\r\n"}); %! endif + */ DEFUNX ("fcntl", Ffcntl, args, , diff -r 6762a6d23010 -r 4502d6d577d5 libinterp/octave-value/ov-class.cc --- a/libinterp/octave-value/ov-class.cc Tue Nov 26 12:38:46 2013 -0500 +++ b/libinterp/octave-value/ov-class.cc Sat Nov 30 12:39:54 2013 -0500 @@ -2016,33 +2016,113 @@ %!error class () */ -DEFUN (__isa_parent__, args, , +DEFUN (isa, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} __isa_parent__ (@var{class}, @var{name})\n\ -Undocumented internal function.\n\ +@deftypefn {Function File} {} isa (@var{obj}, @var{classname})\n\ +Return true if @var{obj} is an object from the class @var{classname}.\n\ +\n\ +@var{classname} may also be one of the following class categories:\n\ +\n\ +@table @asis\n\ +@item @qcode{\"float\"}\n\ +Floating point value comprising classes @qcode{\"double\"} and\n\ +@qcode{\"single\"}.\n\ +\n\ +@item @qcode{\"integer\"}\n\ +Integer value comprising classes (u)int8, (u)int16, (u)int32, (u)int64.\n\ +\n\ +@item @qcode{\"numeric\"}\n\ +Numeric value comprising either a floating point or integer value.\n\ +@end table\n\ +\n\ +If @var{classname} is a cell array of string, a logical array of the same\n\ +size is returned, containing true for each class to which @var{obj}\n\ +belongs to.\n\ +\n\ +@seealso{class, typeinfo}\n\ @end deftypefn") { - octave_value retval = false; - - if (args.length () == 2) + octave_value retval; + + if (args.length () != 2) + { + print_usage (); + return retval; + } + + octave_value obj = args(0); // not const because of find_parent_class () + const Array cls = args(1).cellstr_value (); + if (error_state) + { + error ("isa: CLASSNAME must be a string or cell attay of strings"); + return retval; + } + + boolNDArray matches (cls.dims (), false); + const octave_idx_type n = cls.numel (); + for (octave_idx_type idx = 0; idx < n; idx++) { - octave_value cls = args(0); - octave_value nm = args(1); - - if (! error_state) - { - if (cls.find_parent_class (nm.string_value ())) - retval = true; - } - else - error ("__isa_parent__: expecting arguments to be character strings"); + const std::string cl = cls(idx); + if ((cl == "float" && obj.is_float_type ()) || + (cl == "integer" && obj.is_integer_type ()) || + (cl == "numeric" && obj.is_numeric_type ()) || + obj.class_name () == cl || obj.find_parent_class (cl)) + matches(idx) = true; } - else - print_usage (); - - return retval; + return octave_value (matches); } +/* +%!assert (isa ("char", "float"), false) +%!assert (isa (logical (1), "float"), false) +%!assert (isa (double (13), "float"), true) +%!assert (isa (single (13), "float"), true) +%!assert (isa (int8 (13), "float"), false) +%!assert (isa (int16 (13), "float"), false) +%!assert (isa (int32 (13), "float"), false) +%!assert (isa (int64 (13), "float"), false) +%!assert (isa (uint8 (13), "float"), false) +%!assert (isa (uint16 (13), "float"), false) +%!assert (isa (uint32 (13), "float"), false) +%!assert (isa (uint64 (13), "float"), false) +%!assert (isa ("char", "numeric"), false) +%!assert (isa (logical (1), "numeric"), false) +%!assert (isa (double (13), "numeric"), true) +%!assert (isa (single (13), "numeric"), true) +%!assert (isa (int8 (13), "numeric"), true) +%!assert (isa (int16 (13), "numeric"), true) +%!assert (isa (int32 (13), "numeric"), true) +%!assert (isa (int64 (13), "numeric"), true) +%!assert (isa (uint8 (13), "numeric"), true) +%!assert (isa (uint16 (13), "numeric"), true) +%!assert (isa (uint32 (13), "numeric"), true) +%!assert (isa (uint64 (13), "numeric"), true) +%!assert (isa (uint8 (13), "integer"), true) +%!assert (isa (double (13), "integer"), false) +%!assert (isa (single (13), "integer"), false) +%!assert (isa (single (13), {"integer", "float", "single"}), [false true true]) + +%!assert (isa (double (13), "double")) +%!assert (isa (single (13), "single")) +%!assert (isa (int8 (13), "int8")) +%!assert (isa (int16 (13), "int16")) +%!assert (isa (int32 (13), "int32")) +%!assert (isa (int64 (13), "int64")) +%!assert (isa (uint8 (13), "uint8")) +%!assert (isa (uint16 (13), "uint16")) +%!assert (isa (uint32 (13), "uint32")) +%!assert (isa (uint64 (13), "uint64")) +%!assert (isa ("string", "char")) +%!assert (isa (true, "logical")) +%!assert (isa (false, "logical")) +%!assert (isa ({1, 2}, "cell")) +%!assert (isa ({1, 2}, {"numeric", "integer", "cell"}), [false false true]) + +%!test +%! a.b = 1; +%! assert (isa (a, "struct")); +*/ + DEFUN (__parent_classes__, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} __parent_classes__ (@var{x})\n\ diff -r 6762a6d23010 -r 4502d6d577d5 scripts/general/isa.m --- a/scripts/general/isa.m Tue Nov 26 12:38:46 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -## Copyright (C) 2004-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 -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {} isa (@var{obj}, @var{classname}) -## Return true if @var{obj} is an object from the class @var{classname}. -## -## @var{classname} may also be one of the following class categories: -## -## @table @asis -## @item @qcode{"float"} -## Floating point value comprising classes @qcode{"double"} and -## @qcode{"single"}. -## -## @item @qcode{"integer"} -## Integer value comprising classes (u)int8, (u)int16, (u)int32, (u)int64. -## -## @item @qcode{"numeric"} -## Numeric value comprising either a floating point or integer value. -## @end table -## @seealso{class, typeinfo} -## @end deftypefn - -## Author: Paul Kienzle -## Adapted-by: jwe - -function retval = isa (obj, classname) - - if (nargin != 2) - print_usage (); - endif - - if (strcmp (classname, "float")) - retval = isfloat (obj); - elseif (strcmp (classname, "integer")) - retval = isinteger (obj); - elseif (strcmp (classname, "numeric")) - retval = isnumeric (obj); - else - class_of_obj = class (obj); - retval = strcmp (class_of_obj, classname); - if (! retval && isobject (obj)) - retval = __isa_parent__ (obj, classname); - endif - endif - -endfunction - - -%!assert (isa ("char", "float"), false) -%!assert (isa (logical (1), "float"), false) -%!assert (isa (double (13), "float"), true) -%!assert (isa (single (13), "float"), true) -%!assert (isa (int8 (13), "float"), false) -%!assert (isa (int16 (13), "float"), false) -%!assert (isa (int32 (13), "float"), false) -%!assert (isa (int64 (13), "float"), false) -%!assert (isa (uint8 (13), "float"), false) -%!assert (isa (uint16 (13), "float"), false) -%!assert (isa (uint32 (13), "float"), false) -%!assert (isa (uint64 (13), "float"), false) -%!assert (isa ("char", "numeric"), false) -%!assert (isa (logical (1), "numeric"), false) -%!assert (isa (double (13), "numeric"), true) -%!assert (isa (single (13), "numeric"), true) -%!assert (isa (int8 (13), "numeric"), true) -%!assert (isa (int16 (13), "numeric"), true) -%!assert (isa (int32 (13), "numeric"), true) -%!assert (isa (int64 (13), "numeric"), true) -%!assert (isa (uint8 (13), "numeric"), true) -%!assert (isa (uint16 (13), "numeric"), true) -%!assert (isa (uint32 (13), "numeric"), true) -%!assert (isa (uint64 (13), "numeric"), true) -%!assert (isa (uint8 (13), "integer"), true) -%!assert (isa (double (13), "integer"), false) -%!assert (isa (single (13), "integer"), false) - -%!assert (isa (double (13), "double")) -%!assert (isa (single (13), "single")) -%!assert (isa (int8 (13), "int8")) -%!assert (isa (int16 (13), "int16")) -%!assert (isa (int32 (13), "int32")) -%!assert (isa (int64 (13), "int64")) -%!assert (isa (uint8 (13), "uint8")) -%!assert (isa (uint16 (13), "uint16")) -%!assert (isa (uint32 (13), "uint32")) -%!assert (isa (uint64 (13), "uint64")) -%!assert (isa ("string", "char")) -%!assert (isa (true, "logical")) -%!assert (isa (false, "logical")) -%!assert (isa ({1, 2}, "cell")) -%!test -%! a.b = 1; -%! assert (isa (a, "struct")); - diff -r 6762a6d23010 -r 4502d6d577d5 scripts/general/module.mk --- a/scripts/general/module.mk Tue Nov 26 12:38:46 2013 -0500 +++ b/scripts/general/module.mk Sat Nov 30 12:39:54 2013 -0500 @@ -40,7 +40,6 @@ general/interp3.m \ general/interpn.m \ general/interpft.m \ - general/isa.m \ general/iscolumn.m \ general/isdir.m \ general/isequal.m \ diff -r 6762a6d23010 -r 4502d6d577d5 scripts/testfun/__run_test_suite__.m --- a/scripts/testfun/__run_test_suite__.m Tue Nov 26 12:38:46 2013 -0500 +++ b/scripts/testfun/__run_test_suite__.m Sat Nov 30 12:39:54 2013 -0500 @@ -28,7 +28,7 @@ fixedtestdir = fullfile (testsdir, "fixed"); fcnfiledir = octave_config_info ("fcnfiledir"); if (nargin == 0) - fcndirs = { libinterptestdir, liboctavetestdir, fcnfiledir }; + fcndirs = { liboctavetestdir, libinterptestdir, fcnfiledir }; fixedtestdirs = { fixedtestdir }; endif global files_with_no_tests = {}; diff -r 6762a6d23010 -r 4502d6d577d5 src/octave-config.in.cc --- a/src/octave-config.in.cc Tue Nov 26 12:38:46 2013 -0500 +++ b/src/octave-config.in.cc Sat Nov 30 12:39:54 2013 -0500 @@ -51,25 +51,25 @@ " expects to find locally installed .oct files.\n" "\n" " -p VAR, --print VAR Print the value of the given configuration\n" -" variable VAR. Recognized variables are:\n" +" variable VAR. Recognized variables are:\n" "\n" -" API_VERSION LOCALAPIARCHLIBDIR\n" -" CANONICAL_HOST_TYPE LOCALAPIFCNFILEDIR\n" -" DEFAULT_PAGER LOCALAPIOCTFILEDIR\n" -" ARCHLIBDIR LOCALARCHLIBDIR\n" -" BINDIR LOCALFCNFILEDIR\n" -" DATADIR LOCALOCTFILEDIR\n" -" DATAROOTDIR LOCALSTARTUPFILEDIR\n" -" EXEC_PREFIX LOCALVERARCHLIBDIR\n" -" FCNFILEDIR LOCALVERFCNFILEDIR\n" -" LOCALVEROCTFILEDIR MAN1DIR\n" -" IMAGEDIR MANDIR\n" -" MAN1EXT OCTFILEDIR\n" -" INCLUDEDIR OCTINCLUDEDIR\n" -" INFODIR OCTLIBDIR\n" -" INFOFILE PREFIX\n" -" LIBDIR STARTUPFILEDIR\n" -" LIBEXECDIR VERSION\n" +" API_VERSION LOCALAPIARCHLIBDIR\n" +" CANONICAL_HOST_TYPE LOCALAPIFCNFILEDIR\n" +" DEFAULT_PAGER LOCALAPIOCTFILEDIR\n" +" ARCHLIBDIR LOCALARCHLIBDIR\n" +" BINDIR LOCALFCNFILEDIR\n" +" DATADIR LOCALOCTFILEDIR\n" +" DATAROOTDIR LOCALSTARTUPFILEDIR\n" +" EXEC_PREFIX LOCALVERARCHLIBDIR\n" +" FCNFILEDIR LOCALVERFCNFILEDIR\n" +" LOCALVEROCTFILEDIR MAN1DIR\n" +" IMAGEDIR MANDIR\n" +" MAN1EXT OCTFILEDIR\n" +" INCLUDEDIR OCTINCLUDEDIR\n" +" INFODIR OCTLIBDIR\n" +" INFOFILE PREFIX\n" +" LIBDIR STARTUPFILEDIR\n" +" LIBEXECDIR VERSION\n" "\n" " -v, --version Print the Octave version number.\n" "\n"; diff -r 6762a6d23010 -r 4502d6d577d5 src/octave-config.in.sh --- a/src/octave-config.in.sh Tue Nov 26 12:38:46 2013 -0500 +++ b/src/octave-config.in.sh Sat Nov 30 12:39:54 2013 -0500 @@ -117,7 +117,7 @@ expects to find locally installed .oct files. -p VAR, --print VAR Print the value of the given configuration - variable VAR. Recognized variables are: + variable VAR. Recognized variables are: API_VERSION LOCALAPIOCTFILEDIR ARCHLIBDIR LOCALARCHLIBDIR diff -r 6762a6d23010 -r 4502d6d577d5 test/fntests.m --- a/test/fntests.m Tue Nov 26 12:38:46 2013 -0500 +++ b/test/fntests.m Sat Nov 30 12:39:54 2013 -0500 @@ -43,12 +43,12 @@ testdirs = {currdir, srcdir}; endif +liboctave_tree = canonicalize_file_name (fullfile (topbuilddir, "liboctave")); src_tree = canonicalize_file_name (fullfile (topbuilddir, "libinterp")); -liboctave_tree = canonicalize_file_name (fullfile (topbuilddir, "liboctave")); script_tree = canonicalize_file_name (fullfile (topsrcdir, "scripts")); local_script_tree = canonicalize_file_name (fullfile (currdir, "../scripts")); -fundirs = {src_tree, liboctave_tree, script_tree}; +fundirs = {liboctave_tree, src_tree, script_tree}; if (! strcmp (currdir, srcdir)) fundirs{end+1} = local_script_tree;