Mercurial > hg > octave-lyh
diff gui/src/main-window.cc @ 14875:3fd857c284fe gui
Editor now gets focussed when opening a file.
* main-window.cc : Focussing editor after opening or creating a new file.
author | Jacob Dawid <jacob.dawid@gmail.com> |
---|---|
date | Wed, 18 Jul 2012 15:33:43 -0400 |
parents | cff522bf80c5 |
children | 3ad363879015 |
line wrap: on
line diff
--- a/gui/src/main-window.cc +++ b/gui/src/main-window.cc @@ -63,12 +63,21 @@ main_window::new_file () { _file_editor->request_new_file (); + focus_editor (); } void main_window::open_file () { _file_editor->request_open_file (); + focus_editor (); +} + +void +main_window::open_file (QString file_name) +{ + _file_editor->request_open_file (file_name); + focus_editor (); } void @@ -217,9 +226,7 @@ void main_window::current_working_directory_up () { - octave_link::instance () - ->post_event (new octave_change_directory_event (*this, "..")); - + set_current_working_directory (".."); } void @@ -724,7 +731,7 @@ connect (this, SIGNAL (settings_changed ()), this, SLOT (notice_settings ())); connect (_files_dock_widget, SIGNAL (open_file (QString)), - _file_editor, SLOT (request_open_file (QString))); + this, SLOT (open_file (QString))); connect (_files_dock_widget, SIGNAL (displayed_directory_changed(QString)), this, SLOT (set_current_working_directory(QString))); connect (_history_dock_widget, SIGNAL (information (QString)),