changeset 23488:52a74f14345c

restore last editor session not before octave is ready * file-editor-interface.h: restore_session is now a public virtual method * file-editor.cc (construct): do not restore last session when editor is created * file-editor.h: restore_session now public, not private * main-window.cc (handle_octave_ready): restore last editor session when octave is ready, because now all function required for collection the autocompletion information are available
author Torsten <mttl@mailbox.org>
date Fri, 12 May 2017 12:51:23 +0200
parents af2f1f3dbe06
children 1b017f9ee3f1
files libgui/src/m-editor/file-editor-interface.h libgui/src/m-editor/file-editor.cc libgui/src/m-editor/file-editor.h libgui/src/main-window.cc
diffstat 4 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-interface.h	Thu May 11 17:50:49 2017 -0400
+++ b/libgui/src/m-editor/file-editor-interface.h	Fri May 12 12:51:23 2017 +0200
@@ -25,6 +25,7 @@
 
 #include <QMenu>
 #include <QToolBar>
+#include <QSettings>
 #include "octave-dock-widget.h"
 
 class file_editor_interface : public octave_dock_widget
@@ -64,6 +65,8 @@
 
   virtual void empty_script (bool, bool) = 0;
 
+  virtual void restore_session (QSettings *) = 0;
+
   virtual void enable_menu_shortcuts (bool enable) = 0;
 
 public slots:
--- a/libgui/src/m-editor/file-editor.cc	Thu May 11 17:50:49 2017 -0400
+++ b/libgui/src/m-editor/file-editor.cc	Fri May 12 12:51:23 2017 +0200
@@ -1699,8 +1699,6 @@
   setWindowIcon (QIcon (":/actions/icons/logo.png"));
   set_title (tr ("Editor"));
 
-  restore_session (settings);
-
   check_actions ();
 }
 
--- a/libgui/src/m-editor/file-editor.h	Thu May 11 17:50:49 2017 -0400
+++ b/libgui/src/m-editor/file-editor.h	Fri May 12 12:51:23 2017 +0200
@@ -141,6 +141,7 @@
 
   void check_actions (void);
   void empty_script (bool startup, bool visible);
+  void restore_session (QSettings *settings);
 
 signals:
 
@@ -345,8 +346,6 @@
 
   void switch_tab (int direction, bool movetab = false);
 
-  void restore_session (QSettings *settings);
-
   bool editor_tab_has_focus ();
 
   QWidget * find_tab_widget (const QString& openFileName) const;
--- a/libgui/src/main-window.cc	Thu May 11 17:50:49 2017 -0400
+++ b/libgui/src/main-window.cc	Fri May 12 12:51:23 2017 +0200
@@ -1822,6 +1822,7 @@
       // This can not be done when the editor is created because all functions
       // must be known for the lexer's auto completion informations
       editor_window->empty_script (true, false);
+      editor_window->restore_session (settings);
 #endif
     }