diff libgui/src/main-window.cc @ 15993:41471c02d51c

gui: show menu with recently used editor files also in file menu of main window * file-editor-interface.h: new function get_mru_menu () * file-editor.h: new function get_mru_menu (), _mru_file_menu global * file-editor.cc (destructor): delete _mru_file_menu * file-editor.cc (set_focus): make editor visible before setting focus here * main-window.cc (focus_editor): and not here * file-editor.cc (request_new_file,request_open_file): set editor focus here * main-window.cc (new_file,open_file): and not here * main-window.cc (construct): add the editor's mru menu to the file menu
author Torsten <ttl@justmail.de>
date Sat, 02 Feb 2013 13:21:44 +0100
parents c4c46e1a086b
children 74ba79f79fcc
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Sat Feb 02 09:17:26 2013 +0100
+++ b/libgui/src/main-window.cc	Sat Feb 02 13:21:44 2013 +0100
@@ -100,7 +100,6 @@
 {
 #ifdef HAVE_QSCINTILLA
   _file_editor->request_new_file ();
-  focus_editor ();
 #endif
 }
 
@@ -109,7 +108,6 @@
 {
 #ifdef HAVE_QSCINTILLA
   _file_editor->request_open_file ();
-  focus_editor ();
 #endif
 }
 
@@ -118,7 +116,6 @@
 {
 #ifdef HAVE_QSCINTILLA
   _file_editor->request_open_file (file_name);
-  focus_editor ();
 #endif
 }
 
@@ -404,10 +401,6 @@
 main_window::focus_editor ()
 {
 #ifdef HAVE_QSCINTILLA
-  if (!_file_editor->isVisible ())
-    {
-      _file_editor->setVisible (true);
-    }
   // call own function of editor in order to set focus to the current editor tab
   _file_editor->set_focus ();
 #endif
@@ -725,6 +718,9 @@
   QAction *open_action
     = file_menu->addAction (QIcon(":/actions/icons/fileopen.png"), tr ("Open..."));
   open_action->setShortcut (Qt::ControlModifier + Qt::Key_O);
+
+  file_menu->addMenu(_file_editor->get_mru_menu ());
+
   QAction *close_command_window_action
     = file_menu->addAction (tr ("Close Command Window"));
   close_command_window_action->setShortcut (Qt::ControlModifier + Qt::Key_W);