Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp	(revision 42559)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp	(revision 42560)
@@ -131,4 +131,5 @@
 UIActionState::UIActionState(QObject *pParent, const QString &strIcon, const QString &strIconDis)
     : UIAction(pParent, UIActionType_State)
+    , m_iState(0)
 {
     if (!strIcon.isNull())
@@ -141,4 +142,5 @@
                              const QString &strNormalIconDis, const QString &strSmallIconDis)
     : UIAction(pParent, UIActionType_State)
+    , m_iState(0)
 {
     setIcon(UIIconPool::iconSetFull(normalSize, smallSize, strNormalIcon, strSmallIcon, strNormalIconDis, strSmallIconDis));
@@ -147,4 +149,5 @@
 UIActionState::UIActionState(QObject *pParent, const QIcon& icon)
     : UIAction(pParent, UIActionType_State)
+    , m_iState(0)
 {
     if (!icon.isNull())
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 42559)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 42560)
@@ -135,16 +135,30 @@
 }
 
+void UISelectorWindow::sltStateChanged(QString strId)
+{
+    /* Get current item: */
+    UIVMItem *pItem = currentItem();
+
+    /* Make sure current item present: */
+    if (!pItem)
+        return;
+
+    /* If signal is for the current item: */
+    if (pItem->id() == strId)
+        updateActionsAppearance();
+}
+
 void UISelectorWindow::sltSnapshotChanged(QString strId)
 {
     /* Get current item: */
-    UIVMItem *pCurrentItem = currentItem();
+    UIVMItem *pItem = currentItem();
 
     /* Make sure current item present: */
-    if (!pCurrentItem)
-        return;
-
-    /* If signal is for current item: */
-    if (pCurrentItem->id() == strId)
-        m_pVMDesktop->updateSnapshots(pCurrentItem, pCurrentItem->machine());
+    if (!pItem)
+        return;
+
+    /* If signal is for the current item: */
+    if (pItem->id() == strId)
+        m_pVMDesktop->updateSnapshots(pItem, pItem->machine());
 }
 
@@ -734,9 +748,8 @@
 }
 
-void UISelectorWindow::sltCurrentVMItemChanged(bool fRefreshDetails, bool fRefreshSnapshots, bool fRefreshDescription)
+void UISelectorWindow::sltCurrentVMItemChanged(bool fRefreshDetails, bool fRefreshSnapshots, bool)
 {
     /* Get current item: */
     UIVMItem *pItem = currentItem();
-    QList<UIVMItem*> items = currentItems();
 
     /* Determine which menu to show: */
@@ -758,34 +771,6 @@
     }
 
-    /* Enable/disable group actions: */
-    m_pActionGroupRenameDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_RenameDialog, items));
-    m_pActionGroupRemoveDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_RemoveDialog, items));
-    m_pActionGroupStartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Group_StartOrShow, items));
-    m_pActionGroupPauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Group_PauseAndResume, items));
-    m_pActionGroupReset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Reset, items));
-    m_pActionGroupRefresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Refresh, items));
-    m_pActionGroupLogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items));
-    m_pActionGroupShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_ShowInFileManager, items));
-    m_pActionGroupCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_CreateShortcut, items));
-//    m_pActionGroupSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Sort, items));
-
-    /* Enable/disable machine actions: */
-    m_pActionMachineSettingsDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_SettingsDialog, items));
-    m_pActionMachineCloneWizard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CloneWizard, items));
-    m_pActionMachineAddGroupDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_AddGroupDialog, items));
-    m_pActionMachineRemoveDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_RemoveDialog, items));
-    m_pActionMachineStartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, items));
-    m_pActionMachineDiscard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Discard, items));
-    m_pActionMachinePauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, items));
-    m_pActionMachineReset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, items));
-    m_pActionMachineRefresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Refresh, items));
-    m_pActionMachineLogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items));
-    m_pActionMachineShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, items));
-    m_pActionMachineCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, items));
-//    m_pActionMachineSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Sort, items));
-
-    /* Enable/disable machine-close actions: */
-    m_pACPIShutdownAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, items));
-    m_pPowerOffAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_PowerOff, items));
+    /* Update action appearance: */
+    updateActionsAppearance();
 
     /* If currently selected VM item is accessible: */
@@ -798,68 +783,13 @@
             m_pContainer->setCurrentWidget(m_pDetails);
 
-        KMachineState state = pItem->machineState();
-
-        if (fRefreshDetails || fRefreshDescription)
+        if (fRefreshDetails)
             m_pDetails->setItems(currentItems());
         if (fRefreshSnapshots)
             m_pVMDesktop->updateSnapshots(pItem, pItem->machine());
-
-        /* Update the Start button action appearance: */
-        if (state == KMachineState_PoweredOff ||
-            state == KMachineState_Saved ||
-            state == KMachineState_Teleported ||
-            state == KMachineState_Aborted)
-        {
-            m_pActionGroupStartOrShow->setState(1);
-            m_pActionMachineStartOrShow->setState(1);
-#ifdef QT_MAC_USE_COCOA
-            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
-               the necessary size of the toolbar is increased. Also for some languages
-               the with doesn't match if the text increase. So manually adjust the size
-               after changing the text. */
-            mVMToolBar->updateLayout();
-#endif /* QT_MAC_USE_COCOA */
-        }
-        else
-        {
-            m_pActionGroupStartOrShow->setState(2);
-            m_pActionMachineStartOrShow->setState(2);
-#ifdef QT_MAC_USE_COCOA
-            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
-               the necessary size of the toolbar is increased. Also for some languages
-               the with doesn't match if the text increase. So manually adjust the size
-               after changing the text. */
-            mVMToolBar->updateLayout();
-#endif /* QT_MAC_USE_COCOA */
-        }
-
-        /* Update the Pause/Resume action appearance: */
-        if (state == KMachineState_Paused ||
-            state == KMachineState_TeleportingPausedVM)
-        {
-            m_pActionGroupPauseAndResume->blockSignals(true);
-            m_pActionGroupPauseAndResume->setChecked(true);
-            m_pActionGroupPauseAndResume->blockSignals(false);
-            m_pActionMachinePauseAndResume->blockSignals(true);
-            m_pActionMachinePauseAndResume->setChecked(true);
-            m_pActionMachinePauseAndResume->blockSignals(false);
-        }
-        else
-        {
-            m_pActionGroupPauseAndResume->blockSignals(true);
-            m_pActionGroupPauseAndResume->setChecked(false);
-            m_pActionGroupPauseAndResume->blockSignals(false);
-            m_pActionMachinePauseAndResume->blockSignals(true);
-            m_pActionMachinePauseAndResume->setChecked(false);
-            m_pActionMachinePauseAndResume->blockSignals(false);
-        }
-        m_pActionGroupPauseAndResume->updateAppearance();
-        m_pActionMachinePauseAndResume->updateAppearance();
-    }
-
+    }
     /* If currently selected VM item is NOT accessible: */
     else
     {
-        /* Show m_pVMDesktop: */
+        /* Make sure valid widget raised: */
         m_pContainer->setCurrentWidget(m_pVMDesktop);
 
@@ -893,8 +823,4 @@
         /* Empty and disable other tabs: */
         m_pVMDesktop->updateSnapshots(0, CMachine());
-
-        /* Change the Start button text accordingly: */
-        m_pActionGroupStartOrShow->setState(1);
-        m_pActionMachineStartOrShow->setState(1);
     }
 }
@@ -1463,4 +1389,6 @@
 
     /* Global event handlers: */
+    connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), this, SLOT(sltStateChanged(QString)));
+    connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)), this, SLOT(sltStateChanged(QString)));
     connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)), this, SLOT(sltSnapshotChanged(QString)));
 }
@@ -1578,4 +1506,107 @@
 }
 
+void UISelectorWindow::updateActionsAppearance()
+{
+    /* Get current item(s): */
+    UIVMItem *pItem = currentItem();
+    QList<UIVMItem*> items = currentItems();
+
+    /* Enable/disable group actions: */
+    m_pActionGroupRenameDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_RenameDialog, items));
+    m_pActionGroupRemoveDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_RemoveDialog, items));
+    m_pActionGroupStartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Group_StartOrShow, items));
+    m_pActionGroupPauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Group_PauseAndResume, items));
+    m_pActionGroupReset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Reset, items));
+    m_pActionGroupRefresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Refresh, items));
+    m_pActionGroupLogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items));
+    m_pActionGroupShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_ShowInFileManager, items));
+    m_pActionGroupCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_CreateShortcut, items));
+//    m_pActionGroupSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Sort, items));
+
+    /* Enable/disable machine actions: */
+    m_pActionMachineSettingsDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_SettingsDialog, items));
+    m_pActionMachineCloneWizard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CloneWizard, items));
+    m_pActionMachineAddGroupDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_AddGroupDialog, items));
+    m_pActionMachineRemoveDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_RemoveDialog, items));
+    m_pActionMachineStartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, items));
+    m_pActionMachineDiscard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Discard, items));
+    m_pActionMachinePauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, items));
+    m_pActionMachineReset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, items));
+    m_pActionMachineRefresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Refresh, items));
+    m_pActionMachineLogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items));
+    m_pActionMachineShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, items));
+    m_pActionMachineCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, items));
+//    m_pActionMachineSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Sort, items));
+
+    /* Enable/disable machine-close actions: */
+    m_pACPIShutdownAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, items));
+    m_pPowerOffAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_PowerOff, items));
+
+    /* If item present: */
+    if (pItem && pItem->accessible())
+    {
+        /* Get state: */
+        KMachineState state = pItem->machineState();
+
+        /* Update the Start button action appearance: */
+        if (state == KMachineState_PoweredOff ||
+            state == KMachineState_Saved ||
+            state == KMachineState_Teleported ||
+            state == KMachineState_Aborted)
+        {
+            m_pActionGroupStartOrShow->setState(1);
+            m_pActionMachineStartOrShow->setState(1);
+#ifdef QT_MAC_USE_COCOA
+            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
+               the necessary size of the toolbar is increased. Also for some languages
+               the with doesn't match if the text increase. So manually adjust the size
+               after changing the text. */
+            mVMToolBar->updateLayout();
+#endif /* QT_MAC_USE_COCOA */
+        }
+        else
+        {
+            m_pActionGroupStartOrShow->setState(2);
+            m_pActionMachineStartOrShow->setState(2);
+#ifdef QT_MAC_USE_COCOA
+            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
+               the necessary size of the toolbar is increased. Also for some languages
+               the with doesn't match if the text increase. So manually adjust the size
+               after changing the text. */
+            mVMToolBar->updateLayout();
+#endif /* QT_MAC_USE_COCOA */
+        }
+
+        /* Update the Pause/Resume action appearance: */
+        if (state == KMachineState_Paused ||
+            state == KMachineState_TeleportingPausedVM)
+        {
+            m_pActionGroupPauseAndResume->blockSignals(true);
+            m_pActionGroupPauseAndResume->setChecked(true);
+            m_pActionGroupPauseAndResume->blockSignals(false);
+            m_pActionMachinePauseAndResume->blockSignals(true);
+            m_pActionMachinePauseAndResume->setChecked(true);
+            m_pActionMachinePauseAndResume->blockSignals(false);
+        }
+        else
+        {
+            m_pActionGroupPauseAndResume->blockSignals(true);
+            m_pActionGroupPauseAndResume->setChecked(false);
+            m_pActionGroupPauseAndResume->blockSignals(false);
+            m_pActionMachinePauseAndResume->blockSignals(true);
+            m_pActionMachinePauseAndResume->setChecked(false);
+            m_pActionMachinePauseAndResume->blockSignals(false);
+        }
+        m_pActionGroupPauseAndResume->updateAppearance();
+        m_pActionMachinePauseAndResume->updateAppearance();
+    }
+    else
+    {
+        /* Update the Start button action appearance: */
+        m_pActionGroupStartOrShow->setState(1);
+        m_pActionMachineStartOrShow->setState(1);
+    }
+}
+
 bool UISelectorWindow::isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items)
 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h	(revision 42559)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h	(revision 42560)
@@ -63,5 +63,6 @@
 private slots:
 
-    /* Handler: Snapshot-view stuff: */
+    /* Handlers: Global-event stuff: */
+    void sltStateChanged(QString strId);
     void sltSnapshotChanged(QString strId);
 
@@ -136,4 +137,7 @@
     QList<UIVMItem*> currentItems() const;
 
+    /* Helper: Action update stuff: */
+    void updateActionsAppearance();
+
     /* Helpers: Action stuff: */
     static bool isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items);
