diff libgui/src/m-editor/octave-qscintilla.cc @ 18689:fac35875f6eb gui-release

update enabled status of undo/redo actions in the editor * file-editor-tab.h: new inline function returning the qscintilla edit area * octave-qscintilla.cc (constructor): connect textChanged signal to new private slot text_changed; (text_changed): new slot emitting a signal on undo/redo availability * octave-qscintilla.h: new slot and new signal * file-editor.cc (edit_status_update): new slot for updating undo/redo actions; (construct): undo/redo actions disabled at the beginning; (add_new_edit_tab): connect new slot to the signal from the qscintilla edit area indicating undo/redo availability * file-editor.h: new slot
author Torsten <ttl@justmail.de>
date Sun, 27 Apr 2014 19:36:54 +0200
parents 99e26cb0f87f
children 7c78430535db 095fdef3d67c
line wrap: on
line diff
--- a/libgui/src/m-editor/octave-qscintilla.cc	Sun Apr 27 18:42:25 2014 +0200
+++ b/libgui/src/m-editor/octave-qscintilla.cc	Sun Apr 27 19:36:54 2014 +0200
@@ -39,6 +39,8 @@
 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 ();
 
@@ -263,4 +265,10 @@
   QsciScintilla::focusOutEvent(focusEvent);
 }
 
+void
+octave_qscintilla::text_changed ()
+{
+  emit status_update (isUndoAvailable (), isRedoAvailable ());
+}
+
 #endif