changeset 19659:2f4406e9dad6

maint: Periodic merge of gui-release to default.
author John W. Eaton <jwe@octave.org>
date Fri, 23 Jan 2015 16:40:25 -0500
parents e8e3a89fa370 (current diff) 6b2d7a5dc62a (diff)
children 05e3639b0fac
files libgui/graphics/Backend.cc libgui/graphics/BaseControl.cc libgui/graphics/Container.cc libgui/graphics/ContextMenu.cc libgui/graphics/EditControl.cc libgui/graphics/Figure.cc libgui/graphics/GLCanvas.cc libgui/graphics/Menu.cc libgui/graphics/MouseModeActionGroup.cc libgui/graphics/Object.h libgui/graphics/Panel.cc libgui/graphics/QtHandlesUtils.cc libgui/graphics/TextEdit.cc libgui/graphics/TextEdit.h libgui/graphics/ToolBar.cc libgui/graphics/__init_qt__.cc libgui/src/m-editor/octave-qscintilla.cc libgui/src/octave-dock-widget.cc libgui/src/octave-gui.cc libinterp/corefcn/pr-output.cc libinterp/corefcn/profiler.cc libinterp/corefcn/toplev.cc libinterp/octave-value/ov-base-diag.cc libinterp/octave-value/ov-perm.cc liboctave/cruft/Faddeeva/Faddeeva.cc
diffstat 13 files changed, 51 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/graphics/BaseControl.h	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/graphics/BaseControl.h	Fri Jan 23 16:40:25 2015 -0500
@@ -39,7 +39,7 @@
 
   Container* innerContainer (void) { return 0; }
 
-  bool eventFilter (QObject* watched, QEvent* event);
+  bool eventFilter (QObject* watched, QEvent* e);
 
 protected:
   void init (QWidget* w, bool callBase = false);
--- a/libgui/graphics/Container.cc	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/graphics/Container.cc	Fri Jan 23 16:40:25 2015 -0500
@@ -47,18 +47,18 @@
 {
 }
 
-Canvas* Container::canvas (const graphics_handle& xhandle, bool xcreate)
+Canvas* Container::canvas (const graphics_handle& gh, bool xcreate)
 {
   if (! m_canvas && xcreate)
     {
-      graphics_object go = gh_manager::get_object (xhandle);
+      graphics_object go = gh_manager::get_object (gh);
 
       if (go)
         {
           graphics_object fig = go.get_ancestor ("figure");
 
           m_canvas = Canvas::create (fig.get("renderer").string_value (),
-                                     this, xhandle);
+                                     this, gh);
 
           QWidget* canvasWidget = m_canvas->qWidget ();
 
--- a/libgui/graphics/GLCanvas.cc	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/graphics/GLCanvas.cc	Fri Jan 23 16:40:25 2015 -0500
@@ -37,8 +37,8 @@
 namespace QtHandles
 {
 
-GLCanvas::GLCanvas (QWidget* xparent, const graphics_handle& xhandle)
-  : QGLWidget (xparent), Canvas (xhandle)
+GLCanvas::GLCanvas (QWidget* xparent, const graphics_handle& gh)
+  : QGLWidget (xparent), Canvas (gh)
 {
   setFocusPolicy (Qt::ClickFocus);
 }
@@ -47,9 +47,9 @@
 {
 }
 
-void GLCanvas::draw (const graphics_handle& xhandle)
+void GLCanvas::draw (const graphics_handle& gh)
 {
-  graphics_object go = gh_manager::get_object (xhandle);
+  graphics_object go = gh_manager::get_object (gh);
 
   if (go)
     {
--- a/libgui/graphics/Menu.cc	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/graphics/Menu.cc	Fri Jan 23 16:40:25 2015 -0500
@@ -58,14 +58,14 @@
 
 Menu* Menu::create (const graphics_object& go)
 {
-  Object* parent = Object::parentObject (go);
+  Object* parent_obj = Object::parentObject (go);
 
-  if (parent)
+  if (parent_obj)
     {
-      QObject* qObj = parent->qObject ();
+      QObject* qObj = parent_obj->qObject ();
 
       if (qObj)
-        return new Menu (go, new QAction (qObj), parent);
+        return new Menu (go, new QAction (qObj), parent_obj);
     }
 
   return 0;
--- a/libgui/graphics/TextEdit.h	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/graphics/TextEdit.h	Fri Jan 23 16:40:25 2015 -0500
@@ -33,7 +33,7 @@
   Q_OBJECT
 
 public:
-  TextEdit (QWidget* xparent) : QTextEdit (xparent) { }
+  TextEdit (QWidget* xparent) : QTextEdit(xparent) { }
   ~TextEdit (void) { }
 
 signals:
--- a/libgui/src/m-editor/file-editor-tab.cc	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/src/m-editor/file-editor-tab.cc	Fri Jan 23 16:40:25 2015 -0500
@@ -82,21 +82,10 @@
   _file_system_watcher.setObjectName ("_qt_autotest_force_engine_poller");
 
   _edit_area = new octave_qscintilla (this);
-  // Connect signal for command execution to a slot of this tab which in turn
-  // emits a signal connected to the main window.
-  // Direct connection is not possible because tab's parent is null.
-  connect (_edit_area,
-           SIGNAL (execute_command_in_terminal_signal (const QString&)),
-           this,
-           SLOT (execute_command_in_terminal (const QString&)));
 
-  connect (_edit_area,
-           SIGNAL (cursorPositionChanged (int, int)),
-           this,
-           SLOT (handle_cursor_moved (int,int)));
+  connect (_edit_area, SIGNAL (cursorPositionChanged (int, int)),
+           this, SLOT (handle_cursor_moved (int,int)));
 
-  connect (_edit_area, SIGNAL (create_context_menu_signal (QMenu*)),
-           this, SLOT (create_context_menu (QMenu*)));
   connect (_edit_area, SIGNAL (context_menu_edit_signal (const QString&)),
            this, SLOT (handle_context_menu_edit (const QString&)));
 
@@ -208,12 +197,6 @@
 }
 
 void
-file_editor_tab::execute_command_in_terminal (const QString& command)
-{
-  emit execute_command_in_terminal_signal (command); // connected to main window
-}
-
-void
 file_editor_tab::handle_context_menu_edit (const QString& word_at_cursor)
 {
   // search for a subfunction in actual file (this is done at first because
@@ -311,8 +294,10 @@
     filename = QString::fromStdString (
                            map.contents ("file").data ()[0].string_value ());
 
-  emit execute_command_in_terminal_signal (QString("edit ")
-                                           + "\""+filename+"\"");
+  if (! filename.endsWith (".m"))
+    filename.append (".m");
+
+  emit request_open_file (filename);
 }
 
 void
@@ -2087,12 +2072,6 @@
   _col_indicator->setNum (col+1);
 }
 
-void
-file_editor_tab::create_context_menu (QMenu *menu)
-{
-  emit create_context_menu_tab_signal (menu);
-}
-
 QString
 file_editor_tab::get_function_name ()
 {
--- a/libgui/src/m-editor/file-editor-tab.h	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/src/m-editor/file-editor-tab.h	Fri Jan 23 16:40:25 2015 -0500
@@ -120,8 +120,6 @@
 
   void file_has_changed (const QString& fileName);
 
-  void execute_command_in_terminal (const QString& command);
-  void create_context_menu (QMenu *);
   void handle_context_menu_edit (const QString&);
 
 signals:
@@ -135,9 +133,8 @@
   void editor_check_conflict_save (const QString& saveFileName,
                                    bool remove_on_success);
   void run_file_signal (const QFileInfo& info);
-  void execute_command_in_terminal_signal (const QString&);
   void set_global_edit_shortcuts_signal (bool);
-  void create_context_menu_tab_signal (QMenu *);
+  void request_open_file (const QString&);
 
 protected:
 
--- a/libgui/src/m-editor/file-editor.cc	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/src/m-editor/file-editor.cc	Fri Jan 23 16:40:25 2015 -0500
@@ -1567,7 +1567,11 @@
                            QStringList ()).toStringList ();
 
       for (int n = 0; n < sessionFileNames.count (); ++n)
-        request_open_file (sessionFileNames.at (n));
+        {
+          QFileInfo file = QFileInfo (sessionFileNames.at (n));
+          if (file.exists ())
+            request_open_file (sessionFileNames.at (n));
+        }
     }
 
   check_actions ();
@@ -1582,6 +1586,15 @@
   connect (f->qsci_edit_area (), SIGNAL (status_update (bool, bool)),
            this, SLOT (edit_status_update (bool, bool)));
 
+  connect (f->qsci_edit_area (), SIGNAL (show_doc_signal (const QString&)),
+           main_win (), SLOT (handle_show_doc (const QString&)));
+
+  connect (f->qsci_edit_area (), SIGNAL (create_context_menu_signal (QMenu *)),
+           this, SLOT (create_context_menu (QMenu *)));
+
+  connect (f->qsci_edit_area (), SIGNAL (execute_command_in_terminal_signal (const QString&)),
+           main_win (), SLOT (execute_command_in_terminal (const QString&)));
+
   // Signals from the file editor_tab
   connect (f, SIGNAL (file_name_changed (const QString&, const QString&)),
            this, SLOT (handle_file_name_changed (const QString&,
@@ -1602,14 +1615,11 @@
   connect (f, SIGNAL (mru_add_file (const QString&)),
            this, SLOT (handle_mru_add_file (const QString&)));
 
-  connect (f, SIGNAL (create_context_menu_tab_signal (QMenu *)),
-           this, SLOT (create_context_menu (QMenu *)));
-
   connect (f, SIGNAL (run_file_signal (const QFileInfo&)),
            main_win (), SLOT (run_file_in_terminal (const QFileInfo&)));
 
-  connect (f, SIGNAL (execute_command_in_terminal_signal (const QString&)),
-           main_win (), SLOT (execute_command_in_terminal (const QString&)));
+  connect (f, SIGNAL (request_open_file (const QString&)),
+           this, SLOT (request_open_file (const QString&)));
 
   connect (f, SIGNAL (set_global_edit_shortcuts_signal (bool)),
            main_win (), SLOT (set_global_edit_shortcuts (bool)));
--- a/libgui/src/m-editor/octave-qscintilla.cc	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Fri Jan 23 16:40:25 2015 -0500
@@ -255,12 +255,10 @@
 void
 octave_qscintilla::contextmenu_help_doc (bool documentation)
 {
-  QString command;
   if (documentation)
-    command = "doc ";
+    emit show_doc_signal (_word_at_cursor);
   else
-    command = "help ";
-  emit execute_command_in_terminal_signal (command + _word_at_cursor);
+    emit execute_command_in_terminal_signal ("help " + _word_at_cursor);
 }
 
 void
--- a/libgui/src/m-editor/octave-qscintilla.h	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/src/m-editor/octave-qscintilla.h	Fri Jan 23 16:40:25 2015 -0500
@@ -54,6 +54,7 @@
   void context_menu_edit_signal (const QString&);
   void qsci_has_focus_signal (bool);
   void status_update (bool,bool);
+  void show_doc_signal (const QString&);
 
 private slots:
 
--- a/libgui/src/octave-dock-widget.cc	Fri Jan 23 15:37:56 2015 +0000
+++ b/libgui/src/octave-dock-widget.cc	Fri Jan 23 16:40:25 2015 -0500
@@ -244,6 +244,9 @@
 #else
 
   // non windows: just say we are a docked widget again
+
+  Q_UNUSED (dock);
+
   setWindowFlags (Qt::Widget);
 
   QString css = styleSheet ();
@@ -431,4 +434,4 @@
       set_style (true);
       update ();
     }
-}
\ No newline at end of file
+}
--- a/libinterp/corefcn/toplev.cc	Fri Jan 23 15:37:56 2015 +0000
+++ b/libinterp/corefcn/toplev.cc	Fri Jan 23 16:40:25 2015 -0500
@@ -849,7 +849,7 @@
 
   octave_stdout << "\n" << octave_name_version_and_copyright () << "\n\
 \n\
-GNU Octave free software; you can redistribute it and/or modify\n\
+GNU Octave is free software; you can redistribute it and/or modify\n\
 it under the terms of the GNU General Public License as published by\n\
 the Free Software Foundation; either version 3 of the License, or\n\
 (at your option) any later version.\n\
--- a/liboctave/cruft/Faddeeva/Faddeeva.cc	Fri Jan 23 15:37:56 2015 +0000
+++ b/liboctave/cruft/Faddeeva/Faddeeva.cc	Fri Jan 23 16:40:25 2015 -0500
@@ -139,6 +139,7 @@
                        slight accuracy improvements to erf and dawson
                        functions near the origin.  Use gnulib functions
                        if GNULIB_NAMESPACE is defined.
+     18 December 2012: Slight tweaks (remove recomputation of x*x in Dawson)
 */
 
 /////////////////////////////////////////////////////////////////////////
@@ -210,6 +211,7 @@
 // the Octave developers prefer that we silence the warning.
 #  ifdef GNULIB_NAMESPACE
 #    define floor GNULIB_NAMESPACE::floor
+#    define log GNULIB_NAMESPACE::log
 #  endif
 
 #else // !__cplusplus, i.e. pure C (requires C99 features)
@@ -565,8 +567,8 @@
  taylor_realaxis:
   {
     double x2 = x*x;
-    double y2 = y*y;
     if (x2 > 1600) { // |x| > 40
+      double y2 = y*y;
       if (x2 > 25e14) {// |x| > 5e7
         double xy2 = (x*y)*(x*y);
         return C((0.5 + y2 * (0.5 + 0.25*y2
@@ -584,6 +586,7 @@
     }
     else {
       double D = spi2 * FADDEEVA(w_im)(x);
+      double y2 = y*y;
       return C
         (D + y2 * (D + x - 2*D*x2)
          + y2*y2 * (D * (0.5 - x2 * (2 - 0.66666666666666666667*x2))
@@ -693,7 +696,7 @@
   else {
     const double pi = 3.14159265358979323846264338327950288419716939937510582;
     if (relerr > 0.1) relerr = 0.1; // not sensible to compute < 1 digit
-    a = pi / sqrt(-gnulib::log(relerr*0.5));
+    a = pi / sqrt(-log(relerr*0.5));
     c = (2/pi)*a;
     a2 = a*a;
   }
@@ -1009,7 +1012,7 @@
    compared to fitting the whole [0,1] interval with a single polynomial. */
 static double erfcx_y100(double y100)
 {
-  switch (static_cast<int> (y100)) {
+  switch ((int) y100) {
 case 0: {
 double t = 2*y100 - 1;
 return 0.70878032454106438663e-3 + (0.71234091047026302958e-3 + (0.35779077297597742384e-5 + (0.17403143962587937815e-7 + (0.81710660047307788845e-10 + (0.36885022360434957634e-12 + 0.15917038551111111111e-14 * t) * t) * t) * t) * t) * t;
@@ -1453,7 +1456,7 @@
    the Chebyshev polynomials to be of significantly lower degree (about 1/30)
    compared to fitting the whole [0,1] interval with a single polynomial. */
 static double w_im_y100(double y100, double x) {
-  switch (static_cast<int> (y100)) {
+  switch ((int) y100) {
     case 0: {
       double t = 2*y100 - 1;
       return 0.28351593328822191546e-2 + (0.28494783221378400759e-2 + (0.14427470563276734183e-4 + (0.10939723080231588129e-6 + (0.92474307943275042045e-9 + (0.89128907666450075245e-11 + 0.92974121935111111110e-13 * t) * t) * t) * t) * t) * t;