Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 45373)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 45374)
@@ -713,12 +713,4 @@
 endif
 
-ifdef VBOX_GUI_WITH_SYSTRAY
- VirtualBox_DEFS += VBOX_GUI_WITH_SYSTRAY
- VirtualBox_QT_MOCHDRS += \
-	src/selector/VBoxTrayIcon.h
- VirtualBox_SOURCES += \
-	src/selector/VBoxTrayIcon.cpp
-endif
-
 if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_GUI_USE_QGL)
  VirtualBox_SOURCES += \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp	(revision 45373)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp	(revision 45374)
@@ -124,11 +124,4 @@
 #endif /* VBOX_WITH_VIDEOHWACCEL */
 
-#ifdef VBOX_GUI_WITH_SYSTRAY
-/* Tray icon declarations: */
-const char* UIDefs::GUI_TrayIconWinID = "GUI/TrayIcon/WinID";
-const char* UIDefs::GUI_TrayIconEnabled = "GUI/TrayIcon/Enabled";
-const char* UIDefs::GUI_MainWindowCount = "GUI/MainWindowCount";
-#endif /* VBOX_GUI_WITH_SYSTRAY */
-
 /* File extensions definitions: */
 QStringList UIDefs::VBoxFileExts = QStringList() << "xml" << "vbox";
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h	(revision 45373)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h	(revision 45374)
@@ -201,11 +201,4 @@
 #endif /* VBOX_WITH_VIDEOHWACCEL */
 
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    /* Tray icon declarations: */
-    extern const char* GUI_TrayIconWinID;
-    extern const char* GUI_TrayIconEnabled;
-    extern const char* GUI_MainWindowCount;
-#endif /* VBOX_GUI_WITH_SYSTRAY */
-
     /* File extensions declarations: */
     extern QStringList VBoxFileExts;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.cpp	(revision 45373)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.cpp	(revision 45374)
@@ -40,7 +40,4 @@
     UIExtraDataEventHandlerPrivate(QObject *pParent = 0)
         : QObject(pParent)
-#ifdef VBOX_GUI_WITH_SYSTRAY
-        , m_fIsTrayIconOwner(false)
-#endif /* VBOX_GUI_WITH_SYSTRAY */
     {}
 
@@ -54,17 +51,4 @@
             if (strKey.startsWith("GUI/"))
             {
-#ifdef VBOX_GUI_WITH_SYSTRAY
-                if (strKey == GUI_TrayIconWinID)
-                {
-                    if (m_fIsTrayIconOwner)
-                    {
-                        if (!(strValue.isEmpty() ||
-                              strValue == QString("%1")
-                              .arg((qulonglong)vboxGlobal().mainWindow()->winId())))
-                            fVeto = true;
-                    }
-                    return;
-                }
-#endif /* VBOX_GUI_WITH_SYSTRAY */
                 /* Try to set the global setting to check its syntax */
                 VBoxGlobalSettings gs(false /* non-null */);
@@ -96,26 +80,4 @@
                 if (strKey == GUI_Input_MachineShortcuts && gActionPool->type() == UIActionPoolType_Runtime)
                     emit sigMachineShortcutsChanged();
-#ifdef VBOX_GUI_WITH_SYSTRAY
-                if (strKey == GUI_MainWindowCount)
-                    emit sigMainWindowCountChange(strValue.toInt());
-                if (strKey == GUI_TrayIconWinID)
-                {
-                    if (strValue.isEmpty())
-                    {
-                        m_fIsTrayIconOwner = false;
-                        emit sigCanShowTrayIcon(true);
-                    }
-                    else if (strValue == QString("%1")
-                             .arg((qulonglong)vboxGlobal().mainWindow()->winId()))
-                    {
-                        m_fIsTrayIconOwner = true;
-                        emit sigCanShowTrayIcon(true);
-                    }
-                    else
-                        emit sigCanShowTrayIcon(false);
-                }
-                if (strKey == GUI_TrayIconEnabled)
-                    emit sigTrayIconChange((strValue.toLower() == "true") ? true : false);
-#endif /* VBOX_GUI_WITH_SYSTRAY */
 #ifdef Q_WS_MAC
                 if (strKey == GUI_PresentationModeEnabled)
@@ -156,9 +118,4 @@
     void sigSelectorShortcutsChanged();
     void sigMachineShortcutsChanged();
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    void sigMainWindowCountChange(int count);
-    void sigCanShowTrayIcon(bool fEnabled);
-    void sigTrayIconChange(bool fEnabled);
-#endif /* VBOX_GUI_WITH_SYSTRAY */
 #ifdef RT_OS_DARWIN
     void sigPresentationModeChange(bool fEnabled);
@@ -170,9 +127,4 @@
     /** protects #OnExtraDataChange() */
     QMutex m_mutex;
-
-    /* Private member vars */
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    bool m_fIsTrayIconOwner;
-#endif /* VBOX_GUI_WITH_SYSTRAY */
 };
 
@@ -239,18 +191,4 @@
             Qt::QueuedConnection);
 
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    connect(m_pHandler, SIGNAL(sigMainWindowCountChange(int)),
-            this, SIGNAL(sigMainWindowCountChange(int)),
-            Qt::QueuedConnection);
-
-    connect(m_pHandler, SIGNAL(sigCanShowTrayIcon(bool)),
-            this, SIGNAL(sigCanShowTrayIcon(bool)),
-            Qt::QueuedConnection);
-
-    connect(m_pHandler, SIGNAL(sigTrayIconChange(bool)),
-            this, SIGNAL(sigTrayIconChange(bool)),
-            Qt::QueuedConnection);
-#endif /* VBOX_GUI_WITH_SYSTRAY */
-
 #ifdef Q_WS_MAC
     connect(m_pHandler, SIGNAL(sigPresentationModeChange(bool)),
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.h	(revision 45373)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIExtraDataEventHandler.h	(revision 45374)
@@ -39,9 +39,4 @@
     void sigSelectorShortcutsChanged();
     void sigMachineShortcutsChanged();
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    void sigMainWindowCountChange(int count);
-    void sigCanShowTrayIcon(bool fEnabled);
-    void sigTrayIconChange(bool fEnabled);
-#endif /* VBOX_GUI_WITH_SYSTRAY */
 #ifdef RT_OS_DARWIN
     void sigPresentationModeChange(bool fEnabled);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 45373)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 45374)
@@ -85,13 +85,4 @@
 # include "VBoxFBOverlay.h"
 #endif /* VBOX_WITH_VIDEOHWACCEL */
-
-#ifdef VBOX_GUI_WITH_SYSTRAY
-#include <iprt/process.h>
-#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
-#define HOSTSUFF_EXE ".exe"
-#else /* !RT_OS_WINDOWS */
-#define HOSTSUFF_EXE ""
-#endif /* !RT_OS_WINDOWS */
-#endif /* VBOX_GUI_WITH_SYSTRAY */
 
 /* COM includes: */
@@ -280,8 +271,4 @@
     , m_pVirtualMachine(0)
     , mMainWindow (NULL)
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    , mIsTrayMenu (false)
-    , mIncreasedWindowCounter (false)
-#endif
     , mMediaEnumThread (NULL)
     , mIsKWinManaged (false)
@@ -525,111 +512,4 @@
     return s.value(QString("%1").arg(aKey)).toString();
 }
-
-#ifdef VBOX_GUI_WITH_SYSTRAY
-
-/**
- *  Returns true if the current instance a systray menu only (started with
- *  "-systray" parameter).
- */
-bool VBoxGlobal::isTrayMenu() const
-{
-    return mIsTrayMenu;
-}
-
-void VBoxGlobal::setTrayMenu(bool aIsTrayMenu)
-{
-    mIsTrayMenu = aIsTrayMenu;
-}
-
-/**
- *  Spawns a new selector window (process).
- */
-void VBoxGlobal::trayIconShowSelector()
-{
-    /* Get the path to the executable. */
-    char path[RTPATH_MAX];
-    RTPathAppPrivateArch(path, RTPATH_MAX);
-    size_t sz = strlen(path);
-    path[sz++] = RTPATH_DELIMITER;
-    path[sz] = 0;
-    char *cmd = path + sz;
-    sz = RTPATH_MAX - sz;
-
-    int rc = 0;
-    const char VirtualBox_exe[] = "VirtualBox" HOSTSUFF_EXE;
-    Assert(sz >= sizeof(VirtualBox_exe));
-    strcpy(cmd, VirtualBox_exe);
-    const char * args[] = {path, 0 };
-    rc = RTProcCreate(path, args, RTENV_DEFAULT, RTPROC_FLAGS_DETACHED, NULL);
-    if (RT_FAILURE(rc))
-        LogRel(("Systray: Failed to start new selector window! Path=%s, rc=%Rrc\n", path, rc));
-}
-
-/**
- *  Tries to install the tray icon using the current instance (singleton).
- *  Returns true if this instance is the tray icon, false if not.
- */
-bool VBoxGlobal::trayIconInstall()
-{
-    int rc = 0;
-    QString strTrayWinID = mVBox.GetExtraData(GUI_TrayIconWinID);
-    if (false == strTrayWinID.isEmpty())
-    {
-        /* Check if current tray icon is alive by writing some bogus value. */
-        mVBox.SetExtraData(GUI_TrayIconWinID, "0");
-        if (mVBox.isOk())
-        {
-            /* Current tray icon died - clean up. */
-            mVBox.SetExtraData(GUI_TrayIconWinID, NULL);
-            strTrayWinID.clear();
-        }
-    }
-
-    /* Is there already a tray icon or is tray icon not active? */
-    if (   (mIsTrayMenu == false)
-        && (vboxGlobal().settings().trayIconEnabled())
-        && (QSystemTrayIcon::isSystemTrayAvailable())
-        && (strTrayWinID.isEmpty()))
-    {
-        /* Get the path to the executable. */
-        char path[RTPATH_MAX];
-        RTPathAppPrivateArch(path, RTPATH_MAX);
-        size_t sz = strlen(path);
-        path[sz++] = RTPATH_DELIMITER;
-        path[sz] = 0;
-        char *cmd = path + sz;
-        sz = RTPATH_MAX - sz;
-
-        const char VirtualBox_exe[] = "VirtualBox" HOSTSUFF_EXE;
-        Assert(sz >= sizeof(VirtualBox_exe));
-        strcpy(cmd, VirtualBox_exe);
-        const char * args[] = {path, "-systray", 0 };
-        rc = RTProcCreate(path, args, RTENV_DEFAULT, RTPROC_FLAGS_DETACHED, NULL);
-        if (RT_FAILURE(rc))
-        {
-            LogRel(("Systray: Failed to start systray window! Path=%s, rc=%Rrc\n", path, rc));
-            return false;
-        }
-    }
-
-    if (mIsTrayMenu)
-    {
-        // Use this selector for displaying the tray icon
-        mVBox.SetExtraData(GUI_TrayIconWinID,
-                           QString("%1").arg((qulonglong)vboxGlobal().mainWindow()->winId()));
-
-        /* The first process which can grab this "mutex" will win ->
-         * It will be the tray icon menu then. */
-        if (mVBox.isOk())
-        {
-            emit sigTrayIconShow(true);
-            return true;
-        }
-    }
-
-    return false;
-}
-
-#endif
 
 #ifdef Q_WS_X11
@@ -2303,16 +2183,4 @@
     return QString();
 }
-
-#ifdef VBOX_GUI_WITH_SYSTRAY
-/**
- *  Returns the number of current running Fe/Qt4 main windows.
- *
- *  @return Number of running main windows.
- */
-int VBoxGlobal::mainWindowCount ()
-{
-    return mVBox.GetExtraData (GUI_MainWindowCount).toInt();
-}
-#endif
 
 /**
@@ -4186,16 +4054,4 @@
     connect(gEDataEvents, SIGNAL(sigGUILanguageChange(QString)),
             this, SLOT(sltGUILanguageChange(QString)));
-
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    {
-        /* Increase open Fe/Qt4 windows reference count. */
-        int c = mVBox.GetExtraData (GUI_MainWindowCount).toInt() + 1;
-        AssertMsgReturnVoid ((c >= 0) || (mVBox.isOk()),
-            ("Something went wrong with the window reference count!"));
-        mVBox.SetExtraData (GUI_MainWindowCount, QString ("%1").arg (c));
-        mIncreasedWindowCounter = mVBox.isOk();
-        AssertReturnVoid (mIncreasedWindowCounter);
-    }
-#endif
 
     /* Initialize guest OS Type list. */
@@ -4380,10 +4236,4 @@
             bForceFullscreen = true;
         }
-#ifdef VBOX_GUI_WITH_SYSTRAY
-        else if (!::strcmp (arg, "-systray") || !::strcmp (arg, "--systray"))
-        {
-            mIsTrayMenu = true;
-        }
-#endif
         else if (!::strcmp (arg, "-comment") || !::strcmp (arg, "--comment"))
         {
@@ -4613,24 +4463,4 @@
     }
 
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    if (mIncreasedWindowCounter)
-    {
-        /* Decrease open Fe/Qt4 windows reference count. */
-        int c = mVBox.GetExtraData (GUI_MainWindowCount).toInt() - 1;
-        AssertMsg ((c >= 0) || (mVBox.isOk()),
-            ("Something went wrong with the window reference count!"));
-        if (c < 0)
-            c = 0;   /* Clean up the mess. */
-        mVBox.SetExtraData (GUI_MainWindowCount,
-                            (c > 0) ? QString ("%1").arg (c) : NULL);
-        AssertWrapperOk (mVBox);
-        if (c == 0)
-        {
-            mVBox.SetExtraData (GUI_TrayIconWinID, NULL);
-            AssertWrapperOk (mVBox);
-        }
-    }
-#endif
-
 #ifdef VBOX_GUI_WITH_PIDFILE
     deletePidfile();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 45373)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h	(revision 45374)
@@ -114,10 +114,4 @@
     bool isVMConsoleProcess() const { return !vmUuid.isNull(); }
     bool showStartVMErrors() const { return mShowStartVMErrors; }
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    bool isTrayMenu() const;
-    void setTrayMenu(bool aIsTrayMenu);
-    void trayIconShowSelector();
-    bool trayIconInstall();
-#endif
     QString managedVMUuid() const { return vmUuid; }
     QList<QUrl> &argUrlList() { return m_ArgUrlList; }
@@ -424,8 +418,4 @@
     void mediumRemoved (UIMediumType, const QString &);
 
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    void sigTrayIconShow(bool fEnabled);
-#endif
-
 public slots:
 
@@ -465,9 +455,4 @@
     QString vmUuid;
     QList<QUrl> m_ArgUrlList;
-
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    bool mIsTrayMenu : 1; /*< Tray icon active/desired? */
-    bool mIncreasedWindowCounter : 1;
-#endif
 
     /** Whether to show error message boxes for VM start errors. */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp	(revision 45373)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp	(revision 45374)
@@ -483,10 +483,4 @@
             if (vboxGlobal().isVMConsoleProcess())
             {
-#ifdef VBOX_GUI_WITH_SYSTRAY
-                if (vboxGlobal().trayIconInstall())
-                {
-                    /* Nothing to do here yet. */
-                }
-#endif
                 if (vboxGlobal().startMachine (vboxGlobal().managedVMUuid()))
                 {
@@ -519,24 +513,6 @@
 
                 vboxGlobal().setMainWindow (&vboxGlobal().selectorWnd());
-#ifdef VBOX_GUI_WITH_SYSTRAY
-                if (vboxGlobal().trayIconInstall())
-                {
-                    /* Nothing to do here yet. */
-                }
-
-                if (false == vboxGlobal().isTrayMenu())
-                {
-#endif
                     vboxGlobal().selectorWnd().show();
-#ifdef VBOX_GUI_WITH_SYSTRAY
-                }
-
-                do
-                {
-#endif
                     rc = a.exec();
-#ifdef VBOX_GUI_WITH_SYSTRAY
-                } while (vboxGlobal().isTrayMenu());
-#endif
             }
         }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 45373)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 45374)
@@ -941,12 +941,4 @@
     sltCurrentVMItemChanged();
 
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    if (vboxGlobal().isTrayMenu())
-    {
-        m_pTrayIcon->retranslateUi();
-        m_pTrayIcon->refresh();
-    }
-#endif /* VBOX_GUI_WITH_SYSTRAY */
-
 #ifdef QT_MAC_USE_COCOA
     /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
@@ -1486,14 +1478,4 @@
             this, SLOT(sltShowMachineSettingsDialog(const QString&, const QString&, const QString&)));
 
-#ifdef VBOX_GUI_WITH_SYSTRAY
-    /* Tray icon connections: */
-    connect(m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
-            this, SLOT(sltTrayIconActivated(QSystemTrayIcon::ActivationReason)));
-    connect(gEDataEvents, SIGNAL(sigMainWindowCountChange(int)), this, SLOT(sltMainWindowCountChanged(int)));
-    connect(gEDataEvents, SIGNAL(sigCanShowTrayIcon(bool)), this, SLOT(sltTrayIconCanShow(bool)));
-    connect(gEDataEvents, SIGNAL(sigTrayIconChange(bool)), this, SLOT(sltTrayIconChanged(bool)));
-    connect(&vboxGlobal(), SIGNAL(sigTrayIconShow(bool)), this, SLOT(sltTrayIconShow(bool)));
-#endif /* VBOX_GUI_WITH_SYSTRAY */
-
     /* Global event handlers: */
     connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), this, SLOT(sltStateChanged(QString)));
Index: unk/src/VBox/Frontends/VirtualBox/src/selector/VBoxTrayIcon.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxTrayIcon.cpp	(revision 45373)
+++ 	(revision )
@@ -1,410 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt GUI ("VirtualBox"):
- * VBoxTrayIcon class implementation
- */
-
-/*
- * Copyright (C) 2006-2013 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifdef VBOX_GUI_WITH_SYSTRAY
-
-/* Local includes */
-#include "VBoxTrayIcon.h"
-#include "UISelectorWindow.h"
-#include "UIIconPool.h"
-#include "UIVMItem.h"
-#include "UIVMListView.h"
-
-/* Global includes */
-#include <QMenu>
-#include <QAction>
-
-VBoxTrayIcon::VBoxTrayIcon (UISelectorWindow* aParent, UIVMItemModel* aVMModel)
-{
-    mParent = aParent;
-    mVMModel = aVMModel;
-
-    mShowSelectorAction = new QAction (this);
-    Assert (mShowSelectorAction);
-    mShowSelectorAction->setIcon(UIIconPool::iconSet(":/VirtualBox_16px.png"));
-
-    mHideSystrayMenuAction = new QAction (this);
-    Assert (mHideSystrayMenuAction);
-    mHideSystrayMenuAction->setIcon(UIIconPool::iconSet(":/exit_16px.png"));
-
-    /* reuse parent action data */
-
-    mVmConfigAction = new QAction (this);
-    Assert (mVmConfigAction);
-    mVmConfigAction->setIcon (mParent->vmConfigAction()->icon());
-
-    mVmDeleteAction = new QAction (this);
-    Assert (mVmDeleteAction);
-    mVmDeleteAction->setIcon (mParent->vmDeleteAction()->icon());
-
-    mVmStartAction = new QAction (this);
-    Assert (mVmStartAction);
-    mVmStartAction->setIcon (mParent->vmStartAction()->icon());
-
-    mVmDiscardAction = new QAction (this);
-    Assert (mVmDiscardAction);
-    mVmDiscardAction->setIcon (mParent->vmDiscardAction()->icon());
-
-    mVmPauseAction = new QAction (this);
-    Assert (mVmPauseAction);
-    mVmPauseAction->setCheckable (true);
-    mVmPauseAction->setIcon (mParent->vmPauseAction()->icon());
-
-    mVmRefreshAction = new QAction (this);
-    Assert (mVmRefreshAction);
-    mVmRefreshAction->setIcon (mParent->vmRefreshAction()->icon());
-
-    mVmShowLogsAction = new QAction (this);
-    Assert (mVmConfigAction);
-    mVmShowLogsAction->setIcon (mParent->vmShowLogsAction()->icon());
-
-    mTrayIconMenu = new QMenu (aParent);
-    Assert (mTrayIconMenu);
-
-    setIcon (QIcon (":/VirtualBox_16px.png"));
-    setContextMenu (mTrayIconMenu);
-
-    connect (mShowSelectorAction, SIGNAL (triggered()), mParent, SLOT (showWindow()));
-    connect (mHideSystrayMenuAction, SIGNAL (triggered()), this, SLOT (trayIconShow()));
-}
-
-VBoxTrayIcon::~VBoxTrayIcon ()
-{
-    /* Erase dialog handle in config file. */
-    if (mActive)
-    {
-        vboxGlobal().virtualBox().SetExtraData(GUI_TrayIconWinID, QString::null);
-        hide();
-    }
-}
-
-void VBoxTrayIcon::retranslateUi ()
-{
-    if (!mActive)
-        return;
-
-    mShowSelectorAction->setText (tr ("Show Selector Window"));
-    mShowSelectorAction->setStatusTip (tr (
-        "Show the selector window assigned to this menu"));
-
-    mHideSystrayMenuAction->setText (tr ("Hide Tray Icon"));
-    mHideSystrayMenuAction->setStatusTip (tr (
-        "Remove this icon from the system tray"));
-
-    /* reuse parent action data */
-
-    mVmConfigAction->setText (mParent->vmConfigAction()->text());
-    mVmConfigAction->setStatusTip (mParent->vmConfigAction()->statusTip());
-
-    mVmDeleteAction->setText (mParent->vmDeleteAction()->text());
-    mVmDeleteAction->setStatusTip (mParent->vmDeleteAction()->statusTip());
-
-    mVmPauseAction->setText (mParent->vmPauseAction()->text());
-    mVmPauseAction->setStatusTip (mParent->vmPauseAction()->statusTip());
-
-    mVmDiscardAction->setText (mParent->vmDiscardAction()->text());
-    mVmDiscardAction->setStatusTip (mParent->vmDiscardAction()->statusTip());
-
-    mVmShowLogsAction->setText (mParent->vmShowLogsAction()->text());
-    mVmShowLogsAction->setStatusTip (mParent->vmShowLogsAction()->statusTip());
-}
-
-void VBoxTrayIcon::showSubMenu ()
-{
-    if (!mActive)
-        return;
-
-    UIVMItem* pItem = NULL;
-    QMenu *pMenu = NULL;
-    QVariant vID;
-
-    if ((pMenu = qobject_cast<QMenu*>(sender())))
-    {
-        vID = pMenu->menuAction()->data();
-        if (vID.canConvert<QString>() && mVMModel)
-            pItem = mVMModel->itemById (qvariant_cast<QString>(vID));
-    }
-
-    mVmConfigAction->setData (vID);
-    mVmDeleteAction->setData (vID);
-    mVmDiscardAction->setData (vID);
-    mVmStartAction->setData (vID);
-    mVmPauseAction->setData (vID);
-    mVmShowLogsAction->setData (vID);
-
-    if (pItem && pItem->accessible())
-    {
-        /* look at vmListViewCurrentChanged() */
-        CMachine m = pItem->machine();
-        KMachineState s = pItem->machineState();
-        bool running = pItem->sessionState() != KSessionState_Unlocked;
-        bool modifyEnabled = !running && s != KMachineState_Saved;
-
-        /* Settings */
-        mVmConfigAction->setEnabled (modifyEnabled);
-
-        /* Delete */
-        mVmDeleteAction->setEnabled (!running);
-
-        /* Discard */
-        mVmDiscardAction->setEnabled (s == KMachineState_Saved && !running);
-
-        /* Change the Start button text accordingly */
-        if (   s == KMachineState_PoweredOff
-            || s == KMachineState_Saved
-            || s == KMachineState_Teleported
-            || s == KMachineState_Aborted
-           )
-        {
-            mVmStartAction->setText (UIVMListView::tr ("S&tart"));
-            mVmStartAction->setStatusTip (
-                  UIVMListView::tr ("Start the selected virtual machine"));
-            mVmStartAction->setEnabled (!running);
-        }
-        else
-        {
-            mVmStartAction->setText (UIVMListView::tr ("S&how"));
-            mVmStartAction->setStatusTip (
-                  UIVMListView::tr ("Switch to the window of the selected virtual machine"));
-            mVmStartAction->setEnabled (pItem->canSwitchTo());
-        }
-
-        /* Change the Pause/Resume button text accordingly */
-        mVmPauseAction->setEnabled (   s == KMachineState_Running
-                                    || s == KMachineState_Teleporting
-                                    || s == KMachineState_LiveSnapshotting
-                                    || s == KMachineState_Paused
-                                    || s == KMachineState_TeleportingPausedVM
-                                   );
-
-        if (   s == KMachineState_Paused
-            || s == KMachineState_TeleportingPausedVM /*?*/
-           )
-        {
-            mVmPauseAction->setText (UIVMListView::tr ("R&esume"));
-            mVmPauseAction->setStatusTip (
-                  UIVMListView::tr ("Resume the execution of the virtual machine"));
-            mVmPauseAction->blockSignals (true);
-            mVmPauseAction->setChecked (true);
-            mVmPauseAction->blockSignals (false);
-        }
-        else
-        {
-            mVmPauseAction->setText (UIVMListView::tr ("&Pause"));
-            mVmPauseAction->setStatusTip (
-                  UIVMListView::tr ("Suspend the execution of the virtual machine"));
-            mVmPauseAction->blockSignals (true);
-            mVmPauseAction->setChecked (false);
-            mVmPauseAction->blockSignals (false);
-        }
-
-        mVmShowLogsAction->setEnabled (true);
-
-        /* Disconnect old slot which maybe was connected from another selected sub menu. */
-        disconnect (mVmConfigAction, SIGNAL (triggered()), this, SLOT (vmSettings()));
-        disconnect (mVmDeleteAction, SIGNAL (triggered()), this, SLOT (vmDelete()));
-        disconnect (mVmDiscardAction, SIGNAL (triggered()), this, SLOT (vmDiscard()));
-        disconnect (mVmStartAction, SIGNAL (triggered()), this, SLOT (vmStart()));
-        disconnect (mVmPauseAction, SIGNAL (toggled (bool)), this, SLOT (vmPause (bool)));
-        disconnect (mVmShowLogsAction, SIGNAL (triggered()), this, SLOT (vmShowLogs()));
-
-        /* Connect new sub menu with slots. */
-        connect (mVmConfigAction, SIGNAL (triggered()), this, SLOT (vmSettings()));
-        connect (mVmDeleteAction, SIGNAL (triggered()), this, SLOT (vmDelete()));
-        connect (mVmDiscardAction, SIGNAL (triggered()), this, SLOT (vmDiscard()));
-        connect (mVmStartAction, SIGNAL (triggered()), this, SLOT (vmStart()));
-        connect (mVmPauseAction, SIGNAL (toggled (bool)), this, SLOT (vmPause (bool)));
-        connect (mVmShowLogsAction, SIGNAL (triggered()), this, SLOT (vmShowLogs()));
-    }
-    else    /* Item is not accessible. */
-    {
-        mVmConfigAction->setEnabled (false);
-        mVmDeleteAction->setEnabled (pItem != NULL);
-        mVmDiscardAction->setEnabled (false);
-        mVmPauseAction->setEnabled (false);
-
-        /* Set the Start button text accordingly. */
-        mVmStartAction->setText (UIVMListView::tr ("S&tart"));
-        mVmStartAction->setStatusTip (
-              UIVMListView::tr ("Start the selected virtual machine"));
-        mVmStartAction->setEnabled (false);
-
-        /* Disable the show log item for the selected vm. */
-        mVmShowLogsAction->setEnabled (false);
-    }
-
-    /* Build sub menu entries (add rest of sub menu entries later here). */
-    pMenu->addAction (mVmStartAction);
-    pMenu->addAction (mVmPauseAction);
-}
-
-void VBoxTrayIcon::hideSubMenu ()
-{
-    if (!mActive)
-        return;
-
-    UIVMItem* pItem = NULL;
-    QVariant vID;
-
-    if (QMenu *pMenu = qobject_cast<QMenu*>(sender()))
-    {
-        vID = pMenu->menuAction()->data();
-        if (vID.canConvert<QString>() && mVMModel)
-            pItem = mVMModel->itemById (qvariant_cast<QString>(vID));
-    }
-
-    /* Nothing to do here yet. */
-
-    Assert (pItem);
-}
-
-void VBoxTrayIcon::refresh ()
-{
-    if (!mActive)
-        return;
-
-    AssertReturnVoid (mVMModel);
-    AssertReturnVoid (mTrayIconMenu);
-
-    mTrayIconMenu->clear();
-
-    UIVMItem* pItem = NULL;
-    QMenu* pCurMenu = mTrayIconMenu;
-    QMenu* pSubMenu = NULL;
-
-    int iCurItemCount = 0;
-
-    mTrayIconMenu->addAction (mShowSelectorAction);
-    mTrayIconMenu->setDefaultAction (mShowSelectorAction);
-
-    if (mVMModel->rowCount() > 0)
-        mTrayIconMenu->addSeparator();
-
-    for (int i = 0; i < mVMModel->rowCount(); i++, iCurItemCount++)
-    {
-        pItem = mVMModel->itemByRow(i);
-        Assert(pItem);
-
-        if (iCurItemCount > 10) /* 10 machines per sub menu. */
-        {
-            pSubMenu = new QMenu (tr ("&Other Machines...", "tray menu"));
-            Assert (pSubMenu);
-            pCurMenu->addMenu (pSubMenu);
-            pCurMenu = pSubMenu;
-            iCurItemCount = 0;
-        }
-
-        pSubMenu = new QMenu (QString ("&%1. %2")
-                              .arg ((iCurItemCount + 1) % 100).arg (pItem->name()));
-        Assert (pSubMenu);
-        pSubMenu->setIcon (pItem->machineStateIcon());
-
-        QAction *pAction = NULL;
-        QVariant vID;
-        vID.setValue (pItem->id());
-
-        pSubMenu->menuAction()->setData (vID);
-        connect (pSubMenu, SIGNAL (aboutToShow()), this, SLOT (showSubMenu()));
-        connect (pSubMenu, SIGNAL (aboutToHide()), this, SLOT (hideSubMenu()));
-        pCurMenu->addMenu (pSubMenu);
-    }
-
-    if (mVMModel->rowCount() > 0)
-        mTrayIconMenu->addSeparator();
-
-    mTrayIconMenu->addAction (mHideSystrayMenuAction);
-
-    /* We're done constructing the menu, show it */
-    setVisible (true);
-}
-
-UIVMItem* VBoxTrayIcon::GetItem (QObject* aObject)
-{
-    UIVMItem* pItem = NULL;
-    if (QAction *pAction = qobject_cast<QAction*>(sender()))
-    {
-        QVariant v = pAction->data();
-        if (v.canConvert<QString>() && mVMModel)
-            pItem = mVMModel->itemById (qvariant_cast<QString>(v));
-    }
-
-    Assert (pItem);
-    return pItem;
-}
-
-void VBoxTrayIcon::trayIconShow (bool aShow)
-{
-    if (!vboxGlobal().isTrayMenu())
-        return;
-
-    mActive = aShow;
-    if (mActive)
-    {
-        refresh();
-        retranslateUi();
-    }
-    setVisible (mActive);
-
-    if (!mActive)
-        mParent->fileExit();
-}
-
-void VBoxTrayIcon::vmSettings()
-{
-    UIVMItem* pItem = GetItem (sender());
-    mParent->vmSettings (NULL, NULL, pItem->id());
-}
-
-void VBoxTrayIcon::vmDelete()
-{
-    UIVMItem* pItem = GetItem (sender());
-    mParent->vmDelete (pItem->id());
-}
-
-void VBoxTrayIcon::vmStart()
-{
-    UIVMItem* pItem = GetItem (sender());
-    mParent->vmStart (pItem->id());
-}
-
-void VBoxTrayIcon::vmDiscard()
-{
-    UIVMItem* pItem = GetItem (sender());
-    mParent->vmDiscard (pItem->id());
-}
-
-void VBoxTrayIcon::vmPause(bool aPause)
-{
-    UIVMItem* pItem = GetItem (sender());
-    mParent->vmPause (aPause, pItem->id());
-}
-
-void VBoxTrayIcon::vmRefresh()
-{
-    UIVMItem* pItem = GetItem (sender());
-    mParent->vmRefresh (pItem->id());
-}
-
-void VBoxTrayIcon::vmShowLogs()
-{
-    UIVMItem* pItem = GetItem (sender());
-    mParent->vmShowLogs (pItem->id());
-}
-
-#endif /* VBOX_GUI_WITH_SYSTRAY */
-
Index: unk/src/VBox/Frontends/VirtualBox/src/selector/VBoxTrayIcon.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxTrayIcon.h	(revision 45373)
+++ 	(revision )
@@ -1,93 +1,0 @@
-/** @file
- *
- * VBox frontends: Qt GUI ("VirtualBox"):
- * VBoxTrayIcon class declaration
- */
-
-/*
- * Copyright (C) 2006-2011 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-#ifndef __VBoxTrayIcon_h__
-#define __VBoxTrayIcon_h__
-
-#ifdef VBOX_GUI_WITH_SYSTRAY
-
-/* Global includes */
-#include <QSystemTrayIcon>
-
-/* Local forward declarations */
-class UISelectorWindow;
-class UIVMItem;
-class UIVMItemModel;
-
-/* Global forward declarations */
-class QMenu;
-class QAction;
-
-class VBoxTrayIcon : public QSystemTrayIcon
-{
-    Q_OBJECT;
-
-public:
-
-    VBoxTrayIcon (UISelectorWindow* aParent, UIVMItemModel* aVMModel);
-    virtual ~VBoxTrayIcon ();
-
-    void refresh ();
-    void retranslateUi ();
-
-protected:
-
-    UIVMItem* GetItem (QObject* aObject);
-
-public slots:
-
-    void trayIconShow (bool aShow = false);
-
-private slots:
-
-    void showSubMenu();
-    void hideSubMenu ();
-
-    void vmSettings();
-    void vmDelete();
-    void vmStart();
-    void vmDiscard();
-    void vmPause(bool aPause);
-    void vmRefresh();
-    void vmShowLogs();
-
-private:
-
-    bool mActive;           /* Is systray menu active/available? */
-
-    /* The vm list model */
-    UIVMItemModel *mVMModel;
-
-    UISelectorWindow* mParent;
-    QMenu *mTrayIconMenu;
-
-    QAction *mShowSelectorAction;
-    QAction *mHideSystrayMenuAction;
-    QAction *mVmConfigAction;
-    QAction *mVmDeleteAction;
-    QAction *mVmStartAction;
-    QAction *mVmDiscardAction;
-    QAction *mVmPauseAction;
-    QAction *mVmRefreshAction;
-    QAction *mVmShowLogsAction;
-};
-
-#endif /* VBOX_GUI_WITH_SYSTRAY */
-
-#endif /* __VBoxTrayIcon_h__ */
-
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp	(revision 45373)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp	(revision 45374)
@@ -31,8 +31,4 @@
     Ui::UIGlobalSettingsGeneral::setupUi(this);
 
-#ifndef VBOX_GUI_WITH_SYSTRAY
-    m_pEnableTrayIconCheckbox->hide();
-    m_pSpacerWidget1->hide();
-#endif /* !VBOX_GUI_WITH_SYSTRAY */
 #ifndef Q_WS_MAC
     m_pEnablePresentationModeCheckbox->hide();
