diff gui/src/VariablesDockWidget.cpp @ 13577:e440b3f32f02

Fixed bug with closing subwindows.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Mon, 01 Aug 2011 18:51:36 +0200
parents b48ac9ad8de0
children c0e66d6e3dc8
line wrap: on
line diff
--- a/gui/src/VariablesDockWidget.cpp	Mon Aug 01 18:10:33 2011 +0200
+++ b/gui/src/VariablesDockWidget.cpp	Mon Aug 01 18:51:36 2011 +0200
@@ -67,6 +67,8 @@
   m_variablesTreeWidget->expandAll ();
   m_variablesTreeWidget->setAlternatingRowColors (true);
   m_variablesTreeWidget->setAnimated (true);
+
+  connect (this, SIGNAL (visibilityChanged(bool)), this, SLOT(handleVisibilityChanged(bool)));
 }
 
 void
@@ -203,3 +205,17 @@
   QList < SymbolRecord > symbolTable = OctaveLink::instance ()->copyCurrentSymbolTable ();
   setVariablesList (symbolTable);
 }
+
+void
+VariablesDockWidget::handleVisibilityChanged (bool visible)
+{
+  if (visible)
+    emit activeChanged (true);
+}
+
+void
+VariablesDockWidget::closeEvent (QCloseEvent *event)
+{
+  emit activeChanged (false);
+  QDockWidget::closeEvent (event);
+}