VirtualBox

Changeset 42526 in vbox for trunk


Ignore:
Timestamp:
Aug 2, 2012 10:31:28 AM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: 6234: Support for VM groups: Initial commit. GUI-3 branch reintegrated to trunk.

Location:
trunk
Files:
31 added
50 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/doc/manual/en_US/user_Glossary.xml

  • trunk/doc/manual/en_US/user_Introduction.xml

  • trunk/doc/manual/en_US/user_Troubleshooting.xml

  • trunk/include/VBox/vmm/cpumctx-v1_6.h

  • trunk/src/VBox/Devices/PC/DevApic.h

  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r42312 r42526  
    148148        ./src/converter \
    149149        ./src/extensions \
     150        ./src/extensions/graphics \
    150151        ./src/globals \
    151152        ./src/net \
     
    161162        ./src/runtime/seamless \
    162163        ./src/selector \
     164        ./src/selector/graphics/chooser \
     165        ./src/selector/graphics/details \
    163166        ./src/settings \
    164167        ./src/settings/global \
    165168        ./src/settings/machine \
    166169        ./src/widgets \
     170        ./src/widgets/graphics \
    167171        ./src/wizards \
    168172        ./src/wizards/newvm \
     
    271275        src/extensions/QITreeWidget.h \
    272276        src/extensions/QIWidgetValidator.h \
     277        src/extensions/QIAdvancedToolBar.h \
     278        src/extensions/graphics/QIGraphicsWidget.h \
    273279        src/globals/UIActionPool.h \
    274280        src/globals/UIExtraDataEventHandler.h \
     
    325331        src/selector/UISelectorWindow.h \
    326332        src/selector/VBoxSnapshotsWgt.h \
     333        src/selector/graphics/chooser/UIGChooser.h \
     334        src/selector/graphics/chooser/UIGChooserModel.h \
     335        src/selector/graphics/chooser/UIGChooserView.h \
     336        src/selector/graphics/chooser/UIGChooserHandlerMouse.h \
     337        src/selector/graphics/chooser/UIGChooserHandlerKeyboard.h \
     338        src/selector/graphics/chooser/UIGChooserItem.h \
     339        src/selector/graphics/chooser/UIGChooserItemGroup.h \
     340        src/selector/graphics/chooser/UIGChooserItemMachine.h \
     341        src/selector/graphics/details/UIGDetails.h \
     342        src/selector/graphics/details/UIGDetailsModel.h \
     343        src/selector/graphics/details/UIGDetailsView.h \
     344        src/selector/graphics/details/UIGDetailsItem.h \
     345        src/selector/graphics/details/UIGDetailsGroup.h \
     346        src/selector/graphics/details/UIGDetailsSet.h \
     347        src/selector/graphics/details/UIGDetailsElement.h \
     348        src/selector/graphics/details/UIGDetailsElements.h \
     349        src/selector/graphics/details/UIGMachinePreview.h \
    327350        src/settings/UISettingsDialog.h \
    328351        src/settings/UISettingsDialogSpecific.h \
     
    368391        src/widgets/UINameAndSystemEditor.h \
    369392        src/widgets/VBoxWarningPane.h \
     393        src/widgets/graphics/UIGraphicsButton.h \
     394        src/widgets/graphics/UIGraphicsRotatorButton.h \
     395        src/widgets/graphics/UIGraphicsZoomButton.h \
     396        src/widgets/graphics/UIGraphicsToolBar.h \
    370397        src/wizards/UIWizard.h \
    371398        src/wizards/UIWizardPage.h \
     
    411438        src/UIVMLogViewer.cpp \
    412439        src/extensions/QISplitter.cpp \
     440        src/extensions/QIAdvancedToolBar.cpp \
    413441        src/globals/UIActionPool.cpp \
    414442        src/globals/UIExtraDataEventHandler.cpp \
     
    474502        src/extensions/QITreeWidget.cpp \
    475503        src/extensions/QIWidgetValidator.cpp \
     504        src/extensions/QIAdvancedToolBar.cpp \
     505        src/extensions/graphics/QIGraphicsWidget.cpp \
    476506        src/globals/UIDefs.cpp \
    477507        src/globals/COMDefs.cpp \
     
    540570        src/selector/UIVirtualBoxEventHandler.cpp \
    541571        src/selector/UISelectorWindow.cpp \
     572        src/selector/graphics/chooser/UIGChooser.cpp \
     573        src/selector/graphics/chooser/UIGChooserModel.cpp \
     574        src/selector/graphics/chooser/UIGChooserView.cpp \
     575        src/selector/graphics/chooser/UIGChooserHandlerMouse.cpp \
     576        src/selector/graphics/chooser/UIGChooserHandlerKeyboard.cpp \
     577        src/selector/graphics/chooser/UIGChooserItem.cpp \
     578        src/selector/graphics/chooser/UIGChooserItemGroup.cpp \
     579        src/selector/graphics/chooser/UIGChooserItemMachine.cpp \
     580        src/selector/graphics/details/UIGDetails.cpp \
     581        src/selector/graphics/details/UIGDetailsModel.cpp \
     582        src/selector/graphics/details/UIGDetailsView.cpp \
     583        src/selector/graphics/details/UIGDetailsItem.cpp \
     584        src/selector/graphics/details/UIGDetailsGroup.cpp \
     585        src/selector/graphics/details/UIGDetailsSet.cpp \
     586        src/selector/graphics/details/UIGDetailsElement.cpp \
     587        src/selector/graphics/details/UIGDetailsElements.cpp \
     588        src/selector/graphics/details/UIGMachinePreview.cpp \
    542589        src/selector/VBoxSnapshotsWgt.cpp \
    543590        src/settings/UISettingsDefs.cpp \
     
    586633        src/widgets/UINameAndSystemEditor.cpp \
    587634        src/widgets/VBoxWarningPane.cpp \
     635        src/widgets/graphics/UIGraphicsButton.cpp \
     636        src/widgets/graphics/UIGraphicsRotatorButton.cpp \
     637        src/widgets/graphics/UIGraphicsZoomButton.cpp \
     638        src/widgets/graphics/UIGraphicsToolBar.cpp \
    588639        src/wizards/UIWizard.cpp \
    589640        src/wizards/UIWizardPage.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverter.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverter.h

    r41850 r42526  
    6666    }
    6767
     68    /* QString <= template class: */
     69    template<class T> QString toInternalString(const T &data) const
     70    {
     71        if (canConvert<T>())
     72            return ::toInternalString(data);
     73        Assert(0); return QString();
     74    }
     75    /* Template class <= QString: */
     76    template<class T> T fromInternalString(const QString &strData) const
     77    {
     78        if (canConvert<T>())
     79            return ::fromInternalString<T>(strData);
     80        Assert(0); return T();
     81    }
     82
    6883private:
    6984
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h

    r42261 r42526  
    4747template<class X> X fromString(const QString & /* strData */) { Assert(0); return X(); }
    4848
     49/* Converts passed 'Object of type X' to non-translated QString.
     50 * This function returns null QString for any object type until re-determined for specific one. */
     51template<class X> QString toInternalString(const X & /* xobject */) { Assert(0); return QString(); }
     52/* Converts passed non-translated QString to 'Object of type X'.
     53 * This function returns default constructed object for any object type until re-determined for specific one. */
     54template<class X> X fromInternalString(const QString & /* strData */) { Assert(0); return X(); }
     55
    4956/* Declare global canConvert specializations: */
    5057template<> bool canConvert<StorageSlot>();
     58template<> bool canConvert<DetailsElementType>();
    5159
    5260/* Declare COM canConvert specializations: */
     
    7583template<> QString toString(const StorageSlot &storageSlot);
    7684template<> StorageSlot fromString<StorageSlot>(const QString &strStorageSlot);
     85template<> QString toString(const DetailsElementType &detailsElementType);
     86template<> DetailsElementType fromString<DetailsElementType>(const QString &strDetailsElementType);
     87template<> QString toInternalString(const DetailsElementType &detailsElementType);
     88template<> DetailsElementType fromInternalString<DetailsElementType>(const QString &strDetailsElementType);
    7789
    7890/* Declare COM conversion specializations: */
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendCOM.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r41850 r42526  
    3232 * These functions returns 'true' for all allowed conversions. */
    3333template<> bool canConvert<StorageSlot>() { return true; }
     34template<> bool canConvert<DetailsElementType>() { return true; }
    3435
    3536/* QString <= StorageSlot: */
     
    261262}
    262263
     264/* QString <= DetailsElementType: */
     265template<> QString toString(const DetailsElementType &detailsElementType)
     266{
     267    QString strResult;
     268    switch (detailsElementType)
     269    {
     270        case DetailsElementType_General:     strResult = QApplication::translate("VBoxGlobal", "General", "DetailsElementType"); break;
     271        case DetailsElementType_Preview:     strResult = QApplication::translate("VBoxGlobal", "Preview", "DetailsElementType"); break;
     272        case DetailsElementType_System:      strResult = QApplication::translate("VBoxGlobal", "System", "DetailsElementType"); break;
     273        case DetailsElementType_Display:     strResult = QApplication::translate("VBoxGlobal", "Display", "DetailsElementType"); break;
     274        case DetailsElementType_Storage:     strResult = QApplication::translate("VBoxGlobal", "Storage", "DetailsElementType"); break;
     275        case DetailsElementType_Audio:       strResult = QApplication::translate("VBoxGlobal", "Audio", "DetailsElementType"); break;
     276        case DetailsElementType_Network:     strResult = QApplication::translate("VBoxGlobal", "Network", "DetailsElementType"); break;
     277        case DetailsElementType_Serial:      strResult = QApplication::translate("VBoxGlobal", "Serial ports", "DetailsElementType"); break;
     278#ifdef VBOX_WITH_PARALLEL_PORTS
     279        case DetailsElementType_Parallel:    strResult = QApplication::translate("VBoxGlobal", "Parallel ports", "DetailsElementType"); break;
     280#endif /* VBOX_WITH_PARALLEL_PORTS */
     281        case DetailsElementType_USB:         strResult = QApplication::translate("VBoxGlobal", "USB", "DetailsElementType"); break;
     282        case DetailsElementType_SF:          strResult = QApplication::translate("VBoxGlobal", "Shared folders", "DetailsElementType"); break;
     283        case DetailsElementType_Description: strResult = QApplication::translate("VBoxGlobal", "Description", "DetailsElementType"); break;
     284        default:
     285        {
     286            AssertMsgFailed(("No text for details element type=%d", detailsElementType));
     287            break;
     288        }
     289    }
     290    return strResult;
     291}
     292
     293/* DetailsElementType <= QString: */
     294template<> DetailsElementType fromString<DetailsElementType>(const QString &strDetailsElementType)
     295{
     296    QHash<QString, DetailsElementType> list;
     297    list.insert(QApplication::translate("VBoxGlobal", "General", "DetailsElementType"),        DetailsElementType_General);
     298    list.insert(QApplication::translate("VBoxGlobal", "Preview", "DetailsElementType"),        DetailsElementType_Preview);
     299    list.insert(QApplication::translate("VBoxGlobal", "System", "DetailsElementType"),         DetailsElementType_System);
     300    list.insert(QApplication::translate("VBoxGlobal", "Display", "DetailsElementType"),        DetailsElementType_Display);
     301    list.insert(QApplication::translate("VBoxGlobal", "Storage", "DetailsElementType"),        DetailsElementType_Storage);
     302    list.insert(QApplication::translate("VBoxGlobal", "Audio", "DetailsElementType"),          DetailsElementType_Audio);
     303    list.insert(QApplication::translate("VBoxGlobal", "Network", "DetailsElementType"),        DetailsElementType_Network);
     304    list.insert(QApplication::translate("VBoxGlobal", "Serial ports", "DetailsElementType"),   DetailsElementType_Serial);
     305#ifdef VBOX_WITH_PARALLEL_PORTS
     306    list.insert(QApplication::translate("VBoxGlobal", "Parallel ports", "DetailsElementType"), DetailsElementType_Parallel);
     307#endif /* VBOX_WITH_PARALLEL_PORTS */
     308    list.insert(QApplication::translate("VBoxGlobal", "USB", "DetailsElementType"),            DetailsElementType_USB);
     309    list.insert(QApplication::translate("VBoxGlobal", "Shared folders", "DetailsElementType"), DetailsElementType_SF);
     310    list.insert(QApplication::translate("VBoxGlobal", "Description", "DetailsElementType"),    DetailsElementType_Description);
     311    if (!list.contains(strDetailsElementType))
     312    {
     313        AssertMsgFailed(("No value for '%s'", strDetailsElementType.toAscii().constData()));
     314    }
     315    return list.value(strDetailsElementType);
     316}
     317
     318/* QString <= DetailsElementType: */
     319template<> QString toInternalString(const DetailsElementType &detailsElementType)
     320{
     321    QString strResult;
     322    switch (detailsElementType)
     323    {
     324        case DetailsElementType_General:     strResult = "general"; break;
     325        case DetailsElementType_Preview:     strResult = "preview"; break;
     326        case DetailsElementType_System:      strResult = "system"; break;
     327        case DetailsElementType_Display:     strResult = "display"; break;
     328        case DetailsElementType_Storage:     strResult = "storage"; break;
     329        case DetailsElementType_Audio:       strResult = "audio"; break;
     330        case DetailsElementType_Network:     strResult = "network"; break;
     331        case DetailsElementType_Serial:      strResult = "serialPorts"; break;
     332#ifdef VBOX_WITH_PARALLEL_PORTS
     333        case DetailsElementType_Parallel:    strResult = "parallelPorts"; break;
     334#endif /* VBOX_WITH_PARALLEL_PORTS */
     335        case DetailsElementType_USB:         strResult = "usb"; break;
     336        case DetailsElementType_SF:          strResult = "sharedFolders"; break;
     337        case DetailsElementType_Description: strResult = "description"; break;
     338        default:
     339        {
     340            AssertMsgFailed(("No text for details element type=%d", detailsElementType));
     341            break;
     342        }
     343    }
     344    return strResult;
     345}
     346
     347/* DetailsElementType <= QString: */
     348template<> DetailsElementType fromInternalString<DetailsElementType>(const QString &strDetailsElementType)
     349{
     350    QHash<QString, DetailsElementType> list;
     351    list.insert("general",       DetailsElementType_General);
     352    list.insert("preview",       DetailsElementType_Preview);
     353    list.insert("system",        DetailsElementType_System);
     354    list.insert("display",       DetailsElementType_Display);
     355    list.insert("storage",       DetailsElementType_Storage);
     356    list.insert("audio",         DetailsElementType_Audio);
     357    list.insert("network",       DetailsElementType_Network);
     358    list.insert("serialPorts",   DetailsElementType_Serial);
     359#ifdef VBOX_WITH_PARALLEL_PORTS
     360    list.insert("parallelPorts", DetailsElementType_Parallel);
     361#endif /* VBOX_WITH_PARALLEL_PORTS */
     362    list.insert("usb",           DetailsElementType_USB);
     363    list.insert("sharedFolders", DetailsElementType_SF);
     364    list.insert("description",   DetailsElementType_Description);
     365    if (!list.contains(strDetailsElementType))
     366    {
     367        AssertMsgFailed(("No value for '%s'", strDetailsElementType.toAscii().constData()));
     368    }
     369    return list.value(strDetailsElementType);
     370}
     371
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIProcess.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIProcess.h

  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QISplitter.cpp

    r42261 r42526  
    1818 */
    1919
    20 /* Local includes */
    21 #include "QISplitter.h"
    22 
    23 /* Global includes */
     20/* Qt includes: */
    2421#include <QApplication>
    2522#include <QEvent>
     
    2724#include <QPaintEvent>
    2825
    29 /* A simple shaded line. */
     26/* GUI includes: */
     27#include "QISplitter.h"
     28
     29/* A simple shaded line: */
    3030class QIShadeSplitterHandle: public QSplitterHandle
    3131{
     
    3434public:
    3535
    36     QIShadeSplitterHandle(Qt::Orientation aOrientation, QISplitter *aParent)
    37       :QSplitterHandle(aOrientation, aParent)
     36    QIShadeSplitterHandle(Qt::Orientation orientation, QISplitter *pParent)
     37        : QSplitterHandle(orientation, pParent)
    3838    {}
    3939
    4040protected:
    4141
    42     void paintEvent(QPaintEvent *aEvent)
     42    void paintEvent(QPaintEvent *pEvent)
    4343    {
    4444        QPainter painter(this);
    4545        QLinearGradient gradient;
     46        QColor color = palette().color(QPalette::Window);
     47        QGradientStop point1(0, color);
     48        QGradientStop point2(0.5, color.darker(115));
     49        QGradientStop point3(1, color);
     50        QGradientStops stops;
     51        stops << point1 << point2 << point3;
     52        gradient.setStops(stops);
    4653        if (orientation() == Qt::Horizontal)
    4754        {
    48             gradient.setStart(rect().left(), rect().height() / 2);
    49             gradient.setFinalStop(rect().right(), rect().height() / 2);
     55            gradient.setStart(rect().left(), 0);
     56            gradient.setFinalStop(rect().right(), 0);
    5057        }
    5158        else
    5259        {
    53             gradient.setStart(rect().width() / 2, rect().top());
    54             gradient.setFinalStop(rect().width() / 2, rect().bottom());
    55         }
    56         painter.fillRect(aEvent->rect(), QBrush (gradient));
     60            gradient.setStart(0, rect().top());
     61            gradient.setFinalStop(0, rect().bottom());
     62        }
     63        painter.fillRect(pEvent->rect(), gradient);
    5764    }
    5865};
     
    6673public:
    6774
    68     QIDarwinSplitterHandle(Qt::Orientation aOrientation, QISplitter *aParent)
    69       :QSplitterHandle(aOrientation, aParent)
     75    QIDarwinSplitterHandle(Qt::Orientation orientation, QISplitter *pParent)
     76        : QSplitterHandle(orientation, pParent)
    7077    {}
    7178
     
    8188protected:
    8289
    83     void paintEvent(QPaintEvent * /* aEvent */)
     90    void paintEvent(QPaintEvent*)
    8491    {
    8592        QPainter painter(this);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r41689 r42526  
    77
    88/*
    9  * Copyright (C) 2010-2011 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4444};
    4545
    46 /* UIActionInterface stuff: */
    47 UIActionInterface::UIActionInterface(QObject *pParent, UIActionType type)
     46/* UIAction stuff: */
     47UIAction::UIAction(QObject *pParent, UIActionType type)
    4848    : QIWithRetranslateUI3<QAction>(pParent)
    4949    , m_type(type)
     
    5454}
    5555
    56 QString UIActionInterface::menuText(const QString &strText)
     56QString UIAction::menuText(const QString &strText)
    5757{
    5858    return vboxGlobal().isVMConsoleProcess() ? VBoxGlobal::removeAccelMark(strText) : strText;
    5959}
    6060
    61 /* UIMenuInterface stuff: */
    62 UIMenuInterface::UIMenuInterface()
     61/* UIMenu stuff: */
     62UIMenu::UIMenu()
    6363    : m_fShowToolTips(false)
    6464{
    6565}
    6666
    67 bool UIMenuInterface::event(QEvent *pEvent)
     67bool UIMenu::event(QEvent *pEvent)
    6868{
    6969    /* Handle particular event-types: */
     
    8989}
    9090
    91 /* UISimpleAction stuff: */
    92 UISimpleAction::UISimpleAction(QObject *pParent, const QString &strIcon, const QString &strIconDis)
    93     : UIActionInterface(pParent, UIActionType_Simple)
     91/* UIActionSimple stuff: */
     92UIActionSimple::UIActionSimple(QObject *pParent, const QString &strIcon, const QString &strIconDis)
     93    : UIAction(pParent, UIActionType_Simple)
    9494{
    9595    if (!strIcon.isNull())
     
    9797}
    9898
    99 UISimpleAction::UISimpleAction(QObject *pParent,
     99UIActionSimple::UIActionSimple(QObject *pParent,
    100100                               const QSize &normalSize, const QSize &smallSize,
    101101                               const QString &strNormalIcon, const QString &strSmallIcon,
    102102                               const QString &strNormalIconDis, const QString &strSmallIconDis)
    103     : UIActionInterface(pParent, UIActionType_Simple)
     103    : UIAction(pParent, UIActionType_Simple)
    104104{
    105105    setIcon(UIIconPool::iconSetFull(normalSize, smallSize, strNormalIcon, strSmallIcon, strNormalIconDis, strSmallIconDis));
    106106}
    107107
    108 UISimpleAction::UISimpleAction(QObject *pParent, const QIcon& icon)
    109     : UIActionInterface(pParent, UIActionType_Simple)
     108UIActionSimple::UIActionSimple(QObject *pParent, const QIcon& icon)
     109    : UIAction(pParent, UIActionType_Simple)
    110110{
    111111    if (!icon.isNull())
     
    113113}
    114114
    115 /* UIStateAction stuff: */
    116 UIStateAction::UIStateAction(QObject *pParent, const QString &strIcon, const QString &strIconDis)
    117     : UIActionInterface(pParent, UIActionType_State)
     115/* UIActionState stuff: */
     116UIActionState::UIActionState(QObject *pParent, const QString &strIcon, const QString &strIconDis)
     117    : UIAction(pParent, UIActionType_State)
    118118{
    119119    if (!strIcon.isNull())
     
    121121}
    122122
    123 UIStateAction::UIStateAction(QObject *pParent,
     123UIActionState::UIActionState(QObject *pParent,
    124124                             const QSize &normalSize, const QSize &smallSize,
    125125                             const QString &strNormalIcon, const QString &strSmallIcon,
    126126                             const QString &strNormalIconDis, const QString &strSmallIconDis)
    127     : UIActionInterface(pParent, UIActionType_State)
     127    : UIAction(pParent, UIActionType_State)
    128128{
    129129    setIcon(UIIconPool::iconSetFull(normalSize, smallSize, strNormalIcon, strSmallIcon, strNormalIconDis, strSmallIconDis));
    130130}
    131131
    132 UIStateAction::UIStateAction(QObject *pParent, const QIcon& icon)
    133     : UIActionInterface(pParent, UIActionType_State)
     132UIActionState::UIActionState(QObject *pParent, const QIcon& icon)
     133    : UIAction(pParent, UIActionType_State)
    134134{
    135135    if (!icon.isNull())
     
    137137}
    138138
    139 /* UIToggleAction stuff: */
    140 UIToggleAction::UIToggleAction(QObject *pParent, const QString &strIcon, const QString &strIconDis)
    141     : UIActionInterface(pParent, UIActionType_Toggle)
     139/* UIActionToggle stuff: */
     140UIActionToggle::UIActionToggle(QObject *pParent, const QString &strIcon, const QString &strIconDis)
     141    : UIAction(pParent, UIActionType_Toggle)
    142142{
    143143    if (!strIcon.isNull())
     
    146146}
    147147
    148 UIToggleAction::UIToggleAction(QObject *pParent,
     148UIActionToggle::UIActionToggle(QObject *pParent,
    149149                               const QSize &normalSize, const QSize &smallSize,
    150150                               const QString &strNormalIcon, const QString &strSmallIcon,
    151151                               const QString &strNormalIconDis, const QString &strSmallIconDis)
    152     : UIActionInterface(pParent, UIActionType_Toggle)
     152    : UIAction(pParent, UIActionType_Toggle)
    153153{
    154154    setIcon(UIIconPool::iconSetFull(normalSize, smallSize, strNormalIcon, strSmallIcon, strNormalIconDis, strSmallIconDis));
     
    156156}
    157157
    158 UIToggleAction::UIToggleAction(QObject *pParent,
     158UIActionToggle::UIActionToggle(QObject *pParent,
    159159               const QString &strIconOn, const QString &strIconOff,
    160160               const QString &strIconOnDis, const QString &strIconOffDis)
    161     : UIActionInterface(pParent, UIActionType_Toggle)
     161    : UIAction(pParent, UIActionType_Toggle)
    162162{
    163163    setIcon(UIIconPool::iconSetOnOff(strIconOn, strIconOff, strIconOnDis, strIconOffDis));
     
    165165}
    166166
    167 UIToggleAction::UIToggleAction(QObject *pParent, const QIcon &icon)
    168     : UIActionInterface(pParent, UIActionType_Toggle)
     167UIActionToggle::UIActionToggle(QObject *pParent, const QIcon &icon)
     168    : UIAction(pParent, UIActionType_Toggle)
    169169{
    170170    if (!icon.isNull())
     
    173173}
    174174
    175 void UIToggleAction::sltUpdateAppearance()
     175void UIActionToggle::sltUpdateAppearance()
    176176{
    177177    retranslateUi();
    178178}
    179179
    180 void UIToggleAction::init()
     180void UIActionToggle::init()
    181181{
    182182    setCheckable(true);
     
    184184}
    185185
    186 /* UIMenuAction stuff: */
    187 UIMenuAction::UIMenuAction(QObject *pParent, const QString &strIcon, const QString &strIconDis)
    188     : UIActionInterface(pParent, UIActionType_Menu)
     186/* UIActionMenu stuff: */
     187UIActionMenu::UIActionMenu(QObject *pParent, const QString &strIcon, const QString &strIconDis)
     188    : UIAction(pParent, UIActionType_Menu)
    189189{
    190190    if (!strIcon.isNull())
    191191        setIcon(UIIconPool::iconSet(strIcon, strIconDis));
    192     setMenu(new UIMenuInterface);
    193 }
    194 
    195 UIMenuAction::UIMenuAction(QObject *pParent, const QIcon &icon)
    196     : UIActionInterface(pParent, UIActionType_Menu)
     192    setMenu(new UIMenu);
     193}
     194
     195UIActionMenu::UIActionMenu(QObject *pParent, const QIcon &icon)
     196    : UIAction(pParent, UIActionType_Menu)
    197197{
    198198    if (!icon.isNull())
    199199        setIcon(icon);
    200     setMenu(new UIMenuInterface);
    201 }
    202 
    203 class UISimpleActionLogDialog : public UISimpleAction
    204 {
    205     Q_OBJECT;
    206 
    207 public:
    208 
    209     UISimpleActionLogDialog(QObject *pParent)
    210         : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16),
     200    setMenu(new UIMenu);
     201}
     202
     203
     204class UIActionSimpleLogDialog : public UIActionSimple
     205{
     206    Q_OBJECT;
     207
     208public:
     209
     210    UIActionSimpleLogDialog(QObject *pParent)
     211        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    211212                         ":/vm_show_logs_32px.png", ":/show_logs_16px.png",
    212213                         ":/vm_show_logs_disabled_32px.png", ":/show_logs_disabled_16px.png")
     
    227228    void retranslateUi()
    228229    {
    229         setText(QApplication::translate("UIActionPool", "Show &Log..."));
     230        setText(QApplication::translate("UIActionPool", "Show &log..."));
    230231        setStatusTip(QApplication::translate("UIActionPool", "Show the log files of the selected virtual machine"));
    231232    }
    232233};
    233234
    234 class MenuHelpAction : public UIMenuAction
    235 {
    236     Q_OBJECT;
    237 
    238 public:
    239 
    240     MenuHelpAction(QObject *pParent)
    241         : UIMenuAction(pParent)
     235class UIActionMenuHelp : public UIActionMenu
     236{
     237    Q_OBJECT;
     238
     239public:
     240
     241    UIActionMenuHelp(QObject *pParent)
     242        : UIActionMenu(pParent)
    242243    {
    243244        retranslateUi();
     
    252253};
    253254
    254 class ShowHelpAction : public UISimpleAction
    255 {
    256     Q_OBJECT;
    257 
    258 public:
    259 
    260     ShowHelpAction(QObject *pParent)
    261         : UISimpleAction(pParent, UIIconPool::defaultIcon(UIIconPool::DialogHelpIcon))
     255class UIActionSimpleContents : public UIActionSimple
     256{
     257    Q_OBJECT;
     258
     259public:
     260
     261    UIActionSimpleContents(QObject *pParent)
     262        : UIActionSimple(pParent, UIIconPool::defaultIcon(UIIconPool::DialogHelpIcon))
    262263    {
    263264        switch (gActionPool->type())
     
    277278    void retranslateUi()
    278279    {
    279         setText(menuText(QApplication::translate("UIMessageCenter", "&Contents...")));
    280         setStatusTip(QApplication::translate("UIMessageCenter", "Show the online help contents"));
    281     }
    282 };
    283 
    284 class ShowWebAction : public UISimpleAction
    285 {
    286     Q_OBJECT;
    287 
    288 public:
    289 
    290     ShowWebAction(QObject *pParent)
    291         : UISimpleAction(pParent, ":/site_16px.png")
     280        setText(menuText(QApplication::translate("UIActionPool", "&Contents...")));
     281        setStatusTip(QApplication::translate("UIActionPool", "Show help contents"));
     282    }
     283};
     284
     285class UIActionSimpleWebSite : public UIActionSimple
     286{
     287    Q_OBJECT;
     288
     289public:
     290
     291    UIActionSimpleWebSite(QObject *pParent)
     292        : UIActionSimple(pParent, ":/site_16px.png")
    292293    {
    293294        switch (gActionPool->type())
     
    307308    void retranslateUi()
    308309    {
    309         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIMessageCenter", "&VirtualBox Web Site...")), gMS->shortcut(UIMachineShortcuts::WebShortcut)));
    310         setStatusTip(QApplication::translate("UIMessageCenter", "Open the browser and go to the VirtualBox product web site"));
    311     }
    312 };
    313 
    314 class PerformResetWarningsAction : public UISimpleAction
    315 {
    316     Q_OBJECT;
    317 
    318 public:
    319 
    320     PerformResetWarningsAction(QObject *pParent)
    321         : UISimpleAction(pParent, ":/reset_16px.png")
     310        setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&VirtualBox web site...")), gMS->shortcut(UIMachineShortcuts::WebShortcut)));
     311        setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox product web site"));
     312    }
     313};
     314
     315class UIActionSimpleResetWarnings : public UIActionSimple
     316{
     317    Q_OBJECT;
     318
     319public:
     320
     321    UIActionSimpleResetWarnings(QObject *pParent)
     322        : UIActionSimple(pParent, ":/reset_16px.png")
    322323    {
    323324        switch (gActionPool->type())
     
    337338    void retranslateUi()
    338339    {
    339         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIMessageCenter", "&Reset All Warnings")), gMS->shortcut(UIMachineShortcuts::ResetWarningsShortcut)));
    340         setStatusTip(QApplication::translate("UIMessageCenter", "Go back to showing all suppressed warnings and messages"));
    341     }
    342 };
    343 
    344 class ShowNetworkAccessManagerAction : public UISimpleAction
    345 {
    346     Q_OBJECT;
    347 
    348 public:
    349 
    350     ShowNetworkAccessManagerAction(QObject *pParent)
    351         : UISimpleAction(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
     340        setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Reset all warnings")), gMS->shortcut(UIMachineShortcuts::ResetWarningsShortcut)));
     341        setStatusTip(QApplication::translate("UIActionPool", "Go back to showing all suppressed warnings and messages"));
     342    }
     343};
     344
     345class UIActionSimpleNetworkAccessManager : public UIActionSimple
     346{
     347    Q_OBJECT;
     348
     349public:
     350
     351    UIActionSimpleNetworkAccessManager(QObject *pParent)
     352        : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
    352353    {
    353354        switch (gActionPool->type())
     
    367368    void retranslateUi()
    368369    {
    369         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIMessageCenter", "&Network Operations Manager...")), gMS->shortcut(UIMachineShortcuts::NetworkAccessManager)));
    370         setStatusTip(QApplication::translate("UIMessageCenter", "Show Network Operations Manager"));
    371     }
    372 };
    373 
    374 #ifdef VBOX_WITH_REGISTRATION
    375 class PerformRegisterAction : public UISimpleAction
    376 {
    377     Q_OBJECT;
    378 
    379 public:
    380 
    381     PerformRegisterAction(QObject *pParent)
    382         : UISimpleAction(pParent, ":/register_16px.png", ":/register_disabled_16px.png")
    383     {
    384         setEnabled(vboxGlobal().virtualBox().
    385                    GetExtraData(GUI_RegistrationDlgWinID).isEmpty());
    386         switch (gActionPool->type())
    387         {
    388             case UIActionPoolType_Selector:
    389                 setShortcut(gSS->keySequence(UISelectorShortcuts::RegisterShortcut));
    390                 break;
    391             case UIActionPoolType_Runtime:
    392                 setShortcut(gMS->keySequence(UIMachineShortcuts::RegisterShortcut));
    393                 break;
    394         }
    395         retranslateUi();
    396     }
    397 
    398 protected:
    399 
    400     void retranslateUi()
    401     {
    402         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIMessageCenter", "R&egister VirtualBox...")), gMS->shortcut(UIMachineShortcuts::RegisterShortcut)));
    403         setStatusTip(QApplication::translate("UIMessageCenter", "Open VirtualBox registration form"));
    404     }
    405 };
    406 #endif /* VBOX_WITH_REGISTRATION */
    407 
    408 class PerformUpdateAction : public UISimpleAction
    409 {
    410     Q_OBJECT;
    411 
    412 public:
    413 
    414     PerformUpdateAction(QObject *pParent)
    415         : UISimpleAction(pParent, ":/refresh_16px.png", ":/refresh_disabled_16px.png")
     370        setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&Network Operations Manager...")), gMS->shortcut(UIMachineShortcuts::NetworkAccessManager)));
     371        setStatusTip(QApplication::translate("UIActionPool", "Show Network Operations Manager"));
     372    }
     373};
     374
     375class UIActionSimpleCheckForUpdates : public UIActionSimple
     376{
     377    Q_OBJECT;
     378
     379public:
     380
     381    UIActionSimpleCheckForUpdates(QObject *pParent)
     382        : UIActionSimple(pParent, ":/refresh_16px.png", ":/refresh_disabled_16px.png")
    416383    {
    417384        setMenuRole(QAction::ApplicationSpecificRole);
     
    432399    void retranslateUi()
    433400    {
    434         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIMessageCenter", "C&heck for Updates...")), gMS->shortcut(UIMachineShortcuts::UpdateShortcut)));
    435         setStatusTip(QApplication::translate("UIMessageCenter", "Check for a new VirtualBox version"));
    436     }
    437 };
    438 
    439 class ShowAboutAction : public UISimpleAction
    440 {
    441     Q_OBJECT;
    442 
    443 public:
    444 
    445     ShowAboutAction(QObject *pParent)
    446         : UISimpleAction(pParent, ":/about_16px.png")
     401        setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "C&heck for updates...")), gMS->shortcut(UIMachineShortcuts::UpdateShortcut)));
     402        setStatusTip(QApplication::translate("UIActionPool", "Check for a new VirtualBox version"));
     403    }
     404};
     405
     406class UIActionSimpleAbout : public UIActionSimple
     407{
     408    Q_OBJECT;
     409
     410public:
     411
     412    UIActionSimpleAbout(QObject *pParent)
     413        : UIActionSimple(pParent, ":/about_16px.png")
    447414    {
    448415        setMenuRole(QAction::AboutRole);
     
    463430    void retranslateUi()
    464431    {
    465         setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIMessageCenter", "&About VirtualBox...")), gMS->shortcut(UIMachineShortcuts::AboutShortcut)));
    466         setStatusTip(QApplication::translate("UIMessageCenter", "Show a dialog with product information"));
    467     }
    468 };
     432        setText(vboxGlobal().insertKeyToActionText(menuText(QApplication::translate("UIActionPool", "&About VirtualBox...")), gMS->shortcut(UIMachineShortcuts::AboutShortcut)));
     433        setStatusTip(QApplication::translate("UIActionPool", "Show a dialog with product information"));
     434    }
     435};
     436
    469437
    470438/* UIActionPool stuff: */
     
    514482    {
    515483        /* Get current action: */
    516         UIActionInterface *pAction = m_pool[keys[i]];
     484        UIAction *pAction = m_pool[keys[i]];
    517485        /* Skip menus/separators: */
    518486        if (pAction->type() == UIActionType_Menu)
     
    542510{
    543511    /* Various dialog actions: */
    544     m_pool[UIActionIndex_Simple_LogDialog] = new UISimpleActionLogDialog(this);
     512    m_pool[UIActionIndex_Simple_LogDialog] = new UIActionSimpleLogDialog(this);
    545513    /* 'Help' actions: */
    546     m_pool[UIActionIndex_Simple_Help] = new ShowHelpAction(this);
    547     m_pool[UIActionIndex_Simple_Web] = new ShowWebAction(this);
    548     m_pool[UIActionIndex_Simple_ResetWarnings] = new PerformResetWarningsAction(this);
    549     m_pool[UIActionIndex_Simple_NetworkAccessManager] = new ShowNetworkAccessManagerAction(this);
    550 #ifdef VBOX_WITH_REGISTRATION
    551     m_pool[UIActionIndex_Simple_Register] = new PerformRegisterAction(this);
    552 #endif /* VBOX_WITH_REGISTRATION */
    553     m_pool[UIActionIndex_Simple_Update] = new PerformUpdateAction(this);
    554     m_pool[UIActionIndex_Simple_About] = new ShowAboutAction(this);
     514    m_pool[UIActionIndex_Simple_Contents] = new UIActionSimpleContents(this);
     515    m_pool[UIActionIndex_Simple_WebSite] = new UIActionSimpleWebSite(this);
     516    m_pool[UIActionIndex_Simple_ResetWarnings] = new UIActionSimpleResetWarnings(this);
     517    m_pool[UIActionIndex_Simple_NetworkAccessManager] = new UIActionSimpleNetworkAccessManager(this);
     518    m_pool[UIActionIndex_Simple_CheckForUpdates] = new UIActionSimpleCheckForUpdates(this);
     519    m_pool[UIActionIndex_Simple_About] = new UIActionSimpleAbout(this);
    555520}
    556521
     
    563528    /* Recreate 'help' menu items as well.
    564529     * This makes sure they are removed also from the Application menu: */
    565     if (m_pool[UIActionIndex_Simple_Help])
    566         delete m_pool[UIActionIndex_Simple_Help];
    567     m_pool[UIActionIndex_Simple_Help] = new ShowHelpAction(this);
    568     if (m_pool[UIActionIndex_Simple_Web])
    569         delete m_pool[UIActionIndex_Simple_Web];
    570     m_pool[UIActionIndex_Simple_Web] = new ShowWebAction(this);
     530    if (m_pool[UIActionIndex_Simple_Contents])
     531        delete m_pool[UIActionIndex_Simple_Contents];
     532    m_pool[UIActionIndex_Simple_Contents] = new UIActionSimpleContents(this);
     533    if (m_pool[UIActionIndex_Simple_WebSite])
     534        delete m_pool[UIActionIndex_Simple_WebSite];
     535    m_pool[UIActionIndex_Simple_WebSite] = new UIActionSimpleWebSite(this);
    571536    if (m_pool[UIActionIndex_Simple_ResetWarnings])
    572537        delete m_pool[UIActionIndex_Simple_ResetWarnings];
    573     m_pool[UIActionIndex_Simple_ResetWarnings] = new PerformResetWarningsAction(this);
     538    m_pool[UIActionIndex_Simple_ResetWarnings] = new UIActionSimpleResetWarnings(this);
    574539    if (m_pool[UIActionIndex_Simple_NetworkAccessManager])
    575540        delete m_pool[UIActionIndex_Simple_NetworkAccessManager];
    576     m_pool[UIActionIndex_Simple_NetworkAccessManager] = new ShowNetworkAccessManagerAction(this);
    577 #ifdef VBOX_WITH_REGISTRATION
    578     if (m_pool[UIActionIndex_Simple_Register])
    579         delete m_pool[UIActionIndex_Simple_Register]
    580     m_pool[UIActionIndex_Simple_Register] = new PerformRegisterAction(this);
    581 #endif /* VBOX_WITH_REGISTRATION */
     541    m_pool[UIActionIndex_Simple_NetworkAccessManager] = new UIActionSimpleNetworkAccessManager(this);
    582542#if defined(Q_WS_MAC) && (QT_VERSION >= 0x040700)
    583543    /* For whatever reason, Qt doesn't fully remove items with a
     
    585545     * itself is deleted, a dummy entry is leaved back in the menu.
    586546     * Hiding before deletion helps. */
    587     m_pool[UIActionIndex_Simple_Update]->setVisible(false);
     547    m_pool[UIActionIndex_Simple_CheckForUpdates]->setVisible(false);
    588548#endif
    589549#if !(defined(Q_WS_MAC) && (QT_VERSION < 0x040700))
    590     if (m_pool[UIActionIndex_Simple_Update])
    591         delete m_pool[UIActionIndex_Simple_Update];
    592     m_pool[UIActionIndex_Simple_Update] = new PerformUpdateAction(this);
     550    if (m_pool[UIActionIndex_Simple_CheckForUpdates])
     551        delete m_pool[UIActionIndex_Simple_CheckForUpdates];
     552    m_pool[UIActionIndex_Simple_CheckForUpdates] = new UIActionSimpleCheckForUpdates(this);
    593553    if (m_pool[UIActionIndex_Simple_About])
    594554        delete m_pool[UIActionIndex_Simple_About];
    595     m_pool[UIActionIndex_Simple_About] = new ShowAboutAction(this);
     555    m_pool[UIActionIndex_Simple_About] = new UIActionSimpleAbout(this);
    596556#endif
    597557
     
    599559    if (m_pool[UIActionIndex_Menu_Help])
    600560        delete m_pool[UIActionIndex_Menu_Help];
    601     m_pool[UIActionIndex_Menu_Help] = new MenuHelpAction(this);
     561    m_pool[UIActionIndex_Menu_Help] = new UIActionMenuHelp(this);
    602562}
    603563
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r41047 r42526  
    66
    77/*
    8  * Copyright (C) 2010-2011 Oracle Corporation
     8 * Copyright (C) 2010-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4444    /* 'Help' menu actions: */
    4545    UIActionIndex_Menu_Help,
    46     UIActionIndex_Simple_Help,
    47     UIActionIndex_Simple_Web,
     46    UIActionIndex_Simple_Contents,
     47    UIActionIndex_Simple_WebSite,
    4848    UIActionIndex_Simple_ResetWarnings,
    4949    UIActionIndex_Simple_NetworkAccessManager,
    50 #ifdef VBOX_WITH_REGISTRATION
    51     UIActionIndex_Simple_Register,
    52 #endif /* VBOX_WITH_REGISTRATION */
    53     UIActionIndex_Simple_Update,
     50    UIActionIndex_Simple_CheckForUpdates,
    5451    UIActionIndex_Simple_About,
    5552
     
    5956
    6057/* Basic abstract QAction reimplemetation, extending interface: */
    61 class UIActionInterface : public QIWithRetranslateUI3<QAction>
     58class UIAction : public QIWithRetranslateUI3<QAction>
    6259{
    6360    Q_OBJECT;
     
    7168protected:
    7269
    73     UIActionInterface(QObject *pParent, UIActionType type);
     70    UIAction(QObject *pParent, UIActionType type);
    7471
    7572    QString menuText(const QString &strText);
     
    8178
    8279/* Basic QMenu reimplemetation, extending interface: */
    83 class UIMenuInterface : public QMenu
     80class UIMenu : public QMenu
    8481{
    8582    Q_OBJECT;
     
    8784public:
    8885
    89     UIMenuInterface();
     86    UIMenu();
    9087
    9188    void setShowToolTips(bool fShowToolTips) { m_fShowToolTips = fShowToolTips; }
     
    9996};
    10097
    101 /* Abstract extention for UIActionInterface, describing 'simple' action type: */
    102 class UISimpleAction : public UIActionInterface
    103 {
    104     Q_OBJECT;
    105 
    106 protected:
    107 
    108     UISimpleAction(QObject *pParent,
     98/* Abstract extention for UIAction, describing 'simple' action type: */
     99class UIActionSimple : public UIAction
     100{
     101    Q_OBJECT;
     102
     103protected:
     104
     105    UIActionSimple(QObject *pParent,
    109106                   const QString &strIcon = QString(), const QString &strIconDis = QString());
    110     UISimpleAction(QObject *pParent,
     107    UIActionSimple(QObject *pParent,
    111108                   const QSize &normalSize, const QSize &smallSize,
    112109                   const QString &strNormalIcon, const QString &strSmallIcon,
    113110                   const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString());
    114     UISimpleAction(QObject *pParent, const QIcon& icon);
    115 };
    116 
    117 /* Abstract extention for UIActionInterface, describing 'state' action type: */
    118 class UIStateAction : public UIActionInterface
    119 {
    120     Q_OBJECT;
    121 
    122 protected:
    123 
    124     UIStateAction(QObject *pParent,
     111    UIActionSimple(QObject *pParent, const QIcon& icon);
     112};
     113
     114/* Abstract extention for UIAction, describing 'state' action type: */
     115class UIActionState : public UIAction
     116{
     117    Q_OBJECT;
     118
     119protected:
     120
     121    UIActionState(QObject *pParent,
    125122                  const QString &strIcon = QString(), const QString &strIconDis = QString());
    126     UIStateAction(QObject *pParent,
     123    UIActionState(QObject *pParent,
    127124                  const QSize &normalSize, const QSize &smallSize,
    128125                  const QString &strNormalIcon, const QString &strSmallIcon,
    129126                  const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString());
    130     UIStateAction(QObject *pParent, const QIcon& icon);
     127    UIActionState(QObject *pParent, const QIcon& icon);
    131128    void setState(int iState) { m_iState = iState; retranslateUi(); }
    132129
     
    134131};
    135132
    136 /* Abstract extention for UIActionInterface, describing 'toggle' action type: */
    137 class UIToggleAction : public UIActionInterface
    138 {
    139     Q_OBJECT;
    140 
    141 protected:
    142 
    143     UIToggleAction(QObject *pParent, const QString &strIcon = QString(), const QString &strIconDis = QString());
    144     UIToggleAction(QObject *pParent,
     133/* Abstract extention for UIAction, describing 'toggle' action type: */
     134class UIActionToggle : public UIAction
     135{
     136    Q_OBJECT;
     137
     138protected:
     139
     140    UIActionToggle(QObject *pParent, const QString &strIcon = QString(), const QString &strIconDis = QString());
     141    UIActionToggle(QObject *pParent,
    145142                   const QSize &normalSize, const QSize &smallSize,
    146143                   const QString &strNormalIcon, const QString &strSmallIcon,
    147144                   const QString &strNormalIconDis = QString(), const QString &strSmallIconDis = QString());
    148     UIToggleAction(QObject *pParent, const QString &strIconOn, const QString &strIconOff, const QString &strIconOnDis, const QString &strIconOffDis);
    149     UIToggleAction(QObject *pParent, const QIcon &icon);
     145    UIActionToggle(QObject *pParent, const QString &strIconOn, const QString &strIconOff, const QString &strIconOnDis, const QString &strIconOffDis);
     146    UIActionToggle(QObject *pParent, const QIcon &icon);
    150147    void updateAppearance() { sltUpdateAppearance(); }
    151148
     
    159156};
    160157
    161 /* Abstract extention for UIActionInterface, describing 'menu' action type: */
    162 class UIMenuAction : public UIActionInterface
    163 {
    164     Q_OBJECT;
    165 
    166 protected:
    167 
    168     UIMenuAction(QObject *pParent, const QString &strIcon = QString(), const QString &strIconDis = QString());
    169     UIMenuAction(QObject *pParent, const QIcon &icon);
     158/* Abstract extention for UIAction, describing 'menu' action type: */
     159class UIActionMenu : public UIAction
     160{
     161    Q_OBJECT;
     162
     163protected:
     164
     165    UIActionMenu(QObject *pParent, const QString &strIcon = QString(), const QString &strIconDis = QString());
     166    UIActionMenu(QObject *pParent, const QIcon &icon);
    170167};
    171168
     
    196193
    197194    /* Return corresponding action: */
    198     UIActionInterface* action(int iIndex) const { return m_pool[iIndex]; }
     195    UIAction* action(int iIndex) const { return m_pool[iIndex]; }
    199196
    200197    /* Helping stuff: */
     
    222219
    223220    /* Actions pool itself: */
    224     QMap<int, UIActionInterface*> m_pool;
     221    QMap<int, UIAction*> m_pool;
    225222};
    226223
    227224#define gActionPool UIActionPool::instance()
    228225
    229 #endif // __UIActionPool_h__
    230 
     226#endif /* __UIActionPool_h__ */
     227
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp

    r41695 r42526  
    4343const char* UIDefs::GUI_SelectorVMPositions = "GUI/SelectorVMPositions";
    4444const char* UIDefs::GUI_LastVMSelected = "GUI/LastVMSelected";
     45const char* UIDefs::GUI_LastItemSelected = "GUI/LastItemSelected";
     46const char* UIDefs::GUI_GroupDefinitions = "GUI/GroupDefinitions";
    4547
    4648/* Machine-window definitions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h

    r41819 r42526  
    120120    extern const char* GUI_SelectorVMPositions;
    121121    extern const char* GUI_LastVMSelected;
     122    extern const char* GUI_LastItemSelected;
     123    extern const char* GUI_GroupDefinitions;
    122124
    123125    /* Machine-window declarations: */
     
    229231Q_DECLARE_METATYPE(StorageSlot);
    230232
     233/* Details element type: */
     234enum DetailsElementType
     235{
     236    DetailsElementType_General,
     237    DetailsElementType_System,
     238    DetailsElementType_Preview,
     239    DetailsElementType_Display,
     240    DetailsElementType_Storage,
     241    DetailsElementType_Audio,
     242    DetailsElementType_Network,
     243    DetailsElementType_Serial,
     244#ifdef VBOX_WITH_PARALLEL_PORTS
     245    DetailsElementType_Parallel,
     246#endif /* VBOX_WITH_PARALLEL_PORTS */
     247    DetailsElementType_USB,
     248    DetailsElementType_SF,
     249    DetailsElementType_Description
     250};
     251Q_DECLARE_METATYPE(DetailsElementType);
     252
    231253#endif // __UIDefs_h__
    232254
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r42261 r42526  
    12451245}
    12461246
     1247int UIMessageCenter::confirmMachineItemRemoval(const QStringList &names)
     1248{
     1249    return message(&vboxGlobal().selectorWnd(),
     1250                   Question,
     1251                   tr("<p>You are about to remove following virtual "
     1252                      "machine items from the machine list:</p>"
     1253                      "<p><b>%1</b></p>"
     1254                      "<p>Do you wish to proceed?</p>").arg(names.join(", ")),
     1255                   0, /* auto-confirm id */
     1256                   QIMessageBox::Ok,
     1257                   QIMessageBox::Cancel | QIMessageBox::Escape | QIMessageBox::Default,
     1258                   0,
     1259                   tr("Remove"));
     1260}
     1261
    12471262int UIMessageCenter::confirmMachineDeletion(const QList<CMachine> &machines)
    12481263{
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h

    r41615 r42526  
    255255    int cannotEnterSeamlessMode();
    256256
     257    int confirmMachineItemRemoval(const QStringList &names);
    257258    int confirmMachineDeletion(const QList<CMachine> &machines);
    258259    bool confirmDiscardSavedState(const CMachine &machine);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r42382 r42526  
    11091109 *       @todo in UIMedium::details()).
    11101110 */
    1111 QString VBoxGlobal::details (const CMedium &aMedium, bool aPredictDiff)
     1111QString VBoxGlobal::details (const CMedium &aMedium, bool aPredictDiff, bool fUseHtml /* = true */)
    11121112{
    11131113    CMedium cmedium (aMedium);
     
    11231123    }
    11241124
    1125     return medium.detailsHTML (true /* aNoDiffs */, aPredictDiff);
     1125    return fUseHtml ? medium.detailsHTML (true /* aNoDiffs */, aPredictDiff) :
     1126                      medium.details(true /* aNoDiffs */, aPredictDiff);
    11261127}
    11271128
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r42382 r42526  
    224224    /* details generators */
    225225
    226     QString details (const CMedium &aHD, bool aPredictDiff);
     226    QString details (const CMedium &aHD, bool aPredictDiff, bool fUseHtml = true);
    227227
    228228    QString details (const CUSBDevice &aDevice) const;
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDefs.h

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManagerDialog.h

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.h

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.cpp

  • trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.h

  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r40537 r42526  
    2323#include "VBoxGlobal.h"
    2424
    25 class MenuMachineAction : public UIMenuAction
     25class MenuMachineAction : public UIActionMenu
    2626{
    2727    Q_OBJECT;
     
    3030
    3131    MenuMachineAction(QObject *pParent)
    32         : UIMenuAction(pParent)
     32        : UIActionMenu(pParent)
    3333    {
    3434        retranslateUi();
     
    4343};
    4444
    45 class ShowSettingsDialogAction : public UISimpleAction
     45class ShowSettingsDialogAction : public UIActionSimple
    4646{
    4747    Q_OBJECT;
     
    5050
    5151    ShowSettingsDialogAction(QObject *pParent)
    52         : UISimpleAction(pParent, ":/settings_16px.png", ":/settings_dis_16px.png")
     52        : UIActionSimple(pParent, ":/settings_16px.png", ":/settings_dis_16px.png")
    5353    {
    5454        retranslateUi();
     
    6464};
    6565
    66 class PerformTakeSnapshotAction : public UISimpleAction
     66class PerformTakeSnapshotAction : public UIActionSimple
    6767{
    6868    Q_OBJECT;
     
    7171
    7272    PerformTakeSnapshotAction(QObject *pParent)
    73         : UISimpleAction(pParent, ":/take_snapshot_16px.png", ":/take_snapshot_dis_16px.png")
     73        : UIActionSimple(pParent, ":/take_snapshot_16px.png", ":/take_snapshot_dis_16px.png")
    7474    {
    7575        retranslateUi();
     
    8585};
    8686
    87 class PerformTakeScreenshotAction : public UISimpleAction
     87class PerformTakeScreenshotAction : public UIActionSimple
    8888{
    8989    Q_OBJECT;
     
    9292
    9393    PerformTakeScreenshotAction(QObject *pParent)
    94         : UISimpleAction(pParent, ":/take_screenshot_16px.png", ":/take_screenshot_disabled_16px.png")
     94        : UIActionSimple(pParent, ":/take_screenshot_16px.png", ":/take_screenshot_disabled_16px.png")
    9595    {
    9696        retranslateUi();
     
    106106};
    107107
    108 class ShowInformationDialogAction : public UISimpleAction
     108class ShowInformationDialogAction : public UIActionSimple
    109109{
    110110    Q_OBJECT;
     
    113113
    114114    ShowInformationDialogAction(QObject *pParent)
    115         : UISimpleAction(pParent, ":/session_info_16px.png", ":/session_info_disabled_16px.png")
     115        : UIActionSimple(pParent, ":/session_info_16px.png", ":/session_info_disabled_16px.png")
    116116    {
    117117        retranslateUi();
     
    127127};
    128128
    129 class MenuMouseIntegrationAction : public UIMenuAction
     129class MenuMouseIntegrationAction : public UIActionMenu
    130130{
    131131    Q_OBJECT;
     
    134134
    135135    MenuMouseIntegrationAction(QObject *pParent)
    136         : UIMenuAction(pParent)
     136        : UIActionMenu(pParent)
    137137    {
    138138        retranslateUi();
     
    144144};
    145145
    146 class ToggleMouseIntegrationAction : public UIToggleAction
     146class ToggleMouseIntegrationAction : public UIActionToggle
    147147{
    148148    Q_OBJECT;
     
    151151
    152152    ToggleMouseIntegrationAction(QObject *pParent)
    153         : UIToggleAction(pParent,
     153        : UIActionToggle(pParent,
    154154                         ":/mouse_can_seamless_on_16px.png", ":/mouse_can_seamless_16px.png",
    155155                         ":/mouse_can_seamless_on_disabled_16px.png", ":/mouse_can_seamless_disabled_16px.png")
     
    167167};
    168168
    169 class PerformTypeCADAction : public UISimpleAction
     169class PerformTypeCADAction : public UIActionSimple
    170170{
    171171    Q_OBJECT;
     
    174174
    175175    PerformTypeCADAction(QObject *pParent)
    176         : UISimpleAction(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png")
     176        : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png")
    177177    {
    178178        retranslateUi();
     
    189189
    190190#ifdef Q_WS_X11
    191 class PerformTypeCABSAction : public UISimpleAction
     191class PerformTypeCABSAction : public UIActionSimple
    192192{
    193193    Q_OBJECT;
     
    196196
    197197    PerformTypeCABSAction(QObject *pParent)
    198         : UISimpleAction(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png")
     198        : UIActionSimple(pParent, ":/hostkey_16px.png", ":/hostkey_disabled_16px.png")
    199199    {
    200200        retranslateUi();
     
    211211#endif /* Q_WS_X11 */
    212212
    213 class TogglePauseAction : public UIToggleAction
     213class TogglePauseAction : public UIActionToggle
    214214{
    215215    Q_OBJECT;
     
    218218
    219219    TogglePauseAction(QObject *pParent)
    220         : UIToggleAction(pParent, ":/pause_16px.png", ":/pause_disabled_16px.png")
     220        : UIActionToggle(pParent, ":/pause_16px.png", ":/pause_disabled_16px.png")
    221221    {
    222222        retranslateUi();
     
    232232};
    233233
    234 class PerformResetAction : public UISimpleAction
     234class PerformResetAction : public UIActionSimple
    235235{
    236236    Q_OBJECT;
     
    239239
    240240    PerformResetAction(QObject *pParent)
    241         : UISimpleAction(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")
     241        : UIActionSimple(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")
    242242    {
    243243        retranslateUi();
     
    253253};
    254254
    255 class PerformShutdownAction : public UISimpleAction
     255class PerformShutdownAction : public UIActionSimple
    256256{
    257257    Q_OBJECT;
     
    260260
    261261    PerformShutdownAction(QObject *pParent)
    262         : UISimpleAction(pParent, ":/acpi_16px.png", ":/acpi_disabled_16px.png")
     262        : UIActionSimple(pParent, ":/acpi_16px.png", ":/acpi_disabled_16px.png")
    263263    {
    264264        retranslateUi();
     
    274274};
    275275
    276 class PerformCloseAction : public UISimpleAction
     276class PerformCloseAction : public UIActionSimple
    277277{
    278278    Q_OBJECT;
     
    281281
    282282    PerformCloseAction(QObject *pParent)
    283         : UISimpleAction(pParent, ":/exit_16px.png")
     283        : UIActionSimple(pParent, ":/exit_16px.png")
    284284    {
    285285        setMenuRole(QAction::QuitRole);
     
    296296};
    297297
    298 class MenuViewAction : public UIMenuAction
     298class MenuViewAction : public UIActionMenu
    299299{
    300300    Q_OBJECT;
     
    303303
    304304    MenuViewAction(QObject *pParent)
    305         : UIMenuAction(pParent)
     305        : UIActionMenu(pParent)
    306306    {
    307307        retranslateUi();
     
    316316};
    317317
    318 class ToggleFullscreenModeAction : public UIToggleAction
     318class ToggleFullscreenModeAction : public UIActionToggle
    319319{
    320320    Q_OBJECT;
     
    323323
    324324    ToggleFullscreenModeAction(QObject *pParent)
    325         : UIToggleAction(pParent,
     325        : UIActionToggle(pParent,
    326326                         ":/fullscreen_on_16px.png", ":/fullscreen_16px.png",
    327327                         ":/fullscreen_on_disabled_16px.png", ":/fullscreen_disabled_16px.png")
     
    339339};
    340340
    341 class ToggleSeamlessModeAction : public UIToggleAction
     341class ToggleSeamlessModeAction : public UIActionToggle
    342342{
    343343    Q_OBJECT;
     
    346346
    347347    ToggleSeamlessModeAction(QObject *pParent)
    348         : UIToggleAction(pParent,
     348        : UIActionToggle(pParent,
    349349                         ":/seamless_on_16px.png", ":/seamless_16px.png",
    350350                         ":/seamless_on_disabled_16px.png", ":/seamless_disabled_16px.png")
     
    362362};
    363363
    364 class ToggleScaleModeAction : public UIToggleAction
     364class ToggleScaleModeAction : public UIActionToggle
    365365{
    366366    Q_OBJECT;
     
    369369
    370370    ToggleScaleModeAction(QObject *pParent)
    371         : UIToggleAction(pParent,
     371        : UIActionToggle(pParent,
    372372                         ":/scale_on_16px.png", ":/scale_16px.png",
    373373                         ":/scale_on_disabled_16px.png", ":/scale_disabled_16px.png")
     
    385385};
    386386
    387 class ToggleGuestAutoresizeAction : public UIToggleAction
     387class ToggleGuestAutoresizeAction : public UIActionToggle
    388388{
    389389    Q_OBJECT;
     
    392392
    393393    ToggleGuestAutoresizeAction(QObject *pParent)
    394         : UIToggleAction(pParent,
     394        : UIActionToggle(pParent,
    395395                         ":/auto_resize_on_on_16px.png", ":/auto_resize_on_16px.png",
    396396                         ":/auto_resize_on_on_disabled_16px.png", ":/auto_resize_on_disabled_16px.png")
     
    408408};
    409409
    410 class PerformWindowAdjustAction : public UISimpleAction
     410class PerformWindowAdjustAction : public UIActionSimple
    411411{
    412412    Q_OBJECT;
     
    415415
    416416    PerformWindowAdjustAction(QObject *pParent)
    417         : UISimpleAction(pParent, ":/adjust_win_size_16px.png", ":/adjust_win_size_disabled_16px.png")
     417        : UIActionSimple(pParent, ":/adjust_win_size_16px.png", ":/adjust_win_size_disabled_16px.png")
    418418    {
    419419        retranslateUi();
     
    429429};
    430430
    431 class MenuDevicesAction : public UIMenuAction
     431class MenuDevicesAction : public UIActionMenu
    432432{
    433433    Q_OBJECT;
     
    436436
    437437    MenuDevicesAction(QObject *pParent)
    438         : UIMenuAction(pParent)
     438        : UIActionMenu(pParent)
    439439    {
    440440        retranslateUi();
     
    449449};
    450450
    451 class MenuOpticalDevicesAction : public UIMenuAction
     451class MenuOpticalDevicesAction : public UIActionMenu
    452452{
    453453    Q_OBJECT;
     
    456456
    457457    MenuOpticalDevicesAction(QObject *pParent)
    458         : UIMenuAction(pParent, ":/cd_16px.png", ":/cd_disabled_16px.png")
    459     {
    460         qobject_cast<UIMenuInterface*>(menu())->setShowToolTips(true);
     458        : UIActionMenu(pParent, ":/cd_16px.png", ":/cd_disabled_16px.png")
     459    {
     460        qobject_cast<UIMenu*>(menu())->setShowToolTips(true);
    461461        retranslateUi();
    462462    }
     
    470470};
    471471
    472 class MenuFloppyDevicesAction : public UIMenuAction
     472class MenuFloppyDevicesAction : public UIActionMenu
    473473{
    474474    Q_OBJECT;
     
    477477
    478478    MenuFloppyDevicesAction(QObject *pParent)
    479         : UIMenuAction(pParent, ":/fd_16px.png", ":/fd_disabled_16px.png")
    480     {
    481         qobject_cast<UIMenuInterface*>(menu())->setShowToolTips(true);
     479        : UIActionMenu(pParent, ":/fd_16px.png", ":/fd_disabled_16px.png")
     480    {
     481        qobject_cast<UIMenu*>(menu())->setShowToolTips(true);
    482482        retranslateUi();
    483483    }
     
    491491};
    492492
    493 class MenuUSBDevicesAction : public UIMenuAction
     493class MenuUSBDevicesAction : public UIActionMenu
    494494{
    495495    Q_OBJECT;
     
    498498
    499499    MenuUSBDevicesAction(QObject *pParent)
    500         : UIMenuAction(pParent, ":/usb_16px.png", ":/usb_disabled_16px.png")
    501     {
    502         qobject_cast<UIMenuInterface*>(menu())->setShowToolTips(true);
     500        : UIActionMenu(pParent, ":/usb_16px.png", ":/usb_disabled_16px.png")
     501    {
     502        qobject_cast<UIMenu*>(menu())->setShowToolTips(true);
    503503        retranslateUi();
    504504    }
     
    512512};
    513513
    514 class MenuNetworkAdaptersAction : public UIMenuAction
     514class MenuNetworkAdaptersAction : public UIActionMenu
    515515{
    516516    Q_OBJECT;
     
    519519
    520520    MenuNetworkAdaptersAction(QObject *pParent)
    521         : UIMenuAction(pParent)
     521        : UIActionMenu(pParent)
    522522    {
    523523        retranslateUi();
     
    529529};
    530530
    531 class ShowNetworkAdaptersDialogAction : public UISimpleAction
     531class ShowNetworkAdaptersDialogAction : public UIActionSimple
    532532{
    533533    Q_OBJECT;
     
    536536
    537537    ShowNetworkAdaptersDialogAction(QObject *pParent)
    538         : UISimpleAction(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
     538        : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
    539539    {
    540540        retranslateUi();
     
    550550};
    551551
    552 class MenuSharedFoldersAction : public UIMenuAction
     552class MenuSharedFoldersAction : public UIActionMenu
    553553{
    554554    Q_OBJECT;
     
    557557
    558558    MenuSharedFoldersAction(QObject *pParent)
    559         : UIMenuAction(pParent)
     559        : UIActionMenu(pParent)
    560560    {
    561561        retranslateUi();
     
    567567};
    568568
    569 class ShowSharedFoldersDialogAction : public UISimpleAction
     569class ShowSharedFoldersDialogAction : public UIActionSimple
    570570{
    571571    Q_OBJECT;
     
    574574
    575575    ShowSharedFoldersDialogAction(QObject *pParent)
    576         : UISimpleAction(pParent, ":/shared_folder_16px.png", ":/shared_folder_disabled_16px.png")
     576        : UIActionSimple(pParent, ":/shared_folder_16px.png", ":/shared_folder_disabled_16px.png")
    577577    {
    578578        retranslateUi();
     
    588588};
    589589
    590 class ToggleVRDEServerAction : public UIToggleAction
     590class ToggleVRDEServerAction : public UIActionToggle
    591591{
    592592    Q_OBJECT;
     
    595595
    596596    ToggleVRDEServerAction(QObject *pParent)
    597         : UIToggleAction(pParent,
     597        : UIActionToggle(pParent,
    598598                         ":/vrdp_on_16px.png", ":/vrdp_16px.png",
    599599                         ":/vrdp_on_disabled_16px.png", ":/vrdp_disabled_16px.png")
     
    611611};
    612612
    613 class PerformInstallGuestToolsAction : public UISimpleAction
     613class PerformInstallGuestToolsAction : public UIActionSimple
    614614{
    615615    Q_OBJECT;
     
    618618
    619619    PerformInstallGuestToolsAction(QObject *pParent)
    620         : UISimpleAction(pParent, ":/guesttools_16px.png", ":/guesttools_disabled_16px.png")
     620        : UIActionSimple(pParent, ":/guesttools_16px.png", ":/guesttools_disabled_16px.png")
    621621    {
    622622        retranslateUi();
     
    633633
    634634#ifdef VBOX_WITH_DEBUGGER_GUI
    635 class MenuDebugAction : public UIMenuAction
     635class MenuDebugAction : public UIActionMenu
    636636{
    637637    Q_OBJECT;
     
    640640
    641641    MenuDebugAction(QObject *pParent)
    642         : UIMenuAction(pParent)
     642        : UIActionMenu(pParent)
    643643    {
    644644        retranslateUi();
     
    653653};
    654654
    655 class ShowStatisticsAction : public UISimpleAction
     655class ShowStatisticsAction : public UIActionSimple
    656656{
    657657    Q_OBJECT;
     
    660660
    661661    ShowStatisticsAction(QObject *pParent)
    662         : UISimpleAction(pParent)
     662        : UIActionSimple(pParent)
    663663    {
    664664        retranslateUi();
     
    673673};
    674674
    675 class ShowCommandLineAction : public UISimpleAction
     675class ShowCommandLineAction : public UIActionSimple
    676676{
    677677    Q_OBJECT;
     
    680680
    681681    ShowCommandLineAction(QObject *pParent)
    682         : UISimpleAction(pParent)
     682        : UIActionSimple(pParent)
    683683    {
    684684        retranslateUi();
     
    693693};
    694694
    695 class ToggleLoggingAction : public UIToggleAction
     695class ToggleLoggingAction : public UIActionToggle
    696696{
    697697    Q_OBJECT;
     
    700700
    701701    ToggleLoggingAction(QObject *pParent)
    702         : UIToggleAction(pParent)
     702        : UIActionToggle(pParent)
    703703    {
    704704        retranslateUi();
     
    715715
    716716#ifdef RT_OS_DARWIN
    717 class DockMenuAction : public UIMenuAction
     717class DockMenuAction : public UIActionMenu
    718718{
    719719    Q_OBJECT;
     
    722722
    723723    DockMenuAction(QObject *pParent)
    724         : UIMenuAction(pParent)
     724        : UIActionMenu(pParent)
    725725    {
    726726        retranslateUi();
     
    732732};
    733733
    734 class DockSettingsMenuAction : public UIMenuAction
     734class DockSettingsMenuAction : public UIActionMenu
    735735{
    736736    Q_OBJECT;
     
    739739
    740740    DockSettingsMenuAction(QObject *pParent)
    741         : UIMenuAction(pParent)
     741        : UIActionMenu(pParent)
    742742    {
    743743        retranslateUi();
     
    752752};
    753753
    754 class ToggleDockPreviewMonitorAction : public UIToggleAction
     754class ToggleDockPreviewMonitorAction : public UIActionToggle
    755755{
    756756    Q_OBJECT;
     
    759759
    760760    ToggleDockPreviewMonitorAction(QObject *pParent)
    761         : UIToggleAction(pParent)
     761        : UIActionToggle(pParent)
    762762    {
    763763        retranslateUi();
     
    772772};
    773773
    774 class ToggleDockDisableMonitorAction : public UIToggleAction
     774class ToggleDockDisableMonitorAction : public UIActionToggle
    775775{
    776776    Q_OBJECT;
     
    779779
    780780    ToggleDockDisableMonitorAction(QObject *pParent)
    781         : UIToggleAction(pParent)
     781        : UIActionToggle(pParent)
    782782    {
    783783        retranslateUi();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r41819 r42526  
    11091109
    11101110    /* Open VM settings : Shared folders page: */
    1111     sltOpenVMSettingsDialog("#sfolders");
     1111    sltOpenVMSettingsDialog("#sharedFolders");
    11121112}
    11131113
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp

    r41610 r42526  
    3939/* Helper QMenu reimplementation which allows
    4040 * to highlight first menu item for popped up menu: */
    41 class UIMenu : public QMenu
     41class QIMenu : public QMenu
    4242{
    4343    Q_OBJECT;
     
    4545public:
    4646
    47     UIMenu() : QMenu(0) {}
     47    QIMenu() : QMenu(0) {}
    4848
    4949private slots:
     
    108108{
    109109    /* Create empty menu: */
    110     QMenu *pMenu = new UIMenu;
     110    QMenu *pMenu = new QIMenu;
    111111
    112112    /* Fill menu with prepared items: */
     
    269269
    270270    /* Help submenu: */
    271     pMenu->addAction(gActionPool->action(UIActionIndex_Simple_Help));
    272     pMenu->addAction(gActionPool->action(UIActionIndex_Simple_Web));
     271    pMenu->addAction(gActionPool->action(UIActionIndex_Simple_Contents));
     272    pMenu->addAction(gActionPool->action(UIActionIndex_Simple_WebSite));
    273273    pMenu->addSeparator();
    274274    pMenu->addAction(gActionPool->action(UIActionIndex_Simple_ResetWarnings));
     
    300300#endif
    301301
    302     VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_Help), SIGNAL(triggered()),
     302    VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_Contents), SIGNAL(triggered()),
    303303                        &msgCenter(), SLOT(sltShowHelpHelpDialog()));
    304     VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_Web), SIGNAL(triggered()),
     304    VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_WebSite), SIGNAL(triggered()),
    305305                        &msgCenter(), SLOT(sltShowHelpWebDialog()));
    306306    VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_ResetWarnings), SIGNAL(triggered()),
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp

    r41047 r42526  
    77
    88/*
    9  * Copyright (C) 2010-2011 Oracle Corporation
     9 * Copyright (C) 2010-2012 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2222#include "UISelectorShortcuts.h"
    2323
    24 class UIMenuActionFile : public UIMenuAction
    25 {
    26     Q_OBJECT;
    27 
    28 public:
    29 
    30     UIMenuActionFile(QObject *pParent)
    31         : UIMenuAction(pParent)
     24class UIActionMenuFile : public UIActionMenu
     25{
     26    Q_OBJECT;
     27
     28public:
     29
     30    UIActionMenuFile(QObject *pParent)
     31        : UIActionMenu(pParent)
    3232    {
    3333        retranslateUi();
     
    4646};
    4747
    48 class UISimpleActionMediumManagerDialog : public UISimpleAction
    49 {
    50     Q_OBJECT;
    51 
    52 public:
    53 
    54     UISimpleActionMediumManagerDialog(QObject *pParent)
    55         : UISimpleAction(pParent, ":/diskimage_16px.png")
     48class UIActionSimpleMediumManagerDialog : public UIActionSimple
     49{
     50    Q_OBJECT;
     51
     52public:
     53
     54    UIActionSimpleMediumManagerDialog(QObject *pParent)
     55        : UIActionSimple(pParent, ":/diskimage_16px.png")
    5656    {
    5757        retranslateUi();
     
    6868};
    6969
    70 class UISimpleActionImportApplianceWizard : public UISimpleAction
    71 {
    72     Q_OBJECT;
    73 
    74 public:
    75 
    76     UISimpleActionImportApplianceWizard(QObject *pParent)
    77         : UISimpleAction(pParent, ":/import_16px.png")
     70class UIActionSimpleImportApplianceWizard : public UIActionSimple
     71{
     72    Q_OBJECT;
     73
     74public:
     75
     76    UIActionSimpleImportApplianceWizard(QObject *pParent)
     77        : UIActionSimple(pParent, ":/import_16px.png")
    7878    {
    7979        retranslateUi();
     
    9090};
    9191
    92 class UISimpleActionExportApplianceWizard : public UISimpleAction
    93 {
    94     Q_OBJECT;
    95 
    96 public:
    97 
    98     UISimpleActionExportApplianceWizard(QObject *pParent)
    99         : UISimpleAction(pParent, ":/export_16px.png")
     92class UIActionSimpleExportApplianceWizard : public UIActionSimple
     93{
     94    Q_OBJECT;
     95
     96public:
     97
     98    UIActionSimpleExportApplianceWizard(QObject *pParent)
     99        : UIActionSimple(pParent, ":/export_16px.png")
    100100    {
    101101        retranslateUi();
     
    112112};
    113113
    114 class UISimpleActionPreferencesDialog : public UISimpleAction
    115 {
    116     Q_OBJECT;
    117 
    118 public:
    119 
    120     UISimpleActionPreferencesDialog(QObject *pParent)
    121         : UISimpleAction(pParent, ":/global_settings_16px.png")
     114class UIActionSimplePreferencesDialog : public UIActionSimple
     115{
     116    Q_OBJECT;
     117
     118public:
     119
     120    UIActionSimplePreferencesDialog(QObject *pParent)
     121        : UIActionSimple(pParent, ":/global_settings_16px.png")
    122122    {
    123123        setMenuRole(QAction::PreferencesRole);
     
    135135};
    136136
    137 class UISimpleActionExit : public UISimpleAction
    138 {
    139     Q_OBJECT;
    140 
    141 public:
    142 
    143     UISimpleActionExit(QObject *pParent)
    144         : UISimpleAction(pParent, ":/exit_16px.png")
     137class UIActionSimpleExit : public UIActionSimple
     138{
     139    Q_OBJECT;
     140
     141public:
     142
     143    UIActionSimpleExit(QObject *pParent)
     144        : UIActionSimple(pParent, ":/exit_16px.png")
    145145    {
    146146        setMenuRole(QAction::QuitRole);
     
    158158};
    159159
    160 class UIMenuActionMachine : public UIMenuAction
    161 {
    162     Q_OBJECT;
    163 
    164 public:
    165 
    166     UIMenuActionMachine(QObject *pParent)
    167         : UIMenuAction(pParent)
    168     {
    169         retranslateUi();
    170     }
    171 
    172 protected:
    173 
    174     void retranslateUi()
    175     {
    176         menu()->setTitle(QApplication::translate("UIActionPool", "&Machine"));
    177     }
    178 };
    179 
    180 class UISimpleActionNewWizard : public UISimpleAction
    181 {
    182     Q_OBJECT;
    183 
    184 public:
    185 
    186     UISimpleActionNewWizard(QObject *pParent)
    187         : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/new_16px.png")
    188     {
    189         retranslateUi();
    190     }
    191 
    192 protected:
    193 
    194     void retranslateUi()
    195     {
    196         setText(QApplication::translate("UIActionPool", "&New..."));
     160
     161class UIActionMenuGroup : public UIActionMenu
     162{
     163    Q_OBJECT;
     164
     165public:
     166
     167    UIActionMenuGroup(QObject *pParent)
     168        : UIActionMenu(pParent)
     169    {
     170        retranslateUi();
     171    }
     172
     173protected:
     174
     175    void retranslateUi()
     176    {
     177        menu()->setTitle(QApplication::translate("UIActionPool", "&Group"));
     178    }
     179};
     180
     181class UIActionSimpleGroupNewWizard : public UIActionSimple
     182{
     183    Q_OBJECT;
     184
     185public:
     186
     187    UIActionSimpleGroupNewWizard(QObject *pParent)
     188        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/new_16px.png")
     189    {
     190        retranslateUi();
     191    }
     192
     193protected:
     194
     195    void retranslateUi()
     196    {
     197        setText(QApplication::translate("UIActionPool", "&New machine..."));
    197198        setStatusTip(QApplication::translate("UIActionPool", "Create a new virtual machine"));
    198199        setShortcut(gSS->keySequence(UISelectorShortcuts::NewVMShortcut));
     
    202203};
    203204
    204 class UISimpleActionAddDialog : public UISimpleAction
    205 {
    206     Q_OBJECT;
    207 
    208 public:
    209 
    210     UISimpleActionAddDialog(QObject *pParent)
    211         : UISimpleAction(pParent, ":/vm_add_16px.png")
    212     {
    213         retranslateUi();
    214     }
    215 
    216 protected:
    217 
    218     void retranslateUi()
    219     {
    220         setText(QApplication::translate("UIActionPool", "&Add..."));
     205class UIActionSimpleGroupAddDialog : public UIActionSimple
     206{
     207    Q_OBJECT;
     208
     209public:
     210
     211    UIActionSimpleGroupAddDialog(QObject *pParent)
     212        : UIActionSimple(pParent, ":/vm_add_16px.png")
     213    {
     214        retranslateUi();
     215    }
     216
     217protected:
     218
     219    void retranslateUi()
     220    {
     221        setText(QApplication::translate("UIActionPool", "&Add machine..."));
    221222        setStatusTip(QApplication::translate("UIActionPool", "Add an existing virtual machine"));
    222223        setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMShortcut));
     
    224225};
    225226
    226 class UISimpleActionSettingsDialog : public UISimpleAction
    227 {
    228     Q_OBJECT;
    229 
    230 public:
    231 
    232     UISimpleActionSettingsDialog(QObject *pParent)
    233         : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16),
    234                          ":/vm_settings_32px.png", ":/settings_16px.png",
    235                          ":/vm_settings_disabled_32px.png", ":/settings_dis_16px.png")
    236     {
    237         retranslateUi();
    238     }
    239 
    240 protected:
    241 
    242     void retranslateUi()
    243     {
    244         setText(QApplication::translate("UIActionPool", "&Settings..."));
    245         setStatusTip(QApplication::translate("UIActionPool", "Manage the virtual machine settings"));
    246         setShortcut(gSS->keySequence(UISelectorShortcuts::SettingsVMShortcut));
    247         setToolTip(text().remove('&').remove('.') +
    248                    (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
    249     }
    250 };
    251 
    252 class UISimpleActionCloneWizard : public UISimpleAction
    253 {
    254     Q_OBJECT;
    255 
    256 public:
    257 
    258     UISimpleActionCloneWizard(QObject *pParent)
    259         : UISimpleAction(pParent, ":/vm_clone_16px.png", ":/vm_clone_disabled_16px.png")
    260     {
    261         retranslateUi();
    262     }
    263 
    264 protected:
    265 
    266     void retranslateUi()
    267     {
    268         setText(QApplication::translate("UIActionPool", "Cl&one..."));
    269         setStatusTip(QApplication::translate("UIActionPool", "Clone the selected virtual machine"));
    270         setShortcut(gSS->keySequence(UISelectorShortcuts::CloneVMShortcut));
    271     }
    272 };
    273 
    274 class UISimpleActionRemoveDialog : public UISimpleAction
    275 {
    276     Q_OBJECT;
    277 
    278 public:
    279 
    280     UISimpleActionRemoveDialog(QObject *pParent)
    281         : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16),
     227class UIActionSimpleGroupRenameDialog : public UIActionSimple
     228{
     229    Q_OBJECT;
     230
     231public:
     232
     233    UIActionSimpleGroupRenameDialog(QObject *pParent)
     234        : UIActionSimple(pParent, ":/name_16px.png")
     235    {
     236        retranslateUi();
     237    }
     238
     239protected:
     240
     241    void retranslateUi()
     242    {
     243        setText(QApplication::translate("UIActionPool", "Rena&me group..."));
     244        setStatusTip(QApplication::translate("UIActionPool", "Rename the selected virtual machine group"));
     245        setShortcut(gSS->keySequence(UISelectorShortcuts::RenameVMGroupShortcut));
     246    }
     247};
     248
     249class UIActionSimpleGroupRemoveDialog : public UIActionSimple
     250{
     251    Q_OBJECT;
     252
     253public:
     254
     255    UIActionSimpleGroupRemoveDialog(QObject *pParent)
     256        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    282257                         ":/vm_delete_32px.png", ":/delete_16px.png",
    283258                         ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png")
     
    290265    void retranslateUi()
    291266    {
    292         setText(QApplication::translate("UIActionPool", "&Remove"));
    293         setStatusTip(QApplication::translate("UIActionPool", "Remove the selected virtual machine"));
     267        setText(QApplication::translate("UIActionPool", "&Remove group..."));
     268        setStatusTip(QApplication::translate("UIActionPool", "Remove the selected virtual machine group"));
    294269        setShortcut(gSS->keySequence(UISelectorShortcuts::RemoveVMShortcut));
    295270    }
    296271};
    297272
    298 class UIStateActionStartOrShow : public UIStateAction
    299 {
    300     Q_OBJECT;
    301 
    302 public:
    303 
    304     UIStateActionStartOrShow(QObject *pParent)
    305         : UIStateAction(pParent, QSize(32, 32), QSize(16, 16),
     273class UIActionStateGroupStartOrShow : public UIActionState
     274{
     275    Q_OBJECT;
     276
     277public:
     278
     279    UIActionStateGroupStartOrShow(QObject *pParent)
     280        : UIActionState(pParent, QSize(32, 32), QSize(16, 16),
    306281                         ":/vm_start_32px.png", ":/start_16px.png",
    307282                         ":/vm_start_disabled_32px.png", ":/start_dis_16px.png")
     
    340315};
    341316
    342 class UISimpleActionDiscard : public UISimpleAction
    343 {
    344     Q_OBJECT;
    345 
    346 public:
    347 
    348     UISimpleActionDiscard(QObject *pParent)
    349         : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16),
    350                          ":/vm_discard_32px.png", ":/discard_16px.png",
    351                          ":/vm_discard_disabled_32px.png", ":/discard_dis_16px.png")
    352     {
    353         retranslateUi();
    354     }
    355 
    356 protected:
    357 
    358     void retranslateUi()
    359     {
    360         setIconText(QApplication::translate("UIActionPool", "Discard"));
    361         setText(QApplication::translate("UIActionPool", "D&iscard Saved State"));
    362         setStatusTip(QApplication::translate("UIActionPool", "Discard the saved state of the selected virtual machine"));
    363         setShortcut(gSS->keySequence(UISelectorShortcuts::DiscardVMShortcut));
    364         setToolTip(text().remove('&').remove('.') +
    365                    (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
    366     }
    367 };
    368 
    369 class UIToggleActionPauseAndResume : public UIToggleAction
    370 {
    371     Q_OBJECT;
    372 
    373 public:
    374 
    375     UIToggleActionPauseAndResume(QObject *pParent)
    376         : UIToggleAction(pParent, QSize(32, 32), QSize(16, 16),
     317class UIActionToggleGroupPauseAndResume : public UIActionToggle
     318{
     319    Q_OBJECT;
     320
     321public:
     322
     323    UIActionToggleGroupPauseAndResume(QObject *pParent)
     324        : UIActionToggle(pParent, QSize(32, 32), QSize(16, 16),
    377325                         ":/vm_pause_32px.png", ":/pause_16px.png",
    378326                         ":/vm_pause_disabled_32px.png", ":/pause_disabled_16px.png")
     
    391339};
    392340
    393 class UISimpleActionReset : public UISimpleAction
    394 {
    395     Q_OBJECT;
    396 
    397 public:
    398 
    399     UISimpleActionReset(QObject *pParent)
    400         : UISimpleAction(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")
     341class UIActionSimpleGroupReset : public UIActionSimple
     342{
     343    Q_OBJECT;
     344
     345public:
     346
     347    UIActionSimpleGroupReset(QObject *pParent)
     348        : UIActionSimple(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")
    401349    {
    402350        retranslateUi();
     
    413361};
    414362
    415 class UISimpleActionRefresh : public UISimpleAction
    416 {
    417     Q_OBJECT;
    418 
    419 public:
    420 
    421     UISimpleActionRefresh(QObject *pParent)
    422         : UISimpleAction(pParent, QSize(32, 32), QSize(16, 16),
     363class UIActionSimpleGroupRefresh : public UIActionSimple
     364{
     365    Q_OBJECT;
     366
     367public:
     368
     369    UIActionSimpleGroupRefresh(QObject *pParent)
     370        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
    423371                         ":/refresh_32px.png", ":/refresh_16px.png",
    424372                         ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
     
    431379    void retranslateUi()
    432380    {
    433         setText(QApplication::translate("UIActionPool", "Re&fresh"));
     381        setText(QApplication::translate("UIActionPool", "Re&fresh..."));
    434382        setStatusTip(QApplication::translate("UIActionPool", "Refresh the accessibility state of the selected virtual machine"));
    435383        setShortcut(gSS->keySequence(UISelectorShortcuts::RefreshVMShortcut));
     
    437385};
    438386
    439 class UISimpleActionShowInFileManager : public UISimpleAction
    440 {
    441     Q_OBJECT;
    442 
    443 public:
    444 
    445     UISimpleActionShowInFileManager(QObject *pParent)
    446         : UISimpleAction(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
     387class UIActionSimpleGroupShowInFileManager : public UIActionSimple
     388{
     389    Q_OBJECT;
     390
     391public:
     392
     393    UIActionSimpleGroupShowInFileManager(QObject *pParent)
     394        : UIActionSimple(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
    447395    {
    448396        retranslateUi();
     
    467415};
    468416
    469 class UISimpleActionCreateShortcut : public UISimpleAction
    470 {
    471     Q_OBJECT;
    472 
    473 public:
    474 
    475     UISimpleActionCreateShortcut(QObject *pParent)
    476         : UISimpleAction(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png")
     417class UIActionSimpleGroupCreateShortcut : public UIActionSimple
     418{
     419    Q_OBJECT;
     420
     421public:
     422
     423    UIActionSimpleGroupCreateShortcut(QObject *pParent)
     424        : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png")
    477425    {
    478426        retranslateUi();
     
    494442};
    495443
    496 class UISimpleActionSort : public UISimpleAction
    497 {
    498     Q_OBJECT;
    499 
    500 public:
    501 
    502     UISimpleActionSort(QObject *pParent)
    503         : UISimpleAction(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/)
     444class UIActionSimpleGroupSort : public UIActionSimple
     445{
     446    Q_OBJECT;
     447
     448public:
     449
     450    UIActionSimpleGroupSort(QObject *pParent)
     451        : UIActionSimple(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/)
    504452    {
    505453        retranslateUi();
     
    516464};
    517465
    518 class UIMenuActionMachineClose : public UIMenuAction
    519 {
    520     Q_OBJECT;
    521 
    522 public:
    523 
    524     UIMenuActionMachineClose(QObject *pParent)
    525         : UIMenuAction(pParent, ":/exit_16px.png")
     466
     467class UIActionMenuMachine : public UIActionMenu
     468{
     469    Q_OBJECT;
     470
     471public:
     472
     473    UIActionMenuMachine(QObject *pParent)
     474        : UIActionMenu(pParent)
     475    {
     476        retranslateUi();
     477    }
     478
     479protected:
     480
     481    void retranslateUi()
     482    {
     483        menu()->setTitle(QApplication::translate("UIActionPool", "&Machine"));
     484    }
     485};
     486
     487class UIActionSimpleMachineNewWizard : public UIActionSimple
     488{
     489    Q_OBJECT;
     490
     491public:
     492
     493    UIActionSimpleMachineNewWizard(QObject *pParent)
     494        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16), ":/vm_new_32px.png", ":/new_16px.png")
     495    {
     496        retranslateUi();
     497    }
     498
     499protected:
     500
     501    void retranslateUi()
     502    {
     503        setText(QApplication::translate("UIActionPool", "&New..."));
     504        setStatusTip(QApplication::translate("UIActionPool", "Create a new virtual machine"));
     505        setShortcut(gSS->keySequence(UISelectorShortcuts::NewVMShortcut));
     506        setToolTip(text().remove('&').remove('.') +
     507                   (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
     508    }
     509};
     510
     511class UIActionSimpleMachineAddDialog : public UIActionSimple
     512{
     513    Q_OBJECT;
     514
     515public:
     516
     517    UIActionSimpleMachineAddDialog(QObject *pParent)
     518        : UIActionSimple(pParent, ":/vm_add_16px.png")
     519    {
     520        retranslateUi();
     521    }
     522
     523protected:
     524
     525    void retranslateUi()
     526    {
     527        setText(QApplication::translate("UIActionPool", "&Add..."));
     528        setStatusTip(QApplication::translate("UIActionPool", "Add an existing virtual machine"));
     529        setShortcut(gSS->keySequence(UISelectorShortcuts::AddVMShortcut));
     530    }
     531};
     532
     533class UIActionSimpleMachineSettingsDialog : public UIActionSimple
     534{
     535    Q_OBJECT;
     536
     537public:
     538
     539    UIActionSimpleMachineSettingsDialog(QObject *pParent)
     540        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     541                         ":/vm_settings_32px.png", ":/settings_16px.png",
     542                         ":/vm_settings_disabled_32px.png", ":/settings_dis_16px.png")
     543    {
     544        retranslateUi();
     545    }
     546
     547protected:
     548
     549    void retranslateUi()
     550    {
     551        setText(QApplication::translate("UIActionPool", "&Settings..."));
     552        setStatusTip(QApplication::translate("UIActionPool", "Manage the virtual machine settings"));
     553        setShortcut(gSS->keySequence(UISelectorShortcuts::SettingsVMShortcut));
     554        setToolTip(text().remove('&').remove('.') +
     555                   (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
     556    }
     557};
     558
     559class UIActionSimpleMachineCloneWizard : public UIActionSimple
     560{
     561    Q_OBJECT;
     562
     563public:
     564
     565    UIActionSimpleMachineCloneWizard(QObject *pParent)
     566        : UIActionSimple(pParent, ":/vm_clone_16px.png", ":/vm_clone_disabled_16px.png")
     567    {
     568        retranslateUi();
     569    }
     570
     571protected:
     572
     573    void retranslateUi()
     574    {
     575        setText(QApplication::translate("UIActionPool", "Cl&one..."));
     576        setStatusTip(QApplication::translate("UIActionPool", "Clone the selected virtual machine"));
     577        setShortcut(gSS->keySequence(UISelectorShortcuts::CloneVMShortcut));
     578    }
     579};
     580
     581class UIActionSimpleMachineRemoveDialog : public UIActionSimple
     582{
     583    Q_OBJECT;
     584
     585public:
     586
     587    UIActionSimpleMachineRemoveDialog(QObject *pParent)
     588        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     589                         ":/vm_delete_32px.png", ":/delete_16px.png",
     590                         ":/vm_delete_disabled_32px.png", ":/delete_dis_16px.png")
     591    {
     592        retranslateUi();
     593    }
     594
     595protected:
     596
     597    void retranslateUi()
     598    {
     599        setText(QApplication::translate("UIActionPool", "&Remove..."));
     600        setStatusTip(QApplication::translate("UIActionPool", "Remove the selected virtual machine"));
     601        setShortcut(gSS->keySequence(UISelectorShortcuts::RemoveVMShortcut));
     602    }
     603};
     604
     605class UIActionStateMachineStartOrShow : public UIActionState
     606{
     607    Q_OBJECT;
     608
     609public:
     610
     611    UIActionStateMachineStartOrShow(QObject *pParent)
     612        : UIActionState(pParent, QSize(32, 32), QSize(16, 16),
     613                         ":/vm_start_32px.png", ":/start_16px.png",
     614                         ":/vm_start_disabled_32px.png", ":/start_dis_16px.png")
     615    {
     616        retranslateUi();
     617    }
     618
     619protected:
     620
     621    void retranslateUi()
     622    {
     623        switch (m_iState)
     624        {
     625            case 1:
     626            {
     627                setText(QApplication::translate("UIActionPool", "S&tart"));
     628                setStatusTip(QApplication::translate("UIActionPool", "Start the selected virtual machine"));
     629                setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut));
     630                setToolTip(text().remove('&').remove('.') +
     631                           (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
     632                break;
     633            }
     634            case 2:
     635            {
     636                setText(QApplication::translate("UIActionPool", "S&how"));
     637                setStatusTip(QApplication::translate("UIActionPool", "Switch to the window of the selected virtual machine"));
     638                setShortcut(gSS->keySequence(UISelectorShortcuts::StartVMShortcut));
     639                setToolTip(text().remove('&').remove('.') +
     640                           (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
     641                break;
     642            }
     643            default:
     644                break;
     645        }
     646    }
     647};
     648
     649class UIActionSimpleMachineDiscard : public UIActionSimple
     650{
     651    Q_OBJECT;
     652
     653public:
     654
     655    UIActionSimpleMachineDiscard(QObject *pParent)
     656        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     657                         ":/vm_discard_32px.png", ":/discard_16px.png",
     658                         ":/vm_discard_disabled_32px.png", ":/discard_dis_16px.png")
     659    {
     660        retranslateUi();
     661    }
     662
     663protected:
     664
     665    void retranslateUi()
     666    {
     667        setIconText(QApplication::translate("UIActionPool", "Discard"));
     668        setText(QApplication::translate("UIActionPool", "D&iscard saved state..."));
     669        setStatusTip(QApplication::translate("UIActionPool", "Discard the saved state of the selected virtual machine"));
     670        setShortcut(gSS->keySequence(UISelectorShortcuts::DiscardVMShortcut));
     671        setToolTip(text().remove('&').remove('.') +
     672                   (shortcut().toString().isEmpty() ? "" : QString(" (%1)").arg(shortcut().toString())));
     673    }
     674};
     675
     676class UIActionToggleMachinePauseAndResume : public UIActionToggle
     677{
     678    Q_OBJECT;
     679
     680public:
     681
     682    UIActionToggleMachinePauseAndResume(QObject *pParent)
     683        : UIActionToggle(pParent, QSize(32, 32), QSize(16, 16),
     684                         ":/vm_pause_32px.png", ":/pause_16px.png",
     685                         ":/vm_pause_disabled_32px.png", ":/pause_disabled_16px.png")
     686    {
     687        retranslateUi();
     688    }
     689
     690protected:
     691
     692    void retranslateUi()
     693    {
     694        setText(QApplication::translate("UIActionPool", "&Pause"));
     695        setStatusTip(QApplication::translate("UIActionPool", "Suspend the execution of the virtual machine"));
     696        setShortcut(gSS->keySequence(UISelectorShortcuts::PauseVMShortcut));
     697    }
     698};
     699
     700class UIActionSimpleMachineReset : public UIActionSimple
     701{
     702    Q_OBJECT;
     703
     704public:
     705
     706    UIActionSimpleMachineReset(QObject *pParent)
     707        : UIActionSimple(pParent, ":/reset_16px.png", ":/reset_disabled_16px.png")
     708    {
     709        retranslateUi();
     710    }
     711
     712protected:
     713
     714    void retranslateUi()
     715    {
     716        setText(QApplication::translate("UIActionPool", "&Reset"));
     717        setStatusTip(QApplication::translate("UIActionPool", "Reset the virtual machine"));
     718        setShortcut(gSS->keySequence(UISelectorShortcuts::ResetVMShortcut));
     719    }
     720};
     721
     722class UIActionSimpleMachineRefresh : public UIActionSimple
     723{
     724    Q_OBJECT;
     725
     726public:
     727
     728    UIActionSimpleMachineRefresh(QObject *pParent)
     729        : UIActionSimple(pParent, QSize(32, 32), QSize(16, 16),
     730                         ":/refresh_32px.png", ":/refresh_16px.png",
     731                         ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
     732    {
     733        retranslateUi();
     734    }
     735
     736protected:
     737
     738    void retranslateUi()
     739    {
     740        setText(QApplication::translate("UIActionPool", "Re&fresh..."));
     741        setStatusTip(QApplication::translate("UIActionPool", "Refresh the accessibility state of the selected virtual machine"));
     742        setShortcut(gSS->keySequence(UISelectorShortcuts::RefreshVMShortcut));
     743    }
     744};
     745
     746class UIActionSimpleMachineShowInFileManager : public UIActionSimple
     747{
     748    Q_OBJECT;
     749
     750public:
     751
     752    UIActionSimpleMachineShowInFileManager(QObject *pParent)
     753        : UIActionSimple(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
     754    {
     755        retranslateUi();
     756    }
     757
     758protected:
     759
     760    void retranslateUi()
     761    {
     762#if defined(Q_WS_MAC)
     763        setText(QApplication::translate("UIActionPool", "Show in Finder"));
     764        setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Finder."));
     765#elif defined(Q_WS_WIN)
     766        setText(QApplication::translate("UIActionPool", "Show in Explorer"));
     767        setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in Explorer."));
     768#else
     769        setText(QApplication::translate("UIActionPool", "Show in File Manager"));
     770        setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition file in the File Manager"));
     771#endif
     772        setShortcut(gSS->keySequence(UISelectorShortcuts::ShowVMInFileManagerShortcut));
     773    }
     774};
     775
     776class UIActionSimpleMachineCreateShortcut : public UIActionSimple
     777{
     778    Q_OBJECT;
     779
     780public:
     781
     782    UIActionSimpleMachineCreateShortcut(QObject *pParent)
     783        : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png")
     784    {
     785        retranslateUi();
     786    }
     787
     788protected:
     789
     790    void retranslateUi()
     791    {
     792#if defined(Q_WS_MAC)
     793        setText(QApplication::translate("UIActionPool", "Create Alias on Desktop"));
     794        setStatusTip(QApplication::translate("UIActionPool", "Creates an Alias file to the VirtualBox Machine Definition file on your Desktop."));
     795#else
     796        setText(QApplication::translate("UIActionPool", "Create Shortcut on Desktop"));
     797        setStatusTip(QApplication::translate("UIActionPool", "Creates an Shortcut file to the VirtualBox Machine Definition file on your Desktop."));
     798#endif
     799        setShortcut(gSS->keySequence(UISelectorShortcuts::CreateVMAliasShortcut));
     800    }
     801};
     802
     803class UIActionSimpleMachineSort : public UIActionSimple
     804{
     805    Q_OBJECT;
     806
     807public:
     808
     809    UIActionSimpleMachineSort(QObject *pParent)
     810        : UIActionSimple(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/)
     811    {
     812        retranslateUi();
     813    }
     814
     815protected:
     816
     817    void retranslateUi()
     818    {
     819        setText(QApplication::translate("UIActionPool", "Sort List"));
     820        setStatusTip(QApplication::translate("UIActionPool", "Sort the VM list alphabetically (Shift for descending order)"));
     821        setShortcut(gSS->keySequence(UISelectorShortcuts::ResortVMList));
     822    }
     823};
     824
     825
     826class UIActionMenuMachineClose : public UIActionMenu
     827{
     828    Q_OBJECT;
     829
     830public:
     831
     832    UIActionMenuMachineClose(QObject *pParent)
     833        : UIActionMenu(pParent, ":/exit_16px.png")
    526834    {
    527835        retranslateUi();
     
    537845};
    538846
    539 class UISimpleActionACPIShutdown : public UISimpleAction
    540 {
    541     Q_OBJECT;
    542 
    543 public:
    544 
    545     UISimpleActionACPIShutdown(QObject *pParent)
    546         : UISimpleAction(pParent, ":/acpi_16px.png", ":/acpi_disabled_16px.png")
     847class UIActionSimpleACPIShutdown : public UIActionSimple
     848{
     849    Q_OBJECT;
     850
     851public:
     852
     853    UIActionSimpleACPIShutdown(QObject *pParent)
     854        : UIActionSimple(pParent, ":/acpi_16px.png", ":/acpi_disabled_16px.png")
    547855    {
    548856        retranslateUi();
     
    559867};
    560868
    561 class UISimpleActionPowerOff : public UISimpleAction
    562 {
    563     Q_OBJECT;
    564 
    565 public:
    566 
    567     UISimpleActionPowerOff(QObject *pParent)
    568         : UISimpleAction(pParent, ":/poweroff_16px.png", ":/poweroff_disabled_16px.png")
     869class UIActionSimplePowerOff : public UIActionSimple
     870{
     871    Q_OBJECT;
     872
     873public:
     874
     875    UIActionSimplePowerOff(QObject *pParent)
     876        : UIActionSimple(pParent, ":/poweroff_16px.png", ":/poweroff_disabled_16px.png")
    569877    {
    570878        retranslateUi();
     
    580888    }
    581889};
     890
    582891
    583892/* static */
     
    613922
    614923    /* 'File' actions: */
    615     m_pool[UIActionIndexSelector_Simple_File_MediumManagerDialog] = new UISimpleActionMediumManagerDialog(this);
    616     m_pool[UIActionIndexSelector_Simple_File_ImportApplianceWizard] = new UISimpleActionImportApplianceWizard(this);
    617     m_pool[UIActionIndexSelector_Simple_File_ExportApplianceWizard] = new UISimpleActionExportApplianceWizard(this);
    618     m_pool[UIActionIndexSelector_Simple_File_PreferencesDialog] = new UISimpleActionPreferencesDialog(this);
    619     m_pool[UIActionIndexSelector_Simple_File_Exit] = new UISimpleActionExit(this);
     924    m_pool[UIActionIndexSelector_Simple_File_MediumManagerDialog] = new UIActionSimpleMediumManagerDialog(this);
     925    m_pool[UIActionIndexSelector_Simple_File_ImportApplianceWizard] = new UIActionSimpleImportApplianceWizard(this);
     926    m_pool[UIActionIndexSelector_Simple_File_ExportApplianceWizard] = new UIActionSimpleExportApplianceWizard(this);
     927    m_pool[UIActionIndexSelector_Simple_File_PreferencesDialog] = new UIActionSimplePreferencesDialog(this);
     928    m_pool[UIActionIndexSelector_Simple_File_Exit] = new UIActionSimpleExit(this);
     929
     930    /* 'Group' actions: */
     931    m_pool[UIActionIndexSelector_Simple_Group_NewWizard] = new UIActionSimpleGroupNewWizard(this);
     932    m_pool[UIActionIndexSelector_Simple_Group_AddDialog] = new UIActionSimpleGroupAddDialog(this);
     933    m_pool[UIActionIndexSelector_Simple_Group_RenameDialog] = new UIActionSimpleGroupRenameDialog(this);
     934    m_pool[UIActionIndexSelector_Simple_Group_RemoveDialog] = new UIActionSimpleGroupRemoveDialog(this);
     935    m_pool[UIActionIndexSelector_State_Group_StartOrShow] = new UIActionStateGroupStartOrShow(this);
     936    m_pool[UIActionIndexSelector_Toggle_Group_PauseAndResume] = new UIActionToggleGroupPauseAndResume(this);
     937    m_pool[UIActionIndexSelector_Simple_Group_Reset] = new UIActionSimpleGroupReset(this);
     938    m_pool[UIActionIndexSelector_Simple_Group_Refresh] = new UIActionSimpleGroupRefresh(this);
     939    m_pool[UIActionIndexSelector_Simple_Group_ShowInFileManager] = new UIActionSimpleGroupShowInFileManager(this);
     940    m_pool[UIActionIndexSelector_Simple_Group_CreateShortcut] = new UIActionSimpleGroupCreateShortcut(this);
     941    m_pool[UIActionIndexSelector_Simple_Group_Sort] = new UIActionSimpleGroupSort(this);
    620942
    621943    /* 'Machine' actions: */
    622     m_pool[UIActionIndexSelector_Simple_Machine_NewWizard] = new UISimpleActionNewWizard(this);
    623     m_pool[UIActionIndexSelector_Simple_Machine_AddDialog] = new UISimpleActionAddDialog(this);
    624     m_pool[UIActionIndexSelector_Simple_Machine_SettingsDialog] = new UISimpleActionSettingsDialog(this);
    625     m_pool[UIActionIndexSelector_Simple_Machine_CloneWizard] = new UISimpleActionCloneWizard(this);
    626     m_pool[UIActionIndexSelector_Simple_Machine_RemoveDialog] = new UISimpleActionRemoveDialog(this);
    627     m_pool[UIActionIndexSelector_State_Machine_StartOrShow] = new UIStateActionStartOrShow(this);
    628     m_pool[UIActionIndexSelector_Simple_Machine_Discard] = new UISimpleActionDiscard(this);
    629     m_pool[UIActionIndexSelector_Toggle_Machine_PauseAndResume] = new UIToggleActionPauseAndResume(this);
    630     m_pool[UIActionIndexSelector_Simple_Machine_Reset] = new UISimpleActionReset(this);
    631     m_pool[UIActionIndexSelector_Simple_Machine_Refresh] = new UISimpleActionRefresh(this);
    632     m_pool[UIActionIndexSelector_Simple_Machine_ShowInFileManager] = new UISimpleActionShowInFileManager(this);
    633     m_pool[UIActionIndexSelector_Simple_Machine_CreateShortcut] = new UISimpleActionCreateShortcut(this);
    634     m_pool[UIActionIndexSelector_Simple_Machine_Sort] = new UISimpleActionSort(this);
     944    m_pool[UIActionIndexSelector_Simple_Machine_NewWizard] = new UIActionSimpleMachineNewWizard(this);
     945    m_pool[UIActionIndexSelector_Simple_Machine_AddDialog] = new UIActionSimpleMachineAddDialog(this);
     946    m_pool[UIActionIndexSelector_Simple_Machine_SettingsDialog] = new UIActionSimpleMachineSettingsDialog(this);
     947    m_pool[UIActionIndexSelector_Simple_Machine_CloneWizard] = new UIActionSimpleMachineCloneWizard(this);
     948    m_pool[UIActionIndexSelector_Simple_Machine_RemoveDialog] = new UIActionSimpleMachineRemoveDialog(this);
     949    m_pool[UIActionIndexSelector_State_Machine_StartOrShow] = new UIActionStateMachineStartOrShow(this);
     950    m_pool[UIActionIndexSelector_Simple_Machine_Discard] = new UIActionSimpleMachineDiscard(this);
     951    m_pool[UIActionIndexSelector_Toggle_Machine_PauseAndResume] = new UIActionToggleMachinePauseAndResume(this);
     952    m_pool[UIActionIndexSelector_Simple_Machine_Reset] = new UIActionSimpleMachineReset(this);
     953    m_pool[UIActionIndexSelector_Simple_Machine_Refresh] = new UIActionSimpleMachineRefresh(this);
     954    m_pool[UIActionIndexSelector_Simple_Machine_ShowInFileManager] = new UIActionSimpleMachineShowInFileManager(this);
     955    m_pool[UIActionIndexSelector_Simple_Machine_CreateShortcut] = new UIActionSimpleMachineCreateShortcut(this);
     956    m_pool[UIActionIndexSelector_Simple_Machine_Sort] = new UIActionSimpleMachineSort(this);
    635957
    636958    /* 'Machine/Close' actions: */
    637     m_pool[UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown] = new UISimpleActionACPIShutdown(this);
    638     m_pool[UIActionIndexSelector_Simple_Machine_Close_PowerOff] = new UISimpleActionPowerOff(this);
     959    m_pool[UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown] = new UIActionSimpleACPIShutdown(this);
     960    m_pool[UIActionIndexSelector_Simple_Machine_Close_PowerOff] = new UIActionSimplePowerOff(this);
    639961}
    640962
     
    645967
    646968    /* 'File' menu: */
    647     m_pool[UIActionIndexSelector_Menu_File] = new UIMenuActionFile(this);
     969    m_pool[UIActionIndexSelector_Menu_File] = new UIActionMenuFile(this);
     970
     971    /* 'Group' menu: */
     972    m_pool[UIActionIndexSelector_Menu_Group] = new UIActionMenuGroup(this);
    648973
    649974    /* 'Machine' menu: */
    650     m_pool[UIActionIndexSelector_Menu_Machine] = new UIMenuActionMachine(this);
     975    m_pool[UIActionIndexSelector_Menu_Machine] = new UIActionMenuMachine(this);
    651976
    652977    /* 'Machine/Close' menu: */
    653     m_pool[UIActionIndexSelector_Menu_Machine_Close] = new UIMenuActionMachineClose(this);
     978    m_pool[UIActionIndexSelector_Menu_Machine_Close] = new UIActionMenuMachineClose(this);
    654979}
    655980
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h

    r41047 r42526  
    3333    UIActionIndexSelector_Simple_File_PreferencesDialog,
    3434    UIActionIndexSelector_Simple_File_Exit,
     35
     36    /* 'Group' menu actions: */
     37    UIActionIndexSelector_Menu_Group,
     38    UIActionIndexSelector_Simple_Group_NewWizard,
     39    UIActionIndexSelector_Simple_Group_AddDialog,
     40    UIActionIndexSelector_Simple_Group_RenameDialog,
     41    UIActionIndexSelector_Simple_Group_RemoveDialog,
     42    UIActionIndexSelector_State_Group_StartOrShow,
     43    UIActionIndexSelector_Toggle_Group_PauseAndResume,
     44    UIActionIndexSelector_Simple_Group_Reset,
     45    UIActionIndexSelector_Simple_Group_Refresh,
     46    UIActionIndexSelector_Simple_Group_ShowInFileManager,
     47    UIActionIndexSelector_Simple_Group_CreateShortcut,
     48    UIActionIndexSelector_Simple_Group_Sort,
    3549
    3650    /* 'Machine' menu actions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.cpp

    r41689 r42526  
    3535    m_Shortcuts[SettingsVMShortcut]          = UIKeySequence("SettingsVM",          "Ctrl+S");
    3636    m_Shortcuts[CloneVMShortcut]             = UIKeySequence("CloneVM",             "Ctrl+O");
     37    m_Shortcuts[RemoveVMGroupShortcut]       = UIKeySequence("RemoveVMGroup",       "Ctrl+R");
    3738    m_Shortcuts[RemoveVMShortcut]            = UIKeySequence("RemoveVM",            "Ctrl+R");
     39    m_Shortcuts[RenameVMGroupShortcut]       = UIKeySequence("RenameVMGroup",       "Ctrl+M");
    3840    m_Shortcuts[StartVMShortcut]             = UIKeySequence("StartVM");
    3941    m_Shortcuts[DiscardVMShortcut]           = UIKeySequence("DiscardVM",           "Ctrl+J");
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.h

    r39932 r42526  
    3737        SettingsVMShortcut,
    3838        CloneVMShortcut,
     39        RemoveVMGroupShortcut,
    3940        RemoveVMShortcut,
     41        RenameVMGroupShortcut,
    4042        StartVMShortcut,
    4143        DiscardVMShortcut,
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r41846 r42526  
    66
    77/*
    8  * Copyright (C) 2006-2011 Oracle Corporation
     8 * Copyright (C) 2006-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020# include "precomp.h"
    2121#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
    22 /* Global includes */
     22
     23/* Qt includes: */
    2324#include <QDesktopWidget>
     25#include <QDesktopServices>
    2426#include <QMenuBar>
    2527#include <QResizeEvent>
    26 #include <QDesktopServices>
     28#include <QStackedWidget>
    2729
    2830/* Local includes: */
    2931#include "QISplitter.h"
     32#include "QIFileDialog.h"
    3033#include "UIBar.h"
    3134#include "UINetworkManager.h"
     
    4043#include "UIWizardImportApp.h"
    4144#include "UIVMDesktop.h"
    42 #include "UIVMListView.h"
    4345#include "UIVirtualBoxEventHandler.h"
    44 #include "VBoxGlobal.h"
    4546#include "UIMediumManager.h"
    4647#include "UIMessageCenter.h"
     
    4950#include "UIToolBar.h"
    5051#include "UIVMLogViewer.h"
    51 #include "QIFileDialog.h"
    5252#include "UISelectorShortcuts.h"
    5353#include "UIDesktopServices.h"
    5454#include "UIGlobalSettingsExtension.h"
    5555#include "UIActionPoolSelector.h"
    56 
    57 #ifdef VBOX_GUI_WITH_SYSTRAY
    58 # include "VBoxTrayIcon.h"
    59 # include "UIExtraDataEventHandler.h"
    60 #endif /* VBOX_GUI_WITH_SYSTRAY */
     56#include "UIGChooser.h"
     57#include "UIGDetails.h"
     58#include "UIVMItem.h"
     59#include "VBoxGlobal.h"
    6160
    6261#ifdef Q_WS_MAC
     
    6665#endif /* Q_WS_MAC */
    6766
     67/* Other VBox stuff: */
     68#include <iprt/buildconfig.h>
     69#include <VBox/version.h>
    6870#ifdef Q_WS_X11
    6971# include <iprt/env.h>
    7072#endif /* Q_WS_X11 */
    7173
    72 #include <iprt/buildconfig.h>
    73 #include <VBox/version.h>
    7474#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    7575
     
    8282#endif /* !Q_WS_MAC */
    8383    , mVMToolBar(0)
    84     , m_pVMListView(0)
    85     , m_pVMModel(0)
    86     , m_pMachineContextMenu(0)
     84    , m_pContainer(0)
     85    , m_pChooser(0)
     86    , m_pDetails(0)
    8787    , m_pVMDesktop(0)
    8888    , m_fDoneInaccessibleWarningOnce(false)
     
    9292        *ppSelf = this;
    9393
    94     /* Prepare everything: */
     94    /* Prepare: */
    9595    prepareIcon();
    9696    prepareMenuBar();
    97     prepareContextMenu();
    9897    prepareStatusBar();
    9998    prepareWidgets();
    10099    prepareConnections();
    101100
    102     /* Load all settings: */
     101    /* Load settings: */
    103102    loadSettings();
    104103
     
    129128UISelectorWindow::~UISelectorWindow()
    130129{
    131     /* Destroy our event handlers: */
     130    /* Destroy event handlers: */
    132131    UIVirtualBoxEventHandler::destroy();
    133132
    134     /* Save all settings: */
     133    /* Save settings: */
    135134    saveSettings();
    136 
    137 #ifdef VBOX_GUI_WITH_SYSTRAY
    138     /* Delete systray menu object: */
    139     delete m_pTrayIcon;
    140     m_pTrayIcon = NULL;
    141 #endif /* VBOX_GUI_WITH_SYSTRAY */
     135}
     136
     137void UISelectorWindow::sltDetailsViewIndexChanged(int iWidgetIndex)
     138{
     139    if (iWidgetIndex)
     140        m_pContainer->setCurrentWidget(m_pVMDesktop);
     141    else
     142        m_pContainer->setCurrentWidget(m_pDetails);
     143}
     144
     145void UISelectorWindow::sltMediumEnumFinished(const VBoxMediaList &list)
     146{
     147    /* We warn about inaccessible media only once
     148     * (after media emumeration started from main() at startup),
     149     * to avoid annoying the user: */
     150    if (m_fDoneInaccessibleWarningOnce)
     151        return;
     152    m_fDoneInaccessibleWarningOnce = true;
     153
     154    /* Ignore the signal if a modal widget is currently active
     155     * (we won't be able to properly show the modeless VDI manager window in this case): */
     156    // TODO: Not sure that is required at all...
     157    if (QApplication::activeModalWidget())
     158        return;
     159
     160    /* Ignore the signal if a UIMediumManager window is active: */
     161    // TODO: Thats a very dirty way, rework required!
     162    if (qApp->activeWindow() &&
     163        !strcmp(qApp->activeWindow()->metaObject()->className(), "UIMediumManager"))
     164        return;
     165
     166    /* Look for at least one inaccessible media: */
     167    VBoxMediaList::const_iterator it;
     168    for (it = list.begin(); it != list.end(); ++it)
     169        if ((*it).state() == KMediumState_Inaccessible)
     170            break;
     171    /* Ask the user about: */
     172    if (it != list.end() && msgCenter().remindAboutInaccessibleMedia())
     173    {
     174        /* Show the VMM dialog without refresh: */
     175        UIMediumManager::showModeless(this, false /* refresh? */);
     176    }
    142177}
    143178
     
    225260{
    226261    /* Get selected items: */
    227     QList<UIVMItem*> items = m_pVMListView->currentItems();
     262    QList<UIVMItem*> items = currentItems();
    228263    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    229264
     
    255290void UISelectorWindow::sltPerformExit()
    256291{
    257     /* We have to check if there are any open windows beside this mainwindow
    258      * (e.g. VDM) and if so close them. Note that the default behavior is
    259      * different to Qt3 where a *mainWidget* exists & if this going to close
    260      * all other windows are closed automatically. We do the same below. */
    261     QWidgetList widgets = QApplication::topLevelWidgets();
    262     for(int i = 0; i < widgets.size(); ++i)
    263     {
    264         QWidget *pWidget = widgets[i];
    265         if (pWidget && pWidget->isVisible() && pWidget != this)
    266             pWidget->close();
    267     }
    268     /* We close this pWidget last: */
    269292    close();
    270293}
    271294
    272 void UISelectorWindow::sltShowNewMachineWizard()
    273 {
    274     /* Show New VM wizard: */
     295void UISelectorWindow::sltShowCreateMachineWizard()
     296{
    275297    UIWizardNewVM wizard(this);
    276298    wizard.exec();
     
    299321            strTmpFile = fileNames.at(0);
    300322    }
    301 
    302     /* Open corresponding machine: */
    303     if (!strTmpFile.isEmpty())
    304     {
    305         CMachine newMachine = vbox.OpenMachine(strTmpFile);
    306         /* First we should test what machine was opened: */
    307         if (vbox.isOk() && !newMachine.isNull())
    308         {
    309             /* Second we should check what such machine was NOT already registered.
    310              * Actually current Main implementation will even prevent such machine opening
    311              * but we will perform such a check anyway: */
    312             CMachine oldMachine = vbox.FindMachine(newMachine.GetId());
    313             if (oldMachine.isNull())
    314             {
    315                 /* Register that machine: */
    316                 vbox.RegisterMachine(newMachine);
    317             }
    318             else
    319                 msgCenter().cannotReregisterMachine(this, strTmpFile, oldMachine.GetName());
    320         }
    321         else
    322             msgCenter().cannotOpenMachine(this, strTmpFile, vbox);
    323     }
     323    /* Nothing was chosen? */
     324    if (strTmpFile.isEmpty())
     325        return;
     326
     327    /* Make sure this machine can be opened: */
     328    CMachine newMachine = vbox.OpenMachine(strTmpFile);
     329    if (!vbox.isOk() || newMachine.isNull())
     330    {
     331        msgCenter().cannotOpenMachine(this, strTmpFile, vbox);
     332        return;
     333    }
     334
     335    /* Make sure this machine was NOT registered already: */
     336    CMachine oldMachine = vbox.FindMachine(newMachine.GetId());
     337    if (!oldMachine.isNull())
     338    {
     339        msgCenter().cannotReregisterMachine(this, strTmpFile, oldMachine.GetName());
     340        return;
     341    }
     342
     343    /* Register that machine: */
     344    vbox.RegisterMachine(newMachine);
    324345}
    325346
    326347void UISelectorWindow::sltShowMachineSettingsDialog(const QString &strCategoryRef /* = QString() */,
    327348                                                    const QString &strControlRef /* = QString() */,
    328                                                     const QString &strMachineId /* = QString() */)
     349                                                    const QString &strId /* = QString() */)
    329350{
    330351    /* Check that we do NOT handling that already: */
    331     if (m_pSettingsDialogAction->data().toBool())
     352    if (m_pActionMachineSettingsDialog->data().toBool())
    332353        return;
    333354    /* Remember that we handling that already: */
    334     m_pSettingsDialogAction->setData(true);
     355    m_pActionMachineSettingsDialog->setData(true);
    335356
    336357    /* Process href from VM details / description: */
     
    358379    m_fDoneInaccessibleWarningOnce = true;
    359380
    360     /* Get corresponding VM item: */
    361     UIVMItem *pItem = strMachineId.isNull() ? m_pVMListView->currentItem() : m_pVMModel->itemById(strMachineId);
    362     AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
    363 
    364381    /* Create and execute corresponding VM settings dialog: */
    365     UISettingsDialogMachine dialog(this, pItem->id(), strCategory, strControl);
     382    UISettingsDialogMachine dialog(this,
     383                                   strId.isEmpty() ? currentItem()->id() : strId,
     384                                   strCategory, strControl);
    366385    dialog.execute();
    367386
    368387    /* Remember that we do NOT handling that already: */
    369     m_pSettingsDialogAction->setData(false);
     388    m_pActionMachineSettingsDialog->setData(false);
    370389}
    371390
     
    373392{
    374393    /* Get current item: */
    375     UIVMItem *pItem = m_pVMListView->currentItem();
     394    UIVMItem *pItem = currentItem();
    376395    AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
    377396
     
    381400}
    382401
    383 void UISelectorWindow::sltShowRemoveMachineDialog()
    384 {
     402void UISelectorWindow::sltPerformStartOrShowAction()
     403{
     404    /* Check if the action is enabled: */
     405    if (!m_pActionMachineStartOrShow->isEnabled())
     406        return;
     407
    385408    /* Get selected items: */
    386     QList<UIVMItem*> items = m_pVMListView->currentItems();
    387     AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    388 
    389     /* Populate machine list: */
    390     QList<CMachine> machines;
    391     for (int i = 0; i < items.size(); ++i)
    392         machines << items[i]->machine();
    393     /* Show machine remove dialog: */
    394     int rc = msgCenter().confirmMachineDeletion(machines);
    395     if (rc != QIMessageBox::Cancel)
    396     {
    397         /* For every selected item: */
    398         for (int i = 0; i < machines.size(); ++i)
    399         {
    400             /* Check if current item could be removed: */
    401             if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_RemoveDialog, items[i], items))
    402                 continue;
    403 
    404             /* Get iterated VM: */
    405             CMachine machine = machines[i];
    406             if (rc == QIMessageBox::Yes)
    407             {
    408                 /* Unregister and cleanup machine's data & hard-disks: */
    409                 CMediumVector mediums = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
    410                 if (machine.isOk())
    411                 {
    412                     /* Delete machine hard-disks: */
    413                     CProgress progress = machine.Delete(mediums);
    414                     if (machine.isOk())
    415                     {
    416                         msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_delete_90px.png", 0, true);
    417                         if (progress.GetResultCode() != 0)
    418                             msgCenter().cannotDeleteMachine(machine, progress);
    419                     }
    420                 }
    421                 if (!machine.isOk())
    422                     msgCenter().cannotDeleteMachine(machine);
    423             }
    424             else
    425             {
    426                 /* Just unregister machine: */
    427                 machine.Unregister(KCleanupMode_DetachAllReturnNone);
    428                 if (!machine.isOk())
    429                     msgCenter().cannotDeleteMachine(machine);
    430             }
    431         }
    432     }
    433 }
    434 
    435 void UISelectorWindow::sltPerformStartOrShowAction()
    436 {
    437     /* We always get here when m_pVMListView emits the activated() signal,
    438      * so we must explicitly check if the action is enabled or not. */
    439     if (!m_pStartOrShowAction->isEnabled())
    440         return;
    441 
    442     /* Get selected items: */
    443     QList<UIVMItem*> items = m_pVMListView->currentItems();
     409    QList<UIVMItem*> items = currentItems();
    444410    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    445411
     
    448414    {
    449415        /* Check if current item could be started/showed: */
    450         if (!isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, items[i], items))
     416        if (!isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, items))
    451417            continue;
    452418
     
    461427{
    462428    /* Get current item: */
    463     UIVMItem *pItem = m_pVMListView->currentItem();
     429    UIVMItem *pItem = currentItem();
    464430    AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
    465431
     
    489455{
    490456    /* Get selected items: */
    491     QList<UIVMItem*> items = m_pVMListView->currentItems();
     457    QList<UIVMItem*> items = currentItems();
    492458    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    493459
     
    501467
    502468        /* Check if current item could be paused/resumed: */
    503         if (!isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, pItem, items))
     469        if (!isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, items))
    504470            continue;
    505471
     
    550516
    551517    /* Get selected items: */
    552     QList<UIVMItem*> items = m_pVMListView->currentItems();
     518    QList<UIVMItem*> items = currentItems();
    553519    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    554520
     
    560526
    561527        /* Check if current item could be reseted: */
    562         if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, pItem, items))
     528        if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, items))
    563529            continue;
    564530
     
    588554
    589555    /* Get selected items: */
    590     QList<UIVMItem*> items = m_pVMListView->currentItems();
     556    QList<UIVMItem*> items = currentItems();
    591557    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    592558
     
    598564
    599565        /* Check if current item could be shutdowned: */
    600         if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, pItem, items))
     566        if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, items))
    601567            continue;
    602568
     
    626592
    627593    /* Get selected items: */
    628     QList<UIVMItem*> items = m_pVMListView->currentItems();
     594    QList<UIVMItem*> items = currentItems();
    629595    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    630596
     
    636602
    637603        /* Check if current item could be powered off: */
    638         if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_PowerOff, pItem, items))
     604        if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_PowerOff, items))
    639605            continue;
    640606
     
    660626{
    661627    /* Get selected items: */
    662     QList<UIVMItem*> items = m_pVMListView->currentItems();
     628    QList<UIVMItem*> items = currentItems();
     629    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
     630
     631    // TODO: Notify selector-model to refresh selected items!
     632
     633    /* Refresh details: */
     634    sltCurrentVMItemChanged();
     635}
     636
     637void UISelectorWindow::sltShowLogDialog()
     638{
     639    /* Get selected items: */
     640    QList<UIVMItem*> items = currentItems();
    663641    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    664642
     
    669647        UIVMItem *pItem = items[i];
    670648
    671         /* Check if current item could be refreshed: */
    672         if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_Refresh, pItem, items))
     649        /* Check if log could be show for the current item: */
     650        if (!isActionEnabled(UIActionIndex_Simple_LogDialog, items))
    673651            continue;
    674652
    675         /* Refresh currently selected VM item: */
    676         sltRefreshVMItem(pItem->id(), true /* details */, true /* snapshot */, true /* description */);
    677     }
    678 }
    679 
    680 void UISelectorWindow::sltShowLogDialog()
     653        /* Show VM Log Viewer: */
     654        UIVMLogViewer::showLogViewerFor(this, pItem->machine());
     655    }
     656}
     657
     658void UISelectorWindow::sltShowMachineInFileManager()
    681659{
    682660    /* Get selected items: */
    683     QList<UIVMItem*> items = m_pVMListView->currentItems();
     661    QList<UIVMItem*> items = currentItems();
    684662    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    685663
     
    690668        UIVMItem *pItem = items[i];
    691669
    692         /* Check if log could be show for the current item: */
    693         if (!isActionEnabled(UIActionIndex_Simple_LogDialog, pItem, items))
     670        /* Check if that item could be shown in file-browser: */
     671        if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, items))
    694672            continue;
    695673
    696         /* Show VM Log Viewer: */
    697         UIVMLogViewer::showLogViewerFor(this, pItem->machine());
    698     }
    699 }
    700 
    701 void UISelectorWindow::sltShowMachineInFileManager()
     674        /* Show VM in filebrowser: */
     675        UIDesktopServices::openInFileManager(pItem->machine().GetSettingsFilePath());
     676    }
     677}
     678
     679void UISelectorWindow::sltPerformCreateShortcutAction()
    702680{
    703681    /* Get selected items: */
    704     QList<UIVMItem*> items = m_pVMListView->currentItems();
     682    QList<UIVMItem*> items = currentItems();
    705683    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    706684
     
    711689        UIVMItem *pItem = items[i];
    712690
    713         /* Check if that item could be shown in file-browser: */
    714         if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, pItem, items))
    715             continue;
    716 
    717         /* Show VM in filebrowser: */
    718         UIDesktopServices::openInFileManager(pItem->machine().GetSettingsFilePath());
    719     }
    720 }
    721 
    722 void UISelectorWindow::sltPerformCreateShortcutAction()
    723 {
    724     /* Get selected items: */
    725     QList<UIVMItem*> items = m_pVMListView->currentItems();
    726     AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    727 
    728     /* For each selected item: */
    729     for (int i = 0; i < items.size(); ++i)
    730     {
    731         /* Get iterated item: */
    732         UIVMItem *pItem = items[i];
    733 
    734691        /* Check if shortcuts could be created for this item: */
    735         if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, pItem, items))
     692        if (!isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, items))
    736693            continue;
    737694
     
    744701}
    745702
    746 void UISelectorWindow::sltPerformSortAction()
     703void UISelectorWindow::sltMachineMenuAboutToShow()
     704{
     705    /* Get selected items: */
     706    QList<UIVMItem*> items = currentItems();
     707    /* Enable/disable 'Machine/Close' menu according logic: */
     708    m_pMachineCloseMenuAction->setEnabled(isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, items));
     709}
     710
     711void UISelectorWindow::sltMachineCloseMenuAboutToShow()
    747712{
    748713    /* Get current item: */
    749     UIVMItem *pItem = m_pVMListView->currentItem();
     714    UIVMItem *pItem = currentItem();
     715    /* Get selected items: */
     716    QList<UIVMItem*> items = currentItems();
    750717    AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
    751718
    752     /* Sort VM list: */
    753     const QString strOldId = pItem->id();
    754     m_pVMModel->sortByIdList(QStringList(), qApp->keyboardModifiers() == Qt::ShiftModifier ? Qt::DescendingOrder : Qt::AscendingOrder);
    755     /* Select the VM which was selected before */
    756     m_pVMListView->selectItemById(strOldId);
    757 }
    758 
    759 void UISelectorWindow::sltMachineMenuAboutToShow()
     719    m_pACPIShutdownAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, items));
     720}
     721
     722void UISelectorWindow::sltCurrentVMItemChanged(bool fRefreshDetails, bool fRefreshSnapshots, bool fRefreshDescription)
    760723{
    761724    /* Get current item: */
    762     UIVMItem *pItem = m_pVMListView->currentItem();
    763     /* Get selected items: */
    764     QList<UIVMItem*> items = m_pVMListView->currentItems();
    765     /* Enable/disable 'Machine/Close' menu according logic: */
    766     m_pMachineCloseMenuAction->setEnabled(isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, pItem, items));
    767 }
    768 
    769 void UISelectorWindow::sltMachineCloseMenuAboutToShow()
    770 {
    771     /* Get current item: */
    772     UIVMItem *pItem = m_pVMListView->currentItem();
    773     /* Get selected items: */
    774     QList<UIVMItem*> items = m_pVMListView->currentItems();
    775     AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
    776 
    777     m_pACPIShutdownAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, pItem, items));
    778 }
    779 
    780 void UISelectorWindow::sltMachineContextMenuHovered(QAction *pAction)
    781 {
    782     /* Update statusbar with howered action status text: */
    783     statusBar()->showMessage(pAction->statusTip());
    784 }
    785 
    786 void UISelectorWindow::sltRefreshVMList()
    787 {
    788     /* Refresh VM list: */
    789     CVirtualBox vbox = vboxGlobal().virtualBox();
    790     CMachineVector machines = vbox.GetMachines();
    791     for (CMachineVector::ConstIterator m = machines.begin(); m != machines.end(); ++m)
    792         m_pVMModel->addItem(*m);
    793     /* Apply the saved sort order. */
    794     m_pVMModel->sortByIdList(vbox.GetExtraDataStringList(GUI_SelectorVMPositions));
    795     /* Update details page. */
    796     sltCurrentVMItemChanged();
    797 #ifdef VBOX_GUI_WITH_SYSTRAY
    798     if (vboxGlobal().isTrayMenu())
    799         m_pTrayIcon->refresh();
    800 #endif /* VBOX_GUI_WITH_SYSTRAY */
    801 }
    802 
    803 void UISelectorWindow::sltRefreshVMItem(const QString &strMachineId, bool fDetails, bool fSnapshots, bool fDescription)
    804 {
    805     /* Refresh VM item: */
    806     UIVMItem *pItem = m_pVMModel->itemById(strMachineId);
    807     if (pItem)
    808     {
    809         m_pVMModel->refreshItem(pItem);
    810         if (pItem && pItem->id() == strMachineId)
    811             sltCurrentVMItemChanged(fDetails, fSnapshots, fDescription);
    812     }
    813 }
    814 
    815 void UISelectorWindow::sltShowContextMenu(const QPoint &point)
    816 {
    817     /* Show VM list context menu: */
    818     const QModelIndex &index = m_pVMListView->indexAt(point);
    819     if (index.isValid() && m_pVMListView->model()->data(index, UIVMItemModel::UIVMItemPtrRole).value<UIVMItem*>())
    820     {
    821         m_pMachineContextMenu->exec(m_pVMListView->mapToGlobal(point));
    822         /* Make sure every status bar hint from the context menu is cleared when the menu is closed: */
    823         statusBar()->clearMessage();
    824     }
    825 }
    826 
    827 void UISelectorWindow::sltCurrentVMItemChanged(bool fRefreshDetails, bool fRefreshSnapshots, bool fRefreshDescription)
    828 {
    829     /* Get current item: */
    830     UIVMItem *pItem = m_pVMListView->currentItem();
    831     QList<UIVMItem*> items = m_pVMListView->currentItems();
    832 
    833     /* Enable/disable actions: */
    834     m_pSettingsDialogAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_SettingsDialog, pItem, items));
    835     m_pCloneWizardAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CloneWizard, pItem, items));
    836     m_pRemoveDialogAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_RemoveDialog, pItem, items));
    837     m_pStartOrShowAction->setEnabled(isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, pItem, items));
    838     m_pDiscardAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Discard, pItem, items));
    839     m_pPauseAndResumeAction->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, pItem, items));
    840     m_pResetAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, pItem, items));
    841     m_pACPIShutdownAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, pItem, items));
    842     m_pPowerOffAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_PowerOff, pItem, items));
    843     m_pRefreshAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Refresh, pItem, items));
    844     m_pLogDialogAction->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, pItem, items));
    845     m_pShowInFileManagerAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, pItem, items));
    846     m_pCreateShortcutAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, pItem, items));
    847     m_pSortAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Sort, pItem, items));
     725    UIVMItem *pItem = currentItem();
     726    QList<UIVMItem*> items = currentItems();
     727
     728    /* Determine which menu to show: */
     729    m_pGroupMenuAction->setVisible(m_pChooser->singleGroupSelected());
     730    m_pMachineMenuAction->setVisible(!m_pChooser->singleGroupSelected());
     731
     732    /* Enable/disable group actions: */
     733    m_pActionGroupRenameDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_RenameDialog, items));
     734    m_pActionGroupRemoveDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_RemoveDialog, items));
     735    m_pActionGroupStartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Group_StartOrShow, items));
     736    m_pActionGroupPauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Group_PauseAndResume, items));
     737    m_pActionGroupReset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Reset, items));
     738    m_pActionGroupRefresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Refresh, items));
     739    m_pActionGroupLogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items));
     740    m_pActionGroupShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_ShowInFileManager, items));
     741    m_pActionGroupCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_CreateShortcut, items));
     742//    m_pActionGroupSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Sort, items));
     743
     744    /* Enable/disable machine actions: */
     745    m_pActionMachineSettingsDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_SettingsDialog, items));
     746    m_pActionMachineCloneWizard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CloneWizard, items));
     747    m_pActionMachineRemoveDialog->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_RemoveDialog, items));
     748    m_pActionMachineStartOrShow->setEnabled(isActionEnabled(UIActionIndexSelector_State_Machine_StartOrShow, items));
     749    m_pActionMachineDiscard->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Discard, items));
     750    m_pActionMachinePauseAndResume->setEnabled(isActionEnabled(UIActionIndexSelector_Toggle_Machine_PauseAndResume, items));
     751    m_pActionMachineReset->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Reset, items));
     752    m_pActionMachineRefresh->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Refresh, items));
     753    m_pActionMachineLogDialog->setEnabled(isActionEnabled(UIActionIndex_Simple_LogDialog, items));
     754    m_pActionMachineShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, items));
     755    m_pActionMachineCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, items));
     756//    m_pActionMachineSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Sort, items));
     757
     758    /* Enable/disable machine-close actions: */
     759    m_pACPIShutdownAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown, items));
     760    m_pPowerOffAction->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Close_PowerOff, items));
    848761
    849762    /* If currently selected VM item is accessible: */
    850763    if (pItem && pItem->accessible())
    851764    {
     765        /* Make sure valid widget raised: */
     766        if (m_pVMDesktop->widgetIndex())
     767            m_pContainer->setCurrentWidget(m_pVMDesktop);
     768        else
     769            m_pContainer->setCurrentWidget(m_pDetails);
     770
    852771        CMachine m = pItem->machine();
    853772        QList<CMachine> machines;
     
    857776
    858777        if (fRefreshDetails || fRefreshDescription)
    859             m_pVMDesktop->updateDetails(pItem, machines);
     778            m_pDetails->setItems(currentItems());
    860779        if (fRefreshSnapshots)
    861780            m_pVMDesktop->updateSnapshots(pItem, m);
     
    867786            state == KMachineState_Aborted)
    868787        {
    869             m_pStartOrShowAction->setState(1);
     788            m_pActionGroupStartOrShow->setState(1);
     789            m_pActionMachineStartOrShow->setState(1);
    870790#ifdef QT_MAC_USE_COCOA
    871791            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     
    878798        else
    879799        {
    880             m_pStartOrShowAction->setState(2);
     800            m_pActionGroupStartOrShow->setState(2);
     801            m_pActionMachineStartOrShow->setState(2);
    881802#ifdef QT_MAC_USE_COCOA
    882803            /* There is a bug in Qt Cocoa which result in showing a "more arrow" when
     
    892813            state == KMachineState_TeleportingPausedVM)
    893814        {
    894             m_pPauseAndResumeAction->blockSignals(true);
    895             m_pPauseAndResumeAction->setChecked(true);
    896             m_pPauseAndResumeAction->blockSignals(false);
     815            m_pActionGroupPauseAndResume->blockSignals(true);
     816            m_pActionGroupPauseAndResume->setChecked(true);
     817            m_pActionGroupPauseAndResume->blockSignals(false);
     818            m_pActionMachinePauseAndResume->blockSignals(true);
     819            m_pActionMachinePauseAndResume->setChecked(true);
     820            m_pActionMachinePauseAndResume->blockSignals(false);
    897821        }
    898822        else
    899823        {
    900             m_pPauseAndResumeAction->blockSignals(true);
    901             m_pPauseAndResumeAction->setChecked(false);
    902             m_pPauseAndResumeAction->blockSignals(false);
    903         }
    904         m_pPauseAndResumeAction->updateAppearance();
     824            m_pActionGroupPauseAndResume->blockSignals(true);
     825            m_pActionGroupPauseAndResume->setChecked(false);
     826            m_pActionGroupPauseAndResume->blockSignals(false);
     827            m_pActionMachinePauseAndResume->blockSignals(true);
     828            m_pActionMachinePauseAndResume->setChecked(false);
     829            m_pActionMachinePauseAndResume->blockSignals(false);
     830        }
     831        m_pActionGroupPauseAndResume->updateAppearance();
     832        m_pActionMachinePauseAndResume->updateAppearance();
    905833    }
    906834
     
    908836    else
    909837    {
     838        /* Show m_pVMDesktop: */
     839        m_pContainer->setCurrentWidget(m_pVMDesktop);
     840
    910841        /* Note that the machine becomes inaccessible (or if the last VM gets
    911842         * deleted), we have to update all fields, ignoring input arguments. */
     
    939870
    940871        /* Change the Start button text accordingly: */
    941         m_pStartOrShowAction->setState(1);
     872        m_pActionGroupStartOrShow->setState(1);
     873        m_pActionMachineStartOrShow->setState(1);
    942874    }
    943875}
     
    946878{
    947879    /* Make sure any pending D&D events are consumed. */
     880    // TODO: What? So dangerous method for so cheap purpose?
    948881    qApp->processEvents();
     882
    949883    if (list.isEmpty())
    950884    {
     
    991925}
    992926
    993 void UISelectorWindow::sltMachineRegistered(QString strMachineId, bool fRegistered)
    994 {
    995     /* Add/remove VM: */
    996     if (fRegistered)
    997     {
    998         CMachine m = vboxGlobal().virtualBox().FindMachine(strMachineId);
    999         if (!m.isNull())
    1000         {
    1001             m_pVMModel->addItem(m);
    1002             int iRow = m_pVMModel->rowById(strMachineId);
    1003             m_pVMListView->ensureOneRowSelected(iRow);
    1004         }
    1005         /* m.isNull() is ok (theoretically, the machine could have been
    1006          * already deregistered by some other client at this point) */
    1007     }
    1008     else
    1009     {
    1010         UIVMItem *pItem = m_pVMModel->itemById(strMachineId);
    1011         if (pItem)
    1012         {
    1013             int iRow = m_pVMModel->rowById(strMachineId);
    1014             m_pVMModel->removeItem(pItem);
    1015             m_pVMListView->ensureOneRowSelected(iRow);
    1016         }
    1017         /* item = 0 is ok (if we originated this event then the item
    1018          * has been already removed) */
    1019     }
    1020     /* Make sure all updated: */
    1021     sltCurrentVMItemChanged();
    1022 }
    1023 
    1024 void UISelectorWindow::sltMachineStateChanged(QString strMachineId, KMachineState /* state */)
    1025 {
    1026 #ifdef VBOX_GUI_WITH_SYSTRAY
    1027     if (vboxGlobal().isTrayMenu())
    1028     {
    1029         /* Check if there are some machines alive - else quit, since
    1030          * we're not needed as a systray menu anymore. */
    1031         if (vboxGlobal().mainWindowCount() == 0)
    1032         {
    1033             sltPerformExit();
    1034             return;
    1035         }
    1036     }
    1037 #endif /* VBOX_GUI_WITH_SYSTRAY */
    1038 
    1039     sltRefreshVMItem(strMachineId, true /* aDetails */, true /* aSnapshots */, false /* aDescription */);
    1040 
    1041     /* Simulate a state change signal: */
    1042 //    m_pVMDesktop->updateDescriptionState();
    1043 }
    1044 
    1045 void UISelectorWindow::sltMachineDataChanged(QString strMachineId)
    1046 {
    1047     sltRefreshVMItem(strMachineId, true  /* details */, false /* snapshots */, true  /* description */);
    1048 }
    1049 
    1050 void UISelectorWindow::sltSessionStateChanged(QString strMachineId, KSessionState /* state */)
    1051 {
    1052     sltRefreshVMItem(strMachineId, true  /* details */, false /* snapshots */, false /* description */);
    1053 
    1054 //    /* Simulate a state change signal: */
    1055 //    m_pVMDesktop->updateDescriptionState();
    1056 }
    1057 
    1058 void UISelectorWindow::sltSnapshotChanged(QString strMachineId, QString /* strSnapshotId */)
    1059 {
    1060     sltRefreshVMItem(strMachineId, false /* details */, true  /* snapshot */, false /* description */);
    1061 }
    1062 
    1063 #ifdef VBOX_GUI_WITH_SYSTRAY
    1064 void UISelectorWindow::sltMainWindowCountChanged(int iCount)
    1065 {
    1066     if (vboxGlobal().isTrayMenu() && count <= 1)
    1067         sltPerformExit();
    1068 }
    1069 
    1070 void UISelectorWindow::sltTrayIconCanShow(bool fEnabled)
    1071 {
    1072     emit sltTrayIconChanged(VBoxChangeTrayIconEvent(vboxGlobal().settings().trayIconEnabled()));
    1073 }
    1074 
    1075 void UISelectorWindow::sltTrayIconShow(bool fEnabled)
    1076 {
    1077     if (vboxGlobal().isTrayMenu() && m_pTrayIcon)
    1078         m_pTrayIcon->sltTrayIconShow(fEnabled);
    1079 }
    1080 
    1081 void UISelectorWindow::sltTrayIconChanged(bool fEnabled)
    1082 {
    1083     /* Not used yet. */
    1084 }
    1085 
    1086 void UISelectorWindow::sltTrayIconActivated(QSystemTrayIcon::ActivationReason reason)
    1087 {
    1088     switch (reason)
    1089     {
    1090         case QSystemTrayIcon::Context:
    1091             m_pTrayIcon->refresh();
    1092             break;
    1093 
    1094         case QSystemTrayIcon::Trigger:
    1095             break;
    1096 
    1097         case QSystemTrayIcon::DoubleClick:
    1098             vboxGlobal().trayIconShowSelector();
    1099             break;
    1100 
    1101         case QSystemTrayIcon::MiddleClick:
    1102             break;
    1103 
    1104         default:
    1105             break;
    1106     }
    1107 }
    1108 
    1109 void UISelectorWindow::sltShowWindow()
    1110 {
    1111     showNormal();
    1112     raise();
    1113     activateWindow();
    1114 }
    1115 #endif // VBOX_GUI_WITH_SYSTRAY
    1116 
    1117 void UISelectorWindow::sltMediumEnumerationStarted()
    1118 {
    1119     /* Refresh the current details to pick up hard disk sizes: */
    1120     sltCurrentVMItemChanged(true /* fRefreshDetails */);
    1121 }
    1122 
    1123 void UISelectorWindow::sltMediumEnumFinished(const VBoxMediaList &list)
    1124 {
    1125     /* Refresh the current details to pick up hard disk sizes */
    1126     sltCurrentVMItemChanged(true /* fRefreshDetails */);
    1127 
    1128     /* We warn about inaccessible media only once (after media emumeration
    1129      * started from main() at startup), to avoid annoying the user */
    1130     if (m_fDoneInaccessibleWarningOnce
    1131 #ifdef VBOX_GUI_WITH_SYSTRAY
    1132         || vboxGlobal().isTrayMenu()
    1133 #endif /* VBOX_GUI_WITH_SYSTRAY */
    1134        )
    1135         return;
    1136 
    1137     m_fDoneInaccessibleWarningOnce = true;
    1138 
    1139     do
    1140     {
    1141         /* Ignore the signal if a modal widget is currently active (we won't be
    1142          * able to properly show the modeless VDI manager window in this case): */
    1143         if (QApplication::activeModalWidget())
    1144             break;
    1145 
    1146         /* Ignore the signal if a UIMediumManager window is active: */
    1147         if (qApp->activeWindow() &&
    1148             !strcmp(qApp->activeWindow()->metaObject()->className(), "UIMediumManager"))
    1149             break;
    1150 
    1151         /* Look for at least one inaccessible media: */
    1152         VBoxMediaList::const_iterator it;
    1153         for (it = list.begin(); it != list.end(); ++ it)
    1154             if ((*it).state() == KMediumState_Inaccessible)
    1155                 break;
    1156 
    1157         if (it != list.end() && msgCenter().remindAboutInaccessibleMedia())
    1158         {
    1159             /* Show the VDM dialog but don't refresh once more after a just-finished refresh: */
    1160             UIMediumManager::showModeless(this, false /* aRefresh */);
    1161         }
    1162     }
    1163     while (0);
    1164 }
    1165 
    1166927void UISelectorWindow::retranslateUi()
    1167928{
     
    1200961bool UISelectorWindow::event(QEvent *pEvent)
    1201962{
     963    /* Which event do we have? */
    1202964    switch (pEvent->type())
    1203965    {
     
    12471009            break;
    12481010    }
    1249 
     1011    /* Call to base-class: */
    12501012    return QMainWindow::event(pEvent);
    12511013}
     
    12531015void UISelectorWindow::closeEvent(QCloseEvent *pEvent)
    12541016{
    1255 #ifdef VBOX_GUI_WITH_SYSTRAY
    1256     /* Needed for breaking out of the while() loop in main(). */
    1257     if (vboxGlobal().isTrayMenu())
    1258         vboxGlobal().setTrayMenu(false);
    1259 #endif /* VBOX_GUI_WITH_SYSTRAY */
    1260 
     1017    // TODO: Such things are obsolete, rework required!
    12611018    emit closing();
    12621019    QMainWindow::closeEvent(pEvent);
     
    12661023bool UISelectorWindow::eventFilter(QObject *pObject, QEvent *pEvent)
    12671024{
     1025    /* Ignore for non-active window: */
    12681026    if (!isActiveWindow())
    12691027        return QIWithRetranslateUI2<QMainWindow>::eventFilter(pObject, pEvent);
    12701028
     1029    /* Ignore for other objects: */
    12711030    if (qobject_cast<QWidget*>(pObject) &&
    12721031        qobject_cast<QWidget*>(pObject)->window() != this)
    12731032        return QIWithRetranslateUI2<QMainWindow>::eventFilter(pObject, pEvent);
    12741033
     1034    /* Which event do we have? */
    12751035    switch (pEvent->type())
    12761036    {
     
    12961056            break;
    12971057    }
     1058    /* Call to base-class: */
    12981059    return QIWithRetranslateUI2<QMainWindow>::eventFilter(pObject, pEvent);
    12991060}
     
    13121073void UISelectorWindow::prepareMenuBar()
    13131074{
    1314     /* Prepare 'File' menu: */
     1075    /* Prepare File-menu: */
    13151076    m_pFileMenu = gActionPool->action(UIActionIndexSelector_Menu_File)->menu();
    13161077    prepareMenuFile(m_pFileMenu);
    13171078    menuBar()->addMenu(m_pFileMenu);
    13181079
    1319     /* Prepare 'Machine' menu: */
     1080    /* Prepare 'Close' menu: */
     1081    m_pMachineCloseMenuAction = gActionPool->action(UIActionIndexSelector_Menu_Machine_Close);
     1082    m_pMachineCloseMenu = m_pMachineCloseMenuAction->menu();
     1083    prepareMenuMachineClose(m_pMachineCloseMenu);
     1084
     1085    /* Prepare Group-menu: */
     1086    m_pGroupMenu = gActionPool->action(UIActionIndexSelector_Menu_Group)->menu();
     1087    prepareMenuGroup(m_pGroupMenu);
     1088    m_pGroupMenuAction = menuBar()->addMenu(m_pGroupMenu);
     1089
     1090    /* Prepare Machine-menu: */
    13201091    m_pMachineMenu = gActionPool->action(UIActionIndexSelector_Menu_Machine)->menu();
    13211092    prepareMenuMachine(m_pMachineMenu);
    1322     menuBar()->addMenu(m_pMachineMenu);
     1093    m_pMachineMenuAction = menuBar()->addMenu(m_pMachineMenu);
    13231094
    13241095#ifdef Q_WS_MAC
     
    13261097#endif /* Q_WS_MAC */
    13271098
    1328     /* Prepare 'Help' menu: */
     1099    /* Prepare Help-menu: */
    13291100    m_pHelpMenu = gActionPool->action(UIActionIndex_Menu_Help)->menu();
    13301101    prepareMenuHelp(m_pHelpMenu);
     
    13411112        return;
    13421113
    1343     /* Populate 'File' menu: */
     1114    /* Populate File-menu: */
    13441115    m_pMediumManagerDialogAction = gActionPool->action(UIActionIndexSelector_Simple_File_MediumManagerDialog);
    13451116    pMenu->addAction(m_pMediumManagerDialogAction);
     
    13601131}
    13611132
    1362 void UISelectorWindow::prepareMenuMachine(QMenu *pMenu)
     1133void UISelectorWindow::prepareMenuGroup(QMenu *pMenu)
    13631134{
    13641135    /* Do not touch if filled already: */
     
    13661137        return;
    13671138
    1368     /* Populate 'Machine' menu: */
    1369     m_pNewWizardAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_NewWizard);
    1370     pMenu->addAction(m_pNewWizardAction);
    1371     m_pAddDialogAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_AddDialog);
    1372     pMenu->addAction(m_pAddDialogAction);
    1373     m_pSettingsDialogAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_SettingsDialog);
    1374     pMenu->addAction(m_pSettingsDialogAction);
    1375     m_pCloneWizardAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_CloneWizard);
    1376     pMenu->addAction(m_pCloneWizardAction);
    1377     m_pRemoveDialogAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_RemoveDialog);
    1378     pMenu->addAction(m_pRemoveDialogAction);
     1139    /* Populate Machine-menu: */
     1140    m_pActionGroupNewWizard = gActionPool->action(UIActionIndexSelector_Simple_Group_NewWizard);
     1141    pMenu->addAction(m_pActionGroupNewWizard);
     1142    m_pActionGroupAddDialog = gActionPool->action(UIActionIndexSelector_Simple_Group_AddDialog);
     1143    pMenu->addAction(m_pActionGroupAddDialog);
     1144    m_pActionGroupRenameDialog = gActionPool->action(UIActionIndexSelector_Simple_Group_RenameDialog);
     1145    pMenu->addAction(m_pActionGroupRenameDialog);
     1146    m_pActionGroupRemoveDialog = gActionPool->action(UIActionIndexSelector_Simple_Group_RemoveDialog);
     1147    pMenu->addAction(m_pActionGroupRemoveDialog);
    13791148    pMenu->addSeparator();
    1380     m_pStartOrShowAction = gActionPool->action(UIActionIndexSelector_State_Machine_StartOrShow);
    1381     pMenu->addAction(m_pStartOrShowAction);
    1382     m_pDiscardAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_Discard);
    1383     pMenu->addAction(m_pDiscardAction);
    1384     m_pPauseAndResumeAction = gActionPool->action(UIActionIndexSelector_Toggle_Machine_PauseAndResume);
    1385     pMenu->addAction(m_pPauseAndResumeAction);
    1386     m_pResetAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_Reset);
    1387     pMenu->addAction(m_pResetAction);
    1388     /* Prepare 'machine/close' menu: */
    1389     m_pMachineCloseMenuAction = gActionPool->action(UIActionIndexSelector_Menu_Machine_Close);
    1390     m_pMachineCloseMenu = m_pMachineCloseMenuAction->menu();
    1391     prepareMenuMachineClose(m_pMachineCloseMenu);
     1149    m_pActionGroupStartOrShow = gActionPool->action(UIActionIndexSelector_State_Group_StartOrShow);
     1150    pMenu->addAction(m_pActionGroupStartOrShow);
     1151    m_pActionGroupPauseAndResume = gActionPool->action(UIActionIndexSelector_Toggle_Group_PauseAndResume);
     1152    pMenu->addAction(m_pActionGroupPauseAndResume);
     1153    m_pActionGroupReset = gActionPool->action(UIActionIndexSelector_Simple_Group_Reset);
     1154    pMenu->addAction(m_pActionGroupReset);
    13921155    pMenu->addMenu(m_pMachineCloseMenu);
    13931156    pMenu->addSeparator();
    1394     m_pRefreshAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_Refresh);
    1395     pMenu->addAction(m_pRefreshAction);
    1396     m_pLogDialogAction = gActionPool->action(UIActionIndex_Simple_LogDialog);
    1397     pMenu->addAction(m_pLogDialogAction);
     1157    m_pActionGroupRefresh = gActionPool->action(UIActionIndexSelector_Simple_Group_Refresh);
     1158    pMenu->addAction(m_pActionGroupRefresh);
     1159    m_pActionGroupLogDialog = gActionPool->action(UIActionIndex_Simple_LogDialog);
     1160    pMenu->addAction(m_pActionGroupLogDialog);
    13981161    pMenu->addSeparator();
    1399     m_pShowInFileManagerAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_ShowInFileManager);
    1400     pMenu->addAction(m_pShowInFileManagerAction);
    1401     m_pCreateShortcutAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_CreateShortcut);
    1402     pMenu->addAction(m_pCreateShortcutAction);
     1162    m_pActionGroupShowInFileManager = gActionPool->action(UIActionIndexSelector_Simple_Group_ShowInFileManager);
     1163    pMenu->addAction(m_pActionGroupShowInFileManager);
     1164    m_pActionGroupCreateShortcut = gActionPool->action(UIActionIndexSelector_Simple_Group_CreateShortcut);
     1165    pMenu->addAction(m_pActionGroupCreateShortcut);
    14031166    pMenu->addSeparator();
    1404     m_pSortAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_Sort);
    1405     pMenu->addAction(m_pSortAction);
    1406 }
    1407 
    1408 void UISelectorWindow::prepareMenuMachineClose(QMenu *pMenu)
     1167//    m_pActionGroupSort = gActionPool->action(UIActionIndexSelector_Simple_Group_Sort);
     1168//    pMenu->addAction(m_pActionGroupSort);
     1169}
     1170
     1171void UISelectorWindow::prepareMenuMachine(QMenu *pMenu)
    14091172{
    14101173    /* Do not touch if filled already: */
     
    14121175        return;
    14131176
    1414     /* Populate 'Machine/Close' menu: */
     1177    /* Populate Machine-menu: */
     1178    m_pActionMachineNewWizard = gActionPool->action(UIActionIndexSelector_Simple_Machine_NewWizard);
     1179    pMenu->addAction(m_pActionMachineNewWizard);
     1180    m_pActionMachineAddDialog = gActionPool->action(UIActionIndexSelector_Simple_Machine_AddDialog);
     1181    pMenu->addAction(m_pActionMachineAddDialog);
     1182    m_pActionMachineSettingsDialog = gActionPool->action(UIActionIndexSelector_Simple_Machine_SettingsDialog);
     1183    pMenu->addAction(m_pActionMachineSettingsDialog);
     1184    m_pActionMachineCloneWizard = gActionPool->action(UIActionIndexSelector_Simple_Machine_CloneWizard);
     1185    pMenu->addAction(m_pActionMachineCloneWizard);
     1186    m_pActionMachineRemoveDialog = gActionPool->action(UIActionIndexSelector_Simple_Machine_RemoveDialog);
     1187    pMenu->addAction(m_pActionMachineRemoveDialog);
     1188    pMenu->addSeparator();
     1189    m_pActionMachineStartOrShow = gActionPool->action(UIActionIndexSelector_State_Machine_StartOrShow);
     1190    pMenu->addAction(m_pActionMachineStartOrShow);
     1191    m_pActionMachineDiscard = gActionPool->action(UIActionIndexSelector_Simple_Machine_Discard);
     1192    pMenu->addAction(m_pActionMachineDiscard);
     1193    m_pActionMachinePauseAndResume = gActionPool->action(UIActionIndexSelector_Toggle_Machine_PauseAndResume);
     1194    pMenu->addAction(m_pActionMachinePauseAndResume);
     1195    m_pActionMachineReset = gActionPool->action(UIActionIndexSelector_Simple_Machine_Reset);
     1196    pMenu->addAction(m_pActionMachineReset);
     1197    pMenu->addMenu(m_pMachineCloseMenu);
     1198    pMenu->addSeparator();
     1199    m_pActionMachineRefresh = gActionPool->action(UIActionIndexSelector_Simple_Machine_Refresh);
     1200    pMenu->addAction(m_pActionMachineRefresh);
     1201    m_pActionMachineLogDialog = gActionPool->action(UIActionIndex_Simple_LogDialog);
     1202    pMenu->addAction(m_pActionMachineLogDialog);
     1203    pMenu->addSeparator();
     1204    m_pActionMachineShowInFileManager = gActionPool->action(UIActionIndexSelector_Simple_Machine_ShowInFileManager);
     1205    pMenu->addAction(m_pActionMachineShowInFileManager);
     1206    m_pActionMachineCreateShortcut = gActionPool->action(UIActionIndexSelector_Simple_Machine_CreateShortcut);
     1207    pMenu->addAction(m_pActionMachineCreateShortcut);
     1208    pMenu->addSeparator();
     1209//    m_pActionMachineSort = gActionPool->action(UIActionIndexSelector_Simple_Machine_Sort);
     1210//    pMenu->addAction(m_pActionMachineSort);
     1211}
     1212
     1213void UISelectorWindow::prepareMenuMachineClose(QMenu *pMenu)
     1214{
     1215    /* Do not touch if filled already: */
     1216    if (!pMenu->isEmpty())
     1217        return;
     1218
     1219    /* Populate Machine/Close-menu: */
    14151220    m_pACPIShutdownAction = gActionPool->action(UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown);
    14161221    pMenu->addAction(m_pACPIShutdownAction);
     
    14251230        return;
    14261231
    1427     /* Populate 'Help' menu: */
    1428     m_pHelpAction = gActionPool->action(UIActionIndex_Simple_Help);
     1232    /* Populate Help-menu: */
     1233    m_pHelpAction = gActionPool->action(UIActionIndex_Simple_Contents);
    14291234    pMenu->addAction(m_pHelpAction);
    1430     m_pWebAction = gActionPool->action(UIActionIndex_Simple_Web);
     1235    m_pWebAction = gActionPool->action(UIActionIndex_Simple_WebSite);
    14311236    pMenu->addAction(m_pWebAction);
    14321237    pMenu->addSeparator();
     
    14401245    pMenu->addAction(m_pRegisterAction);
    14411246#endif /* VBOX_WITH_REGISTRATION */
    1442     m_pUpdateAction = gActionPool->action(UIActionIndex_Simple_Update);
     1247    m_pUpdateAction = gActionPool->action(UIActionIndex_Simple_CheckForUpdates);
    14431248    pMenu->addAction(m_pUpdateAction);
    14441249#ifndef Q_WS_MAC
     
    14491254}
    14501255
    1451 void UISelectorWindow::prepareContextMenu()
    1452 {
    1453     m_pMachineContextMenu = new QMenu(this);
    1454     m_pMachineContextMenu->addAction(m_pSettingsDialogAction);
    1455     m_pMachineContextMenu->addAction(m_pCloneWizardAction);
    1456     m_pMachineContextMenu->addAction(m_pRemoveDialogAction);
    1457     m_pMachineContextMenu->addSeparator();
    1458     m_pMachineContextMenu->addAction(m_pStartOrShowAction);
    1459     m_pMachineContextMenu->addAction(m_pDiscardAction);
    1460     m_pMachineContextMenu->addAction(m_pPauseAndResumeAction);
    1461     m_pMachineContextMenu->addAction(m_pResetAction);
    1462     m_pMachineContextMenu->addMenu(m_pMachineCloseMenu);
    1463     m_pMachineContextMenu->addSeparator();
    1464     m_pMachineContextMenu->addAction(m_pRefreshAction);
    1465     m_pMachineContextMenu->addAction(m_pLogDialogAction);
    1466     m_pMachineContextMenu->addSeparator();
    1467     m_pMachineContextMenu->addAction(m_pShowInFileManagerAction);
    1468     m_pMachineContextMenu->addAction(m_pCreateShortcutAction);
    1469     m_pMachineContextMenu->addSeparator();
    1470     m_pMachineContextMenu->addAction(m_pSortAction);
    1471 }
    1472 
    14731256void UISelectorWindow::prepareStatusBar()
    14741257{
     
    14861269    /* Prepare splitter: */
    14871270    m_pSplitter = new QISplitter(this);
     1271#ifdef Q_WS_X11
    14881272    m_pSplitter->setHandleType(QISplitter::Native);
     1273#endif /* Q_WS_X11 */
    14891274
    14901275    /* Prepare tool-bar: */
     
    14931278    mVMToolBar->setIconSize(QSize(32, 32));
    14941279    mVMToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    1495     mVMToolBar->addAction(m_pNewWizardAction);
    1496     mVMToolBar->addAction(m_pSettingsDialogAction);
    1497     mVMToolBar->addAction(m_pStartOrShowAction);
    1498     mVMToolBar->addAction(m_pDiscardAction);
    1499 
    1500     /* Prepare VM list: */
    1501     m_pVMModel = new UIVMItemModel(this);
    1502     m_pVMListView = new UIVMListView(m_pVMModel);
    1503     m_pVMListView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    1504     /* Make non-possible to activate list elements by single click,
    1505      * this hack should disable the current possibility to do it if present: */
    1506     if (m_pVMListView->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, m_pVMListView))
    1507         m_pVMListView->setStyleSheet("activate-on-singleclick : 0");
     1280    mVMToolBar->addAction(m_pActionMachineNewWizard);
     1281    mVMToolBar->addAction(m_pActionMachineSettingsDialog);
     1282    mVMToolBar->addAction(m_pActionMachineStartOrShow);
     1283    mVMToolBar->addAction(m_pActionMachineDiscard);
     1284
     1285    /* Prepare graphics VM list: */
     1286    m_pChooser = new UIGChooser(this);
     1287    m_pChooser->setStatusBar(statusBar());
     1288
     1289    /* Prepare graphics details: */
     1290    m_pDetails = new UIGDetails(this);
    15081291
    15091292    /* Prepare details and snapshots tabs: */
    1510     m_pVMDesktop = new UIVMDesktop(mVMToolBar, m_pRefreshAction, this);
     1293    m_pVMDesktop = new UIVMDesktop(mVMToolBar, m_pActionMachineRefresh, this);
     1294
     1295    /* Crate container: */
     1296    m_pContainer = new QStackedWidget(this);
     1297    m_pContainer->addWidget(m_pDetails);
     1298    m_pContainer->addWidget(m_pVMDesktop);
    15111299
    15121300    /* Layout all the widgets: */
    1513 #define BIG_TOOLBAR
    15141301#if MAC_LEOPARD_STYLE
    15151302    addToolBar(mVMToolBar);
    15161303    /* Central widget @ horizontal layout: */
    15171304    setCentralWidget(m_pSplitter);
    1518     m_pSplitter->addWidget(m_pVMListView);
     1305    m_pSplitter->addWidget(m_pChooser);
    15191306#else /* MAC_LEOPARD_STYLE */
    1520     QWidget *pLeftWidget = new QWidget(this);
    1521     QVBoxLayout *pLeftVLayout = new QVBoxLayout(pLeftWidget);
    1522     pLeftVLayout->setContentsMargins(0, 0, 0, 0);
    1523     pLeftVLayout->setSpacing(0);
    1524 # ifdef BIG_TOOLBAR
     1307    QWidget *pCentralWidget = new QWidget(this);
     1308    setCentralWidget(pCentralWidget);
     1309    QVBoxLayout *pCentralLayout = new QVBoxLayout(pCentralWidget);
     1310    pCentralLayout->setContentsMargins(0, 0, 0, 0);
     1311    pCentralLayout->setSpacing(0);
    15251312    m_pBar = new UIMainBar(this);
    15261313    m_pBar->setContentWidget(mVMToolBar);
    1527     pLeftVLayout->addWidget(m_pBar);
    1528     pLeftVLayout->addWidget(m_pSplitter);
    1529     setCentralWidget(pLeftWidget);
    1530     m_pSplitter->addWidget(m_pVMListView);
    1531 # else /* BIG_TOOLBAR */
    1532     pLeftVLayout->addWidget(mVMToolBar);
    1533     pLeftVLayout->addWidget(m_pVMListView);
    1534     setCentralWidget(m_pSplitter);
    1535     m_pSplitter->addWidget(pLeftWidget);
    1536 # endif /* !BIG_TOOLBAR */
     1314    pCentralLayout->addWidget(m_pBar);
     1315    pCentralLayout->addWidget(m_pSplitter);
     1316    m_pSplitter->addWidget(m_pChooser);
    15371317#endif /* !MAC_LEOPARD_STYLE */
    1538     m_pSplitter->addWidget(m_pVMDesktop);
     1318    m_pSplitter->addWidget(m_pContainer);
    15391319
    15401320    /* Set the initial distribution. The right site is bigger. */
     
    15421322    m_pSplitter->setStretchFactor(1, 3);
    15431323
    1544     /* Refresh VM list: */
    1545     sltRefreshVMList();
    1546     /* Reset to the first item: */
    1547     m_pVMListView->selectItemByRow(0);
    15481324    /* Bring the VM list to the focus: */
    1549     m_pVMListView->setFocus();
    1550 
    1551 #ifdef VBOX_GUI_WITH_SYSTRAY
    1552     m_pTrayIcon = new VBoxTrayIcon(this, m_pVMModel);
    1553     Assert(m_pTrayIcon);
    1554 #endif /* VBOX_GUI_WITH_SYSTRAY */
     1325    m_pChooser->setFocus();
    15551326}
    15561327
    15571328void UISelectorWindow::prepareConnections()
    15581329{
    1559     /* VirtualBox event connections: */
    1560     connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), this, SLOT(sltMachineStateChanged(QString, KMachineState)));
    1561     connect(gVBoxEvents, SIGNAL(sigMachineDataChange(QString)), this, SLOT(sltMachineDataChanged(QString)));
    1562     connect(gVBoxEvents, SIGNAL(sigMachineRegistered(QString, bool)), this, SLOT(sltMachineRegistered(QString, bool)));
    1563     connect(gVBoxEvents, SIGNAL(sigSessionStateChange(QString, KSessionState)), this, SLOT(sltSessionStateChanged(QString, KSessionState)));
    1564     connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)), this, SLOT(sltSnapshotChanged(QString, QString)));
    1565 
    15661330    /* Medium enumeration connections: */
    1567     connect(&vboxGlobal(), SIGNAL(mediumEnumStarted()), this, SLOT(sltMediumEnumerationStarted()));
    15681331    connect(&vboxGlobal(), SIGNAL(mediumEnumFinished(const VBoxMediaList &)), this, SLOT(sltMediumEnumFinished(const VBoxMediaList &)));
    15691332
     
    15781341    connect(m_pExitAction, SIGNAL(triggered()), this, SLOT(sltPerformExit()));
    15791342
     1343    /* 'Group' menu connections: */
     1344    connect(m_pGroupMenu, SIGNAL(aboutToShow()), this, SLOT(sltMachineMenuAboutToShow()));
     1345    connect(m_pActionGroupNewWizard, SIGNAL(triggered()), this, SLOT(sltShowCreateMachineWizard()));
     1346    connect(m_pActionGroupAddDialog, SIGNAL(triggered()), this, SLOT(sltShowAddMachineDialog()));
     1347    connect(m_pActionGroupStartOrShow, SIGNAL(triggered()), this, SLOT(sltPerformStartOrShowAction()));
     1348    connect(m_pActionGroupPauseAndResume, SIGNAL(toggled(bool)), this, SLOT(sltPerformPauseResumeAction(bool)));
     1349    connect(m_pActionGroupReset, SIGNAL(triggered()), this, SLOT(sltPerformResetAction()));
     1350    connect(m_pActionGroupRefresh, SIGNAL(triggered()), this, SLOT(sltPerformRefreshAction()));
     1351    connect(m_pActionGroupLogDialog, SIGNAL(triggered()), this, SLOT(sltShowLogDialog()));
     1352    connect(m_pActionGroupShowInFileManager, SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager()));
     1353    connect(m_pActionGroupCreateShortcut, SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction()));
     1354
    15801355    /* 'Machine' menu connections: */
    15811356    connect(m_pMachineMenu, SIGNAL(aboutToShow()), this, SLOT(sltMachineMenuAboutToShow()));
    1582     connect(m_pNewWizardAction, SIGNAL(triggered()), this, SLOT(sltShowNewMachineWizard()));
    1583     connect(m_pAddDialogAction, SIGNAL(triggered()), this, SLOT(sltShowAddMachineDialog()));
    1584     connect(m_pSettingsDialogAction, SIGNAL(triggered()), this, SLOT(sltShowMachineSettingsDialog()));
    1585     connect(m_pCloneWizardAction, SIGNAL(triggered()), this, SLOT(sltShowCloneMachineWizard()));
    1586     connect(m_pRemoveDialogAction, SIGNAL(triggered()), this, SLOT(sltShowRemoveMachineDialog()));
    1587     connect(m_pStartOrShowAction, SIGNAL(triggered()), this, SLOT(sltPerformStartOrShowAction()));
    1588     connect(m_pDiscardAction, SIGNAL(triggered()), this, SLOT(sltPerformDiscardAction()));
    1589     connect(m_pPauseAndResumeAction, SIGNAL(toggled(bool)), this, SLOT(sltPerformPauseResumeAction(bool)));
    1590     connect(m_pResetAction, SIGNAL(triggered()), this, SLOT(sltPerformResetAction()));
    1591     connect(m_pRefreshAction, SIGNAL(triggered()), this, SLOT(sltPerformRefreshAction()));
    1592     connect(m_pLogDialogAction, SIGNAL(triggered()), this, SLOT(sltShowLogDialog()));
    1593     connect(m_pShowInFileManagerAction, SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager()));
    1594     connect(m_pCreateShortcutAction, SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction()));
    1595     connect(m_pSortAction, SIGNAL(triggered()), this, SLOT(sltPerformSortAction()));
     1357    connect(m_pActionMachineNewWizard, SIGNAL(triggered()), this, SLOT(sltShowCreateMachineWizard()));
     1358    connect(m_pActionMachineAddDialog, SIGNAL(triggered()), this, SLOT(sltShowAddMachineDialog()));
     1359    connect(m_pActionMachineSettingsDialog, SIGNAL(triggered()), this, SLOT(sltShowMachineSettingsDialog()));
     1360    connect(m_pActionMachineCloneWizard, SIGNAL(triggered()), this, SLOT(sltShowCloneMachineWizard()));
     1361    connect(m_pActionMachineStartOrShow, SIGNAL(triggered()), this, SLOT(sltPerformStartOrShowAction()));
     1362    connect(m_pActionMachineDiscard, SIGNAL(triggered()), this, SLOT(sltPerformDiscardAction()));
     1363    connect(m_pActionMachinePauseAndResume, SIGNAL(toggled(bool)), this, SLOT(sltPerformPauseResumeAction(bool)));
     1364    connect(m_pActionMachineReset, SIGNAL(triggered()), this, SLOT(sltPerformResetAction()));
     1365    connect(m_pActionMachineRefresh, SIGNAL(triggered()), this, SLOT(sltPerformRefreshAction()));
     1366    connect(m_pActionMachineLogDialog, SIGNAL(triggered()), this, SLOT(sltShowLogDialog()));
     1367    connect(m_pActionMachineShowInFileManager, SIGNAL(triggered()), this, SLOT(sltShowMachineInFileManager()));
     1368    connect(m_pActionMachineCreateShortcut, SIGNAL(triggered()), this, SLOT(sltPerformCreateShortcutAction()));
    15961369
    15971370    /* 'Machine/Close' menu connections: */
     
    16121385    connect(m_pAboutAction, SIGNAL(triggered()), &msgCenter(), SLOT(sltShowHelpAboutDialog()));
    16131386
    1614     /* 'Machine' context menu connections: */
    1615     connect(m_pMachineContextMenu, SIGNAL(aboutToShow()), this, SLOT(sltMachineMenuAboutToShow()));
    1616     connect(m_pMachineContextMenu, SIGNAL(hovered(QAction*)), this, SLOT(sltMachineContextMenuHovered(QAction*)));
    1617 
    16181387    /* Status-bar connections: */
    16191388    connect(statusBar(), SIGNAL(customContextMenuRequested(const QPoint&)),
    16201389            this, SLOT(sltShowSelectorContextMenu(const QPoint&)));
    16211390
    1622     /* VM list-view connections: */
    1623     connect(m_pVMListView, SIGNAL(sigUrlsDropped(QList<QUrl>)), this, SLOT(sltOpenUrls(QList<QUrl>)), Qt::QueuedConnection);
    1624     connect(m_pVMListView, SIGNAL(currentChanged()), this, SLOT(sltCurrentVMItemChanged()));
    1625     connect(m_pVMListView, SIGNAL(activated()), this, SLOT(sltPerformStartOrShowAction()));
    1626     connect(m_pVMListView, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(sltShowContextMenu(const QPoint &)));
     1391    /* Graphics VM chooser connections: */
     1392    connect(m_pChooser, SIGNAL(sigSelectionChanged()), this, SLOT(sltCurrentVMItemChanged()), Qt::QueuedConnection);
    16271393
    16281394    /* Tool-bar connections: */
     
    16361402
    16371403    /* VM desktop connections: */
    1638     connect(m_pVMDesktop, SIGNAL(linkClicked(const QString &)), this, SLOT(sltShowMachineSettingsDialog(const QString &)));
     1404    connect(m_pVMDesktop, SIGNAL(sigCurrentChanged(int)), this, SLOT(sltDetailsViewIndexChanged(int)));
     1405    connect(m_pDetails, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)),
     1406            this, SLOT(sltShowMachineSettingsDialog(const QString&, const QString&, const QString&)));
    16391407
    16401408#ifdef VBOX_GUI_WITH_SYSTRAY
     
    16951463            setGeometry(m_normalGeo);
    16961464        }
    1697     }
    1698 
    1699     /* Restore selected VM(s): */
    1700     {
    1701         QString strPrevVMId = vbox.GetExtraData(GUI_LastVMSelected);
    1702 
    1703         m_pVMListView->selectItemById(strPrevVMId);
    17041465    }
    17051466
     
    17521513    }
    17531514
    1754     /* Save selected VM(s): */
    1755     {
    1756         UIVMItem *pItem = m_pVMListView->currentItem();
    1757         QString strCurrentVMId = pItem ? QString(pItem->id()) : QString();
    1758         vbox.SetExtraData(GUI_LastVMSelected, strCurrentVMId);
    1759         vbox.SetExtraDataStringList(GUI_SelectorVMPositions, m_pVMModel->idList());
    1760     }
    1761 
    17621515    /* Save splitter handle position: */
    17631516    {
     
    17661519}
    17671520
    1768 bool UISelectorWindow::isActionEnabled(int iActionIndex, UIVMItem *pItem, const QList<UIVMItem*> &items)
    1769 {
    1770     if (pItem)
    1771     {
    1772         switch (iActionIndex)
    1773         {
    1774             case UIActionIndexSelector_Simple_Machine_SettingsDialog:
     1521UIVMItem* UISelectorWindow::currentItem() const
     1522{
     1523    return m_pChooser->currentItem();
     1524}
     1525
     1526QList<UIVMItem*> UISelectorWindow::currentItems() const
     1527{
     1528    return m_pChooser->currentItems();
     1529}
     1530
     1531bool UISelectorWindow::isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items)
     1532{
     1533    /* No actions enabled for empty item list: */
     1534    if (items.isEmpty())
     1535        return false;
     1536
     1537    /* Get first item: */
     1538    UIVMItem *pItem = items.first();
     1539
     1540    /* For known action types: */
     1541    switch (iActionIndex)
     1542    {
     1543        case UIActionIndexSelector_Simple_Machine_SettingsDialog:
     1544        {
     1545            /* Check that there is only one item, its accessible
     1546             * and machine is not in 'stuck' or 'saved' state. */
     1547            return items.size() == 1 &&
     1548                   pItem->accessible() &&
     1549                   pItem->machineState() != KMachineState_Stuck &&
     1550                   pItem->machineState() != KMachineState_Saved;
     1551        }
     1552        case UIActionIndexSelector_Simple_Machine_CloneWizard:
     1553        {
     1554            /* Check that there is only one item, its accessible
     1555             * and session state is unlocked. */
     1556            return items.size() == 1 &&
     1557                   pItem->accessible() &&
     1558                   pItem->sessionState() == KSessionState_Unlocked;
     1559        }
     1560        case UIActionIndexSelector_Simple_Group_RenameDialog:
     1561        case UIActionIndexSelector_Simple_Group_RemoveDialog:
     1562        {
     1563            /* Group can be always removed/renamed: */
     1564            return true;
     1565        }
     1566        case UIActionIndexSelector_Simple_Machine_RemoveDialog:
     1567        {
     1568            /* Check that all machines are NOT accessible
     1569             * or session states of all machines are unlocked. */
     1570            return isItemsInaccessible(items) || isItemsHasUnlockedSession(items);
     1571        }
     1572        case UIActionIndexSelector_State_Group_StartOrShow:
     1573        case UIActionIndexSelector_State_Machine_StartOrShow:
     1574        {
     1575            /* Make sure all items are accessible: */
     1576            if (!isItemsAccessible(items))
     1577                return false;
     1578
     1579            /* If machine is in one of 'powered-off' states:*/
     1580            if (pItem->machineState() == KMachineState_PoweredOff ||
     1581                pItem->machineState() == KMachineState_Saved ||
     1582                pItem->machineState() == KMachineState_Teleported ||
     1583                pItem->machineState() == KMachineState_Aborted)
    17751584            {
    1776                 /* Check that there is only one item, its accessible
    1777                  * and machine is not in 'stuck' or 'saved' state.
    1778                  * Modifying VM settings in 'saved' state will be available later. */
    1779                 return items.size() == 1 &&
    1780                        pItem && pItem->accessible() &&
    1781                        pItem->machineState() != KMachineState_Stuck &&
    1782                        pItem->machineState() != KMachineState_Saved;
     1585                /* It depends on session state: */
     1586                return pItem->sessionState() == KSessionState_Unlocked;
    17831587            }
    1784             case UIActionIndexSelector_Simple_Machine_CloneWizard:
     1588
     1589            /* Otherwise we are in running mode and
     1590             * should allow to switch to VM if its possible: */
     1591            return pItem->canSwitchTo();
     1592        }
     1593        case UIActionIndexSelector_Simple_Machine_Discard:
     1594        {
     1595            /* Check that there is only one item, its accessible
     1596             * and machine is in 'saved' state and session state is unlocked. */
     1597            return items.size() == 1 &&
     1598                   pItem->accessible() &&
     1599                   pItem->machineState() == KMachineState_Saved &&
     1600                   pItem->sessionState() == KSessionState_Unlocked;
     1601        }
     1602        case UIActionIndexSelector_Toggle_Group_PauseAndResume:
     1603        case UIActionIndexSelector_Toggle_Machine_PauseAndResume:
     1604        {
     1605            /* Make sure all items are accessible: */
     1606            if (!isItemsAccessible(items))
     1607                return false;
     1608
     1609            /* True if machine is in one of next 'running' or 'paused' states: */
     1610            return pItem->machineState() == KMachineState_Running ||
     1611                   pItem->machineState() == KMachineState_Teleporting ||
     1612                   pItem->machineState() == KMachineState_LiveSnapshotting ||
     1613                   pItem->machineState() == KMachineState_Paused ||
     1614                   pItem->machineState() == KMachineState_TeleportingPausedVM;
     1615        }
     1616        case UIActionIndexSelector_Simple_Group_Reset:
     1617        case UIActionIndexSelector_Simple_Machine_Reset:
     1618        {
     1619            /* Make sure all items are accessible: */
     1620            if (!isItemsAccessible(items))
     1621                return false;
     1622
     1623            /* True if machine is in one of 'running' states: */
     1624            return pItem->machineState() == KMachineState_Running ||
     1625                   pItem->machineState() == KMachineState_Teleporting ||
     1626                   pItem->machineState() == KMachineState_LiveSnapshotting;
     1627        }
     1628        case UIActionIndexSelector_Menu_Machine_Close:
     1629        {
     1630            /* Make sure all items are accessible: */
     1631            if (!isItemsAccessible(items))
     1632                return false;
     1633
     1634            /* True if machine is in one of next 'running' or 'paused' states: */
     1635            return pItem->machineState() == KMachineState_Running ||
     1636                   pItem->machineState() == KMachineState_Paused;
     1637        }
     1638        case UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown:
     1639        {
     1640            /* Check that 'Machine/Close' menu is enabled: */
     1641            if (!isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, items))
     1642                return false;
     1643
     1644            /* Check if we are entered ACPI mode already.
     1645             * Only then it make sense to send the ACPI shutdown sequence: */
     1646            bool fEnteredACPIMode = false;
     1647            CSession session = vboxGlobal().openExistingSession(pItem->id());
     1648            if (!session.isNull())
    17851649            {
    1786                 /* Check that there is only one item, its accessible
    1787                  * and session state is unlocked. */
    1788                 return items.size() == 1 &&
    1789                        pItem && pItem->accessible() &&
    1790                        pItem->sessionState() == KSessionState_Unlocked;
     1650                CConsole console = session.GetConsole();
     1651                if (!console.isNull())
     1652                    fEnteredACPIMode = console.GetGuestEnteredACPIMode();
     1653                session.UnlockMachine();
    17911654            }
    1792             case UIActionIndexSelector_Simple_Machine_RemoveDialog:
    1793             {
    1794                 /* Check that item is present and
    1795                  * machine is not accessible or session state is unlocked. */
    1796                 return pItem &&
    1797                        (!pItem->accessible() || pItem->sessionState() == KSessionState_Unlocked);
    1798             }
    1799             case UIActionIndexSelector_State_Machine_StartOrShow:
    1800             {
    1801                 /* Check that item present and accessible: */
    1802                 if (!pItem || !pItem->accessible())
    1803                     return false;
    1804 
    1805                 /* Check if we are in powered off mode which unifies next possible states.
    1806                  * Then if session state is unlocked we can allow to start VM. */
    1807                 if (pItem->machineState() == KMachineState_PoweredOff ||
    1808                     pItem->machineState() == KMachineState_Saved ||
    1809                     pItem->machineState() == KMachineState_Teleported ||
    1810                     pItem->machineState() == KMachineState_Aborted)
    1811                     return pItem->sessionState() == KSessionState_Unlocked;
    1812 
    1813                 /* Otherwise we are in running mode and
    1814                  * should allow to switch to VM if its possible: */
    1815                 return pItem->canSwitchTo();
    1816             }
    1817             case UIActionIndexSelector_Simple_Machine_Discard:
    1818             {
    1819                 /* Check that there is only one item, its accessible
    1820                  * and machine is in 'saved' state and session state is unlocked. */
    1821                 return items.size() == 1 &&
    1822                        pItem && pItem->accessible() &&
    1823                        pItem->machineState() == KMachineState_Saved &&
    1824                        pItem->sessionState() == KSessionState_Unlocked;
    1825             }
    1826             case UIActionIndexSelector_Toggle_Machine_PauseAndResume:
    1827             {
    1828                 /* Check that item present and accessible
    1829                  * and machine is in 'running' or 'paused' mode which unifies next possible states. */
    1830                 return pItem && pItem->accessible() &&
    1831                        (pItem->machineState() == KMachineState_Running ||
    1832                         pItem->machineState() == KMachineState_Teleporting ||
    1833                         pItem->machineState() == KMachineState_LiveSnapshotting ||
    1834                         pItem->machineState() == KMachineState_Paused ||
    1835                         pItem->machineState() == KMachineState_TeleportingPausedVM);
    1836             }
    1837             case UIActionIndexSelector_Simple_Machine_Reset:
    1838             {
    1839                 /* Check that item present and accessible
    1840                  * and machine is in 'running' mode which unifies next possible states. */
    1841                 return pItem && pItem->accessible() &&
    1842                        (pItem->machineState() == KMachineState_Running ||
    1843                         pItem->machineState() == KMachineState_Teleporting ||
    1844                         pItem->machineState() == KMachineState_LiveSnapshotting);
    1845             }
    1846             case UIActionIndexSelector_Menu_Machine_Close:
    1847             {
    1848                 /* Check that item present and accessible
    1849                  * and machine is in 'running' or 'paused' state. */
    1850                 return pItem && pItem->accessible() &&
    1851                        (pItem->machineState() == KMachineState_Running ||
    1852                         pItem->machineState() == KMachineState_Paused);
    1853             }
    1854             case UIActionIndexSelector_Simple_Machine_Close_ACPIShutdown:
    1855             {
    1856                 /* Check that 'Machine/Close' menu is enabled: */
    1857                 if (!isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, pItem, items))
    1858                     return false;
    1859 
    1860                 /* Check if we are entered ACPI mode already.
    1861                  * Only then it make sense to send the ACPI shutdown sequence: */
    1862                 bool fEnteredACPIMode = false;
    1863                 CSession session = vboxGlobal().openExistingSession(pItem->id());
    1864                 if (!session.isNull())
    1865                 {
    1866                     CConsole console = session.GetConsole();
    1867                     if (!console.isNull())
    1868                         fEnteredACPIMode = console.GetGuestEnteredACPIMode();
    1869                     session.UnlockMachine();
    1870                 }
    1871                 else
    1872                     msgCenter().cannotOpenSession(session);
    1873 
    1874                 return fEnteredACPIMode;
    1875             }
    1876             case UIActionIndexSelector_Simple_Machine_Close_PowerOff:
    1877             {
    1878                 /* The same as 'Machine/Close' menu is enabled: */
    1879                 return isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, pItem, items);
    1880             }
    1881             case UIActionIndexSelector_Simple_Machine_Refresh:
    1882             {
    1883                 /* Check if item present and NOT accessible: */
    1884                 return pItem && !pItem->accessible();
    1885             }
    1886             case UIActionIndex_Simple_LogDialog:
    1887             case UIActionIndexSelector_Simple_Machine_ShowInFileManager:
    1888             case UIActionIndexSelector_Simple_Machine_Sort:
    1889             {
    1890                 /* Check if item present and accessible: */
    1891                 return pItem && pItem->accessible();
    1892             }
    1893             case UIActionIndexSelector_Simple_Machine_CreateShortcut:
    1894             {
     1655            else
     1656                msgCenter().cannotOpenSession(session);
     1657            return fEnteredACPIMode;
     1658        }
     1659        case UIActionIndexSelector_Simple_Machine_Close_PowerOff:
     1660        {
     1661            /* The same as 'Machine/Close' menu is enabled: */
     1662            return isActionEnabled(UIActionIndexSelector_Menu_Machine_Close, items);
     1663        }
     1664        case UIActionIndexSelector_Simple_Group_Refresh:
     1665        case UIActionIndexSelector_Simple_Machine_Refresh:
     1666        {
     1667            /* Make sure all items are NOT accessible: */
     1668            return isItemsInaccessible(items);
     1669        }
     1670        case UIActionIndex_Simple_LogDialog:
     1671        case UIActionIndexSelector_Simple_Group_ShowInFileManager:
     1672        case UIActionIndexSelector_Simple_Machine_ShowInFileManager:
     1673//        case UIActionIndexSelector_Simple_Group_Sort:
     1674//        case UIActionIndexSelector_Simple_Machine_Sort:
     1675//        {
     1676//            /* Make sure all items are accessible: */
     1677//            return isItemsAccessible(items);
     1678//        }
     1679        case UIActionIndexSelector_Simple_Group_CreateShortcut:
     1680        case UIActionIndexSelector_Simple_Machine_CreateShortcut:
     1681        {
     1682            /* Make sure all items supports shortcuts: */
     1683            return isItemsSupportsShortcuts(items);
     1684        }
     1685        default:
     1686            break;
     1687    }
     1688
     1689    /* Unknown actions are disabled: */
     1690    return false;
     1691}
     1692
     1693/* static */
     1694bool UISelectorWindow::isItemsAccessible(const QList<UIVMItem*> &items)
     1695{
     1696    foreach (UIVMItem *pItem, items)
     1697        if (!pItem->accessible())
     1698            return false;
     1699    return true;
     1700}
     1701
     1702/* static */
     1703bool UISelectorWindow::isItemsInaccessible(const QList<UIVMItem*> &items)
     1704{
     1705    foreach (UIVMItem *pItem, items)
     1706        if (pItem->accessible())
     1707            return false;
     1708    return true;
     1709}
     1710
     1711/* static */
     1712bool UISelectorWindow::isItemsHasUnlockedSession(const QList<UIVMItem*> &items)
     1713{
     1714    foreach (UIVMItem *pItem, items)
     1715        if (pItem->sessionState() != KSessionState_Unlocked)
     1716            return false;
     1717    return true;
     1718}
     1719
     1720/* static */
     1721bool UISelectorWindow::isItemsSupportsShortcuts(const QList<UIVMItem*> &items)
     1722{
     1723    /* Make sure all items are accessible: */
     1724    if (!isItemsAccessible(items))
     1725        return false;
     1726
    18951727#ifdef Q_WS_MAC
    1896                 /* On Mac OS X this are real alias files, which don't work with the old
    1897                  * legacy xml files. On the other OS's some kind of start up script is used. */
    1898                 return pItem && pItem->accessible() &&
    1899                        pItem->settingsFile().endsWith(".vbox", Qt::CaseInsensitive);
    1900 #else /* Q_WS_MAC */
    1901                 return pItem && pItem->accessible();
     1728    /* On Mac OS X this are real alias files, which don't work with the old
     1729     * legacy xml files. On the other OS's some kind of start up script is used. */
     1730    foreach (UIVMItem *pItem, items)
     1731        if (!pItem->settingsFile().endsWith(".vbox", Qt::CaseInsensitive))
     1732            return false;
    19021733#endif /* Q_WS_MAC */
    1903             }
    1904             default:
    1905                 break;
    1906         }
    1907     }
    1908     return false;
    1909 }
    1910 
     1734
     1735    /* True by default: */
     1736    return true;
     1737}
     1738
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r41846 r42526  
    66
    77/*
    8  * Copyright (C) 2006-2011 Oracle Corporation
     8 * Copyright (C) 2006-2012 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2323#include <QMainWindow>
    2424#include <QUrl>
    25 #ifdef VBOX_GUI_WITH_SYSTRAY
    26 # include <QSystemTrayIcon>
    27 #endif /* VBOX_GUI_WITH_SYSTRAY */
    2825
    2926/* GUI includes: */
     
    3532class QISplitter;
    3633class QMenu;
    37 class UIActionInterface;
     34class UIAction;
    3835class UIMainBar;
    3936class UIToolBar;
     
    4239class UIVMItemModel;
    4340class UIVMListView;
    44 #ifdef VBOX_GUI_WITH_SYSTRAY
    45 class VBoxTrayIcon;
    46 #endif /* VBOX_GUI_WITH_SYSTRAY */
     41class UIGChooser;
     42class UIGDetails;
     43class QStackedWidget;
    4744
    4845/* VM selector window class: */
     
    5148    Q_OBJECT;
    5249
     50signals:
     51
     52    /* Obsolete: Signal to notify listeners about this dialog closed: */
     53    void closing();
     54
    5355public:
    5456
     
    5759                     QWidget* pParent = 0,
    5860                     Qt::WindowFlags flags = Qt::Window);
    59     virtual ~UISelectorWindow();
    60 
    61 signals:
    62 
    63     /* Signal to notify listeners about this dialog closed: */
    64     void closing();
     61    ~UISelectorWindow();
    6562
    6663private slots:
    6764
    68     /* Menubar/status bar slots: */
     65    /* Handler: Details-view stuff: */
     66    void sltDetailsViewIndexChanged(int iWidgetIndex);
     67
     68    /* Handler: Medium enumeration stuff: */
     69    void sltMediumEnumFinished(const VBoxMediaList &mediumList);
     70
     71    /* Handler: Menubar/status stuff: */
    6972    void sltShowSelectorContextMenu(const QPoint &pos);
    7073
    71     /* 'File' menu slots: */
     74    /* Handlers: File-menu stuff: */
    7275    void sltShowMediumManager();
    7376    void sltShowImportApplianceWizard(const QString &strFileName = QString());
     
    7679    void sltPerformExit();
    7780
    78     /* 'Machine' menu slots: */
    79     void sltShowNewMachineWizard();
     81    /* Handlers: Machine-menu slots: */
     82    void sltShowCreateMachineWizard();
    8083    void sltShowAddMachineDialog(const QString &strFileName = QString());
    8184    void sltShowMachineSettingsDialog(const QString &strCategory = QString(),
    8285                                      const QString &strControl = QString(),
    83                                       const QString &strMachineId = QString());
     86                                      const QString &strId = QString());
    8487    void sltShowCloneMachineWizard();
    85     void sltShowRemoveMachineDialog();
    8688    void sltPerformStartOrShowAction();
    8789    void sltPerformDiscardAction();
     
    9496    void sltShowMachineInFileManager();
    9597    void sltPerformCreateShortcutAction();
    96     void sltPerformSortAction();
    9798    void sltMachineMenuAboutToShow();
    9899    void sltMachineCloseMenuAboutToShow();
    99     void sltMachineContextMenuHovered(QAction *pAction);
    100100
    101101    /* VM list slots: */
    102     void sltRefreshVMList();
    103     void sltRefreshVMItem(const QString &strMachineId, bool fDetails, bool fSnapshots, bool fDescription);
    104     void sltShowContextMenu(const QPoint &point);
    105102    void sltCurrentVMItemChanged(bool fRefreshDetails = true, bool fRefreshSnapshots = true, bool fRefreshDescription = true);
    106103    void sltOpenUrls(QList<QUrl> list = QList<QUrl>());
    107 
    108     /* VirtualBox callback events we're interested in: */
    109     void sltMachineRegistered(QString strID, bool fRegistered);
    110     void sltMachineStateChanged(QString strId, KMachineState state);
    111     void sltMachineDataChanged(QString strId);
    112     void sltSessionStateChanged(QString strId, KSessionState state);
    113     void sltSnapshotChanged(QString strId, QString strSnapshotId);
    114 #ifdef VBOX_GUI_WITH_SYSTRAY
    115     /* Sys tray related event handlers: */
    116     void sltMainWindowCountChanged(int count);
    117     void sltTrayIconCanShow(bool fEnabled);
    118     void sltTrayIconShow(bool fEnabled);
    119     void sltTrayIconChanged(bool fEnabled);
    120     /* Sys tray related slots: */
    121     void sltTrayIconActivated(QSystemTrayIcon::ActivationReason aReason);
    122     void sltShowWindow();
    123 #endif /* VBOX_GUI_WITH_SYSTRAY */
    124 
    125     /* Medium enumeration related slots: */
    126     void sltMediumEnumerationStarted();
    127     void sltMediumEnumFinished(const VBoxMediaList &mediumList);
    128104
    129105private:
     
    139115#endif /* Q_WS_MAC */
    140116
    141     /* Helping stuff: */
     117    /* Helpers: Prepare stuff: */
    142118    void prepareIcon();
    143119    void prepareMenuBar();
    144120    void prepareMenuFile(QMenu *pMenu);
     121    void prepareMenuGroup(QMenu *pMenu);
    145122    void prepareMenuMachine(QMenu *pMenu);
    146123    void prepareMenuMachineClose(QMenu *pMenu);
    147124    void prepareMenuHelp(QMenu *pMenu);
    148     void prepareContextMenu();
    149125    void prepareStatusBar();
    150126    void prepareWidgets();
     
    153129    void saveSettings();
    154130
    155     /* Static helping stuff: */
    156     static bool isActionEnabled(int iActionIndex, UIVMItem *pItem, const QList<UIVMItem*> &items);
     131    /* Helpers: Current item stuff: */
     132    UIVMItem* currentItem() const;
     133    QList<UIVMItem*> currentItems() const;
     134
     135    /* Helpers: Action stuff: */
     136    static bool isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items);
     137    static bool isItemsAccessible(const QList<UIVMItem*> &items);
     138    static bool isItemsInaccessible(const QList<UIVMItem*> &items);
     139    static bool isItemsHasUnlockedSession(const QList<UIVMItem*> &items);
     140    static bool isItemsSupportsShortcuts(const QList<UIVMItem*> &items);
    157141
    158142    /* Central splitter window: */
     
    165149    UIToolBar *mVMToolBar;
    166150
    167     /* VM list view: */
    168     UIVMListView *m_pVMListView;
    169     /* VM list model: */
    170     UIVMItemModel *m_pVMModel;
    171     /* VM list context menu: */
    172     QMenu *m_pMachineContextMenu;
     151    /* Details widgets container: */
     152    QStackedWidget *m_pContainer;
     153
     154    /* Graphics chooser/details: */
     155    UIGChooser *m_pChooser;
     156    UIGDetails *m_pDetails;
    173157
    174158    /* VM details widget: */
     
    177161    /* 'File' menu action pointers: */
    178162    QMenu *m_pFileMenu;
    179     UIActionInterface *m_pMediumManagerDialogAction;
    180     UIActionInterface *m_pImportApplianceWizardAction;
    181     UIActionInterface *m_pExportApplianceWizardAction;
    182     UIActionInterface *m_pPreferencesDialogAction;
    183     UIActionInterface *m_pExitAction;
     163    UIAction *m_pMediumManagerDialogAction;
     164    UIAction *m_pImportApplianceWizardAction;
     165    UIAction *m_pExportApplianceWizardAction;
     166    UIAction *m_pPreferencesDialogAction;
     167    UIAction *m_pExitAction;
    184168
    185169    /* 'Machine' menu action pointers: */
     170    QAction *m_pGroupMenuAction;
     171    QMenu *m_pGroupMenu;
     172    UIAction *m_pActionGroupNewWizard;
     173    UIAction *m_pActionGroupAddDialog;
     174    UIAction *m_pActionGroupRenameDialog;
     175    UIAction *m_pActionGroupRemoveDialog;
     176    UIAction *m_pActionGroupStartOrShow;
     177    UIAction *m_pActionGroupPauseAndResume;
     178    UIAction *m_pActionGroupReset;
     179    UIAction *m_pActionGroupRefresh;
     180    UIAction *m_pActionGroupLogDialog;
     181    UIAction *m_pActionGroupShowInFileManager;
     182    UIAction *m_pActionGroupCreateShortcut;
     183//    UIAction *m_pActionGroupSort;
     184
     185    /* 'Machine' menu action pointers: */
     186    QAction *m_pMachineMenuAction;
    186187    QMenu *m_pMachineMenu;
    187     UIActionInterface *m_pNewWizardAction;
    188     UIActionInterface *m_pAddDialogAction;
    189     UIActionInterface *m_pSettingsDialogAction;
    190     UIActionInterface *m_pCloneWizardAction;
    191     UIActionInterface *m_pRemoveDialogAction;
    192     UIActionInterface *m_pStartOrShowAction;
    193     UIActionInterface *m_pDiscardAction;
    194     UIActionInterface *m_pPauseAndResumeAction;
    195     UIActionInterface *m_pResetAction;
    196     UIActionInterface *m_pRefreshAction;
    197     UIActionInterface *m_pLogDialogAction;
    198     UIActionInterface *m_pShowInFileManagerAction;
    199     UIActionInterface *m_pCreateShortcutAction;
    200     UIActionInterface *m_pSortAction;
     188    UIAction *m_pActionMachineNewWizard;
     189    UIAction *m_pActionMachineAddDialog;
     190    UIAction *m_pActionMachineSettingsDialog;
     191    UIAction *m_pActionMachineCloneWizard;
     192    UIAction *m_pActionMachineRemoveDialog;
     193    UIAction *m_pActionMachineStartOrShow;
     194    UIAction *m_pActionMachineDiscard;
     195    UIAction *m_pActionMachinePauseAndResume;
     196    UIAction *m_pActionMachineReset;
     197    UIAction *m_pActionMachineRefresh;
     198    UIAction *m_pActionMachineLogDialog;
     199    UIAction *m_pActionMachineShowInFileManager;
     200    UIAction *m_pActionMachineCreateShortcut;
     201//    UIAction *m_pActionMachineSort;
    201202
    202203    /* 'Machine / Close' menu action pointers: */
    203     UIActionInterface *m_pMachineCloseMenuAction;
     204    UIAction *m_pMachineCloseMenuAction;
    204205    QMenu *m_pMachineCloseMenu;
    205     UIActionInterface *m_pACPIShutdownAction;
    206     UIActionInterface *m_pPowerOffAction;
     206    UIAction *m_pACPIShutdownAction;
     207    UIAction *m_pPowerOffAction;
    207208
    208209    /* 'Help' menu action pointers: */
    209210    QMenu *m_pHelpMenu;
    210     UIActionInterface *m_pHelpAction;
    211     UIActionInterface *m_pWebAction;
    212     UIActionInterface *m_pResetWarningsAction;
    213     UIActionInterface *m_pNetworkAccessManager;
    214 #ifdef VBOX_WITH_REGISTRATION
    215     UIActionInterface *m_pRegisterAction;
    216 #endif /* VBOX_WITH_REGISTRATION */
    217     UIActionInterface *m_pUpdateAction;
    218     UIActionInterface *m_pAboutAction;
     211    UIAction *m_pHelpAction;
     212    UIAction *m_pWebAction;
     213    UIAction *m_pResetWarningsAction;
     214    UIAction *m_pNetworkAccessManager;
     215    UIAction *m_pUpdateAction;
     216    UIAction *m_pAboutAction;
    219217
    220218    /* Other variables: */
    221219    QRect m_normalGeo;
    222220    bool m_fDoneInaccessibleWarningOnce : 1;
    223 #ifdef VBOX_GUI_WITH_SYSTRAY
    224     /* The systray icon: */
    225     VBoxTrayIcon *m_pTrayIcon;
    226 #endif /* VBOX_GUI_WITH_SYSTRAY */
    227221};
    228222
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp

    r41819 r42526  
    19961996
    19971997    /* Add the pages */
    1998     QStackedLayout *pStack = new QStackedLayout(pMainLayout);
     1998    m_pStackedLayout = new QStackedLayout(pMainLayout);
    19991999
    20002000    m_pDetails = new UIDetailsPagePrivate(this, pRefreshAction);
    20012001    connect(m_pDetails, SIGNAL(linkClicked(const QString&)),
    20022002            this, SIGNAL(linkClicked(const QString&)));
    2003     pStack->addWidget(m_pDetails);
     2003    m_pStackedLayout->addWidget(m_pDetails);
    20042004    m_pSnapshotsPage = new VBoxSnapshotsWgt(this);
    20052005    m_pSnapshotsPage->setContentsMargins(gsLeftMargin, gsTopMargin, gsRightMargin, gsBottomMargin);
    2006     pStack->addWidget(m_pSnapshotsPage);
     2006    m_pStackedLayout->addWidget(m_pSnapshotsPage);
    20072007//    m_pDescription = new UIDescriptionPagePrivate(this);
    20082008//    connect(m_pDescription, SIGNAL(linkClicked(const QString&)),
    20092009//            this, SIGNAL(linkClicked(const QString&)));
    20102010//    m_pDescription->setContentsMargins(gsLeftMargin, gsTopMargin, gsRightMargin, gsBottomMargin);
    2011 //    pStack->addWidget(m_pDescription);
     2011//    m_pStackedLayout->addWidget(m_pDescription);
    20122012
    20132013    /* Connect the header buttons with the stack layout. */
    20142014    connect(m_pHeaderBtn, SIGNAL(clicked(int)),
    2015             pStack, SLOT(setCurrentIndex(int)));
     2015            m_pStackedLayout, SLOT(setCurrentIndex(int)));
     2016    connect(m_pStackedLayout, SIGNAL(currentChanged(int)),
     2017            this, SIGNAL(sigCurrentChanged(int)));
    20162018
    20172019    retranslateUi();
     
    20622064        m_pHeaderBtn->setEnabled(Snap, false);
    20632065    }
     2066}
     2067
     2068int UIVMDesktop::widgetIndex() const
     2069{
     2070    return m_pStackedLayout->currentIndex();
    20642071}
    20652072
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.h

    r39225 r42526  
    3434class VBoxSnapshotsWgt;
    3535class UIToolBar;
     36class QStackedLayout;
    3637
    3738class UIVMDesktop: public QIWithRetranslateUI<QWidget>
    3839{
    3940    Q_OBJECT;
     41
     42signals:
     43
     44    void linkClicked(const QString &strURL);
     45    void sigCurrentChanged(int iWidgetIndex);
    4046
    4147public:
     
    5157//    void updateDescriptionState();
    5258
    53 signals:
    54 
    55     void linkClicked(const QString &strURL);
     59    int widgetIndex() const;
    5660
    5761protected:
     
    6266
    6367    /* Private member vars */
     68    QStackedLayout *m_pStackedLayout;
    6469    UITexturedSegmentedButton *m_pHeaderBtn;
    6570    UIDetailsPagePrivate *m_pDetails;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r42382 r42526  
    677677                    addItem(":/shared_folder_32px.png", ":/shared_folder_disabled_32px.png",
    678678                            ":/shared_folder_16px.png", ":/shared_folder_disabled_16px.png",
    679                             iPageIndex, "#sfolders", pSettingsPage);
     679                            iPageIndex, "#sharedFolders", pSettingsPage);
    680680                    break;
    681681                }
  • trunk/src/VBox/GuestHost/OpenGL/LICENSE

  • trunk/src/VBox/HostServices/SharedOpenGL/LICENSE

  • trunk/src/VBox/Main/glue/tests

  • trunk/src/VBox/Main/glue/tests/Makefile

  • trunk/src/VBox/Main/include/MediumLock.h

  • trunk/src/VBox/Runtime/testcase/tstRTMemEf.cpp

  • trunk/src/libs/libxml2-2.6.31

Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette