# HG changeset patch # User Thorsten Liebig # Date 1346959264 -7200 # Node ID 5ddeef055df32175cb5a211197ceb60129c2bddf # Parent eefbbc1ed60ed0c0c7c60e429ea72dc473fb7bb9 * file-editor.cc (file_editor::request_open_file): canceled open --> restore focus to previous tab diff -r eefbbc1ed60e -r 5ddeef055df3 libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Thu Sep 06 21:13:09 2012 +0200 +++ b/libgui/src/m-editor/file-editor.cc Thu Sep 06 21:21:04 2012 +0200 @@ -99,6 +99,7 @@ file_editor::request_open_file () { file_editor_tab *current_tab = active_editor_tab (); + int curr_tab_index = _tab_widget->currentIndex (); file_editor_tab *fileEditorTab = new file_editor_tab (this); if (fileEditorTab) { @@ -111,6 +112,9 @@ { // If no file was loaded, remove the tab again. _tab_widget->removeTab (_tab_widget->indexOf (fileEditorTab)); + // restore focus to previous tab + if (curr_tab_index>=0) + _tab_widget->setCurrentIndex (curr_tab_index); } } }