diff libgui/src/m-editor/file-editor.h @ 19980:f7a805f02723

link undo in main window to editor if the latter has focus (bug #44402) * file-editor.cc (editor_tab_has_focus): helper function checking whether an edit area has the focus; (copyClipboard, pasteClipboard, selectAll): use this helper function; (do_undo): new slot for the undo action triggered from the main window * file-editor.h: new helper function and new slots * main-window.cc (handle_undo_request): emit a signal for undo instead of undoing in terminal window when terminal does not have focus * main-window.h: new undo signal * octave-dock-widget.cc (octave_dock_widget): connect undo signal from main-window to new virtual slot; * octave-dock-widget.h: new virtual slot do_undo, doing nothing
author Torsten <ttl@justmail.de>
date Sat, 14 Mar 2015 18:54:23 +0100
parents 415864f5b85f
children
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.h	Sat Mar 14 14:52:58 2015 +0000
+++ b/libgui/src/m-editor/file-editor.h	Sat Mar 14 18:54:23 2015 +0100
@@ -213,6 +213,7 @@
   void copyClipboard ();
   void pasteClipboard ();
   void selectAll ();
+  void do_undo ();
 
 private slots:
 
@@ -252,6 +253,8 @@
 
   void toggle_preference (const QString& preference, bool def);
 
+  bool editor_tab_has_focus ();
+
   QWidget *find_tab_widget (const QString& openFileName) const;
   QAction *add_action (QMenu *menu, const QIcon &icon, const QString &text,
                        const char *member);