changeset 16578:0eca6c5657c9

force focus to command window after browsing for directory * main-window.cc (main_window::browse_for_directory): Call set_current_working_directory for consistency with other directory changing functions. Force focus to command window to avoid problem on Windows systems.
author John W. Eaton <jwe@octave.org>
date Sun, 28 Apr 2013 02:29:19 -0400
parents 02a90cb9d79f
children 7f8db1942dc0
files libgui/src/main-window.cc
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/main-window.cc	Sun Apr 28 01:49:03 2013 -0400
+++ b/libgui/src/main-window.cc	Sun Apr 28 02:29:19 2013 -0400
@@ -352,13 +352,15 @@
 void
 main_window::browse_for_directory (void)
 {
-  QString dir =
-    QFileDialog::getExistingDirectory (this, tr ("Set working directory"));
+  QString dir
+    = QFileDialog::getExistingDirectory (this, tr ("Set working directory"));
+
+  set_current_working_directory (dir);
 
-  if (! dir.isEmpty ())
-    octave_link::post_event (this,
-                             &main_window::change_directory_callback,
-                             dir.toStdString ());
+  // FIXME -- on Windows systems, the command window freezes after the
+  // previous actions.  Forcing the focus appears to unstick it.
+
+  focus_command_window ();
 }
 
 void