changeset 19640:3156773fcc80 gui-release

open a doc page from editor directly without command window * file-editor.cc (add_file_editor_tab): connect new signal from edit area requesting showing the documentation * octave-qscintilla.cc (contextmenu_help_doc): emit new signal for documentation * octave-qscintilla.h: new signal for documentation
author Torsten <ttl@justmail.de>
date Thu, 22 Jan 2015 19:02:24 +0100
parents d258070914ef
children 18c213fa9b20
files libgui/src/m-editor/file-editor.cc libgui/src/m-editor/octave-qscintilla.cc libgui/src/m-editor/octave-qscintilla.h
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc	Thu Jan 22 06:52:37 2015 +0100
+++ b/libgui/src/m-editor/file-editor.cc	Thu Jan 22 19:02:24 2015 +0100
@@ -1586,6 +1586,9 @@
   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&)));
+
   // Signals from the file editor_tab
   connect (f, SIGNAL (file_name_changed (const QString&, const QString&)),
            this, SLOT (handle_file_name_changed (const QString&,
--- a/libgui/src/m-editor/octave-qscintilla.cc	Thu Jan 22 06:52:37 2015 +0100
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Thu Jan 22 19:02:24 2015 +0100
@@ -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	Thu Jan 22 06:52:37 2015 +0100
+++ b/libgui/src/m-editor/octave-qscintilla.h	Thu Jan 22 19:02:24 2015 +0100
@@ -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: