Index: kmdimainfrm.cpp
===================================================================
RCS file: /home/kde/kdelibs/kmdi/kmdimainfrm.cpp,v
retrieving revision 1.79
diff -u -r1.79 kmdimainfrm.cpp
--- kmdimainfrm.cpp	30 Oct 2004 21:19:28 -0000	1.79
+++ kmdimainfrm.cpp	15 Nov 2004 10:15:50 -0000
@@ -128,6 +128,7 @@
   KMdiFocusList *focusList;
   int m_styleIDEAlMode;
   int m_toolviewStyle;
+  KAction *closeWindowAction;
 };
 
 //============ constructor ============//
@@ -212,6 +213,14 @@
 
   m_pPlacingMenu = new QPopupMenu( this, "placing_menu");
 
+  d->closeWindowAction = new KAction(i18n("&Close"),
+#ifdef Q_WS_WIN
+    CTRL|Key_F4,
+#else
+    0,
+#endif
+    this, SLOT(closeActiveView()), actionCollection(), "window_close");
+
   // the MDI view taskbar
   createTaskBar();
 
@@ -411,6 +420,8 @@
     return;
   }
 
+  d->closeWindowAction->setEnabled(true);
+
   // common connections used when under MDI control
   QObject::connect( pWnd, SIGNAL(clickedInWindowMenu(int)), this, SLOT(windowMenuItemActivated(int)) );
   QObject::connect( pWnd, SIGNAL(focusInEventOccurs(KMdiChildView*)), this, SLOT(activateView(KMdiChildView*)) );
@@ -859,8 +870,10 @@
     }
   }
 
-  if (!m_pCurrentWindow)
+  if (!m_pCurrentWindow) {
+    d->closeWindowAction->setEnabled(false);
     emit lastChildViewClosed();
+  }
 }
 
 //================== findWindow =================//
@@ -2346,10 +2359,11 @@
   if (!m_bClearingOfWindowMenuBlocked) {
     m_pWindowMenu->clear();
   }
-  int closeId = m_pWindowMenu->insertItem(i18n("&Close"), this, SLOT(closeActiveView()));
+  d->closeWindowAction->plug(m_pWindowMenu);
+  
   int closeAllId = m_pWindowMenu->insertItem(i18n("Close &All"), this, SLOT(closeAllViews()));
   if (bNoViewOpened) {
-    m_pWindowMenu->setItemEnabled(closeId, false);
+    d->closeWindowAction->setEnabled(false);
     m_pWindowMenu->setItemEnabled(closeAllId, false);
   }
   if (!bTabPageMode && !bIDEAlMode) {
