# HG changeset patch # User Jacob Dawid # Date 1342640023 14400 # Node ID 3fd857c284fe9571035554386aa73fb2267396b9 # Parent 5d74d8b982a5711b1656a3a83ca09e8e6e125884 Editor now gets focussed when opening a file. * main-window.cc : Focussing editor after opening or creating a new file. diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,2 +1,2 @@ 33f823397dbb0edb57503f2f6dad2362456bc6a9 gnulib -8f1ce54f3f0e15e35221ce48568c730267b6793b gui/qterminal +5fed5b210291e691a3fbc565ec38d5ced9abc4e5 gui/qterminal diff --git a/gui/src/main-window.cc b/gui/src/main-window.cc --- 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)), diff --git a/gui/src/main-window.h b/gui/src/main-window.h --- 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 (); diff --git a/gui/src/octave-adapter/octave-link.cc b/gui/src/octave-adapter/octave-link.cc --- 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 ();