Mercurial > hg > octave-terminal
changeset 14877: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 | 5d74d8b982a5 |
children | bc6c099eacc0 |
files | .hgsubstate gui/src/main-window.cc gui/src/main-window.h gui/src/octave-adapter/octave-link.cc |
diffstat | 4 files changed, 14 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgsubstate +++ b/.hgsubstate @@ -1,2 +1,2 @@ 33f823397dbb0edb57503f2f6dad2362456bc6a9 gnulib -8f1ce54f3f0e15e35221ce48568c730267b6793b gui/qterminal +5fed5b210291e691a3fbc565ec38d5ced9abc4e5 gui/qterminal
--- 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)),
--- a/gui/src/main-window.h +++ b/gui/src/main-window.h @@ -80,6 +80,7 @@ void handle_command_double_clicked (QString command); void new_file (); void open_file (); + void open_file (QString file_name); void open_bug_tracker_page (); void open_agora_page (); void open_octave_forge_page ();
--- a/gui/src/octave-adapter/octave-link.cc +++ b/gui/src/octave-adapter/octave-link.cc @@ -96,6 +96,7 @@ _next_performance_information.process_events_start = clock (); _event_queue_mutex->lock (); _next_performance_information.event_queue_size = _event_queue.size (); + while (_event_queue.size () > 0) { octave_event * e = _event_queue.front ();