changeset 18695:7c78430535db

maint: Periodic merge of gui-release to stable.
author Rik <rik@octave.org>
date Mon, 28 Apr 2014 11:17:05 -0700
parents fe0e34be5576 (current diff) 1a5dabbaa559 (diff)
children 95a1ee1cbdf1
files libgui/src/m-editor/octave-qscintilla.cc libgui/src/main-window.cc libgui/src/qtinfo/webinfo.cc libgui/src/shortcut-manager.cc libinterp/corefcn/input.cc scripts/gui/listdlg.m
diffstat 16 files changed, 235 insertions(+), 186 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Sun Apr 27 18:02:47 2014 -0700
+++ b/libgui/src/m-editor/file-editor-tab.cc	Mon Apr 28 11:17:05 2014 -0700
@@ -89,6 +89,9 @@
            this,
            SLOT (handle_cursor_moved (int,int)));
 
+  connect (_edit_area, SIGNAL (create_context_menu_signal (QMenu*)),
+           this, SLOT (create_context_menu (QMenu*)));
+
   // create statusbar for row/col indicator
   _status_bar = new QStatusBar (this);
 
@@ -154,6 +157,9 @@
   connect (_edit_area, SIGNAL (copyAvailable (bool)),
            this, SLOT (handle_copy_available (bool)));
 
+  connect (_edit_area, SIGNAL (qsci_has_focus_signal (bool)),
+           this, SLOT (edit_area_has_focus (bool)));
+
   connect (&_file_system_watcher, SIGNAL (fileChanged (const QString&)),
            this, SLOT (file_has_changed (const QString&)));
 
@@ -406,61 +412,6 @@
 }
 
 void
-file_editor_tab::undo (const QWidget *ID)
-{
-  if (ID != this)
-    return;
-
-  _edit_area->undo ();
-}
-
-void
-file_editor_tab::redo (const QWidget *ID)
-{
-  if (ID != this)
-    return;
-
-  _edit_area->redo ();
-}
-
-void
-file_editor_tab::copy (const QWidget *ID)
-{
-  if (ID != this)
-    return;
-
-  _edit_area->copy ();
-}
-
-void
-file_editor_tab::cut (const QWidget *ID)
-{
-  if (ID != this)
-    return;
-
-  _edit_area->cut ();
-}
-
-void
-file_editor_tab::paste (const QWidget *ID)
-{
-  if (ID != this)
-    return;
-
-  _edit_area->paste ();
-}
-
-void
-file_editor_tab::select_all (const QWidget *ID)
-{
-  if (ID != this)
-    return;
-
-  _edit_area->selectAll ();
-}
-
-
-void
 file_editor_tab::context_help (const QWidget *ID, bool doc)
 {
   if (ID != this)
@@ -1664,4 +1615,16 @@
   _col_indicator->setNum (col+1);
 }
 
+void
+file_editor_tab::create_context_menu (QMenu *menu)
+{
+  emit create_context_menu_tab_signal (menu);
+}
+
+void
+file_editor_tab::edit_area_has_focus (bool focus)
+{
+  emit set_global_edit_shortcuts_signal (! focus);
+}
+
 #endif
--- a/libgui/src/m-editor/file-editor-tab.h	Sun Apr 27 18:02:47 2014 -0700
+++ b/libgui/src/m-editor/file-editor-tab.h	Mon Apr 28 11:17:05 2014 -0700
@@ -47,6 +47,8 @@
 
   ~file_editor_tab (void);
 
+  octave_qscintilla *qsci_edit_area () { return _edit_area; }
+
 public slots:
 
   void update_window_title (bool modified);
@@ -67,12 +69,6 @@
   void file_name_query (const QWidget *ID);
 
   void set_focus (const QWidget *ID);
-  void undo (const QWidget *ID);
-  void redo (const QWidget *ID);
-  void copy (const QWidget *ID);
-  void cut (const QWidget *ID);
-  void paste (const QWidget *ID);
-  void select_all (const QWidget *ID);
   void context_help (const QWidget *ID, bool);
   void context_edit (const QWidget *ID);
   void save_file (const QWidget *ID);
@@ -121,6 +117,8 @@
   void file_has_changed (const QString& fileName);
 
   void execute_command_in_terminal (const QString& command);
+  void edit_area_has_focus (bool foucs);
+  void create_context_menu (QMenu *);
 
 signals:
 
@@ -133,6 +131,8 @@
                                    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 *);
 
 protected:
 
--- a/libgui/src/m-editor/file-editor.cc	Sun Apr 27 18:02:47 2014 -0700
+++ b/libgui/src/m-editor/file-editor.cc	Mon Apr 28 11:17:05 2014 -0700
@@ -572,40 +572,45 @@
 void
 file_editor::request_undo (bool)
 {
-  emit fetab_undo (_tab_widget->currentWidget ());
+  emit fetab_scintilla_command (_tab_widget->currentWidget (),
+                                QsciScintillaBase::SCI_UNDO);
 }
 
 void
 file_editor::request_redo (bool)
 {
-  emit fetab_redo (_tab_widget->currentWidget ());
+  emit fetab_scintilla_command (_tab_widget->currentWidget (),
+                                QsciScintillaBase::SCI_REDO);
 }
 
 void
 file_editor::request_copy (bool)
 {
-  emit fetab_copy (_tab_widget->currentWidget ());
+  emit fetab_scintilla_command (_tab_widget->currentWidget (),
+                                QsciScintillaBase::SCI_COPY);
 }
 
 void
 file_editor::request_cut (bool)
 {
-  emit fetab_cut (_tab_widget->currentWidget ());
+  emit fetab_scintilla_command (_tab_widget->currentWidget (),
+                                QsciScintillaBase::SCI_CUT);
 }
 
 void
 file_editor::request_paste (bool)
 {
-  emit fetab_paste (_tab_widget->currentWidget ());
+  emit fetab_scintilla_command (_tab_widget->currentWidget (),
+                                QsciScintillaBase::SCI_PASTE);
 }
 
 void
 file_editor::request_selectall (bool)
 {
-  emit fetab_selectall (_tab_widget->currentWidget ());
+  emit fetab_scintilla_command (_tab_widget->currentWidget (),
+                                QsciScintillaBase::SCI_SELECTALL);
 }
 
-
 void
 file_editor::request_context_help (bool)
 {
@@ -707,55 +712,55 @@
 file_editor::request_delete_start_word (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::DeleteWordLeft);
+                                QsciScintillaBase::SCI_DELWORDLEFT);
 }
 void
 file_editor::request_delete_end_word (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::DeleteWordRight);
+                                QsciScintillaBase::SCI_DELWORDRIGHT);
 }
 void
 file_editor::request_delete_start_line (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::DeleteLineLeft);
+                                QsciScintillaBase::SCI_DELLINELEFT);
 }
 void
 file_editor::request_delete_end_line (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::DeleteLineRight);
+                                QsciScintillaBase::SCI_DELLINERIGHT);
 }
 void
 file_editor::request_delete_line (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::LineDelete);
+                                QsciScintillaBase::SCI_LINEDELETE);
 }
 void
 file_editor::request_copy_line (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::LineCopy);
+                                QsciScintillaBase::SCI_LINECOPY);
 }
 void
 file_editor::request_cut_line (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::LineCut);
+                                QsciScintillaBase::SCI_LINECUT);
 }
 void
 file_editor::request_duplicate_selection (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::SelectionDuplicate);
+                                QsciScintillaBase::SCI_SELECTIONDUPLICATE);
 }
 void
 file_editor::request_transpose_line (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::LineTranspose);
+                                QsciScintillaBase::SCI_LINETRANSPOSE);
 }
 void
 file_editor::request_comment_selected_text (bool)
@@ -773,13 +778,13 @@
 file_editor::request_upper_case (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::SelectionUpperCase);
+                                QsciScintillaBase::SCI_UPPERCASE);
 }
 void
 file_editor::request_lower_case (bool)
 {
   emit fetab_scintilla_command (_tab_widget->currentWidget (),
-                                QsciCommand::SelectionLowerCase);
+                                QsciScintillaBase::SCI_LOWERCASE);
 }
 void
 file_editor::request_indent_selected_text (bool)
@@ -935,12 +940,33 @@
   editor_tab_map[fileName] = ID;
 }
 
+// context menu of edit area
 void
 file_editor::active_tab_changed (int index)
 {
   emit fetab_change_request (_tab_widget->widget (index));
 }
 
+void file_editor::create_context_menu (QMenu *menu)
+{
+  // remove all standard actions from scintilla
+  QList<QAction *> all_actions = menu->actions ();
+  QAction* a;
+
+  foreach (a, all_actions)
+    menu->removeAction (a);
+
+  // add editor's actions with icons and customized shortcuts
+  menu->addAction (_undo_action);
+  menu->addAction (_redo_action);
+  menu->addSeparator ();
+  menu->addAction (_cut_action);
+  menu->addAction (_copy_action);
+  menu->addAction (_paste_action);
+  menu->addSeparator ();
+  menu->addAction (_selectall_action);
+}
+
 void
 file_editor::zoom_in (bool)
 {
@@ -960,6 +986,13 @@
 }
 
 void
+file_editor::edit_status_update (bool undo, bool redo)
+{
+  _undo_action->setEnabled (undo);
+  _redo_action->setEnabled (redo);
+}
+
+void
 file_editor::handle_editor_state_changed (bool copy_available,
                                           const QString& file_name)
 {
@@ -997,22 +1030,18 @@
   int tab_width_max = settings->value ("editor/notebook_tab_width_max", 300)
                                       .toInt ();
 
-  QString style_sheet;
   if (settings->value ("editor/longWindowTitle", false).toBool ())
     {
-      style_sheet = QString ("QTabBar::tab {max-height: 4ex; "
-                             "min-width: %1px; max-width: %2px;}")
+      QString style_sheet = QString ("QTabBar::tab "
+                                     "{min-width: %1px; max-width: %2px;}")
                              .arg (tab_width_min).arg (tab_width_max);
       _tab_widget->setElideMode (Qt::ElideLeft);
+      _tab_widget->setStyleSheet (style_sheet);
     }
   else
-    {
-      style_sheet = QString ("QTabBar::tab {max-height: 4ex;}");
-      _tab_widget->setElideMode (Qt::ElideNone);
-    }
+    _tab_widget->setElideMode (Qt::ElideNone);
 
   _tab_widget->setUsesScrollButtons (true);
-  _tab_widget->setStyleSheet (style_sheet);
 
   set_shortcuts ();
 
@@ -1132,8 +1161,10 @@
 
   _undo_action = add_action (editMenu, QIcon (":/actions/icons/undo.png"),
           tr ("&Undo"), SLOT (request_undo (bool)));
+  _undo_action->setEnabled (false);
   _redo_action = add_action (editMenu, QIcon (":/actions/icons/redo.png"),
           tr ("&Redo"), SLOT (request_redo (bool)));
+  _redo_action->setEnabled (false);
 
   editMenu->addSeparator ();
 
@@ -1370,6 +1401,10 @@
 {
   _tab_widget->addTab (f, fn);
 
+  // signals from the qscintilla edit area
+  connect (f->qsci_edit_area (), SIGNAL (status_update (bool, bool)),
+           this, SLOT (edit_status_update (bool, bool)));
+
   // Signals from the file editor_tab
   connect (f, SIGNAL (file_name_changed (const QString&, const QString&)),
            this, SLOT (handle_file_name_changed (const QString&,
@@ -1390,12 +1425,18 @@
   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 (set_global_edit_shortcuts_signal (bool)),
+           main_win (), SLOT (set_global_edit_shortcuts (bool)));
+
   // Signals from the file_editor non-trivial operations
   connect (this, SIGNAL (fetab_settings_changed (const QSettings *)),
            f, SLOT (notice_settings (const QSettings *)));
@@ -1414,24 +1455,6 @@
            f, SLOT (save_file (const QWidget*, const QString&, bool)));
 
   // Signals from the file_editor trivial operations
-  connect (this, SIGNAL (fetab_undo (const QWidget*)),
-           f, SLOT (undo (const QWidget*)));
-
-  connect (this, SIGNAL (fetab_redo (const QWidget*)),
-           f, SLOT (redo (const QWidget*)));
-
-  connect (this, SIGNAL (fetab_copy (const QWidget*)),
-           f, SLOT (copy (const QWidget*)));
-
-  connect (this, SIGNAL (fetab_cut (const QWidget*)),
-           f, SLOT (cut (const QWidget*)));
-
-  connect (this, SIGNAL (fetab_paste (const QWidget*)),
-           f, SLOT (paste (const QWidget*)));
-
-  connect (this, SIGNAL (fetab_selectall (const QWidget*)),
-           f, SLOT (select_all (const QWidget*)));
-
   connect (this, SIGNAL (fetab_zoom_in (const QWidget*)),
            f, SLOT (zoom_in (const QWidget*)));
   connect (this, SIGNAL (fetab_zoom_out (const QWidget*)),
@@ -1527,38 +1550,6 @@
 }
 
 void
-file_editor::copyClipboard ()
-{
-  QWidget * foc_w = focusWidget ();
-
-  if (foc_w && foc_w->inherits ("octave_qscintilla"))
-    {
-      request_copy (true);
-    }
-}
-void
-file_editor::pasteClipboard ()
-{
-  QWidget * foc_w = focusWidget ();
-
-  if (foc_w && foc_w->inherits ("octave_qscintilla"))
-    {
-      request_paste (true);
-    }
-}
-void
-file_editor::selectAll ()
-{
-  QWidget * foc_w = focusWidget ();
-
-  if (foc_w && foc_w->inherits ("octave_qscintilla"))
-    {
-      request_selectall (true);
-    }
-}
-
-
-void
 file_editor::set_shortcuts ()
 {
   // File menu
@@ -1605,9 +1596,9 @@
   shortcut_manager::set_shortcut (_styles_preferences_action, "editor_edit:styles_preferences");
 
   // View menu
-  shortcut_manager::set_shortcut (_zoom_in_action, "edit_edit:zoom_in");
-  shortcut_manager::set_shortcut (_zoom_out_action, "edit_edit:zoom_out");
-  shortcut_manager::set_shortcut (_zoom_normal_action, "edit_edit:zoom_normal");
+  shortcut_manager::set_shortcut (_zoom_in_action, "editor_view:zoom_in");
+  shortcut_manager::set_shortcut (_zoom_out_action, "editor_view:zoom_out");
+  shortcut_manager::set_shortcut (_zoom_normal_action, "editor_view:zoom_normal");
 
   // Debug menu
   shortcut_manager::set_shortcut (_toggle_breakpoint_action, "editor_debug:toggle_breakpoint");
@@ -1658,8 +1649,6 @@
   _close_all_action->setEnabled (have_tabs);
   _close_others_action->setEnabled (have_tabs && _tab_widget->count () > 1);
 
-  _undo_action->setEnabled (have_tabs);
-  _redo_action->setEnabled (have_tabs);
   _selectall_action->setEnabled (have_tabs);
 }
 
@@ -1727,20 +1716,20 @@
   }
 
 void 
-file_editor::dragEnterEvent (QDragEnterEvent *event)
+file_editor::dragEnterEvent (QDragEnterEvent *e)
   {
-    if (event->mimeData ()->hasUrls ())
+    if (e->mimeData ()->hasUrls ())
       {
-        event->acceptProposedAction();
+        e->acceptProposedAction();
       }
   }
 
 void
-file_editor::dropEvent (QDropEvent *event)
+file_editor::dropEvent (QDropEvent *e)
   {
-    if (event->mimeData ()->hasUrls ())
+    if (e->mimeData ()->hasUrls ())
       {
-        foreach (QUrl url, event->mimeData ()->urls ())
+        foreach (QUrl url, e->mimeData ()->urls ())
         {
           request_open_file (url.toLocalFile ());
         }
--- a/libgui/src/m-editor/file-editor.h	Sun Apr 27 18:02:47 2014 -0700
+++ b/libgui/src/m-editor/file-editor.h	Mon Apr 28 11:17:05 2014 -0700
@@ -76,12 +76,6 @@
                         bool remove_on_success);
   // No fetab_open, functionality in editor
   // No fetab_new, functionality in editor
-  void fetab_undo (const QWidget* ID);
-  void fetab_redo (const QWidget* ID);
-  void fetab_copy (const QWidget* ID);
-  void fetab_cut (const QWidget* ID);
-  void fetab_paste (const QWidget* ID);
-  void fetab_selectall (const QWidget* ID);
   void fetab_context_help (const QWidget* ID, bool);
   void fetab_context_edit (const QWidget* ID);
   void fetab_save_file (const QWidget* ID);
@@ -204,9 +198,6 @@
 
 
 protected slots:
-  void copyClipboard ();
-  void pasteClipboard ();
-  void selectAll ();
 
 private slots:
 
@@ -222,6 +213,9 @@
   void zoom_out (bool);
   void zoom_normal (bool);
 
+  void create_context_menu (QMenu *);
+  void edit_status_update (bool, bool);
+
 protected:
 
   void dragEnterEvent(QDragEnterEvent *event);
--- a/libgui/src/m-editor/octave-qscintilla.cc	Sun Apr 27 18:02:47 2014 -0700
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Mon Apr 28 11:17:05 2014 -0700
@@ -39,8 +39,17 @@
 octave_qscintilla::octave_qscintilla (QWidget *p)
   : QsciScintilla (p)
 {
+  connect (this, SIGNAL (textChanged ()), this, SLOT (text_changed ()));
+
   // clear scintilla edit shortcuts that are handled by the editor
-  QsciCommandSet  *cmd_set =  standardCommands ();
+  QsciCommandSet *cmd_set = standardCommands ();
+
+#ifdef HAVE_QSCI_VERSION_2_6_0
+  // find () was added in QScintilla 2.6
+  cmd_set->find (QsciCommand::SelectionCopy)->setKey (0);
+  cmd_set->find (QsciCommand::SelectionCut)->setKey (0);
+  cmd_set->find (QsciCommand::Paste)->setKey (0);
+  cmd_set->find (QsciCommand::SelectAll)->setKey (0);
   cmd_set->find (QsciCommand::SelectionDuplicate)->setKey (0);
   cmd_set->find (QsciCommand::LineTranspose)->setKey (0);
   cmd_set->find (QsciCommand::Undo)->setKey (0);
@@ -56,6 +65,39 @@
   cmd_set->find (QsciCommand::LineDelete)->setKey (0);
   cmd_set->find (QsciCommand::LineCut)->setKey (0);
   cmd_set->find (QsciCommand::LineCopy)->setKey (0);
+#else
+  // find commands via its default key (tricky way without find ())
+  QList< QsciCommand * > cmd_list = cmd_set->commands ();
+  for (int i = 0; i < cmd_list.length (); i++)
+    {
+      int cmd_key = cmd_list.at (i)->key ();
+      switch (cmd_key)
+        {
+          case Qt::Key_C | Qt::CTRL :               // SelectionCopy
+          case Qt::Key_X | Qt::CTRL :               // SelectionCut
+          case Qt::Key_V | Qt::CTRL :               // Paste
+          case Qt::Key_A | Qt::CTRL :               // SelectAll
+          case Qt::Key_D | Qt::CTRL :               // SelectionDuplicate
+          case Qt::Key_T | Qt::CTRL :               // LineTranspose
+          case Qt::Key_Z | Qt::CTRL :               // Undo
+          case Qt::Key_Y | Qt::CTRL :               // Redo
+          case Qt::Key_Z | Qt::CTRL | Qt::SHIFT :   // Redo
+          case Qt::Key_U | Qt::CTRL :               // SelectionLowerCase
+          case Qt::Key_U | Qt::CTRL | Qt::SHIFT :   // SelectionUpperCase
+          case Qt::Key_Plus | Qt::CTRL :            // ZoomIn
+          case Qt::Key_Minus | Qt::CTRL :           // ZoomOut
+          case Qt::Key_Backspace | Qt::CTRL | Qt::SHIFT :   // DeleteLineLeft
+          case Qt::Key_Delete | Qt::CTRL | Qt::SHIFT :      // DeleteLineRight
+          case Qt::Key_K | Qt::META :                       // DeleteLineRight
+          case Qt::Key_Backspace | Qt::CTRL :       // DeleteWordLeft
+          case Qt::Key_Delete | Qt::CTRL :          // DeleteWordRight
+          case Qt::Key_L | Qt::CTRL | Qt::SHIFT :   // LineDelete
+          case Qt::Key_L | Qt::CTRL :               // LineCut
+          case Qt::Key_T | Qt::CTRL | Qt::SHIFT :   // LineCopy
+            cmd_list.at (i)->setKey (0);
+        }
+    }
+#endif
 }
 
 octave_qscintilla::~octave_qscintilla ()
@@ -115,11 +157,13 @@
 void
 octave_qscintilla::contextMenuEvent (QContextMenuEvent *e)
 {
+  QPoint global_pos, local_pos;                         // the menu's position
   QMenu *context_menu = createStandardContextMenu ();  // standard menu
 
-  // the menu's position
-  QPoint global_pos, local_pos;
+  // fill context menu with editor's standard actions
+  emit create_context_menu_signal (context_menu);
 
+  // determine position depending on mouse or keyboard event
   if (e->reason () == QContextMenuEvent::Mouse)
     {
       // context menu by mouse
@@ -207,4 +251,24 @@
     emit execute_command_in_terminal_signal (commands.at (i));
 }
 
+void
+octave_qscintilla::focusInEvent (QFocusEvent *focusEvent)
+{
+  emit qsci_has_focus_signal (true);
+  QsciScintilla::focusInEvent(focusEvent);
+}
+
+void
+octave_qscintilla::focusOutEvent (QFocusEvent *focusEvent)
+{
+  emit qsci_has_focus_signal (false);
+  QsciScintilla::focusOutEvent(focusEvent);
+}
+
+void
+octave_qscintilla::text_changed ()
+{
+  emit status_update (isUndoAvailable (), isRedoAvailable ());
+}
+
 #endif
--- a/libgui/src/m-editor/octave-qscintilla.h	Sun Apr 27 18:02:47 2014 -0700
+++ b/libgui/src/m-editor/octave-qscintilla.h	Mon Apr 28 11:17:05 2014 -0700
@@ -50,6 +50,9 @@
 signals:
 
   void execute_command_in_terminal_signal (const QString&);
+  void create_context_menu_signal (QMenu*);
+  void qsci_has_focus_signal (bool);
+  void status_update (bool,bool);
 
 private slots:
 
@@ -59,6 +62,13 @@
   void contextmenu_edit (bool);
   void contextmenu_run (bool);
 
+  void text_changed (void);
+
+protected:
+
+  void focusInEvent (QFocusEvent *focusEvent);
+  void focusOutEvent (QFocusEvent *focusEvent);
+
 private:
 
   QString _word_at_cursor;
--- a/libgui/src/main-window.cc	Sun Apr 27 18:02:47 2014 -0700
+++ b/libgui/src/main-window.cc	Mon Apr 28 11:17:05 2014 -0700
@@ -1437,11 +1437,11 @@
                             tr ("Open..."));
   _open_action->setShortcutContext (Qt::ApplicationShortcut);
 
+#ifdef HAVE_QSCINTILLA
   editor_window->insert_new_open_actions (_new_script_action,
                                           _new_function_action,
                                           _open_action);
 
-#ifdef HAVE_QSCINTILLA
   file_menu->addMenu (editor_window->get_mru_menu ());
 #endif
 
@@ -2278,6 +2278,26 @@
 }
 
 void
+main_window::set_global_edit_shortcuts (bool enable)
+{
+  if (enable)
+    {
+      shortcut_manager::set_shortcut (_copy_action, "main_edit:copy");
+      shortcut_manager::set_shortcut (_paste_action, "main_edit:paste");
+      shortcut_manager::set_shortcut (_undo_action, "main_edit:undo");
+      shortcut_manager::set_shortcut (_select_all_action, "main_edit:select_all");
+    }
+  else
+    {
+      QKeySequence no_key = QKeySequence ();
+      _copy_action->setShortcut (no_key);
+      _paste_action->setShortcut (no_key);
+      _undo_action->setShortcut (no_key);
+      _select_all_action->setShortcut (no_key);
+    }
+}
+
+void
 main_window::set_global_shortcuts (bool set_shortcuts)
 {
   if (set_shortcuts)
--- a/libgui/src/main-window.h	Sun Apr 27 18:02:47 2014 -0700
+++ b/libgui/src/main-window.h	Mon Apr 28 11:17:05 2014 -0700
@@ -194,6 +194,7 @@
 
   // setting global shortcuts
   void set_global_shortcuts (bool enable);
+  void set_global_edit_shortcuts (bool enable);
 
   // handling the clipboard
   void clipboard_has_changed (QClipboard::Mode);
--- a/libgui/src/qtinfo/webinfo.cc	Sun Apr 27 18:02:47 2014 -0700
+++ b/libgui/src/qtinfo/webinfo.cc	Mon Apr 28 11:17:05 2014 -0700
@@ -60,7 +60,6 @@
 #ifdef HAVE_QTABWIDGET_SETMOVABLE
   _tab_bar->setMovable (true);
 #endif
-  _tab_bar->setStyleSheet ("QTabBar::tab {max-height: 4ex; }");
   hbox_layout->addWidget (_tab_bar);
 
   _zoom_in_button = new QToolButton (this);
--- a/libgui/src/shortcut-manager.cc	Sun Apr 27 18:02:47 2014 -0700
+++ b/libgui/src/shortcut-manager.cc	Mon Apr 28 11:17:05 2014 -0700
@@ -180,8 +180,7 @@
   // view
   init (tr ("Zoom In"), "editor_view:zoom_in", QKeySequence::ZoomIn);
   init (tr ("Zoom Out"), "editor_view:zoom_out", QKeySequence::ZoomOut);
-  init (tr ("Zoom Normal"), "editor_view:zoom_normal",
-        QKeySequence (Qt::ControlModifier + Qt::Key_Slash));
+  init (tr ("Zoom Normal"), "editor_view:zoom_normal",  QKeySequence (Qt::ControlModifier + Qt::AltModifier + Qt::Key_0));
 
   // debug
   init (tr ("Toggle Breakpoint"), "editor_debug:toggle_breakpoint",
--- a/libinterp/corefcn/input.cc	Sun Apr 27 18:02:47 2014 -0700
+++ b/libinterp/corefcn/input.cc	Mon Apr 28 11:17:05 2014 -0700
@@ -732,7 +732,9 @@
        "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {@var{ans} =} input (@var{prompt})\n\
 @deftypefnx {Built-in Function} {@var{ans} =} input (@var{prompt}, \"s\")\n\
-Print a prompt and wait for user input.  For example,\n\
+Print @var{prompt} and wait for user input.\n\
+\n\
+For example,\n\
 \n\
 @example\n\
 input (\"Pick a number, any number! \")\n\
@@ -762,7 +764,7 @@
 a good idea to always call @code{fflush (stdout)} before calling\n\
 @code{input}.  This will ensure that all pending output is written to\n\
 the screen before your prompt.\n\
-@seealso{yes_or_no, kbhit, pause}\n\
+@seealso{yes_or_no, kbhit, pause, menu, listdlg}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -800,12 +802,13 @@
 DEFUN (yes_or_no, args, ,
        "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {@var{ans} =} yes_or_no (\"@var{prompt}\")\n\
-Ask the user a yes-or-no question.  Return logical true if the answer is yes\n\
-or false if the answer is no.  Takes one argument, @var{prompt}, which is\n\
-the string to display when asking the question.  @var{prompt} should end in\n\
-a space; @code{yes-or-no} adds the string @samp{(yes or no) } to it.  The\n\
-user must confirm the answer with @key{RET} and can edit it until it has\n\
-been confirmed.\n\
+Ask the user a yes-or-no question.\n\
+\n\
+Return logical true if the answer is yes or false if the answer is no.\n\
+Takes one argument, @var{prompt}, which is the string to display when asking\n\
+the question.  @var{prompt} should end in a space; @code{yes-or-no} adds the\n\
+string @samp{(yes or no) } to it.  The user must confirm the answer with\n\
+@key{RET} and can edit it until it has been confirmed.\n\
 @seealso{input}\n\
 @end deftypefn")
 {
@@ -889,7 +892,7 @@
 \n\
 If @code{keyboard} is invoked without arguments, a default prompt of\n\
 @samp{debug> } is used.\n\
-@seealso{dbcont, dbquit}\n\
+@seealso{dbstop, dbcont, dbquit}\n\
 @end deftypefn")
 {
   octave_value_list retval;
--- a/libinterp/corefcn/sysdep.cc	Sun Apr 27 18:02:47 2014 -0700
+++ b/libinterp/corefcn/sysdep.cc	Mon Apr 28 11:17:05 2014 -0700
@@ -641,7 +641,7 @@
 @noindent\n\
 is identical to the above example, but doesn't wait for a keypress,\n\
 returning the empty string if no key is available.\n\
-@seealso{input}\n\
+@seealso{input, pause}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -667,12 +667,16 @@
 
 DEFUN (pause, args, ,
        "-*- texinfo -*-\n\
-@deftypefn {Built-in Function} {} pause (@var{seconds})\n\
-Suspend the execution of the program.  If invoked without any arguments,\n\
-Octave waits until you type a character.  With a numeric argument, it\n\
-pauses for the given number of seconds.  For example, the following\n\
-statement prints a message and then waits 5 seconds before clearing the\n\
-screen.\n\
+@deftypefn  {Built-in Function} {} pause ()\n\
+@deftypefnx {Built-in Function} {} pause (@var{n})\n\
+Suspend the execution of the program for @var{n} seconds.\n\
+\n\
+@var{n} is a positive real value and may be a fraction of a second.\n\
+If invoked without an input arguments then the program is suspended until a\n\
+character is typed.\n\
+\n\
+The following example prints a message and then waits 5 seconds before\n\
+clearing the screen.\n\
 \n\
 @example\n\
 @group\n\
@@ -681,6 +685,7 @@
 clc;\n\
 @end group\n\
 @end example\n\
+@seealso{kbhit, sleep}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -736,6 +741,7 @@
        "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} sleep (@var{seconds})\n\
 Suspend the execution of the program for the given number of seconds.\n\
+@seealso{usleep, pause}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -776,6 +782,7 @@
 microseconds.  On systems where it is not possible to sleep for periods\n\
 of time less than one second, @code{usleep} will pause the execution for\n\
 @code{round (@var{microseconds} / 1e6)} seconds.\n\
+@seealso{sleep, pause}\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -915,8 +922,8 @@
 DEFUN (have_window_system, , ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} have_window_system ()\n\
-Return true if Octave a window system is available (X11, Windows,\n\
-or Apple OS X) and false otherwise.\n\
+Return true if a window system is available (X11, Windows, or Apple OS X)\n\
+and false otherwise.\n\
 @end deftypefn")
 {
   return octave_value (display_info::display_available ());
--- a/scripts/gui/listdlg.m	Sun Apr 27 18:02:47 2014 -0700
+++ b/scripts/gui/listdlg.m	Mon Apr 28 11:17:05 2014 -0700
@@ -74,7 +74,7 @@
 ## @end group
 ## @end example
 ##
-## @seealso{errordlg, helpdlg, inputdlg, msgbox, questdlg, warndlg}
+## @seealso{menu, errordlg, helpdlg, inputdlg, msgbox, questdlg, warndlg}
 ## @end deftypefn
 
 function [sel, ok] = listdlg (varargin)
--- a/scripts/miscellaneous/menu.m	Sun Apr 27 18:02:47 2014 -0700
+++ b/scripts/miscellaneous/menu.m	Mon Apr 28 11:17:05 2014 -0700
@@ -24,7 +24,7 @@
 ## programs.  There is no limit to the number of options that may be passed
 ## in, but it may be confusing to present more than will fit easily on one
 ## screen.
-## @seealso{disp, printf, input}
+## @seealso{input, listdlg}
 ## @end deftypefn
 
 ## Author: jwe
--- a/scripts/plot/util/private/__gnuplot_get_var__.m	Sun Apr 27 18:02:47 2014 -0700
+++ b/scripts/plot/util/private/__gnuplot_get_var__.m	Mon Apr 28 11:17:05 2014 -0700
@@ -27,7 +27,7 @@
 function gp_var_value = __gnuplot_get_var__ (h, gp_var_name, fmt = "")
 
   if (numel (h) == 1 && isfigure (h))
-    if (isempty (get (gcf, "__plot_stream__")))
+    if (isempty (get (h, "__plot_stream__")))
       ostream = __gnuplot_open_stream__ (2, h);
     else
       ostream = get (h, "__plot_stream__");
--- a/scripts/sparse/spy.m	Sun Apr 27 18:02:47 2014 -0700
+++ b/scripts/sparse/spy.m	Mon Apr 28 11:17:05 2014 -0700
@@ -34,7 +34,7 @@
   endif
 
   markersize = NaN;
-  if (numel (x) < 1000)
+  if (nnz (x) < 1000)
     line_spec = "*";
   else
     line_spec = ".";