VirtualBox

Ignore:
Timestamp:
Aug 1, 2018 2:07:18 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: Copy Selector UI functionality too VirtualBox Manager UI, that's initial body of new Manager.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
47 deleted
2 edited
49 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r73385 r73424  
    178178        $(if $(VBOX_GUI_WITH_KEYS_RESET_HANDLER),VBOX_GUI_WITH_KEYS_RESET_HANDLER) \
    179179        $(if $(VBOX_GUI_WITH_CUSTOMIZATIONS1),VBOX_GUI_WITH_CUSTOMIZATIONS1) \
     180        $(if $(VBOX_GUI_WITH_NEW_MANAGER),VBOX_GUI_WITH_NEW_MANAGER) \
    180181        $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE) \
    181182        $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,)
     
    373374        ./src/wizards/importappliance \
    374375        ./src/wizards/firstrun
     376
     377ifdef VBOX_GUI_WITH_NEW_MANAGER
     378VBOX_GUI_INC_DIRS += \
     379        ./src/manager \
     380        ./src/manager/chooser \
     381        ./src/manager/details
     382endif
    375383
    376384ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     
    736744        src/wizards/importappliance/UIWizardImportAppPageBasic2.h \
    737745        src/wizards/importappliance/UIWizardImportAppPageExpert.h
     746
     747ifdef VBOX_GUI_WITH_NEW_MANAGER
     748 VirtualBox_QT_MOCHDRS += \
     749        src/manager/UIToolbarTools.h \
     750        src/manager/UIToolPaneGlobal.h \
     751        src/manager/UIToolPaneMachine.h \
     752        src/manager/UIVirtualBoxManager.h \
     753        src/manager/UIVirtualMachineItem.h \
     754        src/manager/UIWelcomePane.h \
     755        src/manager/chooser/UIChooser.h \
     756        src/manager/chooser/UIChooserModel.h \
     757        src/manager/chooser/UIChooserView.h \
     758        src/manager/chooser/UIChooserHandlerMouse.h \
     759        src/manager/chooser/UIChooserHandlerKeyboard.h \
     760        src/manager/chooser/UIChooserItem.h \
     761        src/manager/chooser/UIChooserItemGroup.h \
     762        src/manager/chooser/UIChooserItemMachine.h \
     763        src/manager/details/UIDetails.h \
     764        src/manager/details/UIDetailsModel.h \
     765        src/manager/details/UIDetailsView.h \
     766        src/manager/details/UIDetailsItem.h \
     767        src/manager/details/UIDetailsGroup.h \
     768        src/manager/details/UIDetailsSet.h \
     769        src/manager/details/UIDetailsElement.h \
     770        src/manager/details/UIDetailsElements.h \
     771        src/manager/details/UIMachinePreview.h
     772endif
    738773
    739774ifndef VBOX_GUI_WITH_SHARED_LIBRARY
     
    11711206        src/wizards/importappliance/UIWizardImportApp.cpp
    11721207
     1208ifdef VBOX_GUI_WITH_NEW_MANAGER
     1209 VirtualBox_QT_MOCSRCS = \
     1210        src/manager/UIWelcomePane.cpp
     1211endif
     1212
    11731213ifndef VBOX_GUI_WITH_SHARED_LIBRARY
    11741214 VirtualBox_QT_MOCSRCS += \
     
    13801420        src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp \
    13811421        src/wizards/importappliance/UIWizardImportAppPageExpert.cpp
     1422
     1423ifdef VBOX_GUI_WITH_NEW_MANAGER
     1424 VirtualBox_SOURCES += \
     1425        src/manager/UIToolbarTools.cpp \
     1426        src/manager/UIToolPaneGlobal.cpp \
     1427        src/manager/UIToolPaneMachine.cpp \
     1428        src/manager/UIVirtualBoxManager.cpp \
     1429        src/manager/UIVirtualMachineItem.cpp \
     1430        src/manager/UIWelcomePane.cpp \
     1431        src/manager/chooser/UIChooser.cpp \
     1432        src/manager/chooser/UIChooserModel.cpp \
     1433        src/manager/chooser/UIChooserView.cpp \
     1434        src/manager/chooser/UIChooserHandlerMouse.cpp \
     1435        src/manager/chooser/UIChooserHandlerKeyboard.cpp \
     1436        src/manager/chooser/UIChooserItem.cpp \
     1437        src/manager/chooser/UIChooserItemGroup.cpp \
     1438        src/manager/chooser/UIChooserItemMachine.cpp \
     1439        src/manager/details/UIDetails.cpp \
     1440        src/manager/details/UIDetailsModel.cpp \
     1441        src/manager/details/UIDetailsView.cpp \
     1442        src/manager/details/UIDetailsItem.cpp \
     1443        src/manager/details/UIDetailsGroup.cpp \
     1444        src/manager/details/UIDetailsSet.cpp \
     1445        src/manager/details/UIDetailsElement.cpp \
     1446        src/manager/details/UIDetailsElements.cpp \
     1447        src/manager/details/UIMachinePreview.cpp
     1448endif
    13821449
    13831450VirtualBox_SOURCES.darwin += \
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIStarter.cpp

    r72362 r73424  
    2525#include "UIStarter.h"
    2626#if !defined(VBOX_GUI_WITH_SHARED_LIBRARY) || !defined(VBOX_RUNTIME_UI)
    27 # include "UISelectorWindow.h"
     27# ifdef VBOX_GUI_WITH_NEW_MANAGER
     28#  include "UIVirtualBoxManager.h"
     29# else
     30#  include "UISelectorWindow.h"
     31# endif
    2832#endif
    2933#if !defined(VBOX_GUI_WITH_SHARED_LIBRARY) || defined(VBOX_RUNTIME_UI)
     
    122126        }
    123127
     128# ifdef VBOX_GUI_WITH_NEW_MANAGER
     129        /* Create/show manager-window: */
     130        UIVirtualBoxManager::create();
     131# else
    124132        /* Create/show selector-window: */
    125133        UISelectorWindow::create();
     134# endif
    126135
    127136# ifdef VBOX_BLEEDING_EDGE
     
    162171{
    163172#if !defined(VBOX_GUI_WITH_SHARED_LIBRARY) || !defined(VBOX_RUNTIME_UI)
     173# ifdef VBOX_GUI_WITH_NEW_MANAGER
     174    /* Recreate/show manager-window: */
     175    UIVirtualBoxManager::destroy();
     176    UIVirtualBoxManager::create();
     177# else
    164178    /* Recreate/show selector-window: */
    165179    UISelectorWindow::destroy();
    166180    UISelectorWindow::create();
     181# endif
    167182#endif /* !VBOX_GUI_WITH_SHARED_LIBRARY || !VBOX_RUNTIME_UI */
    168183}
     
    171186{
    172187#if !defined(VBOX_GUI_WITH_SHARED_LIBRARY) || !defined(VBOX_RUNTIME_UI)
     188# ifdef VBOX_GUI_WITH_NEW_MANAGER
     189    /* Destroy Manager UI: */
     190    if (gpManager)
     191        UIVirtualBoxManager::destroy();
     192# else
    173193    /* Destroy Selector UI: */
    174194    if (gpSelectorWindow)
    175195        UISelectorWindow::destroy();
     196# endif
    176197#endif /* !VBOX_GUI_WITH_SHARED_LIBRARY || !VBOX_RUNTIME_UI */
    177198
     
    186207{
    187208#if !defined(VBOX_GUI_WITH_SHARED_LIBRARY) || !defined(VBOX_RUNTIME_UI)
     209# ifdef VBOX_GUI_WITH_NEW_MANAGER
     210    /* Create/show manager-window: */
     211    UIVirtualBoxManager::create();
     212
     213    /* Ask the Manager UI to open URLs asynchronously: */
     214    QMetaObject::invokeMethod(gpManager, "sltOpenUrls", Qt::QueuedConnection);
     215# else
    188216    /* Create/show selector-window: */
    189217    UISelectorWindow::create();
     
    191219    /* Ask the Selector UI to open URLs asynchronously: */
    192220    QMetaObject::invokeMethod(gpSelectorWindow, "sltOpenUrls", Qt::QueuedConnection);
     221# endif
    193222#endif /* !VBOX_GUI_WITH_SHARED_LIBRARY || !VBOX_RUNTIME_UI */
    194223}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIToolsPaneGlobal class implementation.
     3 * VBox Qt GUI - UIToolPaneGlobal class implementation.
    44 */
    55
     
    2626/* GUI includes */
    2727# include "UIActionPoolSelector.h"
    28 # include "UIDesktopPane.h"
     28# include "UIWelcomePane.h"
    2929# include "UIHostNetworkManager.h"
    3030# include "UIIconPool.h"
    3131# include "UIMediumManager.h"
    32 # include "UIToolsPaneGlobal.h"
     32# include "UIToolPaneGlobal.h"
    3333
    3434/* Other VBox includes: */
     
    3838
    3939
    40 UIToolsPaneGlobal::UIToolsPaneGlobal(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)
     40UIToolPaneGlobal::UIToolPaneGlobal(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)
    4141    : QIWithRetranslateUI<QWidget>(pParent)
    4242    , m_pActionPool(pActionPool)
     
    5050}
    5151
    52 UIToolsPaneGlobal::~UIToolsPaneGlobal()
     52UIToolPaneGlobal::~UIToolPaneGlobal()
    5353{
    5454    /* Cleanup: */
     
    5656}
    5757
    58 ToolTypeGlobal UIToolsPaneGlobal::currentTool() const
     58ToolTypeGlobal UIToolPaneGlobal::currentTool() const
    5959{
    6060    return m_pLayout->currentWidget()->property("ToolType").value<ToolTypeGlobal>();
    6161}
    6262
    63 bool UIToolsPaneGlobal::isToolOpened(ToolTypeGlobal enmType) const
     63bool UIToolPaneGlobal::isToolOpened(ToolTypeGlobal enmType) const
    6464{
    6565    /* Search through the stacked widgets: */
     
    7070}
    7171
    72 void UIToolsPaneGlobal::openTool(ToolTypeGlobal enmType)
     72void UIToolPaneGlobal::openTool(ToolTypeGlobal enmType)
    7373{
    7474    /* Search through the stacked widgets: */
     
    9393            {
    9494                /* Create Desktop pane: */
    95                 m_pPaneDesktop = new UIDesktopPane;
     95                m_pPaneDesktop = new UIWelcomePane;
    9696                AssertPtrReturnVoid(m_pPaneDesktop);
    9797                {
     
    141141}
    142142
    143 void UIToolsPaneGlobal::closeTool(ToolTypeGlobal enmType)
     143void UIToolPaneGlobal::closeTool(ToolTypeGlobal enmType)
    144144{
    145145    /* Search through the stacked widgets: */
     
    167167}
    168168
    169 void UIToolsPaneGlobal::setDetailsError(const QString &strError)
     169void UIToolPaneGlobal::setDetailsError(const QString &strError)
    170170{
    171171    /* Update desktop pane: */
     
    174174}
    175175
    176 void UIToolsPaneGlobal::retranslateUi()
     176void UIToolPaneGlobal::retranslateUi()
    177177{
    178178    /* Translate Global Tools welcome screen: */
     
    215215}
    216216
    217 void UIToolsPaneGlobal::prepare()
     217void UIToolPaneGlobal::prepare()
    218218{
    219219    /* Create stacked-layout: */
     
    227227}
    228228
    229 void UIToolsPaneGlobal::cleanup()
     229void UIToolPaneGlobal::cleanup()
    230230{
    231231    /* Remove all widgets prematurelly: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIToolsPaneGlobal class declaration.
     3 * VBox Qt GUI - UIToolPaneGlobal class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef ___UIToolsPaneGlobal_h___
    19 #define ___UIToolsPaneGlobal_h___
     18#ifndef ___UIToolPaneGlobal_h___
     19#define ___UIToolPaneGlobal_h___
    2020
    2121/* Qt includes: */
     
    3131class QVBoxLayout;
    3232class UIActionPool;
    33 class UIDesktopPane;
     33class UIWelcomePane;
    3434class UIHostNetworkManagerWidget;
    3535class UIMediumManagerWidget;
    36 class UIVMItem;
     36class UIVirtualMachineItem;
    3737class CMachine;
    3838
    3939
    4040/** QWidget subclass representing container for tool panes. */
    41 class UIToolsPaneGlobal : public QIWithRetranslateUI<QWidget>
     41class UIToolPaneGlobal : public QIWithRetranslateUI<QWidget>
    4242{
    4343    Q_OBJECT;
     
    4646
    4747    /** Constructs tools pane passing @a pParent to the base-class. */
    48     UIToolsPaneGlobal(UIActionPool *pActionPool, QWidget *pParent = 0);
     48    UIToolPaneGlobal(UIActionPool *pActionPool, QWidget *pParent = 0);
    4949    /** Destructs tools pane. */
    50     virtual ~UIToolsPaneGlobal() /* override */;
     50    virtual ~UIToolPaneGlobal() /* override */;
    5151
    5252    /** Returns type of tool currently opened. */
     
    8282    QStackedLayout             *m_pLayout;
    8383    /** Holds the Desktop pane instance. */
    84     UIDesktopPane              *m_pPaneDesktop;
     84    UIWelcomePane              *m_pPaneDesktop;
    8585    /** Holds the Virtual Media Manager instance. */
    8686    UIMediumManagerWidget      *m_pPaneMedia;
     
    8989};
    9090
    91 #endif /* !___UIToolsPaneGlobal_h___ */
     91#endif /* !___UIToolPaneGlobal_h___ */
    9292
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIToolsPaneMachine class implementation.
     3 * VBox Qt GUI - UIToolPaneMachine class implementation.
    44 */
    55
     
    2626/* GUI includes */
    2727# include "UIActionPoolSelector.h"
    28 # include "UIDesktopPane.h"
    29 # include "UIGDetails.h"
     28# include "UIWelcomePane.h"
     29# include "UIDetails.h"
    3030# include "UIIconPool.h"
    3131# include "UISnapshotPane.h"
    32 # include "UIToolsPaneMachine.h"
    33 # include "UIVMItem.h"
     32# include "UIToolPaneMachine.h"
     33# include "UIVirtualMachineItem.h"
    3434# include "UIVMLogViewerWidget.h"
    3535
     
    4040
    4141
    42 UIToolsPaneMachine::UIToolsPaneMachine(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)
     42UIToolPaneMachine::UIToolPaneMachine(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)
    4343    : QIWithRetranslateUI<QWidget>(pParent)
    4444    , m_pActionPool(pActionPool)
     
    5454}
    5555
    56 UIToolsPaneMachine::~UIToolsPaneMachine()
     56UIToolPaneMachine::~UIToolPaneMachine()
    5757{
    5858    /* Cleanup: */
     
    6060}
    6161
    62 ToolTypeMachine UIToolsPaneMachine::currentTool() const
     62ToolTypeMachine UIToolPaneMachine::currentTool() const
    6363{
    6464    return m_pLayout->currentWidget()->property("ToolType").value<ToolTypeMachine>();
    6565}
    6666
    67 bool UIToolsPaneMachine::isToolOpened(ToolTypeMachine enmType) const
     67bool UIToolPaneMachine::isToolOpened(ToolTypeMachine enmType) const
    6868{
    6969    /* Search through the stacked widgets: */
     
    7474}
    7575
    76 void UIToolsPaneMachine::openTool(ToolTypeMachine enmType)
     76void UIToolPaneMachine::openTool(ToolTypeMachine enmType)
    7777{
    7878    /* Search through the stacked widgets: */
     
    9797            {
    9898                /* Create Desktop pane: */
    99                 m_pPaneDesktop = new UIDesktopPane(m_pActionPool->action(UIActionIndexST_M_Group_S_Refresh));
     99                m_pPaneDesktop = new UIWelcomePane(m_pActionPool->action(UIActionIndexST_M_Group_S_Refresh));
    100100                AssertPtrReturnVoid(m_pPaneDesktop);
    101101                {
     
    112112            {
    113113                /* Create Details pane: */
    114                 m_pPaneDetails = new UIGDetails;
     114                m_pPaneDetails = new UIDetails;
    115115                AssertPtrReturnVoid(m_pPaneDetails);
    116116                {
    117117                    /* Configure pane: */
    118118                    m_pPaneDetails->setProperty("ToolType", QVariant::fromValue(ToolTypeMachine_Details));
    119                     connect(this, &UIToolsPaneMachine::sigSlidingStarted, m_pPaneDetails, &UIGDetails::sigSlidingStarted);
    120                     connect(this, &UIToolsPaneMachine::sigToggleStarted,  m_pPaneDetails, &UIGDetails::sigToggleStarted);
    121                     connect(this, &UIToolsPaneMachine::sigToggleFinished, m_pPaneDetails, &UIGDetails::sigToggleFinished);
    122                     connect(m_pPaneDetails, &UIGDetails::sigLinkClicked,  this, &UIToolsPaneMachine::sigLinkClicked);
     119                    connect(this, &UIToolPaneMachine::sigSlidingStarted, m_pPaneDetails, &UIDetails::sigSlidingStarted);
     120                    connect(this, &UIToolPaneMachine::sigToggleStarted,  m_pPaneDetails, &UIDetails::sigToggleStarted);
     121                    connect(this, &UIToolPaneMachine::sigToggleFinished, m_pPaneDetails, &UIDetails::sigToggleFinished);
     122                    connect(m_pPaneDetails, &UIDetails::sigLinkClicked,  this, &UIToolPaneMachine::sigLinkClicked);
    123123
    124124                    /* Add into layout: */
     
    164164}
    165165
    166 void UIToolsPaneMachine::closeTool(ToolTypeMachine enmType)
     166void UIToolPaneMachine::closeTool(ToolTypeMachine enmType)
    167167{
    168168    /* Search through the stacked widgets: */
     
    191191}
    192192
    193 void UIToolsPaneMachine::setDetailsError(const QString &strError)
     193void UIToolPaneMachine::setDetailsError(const QString &strError)
    194194{
    195195    /* Update desktop pane: */
     
    198198}
    199199
    200 void UIToolsPaneMachine::setCurrentItem(UIVMItem *pItem)
     200void UIToolPaneMachine::setCurrentItem(UIVirtualMachineItem *pItem)
    201201{
    202202    if (m_pItem == pItem)
     
    217217}
    218218
    219 void UIToolsPaneMachine::setItems(const QList<UIVMItem*> &items)
     219void UIToolPaneMachine::setItems(const QList<UIVirtualMachineItem*> &items)
    220220{
    221221    /* Update details pane: */
     
    224224}
    225225
    226 void UIToolsPaneMachine::setMachine(const CMachine &comMachine)
     226void UIToolPaneMachine::setMachine(const CMachine &comMachine)
    227227{
    228228    /* Update snapshots pane is it is open: */
     
    240240}
    241241
    242 void UIToolsPaneMachine::retranslateUi()
     242void UIToolPaneMachine::retranslateUi()
    243243{
    244244    /* Translate Machine Tools welcome screen: */
     
    303303}
    304304
    305 void UIToolsPaneMachine::prepare()
     305void UIToolPaneMachine::prepare()
    306306{
    307307    /* Create stacked-layout: */
     
    315315}
    316316
    317 void UIToolsPaneMachine::cleanup()
     317void UIToolPaneMachine::cleanup()
    318318{
    319319    /* Remove all widgets prematurelly: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIToolsPaneMachine class declaration.
     3 * VBox Qt GUI - UIToolPaneMachine class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef ___UIToolsPaneMachine_h___
    19 #define ___UIToolsPaneMachine_h___
     18#ifndef ___UIToolPaneMachine_h___
     19#define ___UIToolPaneMachine_h___
    2020
    2121/* Qt includes: */
     
    3131class QVBoxLayout;
    3232class UIActionPool;
    33 class UIDesktopPane;
    34 class UIGDetails;
     33class UIWelcomePane;
     34class UIDetails;
    3535class UIVMLogViewerWidget;
    3636class UISnapshotPane;
    37 class UIVMItem;
     37class UIVirtualMachineItem;
    3838class CMachine;
    3939
    4040
    4141/** QWidget subclass representing container for tool panes. */
    42 class UIToolsPaneMachine : public QIWithRetranslateUI<QWidget>
     42class UIToolPaneMachine : public QIWithRetranslateUI<QWidget>
    4343{
    4444    Q_OBJECT;
     
    4646signals:
    4747
    48     /** Redirects signal from UISelectorWindow to UIGDetails. */
     48    /** Redirects signal from UIVirtualBoxManager to UIDetails. */
    4949    void sigSlidingStarted();
    50     /** Redirects signal from UISelectorWindow to UIGDetails. */
     50    /** Redirects signal from UIVirtualBoxManager to UIDetails. */
    5151    void sigToggleStarted();
    52     /** Redirects signal from UISelectorWindow to UIGDetails. */
     52    /** Redirects signal from UIVirtualBoxManager to UIDetails. */
    5353    void sigToggleFinished();
    54     /** Redirects signal from UIGDetails to UISelectorWindow. */
     54    /** Redirects signal from UIDetails to UIVirtualBoxManager. */
    5555    void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId);
    5656
     
    5858
    5959    /** Constructs tools pane passing @a pParent to the base-class. */
    60     UIToolsPaneMachine(UIActionPool *pActionPool, QWidget *pParent = 0);
     60    UIToolPaneMachine(UIActionPool *pActionPool, QWidget *pParent = 0);
    6161    /** Destructs tools pane. */
    62     virtual ~UIToolsPaneMachine() /* override */;
     62    virtual ~UIToolPaneMachine() /* override */;
    6363
    6464    /** Returns type of tool currently opened. */
     
    7575
    7676    /** Defines current machine @a pItem. */
    77     void setCurrentItem(UIVMItem *pItem);
     77    void setCurrentItem(UIVirtualMachineItem *pItem);
    7878
    7979    /** Defines the machine @a items. */
    80     void setItems(const QList<UIVMItem*> &items);
     80    void setItems(const QList<UIVirtualMachineItem*> &items);
    8181
    8282    /** Defines the @a comMachine object. */
     
    101101
    102102    /** Holds current machine item reference. */
    103     UIVMItem *m_pItem;
     103    UIVirtualMachineItem *m_pItem;
    104104
    105105    /** Holds the stacked-layout instance. */
    106106    QStackedLayout      *m_pLayout;
    107107    /** Holds the Desktop pane instance. */
    108     UIDesktopPane       *m_pPaneDesktop;
     108    UIWelcomePane       *m_pPaneDesktop;
    109109    /** Holds the Details pane instance. */
    110     UIGDetails          *m_pPaneDetails;
     110    UIDetails          *m_pPaneDetails;
    111111    /** Holds the Snapshots pane instance. */
    112112    UISnapshotPane      *m_pPaneSnapshots;
     
    115115};
    116116
    117 #endif /* !___UIToolsPaneMachine_h___ */
     117#endif /* !___UIToolPaneMachine_h___ */
    118118
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolbarTools.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIToolsToolbar class implementation.
     3 * VBox Qt GUI - UIToolbarTools class implementation.
    44 */
    55
     
    3232# include "UITabBar.h"
    3333# include "UIToolBar.h"
    34 # include "UIToolsToolbar.h"
     34# include "UIToolbarTools.h"
    3535
    3636/* Other VBox includes: */
     
    4040
    4141
    42 UIToolsToolbar::UIToolsToolbar(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)
     42UIToolbarTools::UIToolbarTools(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)
    4343    : QWidget(pParent)
    4444    , m_pActionPool(pActionPool)
     
    5252}
    5353
    54 void UIToolsToolbar::setTabBars(UITabBar *pTabBarMachine, UITabBar *pTabBarGlobal)
     54void UIToolbarTools::setTabBars(UITabBar *pTabBarMachine, UITabBar *pTabBarGlobal)
    5555{
    5656    /* Remember the new tab-bars: */
     
    6060    /* Configure tab-bar connections: */
    6161    connect(m_pTabBarMachine, &UITabBar::sigTabRequestForClosing,
    62             this, &UIToolsToolbar::sltHandleCloseToolMachine);
     62            this, &UIToolbarTools::sltHandleCloseToolMachine);
    6363    connect(m_pTabBarMachine, &UITabBar::sigCurrentTabChanged,
    64             this, &UIToolsToolbar::sltHandleToolChosenMachine);
     64            this, &UIToolbarTools::sltHandleToolChosenMachine);
    6565    connect(m_pTabBarGlobal, &UITabBar::sigTabRequestForClosing,
    66             this, &UIToolsToolbar::sltHandleCloseToolGlobal);
     66            this, &UIToolbarTools::sltHandleCloseToolGlobal);
    6767    connect(m_pTabBarGlobal, &UITabBar::sigCurrentTabChanged,
    68             this, &UIToolsToolbar::sltHandleToolChosenGlobal);
     68            this, &UIToolbarTools::sltHandleToolChosenGlobal);
    6969
    7070    /* Let the tab-bars know our opinion: */
     
    7272}
    7373
    74 void UIToolsToolbar::setToolButtonStyle(Qt::ToolButtonStyle enmStyle)
     74void UIToolbarTools::setToolButtonStyle(Qt::ToolButtonStyle enmStyle)
    7575{
    7676    m_pToolBar->setToolButtonStyle(enmStyle);
    7777}
    7878
    79 QList<ToolTypeMachine> UIToolsToolbar::tabOrderMachine() const
     79QList<ToolTypeMachine> UIToolbarTools::tabOrderMachine() const
    8080{
    8181    QList<ToolTypeMachine> list;
     
    8585}
    8686
    87 QList<ToolTypeGlobal> UIToolsToolbar::tabOrderGlobal() const
     87QList<ToolTypeGlobal> UIToolbarTools::tabOrderGlobal() const
    8888{
    8989    QList<ToolTypeGlobal> list;
     
    9393}
    9494
    95 void UIToolsToolbar::sltHandleOpenToolMachine()
     95void UIToolbarTools::sltHandleOpenToolMachine()
    9696{
    9797    /* Acquire sender action: */
     
    116116}
    117117
    118 void UIToolsToolbar::sltHandleOpenToolGlobal()
     118void UIToolbarTools::sltHandleOpenToolGlobal()
    119119{
    120120    /* Acquire sender action: */
     
    139139}
    140140
    141 void UIToolsToolbar::sltHandleCloseToolMachine(const QUuid &uuid)
     141void UIToolbarTools::sltHandleCloseToolMachine(const QUuid &uuid)
    142142{
    143143    /* If the ID is registered: */
     
    153153}
    154154
    155 void UIToolsToolbar::sltHandleCloseToolGlobal(const QUuid &uuid)
     155void UIToolbarTools::sltHandleCloseToolGlobal(const QUuid &uuid)
    156156{
    157157    /* If the ID is registered: */
     
    167167}
    168168
    169 void UIToolsToolbar::sltHandleToolChosenMachine(const QUuid &uuid)
     169void UIToolbarTools::sltHandleToolChosenMachine(const QUuid &uuid)
    170170{
    171171    /* If the ID is registered => Notify listeners: */
     
    174174}
    175175
    176 void UIToolsToolbar::sltHandleToolChosenGlobal(const QUuid &uuid)
     176void UIToolbarTools::sltHandleToolChosenGlobal(const QUuid &uuid)
    177177{
    178178    /* If the ID is registered => Notify listeners: */
     
    181181}
    182182
    183 void UIToolsToolbar::sltHandleActionToggle()
     183void UIToolbarTools::sltHandleActionToggle()
    184184{
    185185    /* Handle known actions: */
     
    190190}
    191191
    192 void UIToolsToolbar::prepare()
     192void UIToolbarTools::prepare()
    193193{
    194194    /* Prepare menu: */
     
    201201}
    202202
    203 void UIToolsToolbar::prepareMenu()
     203void UIToolbarTools::prepareMenu()
    204204{
    205205    /* Configure 'Machine' menu: */
     
    210210        pMenuMachine->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Details));
    211211        connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Details), &UIAction::triggered,
    212                 this, &UIToolsToolbar::sltHandleOpenToolMachine);
     212                this, &UIToolbarTools::sltHandleOpenToolMachine);
    213213        m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Details)
    214214            ->setProperty("ToolTypeMachine", QVariant::fromValue(ToolTypeMachine_Details));
     
    217217        pMenuMachine->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots));
    218218        connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots), &UIAction::triggered,
    219                 this, &UIToolsToolbar::sltHandleOpenToolMachine);
     219                this, &UIToolbarTools::sltHandleOpenToolMachine);
    220220        m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots)
    221221            ->setProperty("ToolTypeMachine", QVariant::fromValue(ToolTypeMachine_Snapshots));
     
    224224        pMenuMachine->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_LogViewer));
    225225        connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_LogViewer), &UIAction::triggered,
    226                 this, &UIToolsToolbar::sltHandleOpenToolMachine);
     226                this, &UIToolbarTools::sltHandleOpenToolMachine);
    227227        m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_LogViewer)
    228228            ->setProperty("ToolTypeMachine", QVariant::fromValue(ToolTypeMachine_LogViewer));
     
    232232    m_pActionPool->action(UIActionIndexST_M_Tools_T_Machine)->setMenu(pMenuMachine);
    233233    connect(m_pActionPool->action(UIActionIndexST_M_Tools_T_Machine), &UIAction::toggled,
    234             this, &UIToolsToolbar::sltHandleActionToggle);
     234            this, &UIToolbarTools::sltHandleActionToggle);
    235235
    236236    /* Configure 'Global' menu: */
     
    241241        pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager));
    242242        connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager), &UIAction::triggered,
    243                 this, &UIToolsToolbar::sltHandleOpenToolGlobal);
     243                this, &UIToolbarTools::sltHandleOpenToolGlobal);
    244244        m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager)
    245245            ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_VirtualMedia));
     
    248248        pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager));
    249249        connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager), &UIAction::triggered,
    250                 this, &UIToolsToolbar::sltHandleOpenToolGlobal);
     250                this, &UIToolbarTools::sltHandleOpenToolGlobal);
    251251        m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager)
    252252            ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_HostNetwork));
     
    256256    m_pActionPool->action(UIActionIndexST_M_Tools_T_Global)->setMenu(pMenuGlobal);
    257257    connect(m_pActionPool->action(UIActionIndexST_M_Tools_T_Global), &UIAction::toggled,
    258             this, &UIToolsToolbar::sltHandleActionToggle);
     258            this, &UIToolbarTools::sltHandleActionToggle);
    259259
    260260    /* By default 'Machine' toggle action is toggled: */
     
    262262}
    263263
    264 void UIToolsToolbar::prepareWidgets()
     264void UIToolbarTools::prepareWidgets()
    265265{
    266266    /* Create main layout: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolbarTools.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIToolsToolbar class declaration.
     3 * VBox Qt GUI - UIToolbarTools class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef ___UIToolsToolbar_h___
    19 #define ___UIToolsToolbar_h___
     18#ifndef ___UIToolbarTools_h___
     19#define ___UIToolbarTools_h___
    2020
    2121/* Qt includes: */
     
    2525
    2626/* GUI includes: */
    27 #include "UIToolsPaneGlobal.h"
    28 #include "UIToolsPaneMachine.h"
     27#include "UIToolPaneGlobal.h"
     28#include "UIToolPaneMachine.h"
    2929
    3030/* Forward declarations: */
     
    3939
    4040/** Tools toolbar imlementation for Selector UI. */
    41 class UIToolsToolbar : public QWidget
     41class UIToolbarTools : public QWidget
    4242{
    4343    Q_OBJECT;
     
    6464    /** Constructs Tools toolbar passing @a pParent to the base-class.
    6565      * @param  pActionPool  Brings the action-pool to take corresponding actions from. */
    66     UIToolsToolbar(UIActionPool *pActionPool, QWidget *pParent = 0);
     66    UIToolbarTools(UIActionPool *pActionPool, QWidget *pParent = 0);
    6767
    6868    /** Defines the tab-bars to control. */
     
    125125};
    126126
    127 #endif /* !___UIToolsToolbar_h___ */
     127#endif /* !___UIToolbarTools_h___ */
    128128
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UISelectorWindow class implementation.
     3 * VBox Qt GUI - UIVirtualBoxManager class implementation.
    44 */
    55
     
    3535# include "UIErrorString.h"
    3636# include "UIExtraDataManager.h"
    37 # include "UIGChooser.h"
     37# include "UIChooser.h"
    3838# include "UIHostNetworkManager.h"
    3939# include "UIMedium.h"
     
    4141# include "UIMessageCenter.h"
    4242# include "UIModalWindowManager.h"
    43 # include "UISelectorWindow.h"
     43# include "UIVirtualBoxManager.h"
    4444# include "UISettingsDialogSpecific.h"
    4545# include "UISlidingWidget.h"
     
    4747# include "UIToolBar.h"
    4848# include "UIVMLogViewerDialog.h"
    49 # include "UIVMItem.h"
    50 # include "UIToolsPaneMachine.h"
    51 # include "UIToolsToolbar.h"
     49# include "UIVirtualMachineItem.h"
     50# include "UIToolPaneMachine.h"
     51# include "UIToolbarTools.h"
    5252# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    5353#  include "UIUpdateManager.h"
     
    8787
    8888/* static */
    89 UISelectorWindow* UISelectorWindow::m_spInstance = 0;
     89UIVirtualBoxManager* UIVirtualBoxManager::m_spInstance = 0;
    9090
    9191/* static */
    92 void UISelectorWindow::create()
     92void UIVirtualBoxManager::create()
    9393{
    9494    /* Return if selector-window is already created: */
     
    9797
    9898    /* Create selector-window: */
    99     new UISelectorWindow;
     99    new UIVirtualBoxManager;
    100100    /* Prepare selector-window: */
    101101    m_spInstance->prepare();
     
    107107
    108108/* static */
    109 void UISelectorWindow::destroy()
     109void UIVirtualBoxManager::destroy()
    110110{
    111111    /* Make sure selector-window is created: */
     
    120120}
    121121
    122 UISelectorWindow::UISelectorWindow()
     122UIVirtualBoxManager::UIVirtualBoxManager()
    123123    : m_fPolished(false)
    124124    , m_fWarningAboutInaccessibleMediaShown(false)
     
    143143}
    144144
    145 UISelectorWindow::~UISelectorWindow()
     145UIVirtualBoxManager::~UIVirtualBoxManager()
    146146{
    147147    m_spInstance = 0;
    148148}
    149149
    150 bool UISelectorWindow::shouldBeMaximized() const
     150bool UIVirtualBoxManager::shouldBeMaximized() const
    151151{
    152152    return gEDataManager->selectorWindowShouldBeMaximized();
    153153}
    154154
    155 void UISelectorWindow::sltHandlePolishEvent()
     155void UIVirtualBoxManager::sltHandlePolishEvent()
    156156{
    157157    /* Get current item: */
    158     UIVMItem *pItem = currentItem();
     158    UIVirtualMachineItem *pItem = currentItem();
    159159
    160160    /* Make sure there is accessible VM item chosen: */
     
    178178
    179179#ifdef VBOX_WS_X11
    180 void UISelectorWindow::sltHandleHostScreenAvailableAreaChange()
     180void UIVirtualBoxManager::sltHandleHostScreenAvailableAreaChange()
    181181{
    182182    /* Prevent handling if fake screen detected: */
     
    190190#endif /* VBOX_WS_X11 */
    191191
    192 void UISelectorWindow::sltShowSelectorWindowContextMenu(const QPoint &position)
     192void UIVirtualBoxManager::sltShowSelectorWindowContextMenu(const QPoint &position)
    193193{
    194194    /* Populate toolbar/statusbar acctions: */
     
    260260}
    261261
    262 void UISelectorWindow::sltHandleChooserPaneIndexChange(bool fUpdateDetails /* = true */,
    263                                                        bool fUpdateSnapshots /* = true */,
    264                                                        bool fUpdateLogViewer /* = true*/)
     262void UIVirtualBoxManager::sltHandleChooserPaneIndexChange(bool fUpdateDetails /* = true */,
     263                                                          bool fUpdateSnapshots /* = true */,
     264                                                          bool fUpdateLogViewer /* = true */)
    265265{
    266266    /* Get current item: */
    267     UIVMItem *pItem = currentItem();
     267    UIVirtualMachineItem *pItem = currentItem();
    268268
    269269    /* Update action visibility: */
     
    324324}
    325325
    326 void UISelectorWindow::sltHandleMediumEnumerationFinish()
     326void UIVirtualBoxManager::sltHandleMediumEnumerationFinish()
    327327{
    328328    /* We try to warn about inaccessible mediums only once
     
    357357}
    358358
    359 void UISelectorWindow::sltOpenUrls(QList<QUrl> list /* = QList<QUrl>() */)
     359void UIVirtualBoxManager::sltOpenUrls(QList<QUrl> list /* = QList<QUrl>() */)
    360360{
    361361    /* Make sure any pending D&D events are consumed. */
     
    416416}
    417417
    418 void UISelectorWindow::sltHandleGroupSavingProgressChange()
     418void UIVirtualBoxManager::sltHandleGroupSavingProgressChange()
    419419{
    420420    updateActionsAppearance();
     
    422422
    423423#ifdef VBOX_WS_MAC
    424 void UISelectorWindow::sltActionHovered(UIAction *pAction)
     424void UIVirtualBoxManager::sltActionHovered(UIAction *pAction)
    425425{
    426426    /* Show the action message for a ten seconds: */
     
    429429#endif /* VBOX_WS_MAC */
    430430
    431 void UISelectorWindow::sltHandleStateChange(QString)
     431void UIVirtualBoxManager::sltHandleStateChange(QString)
    432432{
    433433    /* Get current item: */
    434     UIVMItem *pItem = currentItem();
     434    UIVirtualMachineItem *pItem = currentItem();
    435435
    436436    /* Make sure current item present: */
     
    442442}
    443443
    444 void UISelectorWindow::sltOpenVirtualMediumManagerWindow()
     444void UIVirtualBoxManager::sltOpenVirtualMediumManagerWindow()
    445445{
    446446    /* First check if instance of widget opened embedded: */
     
    456456        UIMediumManagerFactory().prepare(m_pManagerVirtualMedia, this);
    457457        connect(m_pManagerVirtualMedia, &QIManagerDialog::sigClose,
    458                 this, &UISelectorWindow::sltCloseVirtualMediumManagerWindow);
     458                this, &UIVirtualBoxManager::sltCloseVirtualMediumManagerWindow);
    459459    }
    460460
     
    465465}
    466466
    467 void UISelectorWindow::sltCloseVirtualMediumManagerWindow()
     467void UIVirtualBoxManager::sltCloseVirtualMediumManagerWindow()
    468468{
    469469    /* Destroy instance if still exists: */
     
    472472}
    473473
    474 void UISelectorWindow::sltOpenHostNetworkManagerWindow()
     474void UIVirtualBoxManager::sltOpenHostNetworkManagerWindow()
    475475{
    476476    /* First check if instance of widget opened embedded: */
     
    486486        UIHostNetworkManagerFactory().prepare(m_pManagerHostNetwork, this);
    487487        connect(m_pManagerHostNetwork, &QIManagerDialog::sigClose,
    488                 this, &UISelectorWindow::sltCloseHostNetworkManagerWindow);
     488                this, &UIVirtualBoxManager::sltCloseHostNetworkManagerWindow);
    489489    }
    490490
     
    495495}
    496496
    497 void UISelectorWindow::sltCloseHostNetworkManagerWindow()
     497void UIVirtualBoxManager::sltCloseHostNetworkManagerWindow()
    498498{
    499499    /* Destroy instance if still exists: */
     
    502502}
    503503
    504 void UISelectorWindow::sltOpenImportApplianceWizard(const QString &strFileName /* = QString() */)
     504void UIVirtualBoxManager::sltOpenImportApplianceWizard(const QString &strFileName /* = QString() */)
    505505{
    506506    /* Show Import Appliance wizard: */
     
    528528}
    529529
    530 void UISelectorWindow::sltOpenExportApplianceWizard()
     530void UIVirtualBoxManager::sltOpenExportApplianceWizard()
    531531{
    532532    /* Get selected items: */
    533     QList<UIVMItem*> items = currentItems();
     533    QList<UIVirtualMachineItem*> items = currentItems();
    534534    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    535535
     
    556556
    557557#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
    558 void UISelectorWindow::sltOpenExtraDataManagerWindow()
     558void UIVirtualBoxManager::sltOpenExtraDataManagerWindow()
    559559{
    560560    gEDataManager->openWindow(this);
     
    562562#endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */
    563563
    564 void UISelectorWindow::sltOpenPreferencesDialog()
     564void UIVirtualBoxManager::sltOpenPreferencesDialog()
    565565{
    566566    /* Check that we do NOT handling that already: */
     
    582582}
    583583
    584 void UISelectorWindow::sltPerformExit()
     584void UIVirtualBoxManager::sltPerformExit()
    585585{
    586586    close();
    587587}
    588588
    589 void UISelectorWindow::sltOpenAddMachineDialog(const QString &strFileName /* = QString() */)
     589void UIVirtualBoxManager::sltOpenAddMachineDialog(const QString &strFileName /* = QString() */)
    590590{
    591591    /* Initialize variables: */
     
    633633}
    634634
    635 void UISelectorWindow::sltOpenMachineSettingsDialog(const QString &strCategoryRef /* = QString() */,
     635void UIVirtualBoxManager::sltOpenMachineSettingsDialog(const QString &strCategoryRef /* = QString() */,
    636636                                                    const QString &strControlRef /* = QString() */,
    637637                                                    const QString &strID /* = QString() */)
     
    681681}
    682682
    683 void UISelectorWindow::sltOpenCloneMachineWizard()
     683void UIVirtualBoxManager::sltOpenCloneMachineWizard()
    684684{
    685685    /* Get current item: */
    686     UIVMItem *pItem = currentItem();
     686    UIVirtualMachineItem *pItem = currentItem();
    687687    AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
    688688
     
    706706}
    707707
    708 void UISelectorWindow::sltPerformMoveMachine()
    709 {
    710     UIVMItem *pItem = currentItem();
     708void UIVirtualBoxManager::sltPerformMoveMachine()
     709{
     710    UIVirtualMachineItem *pItem = currentItem();
    711711    AssertMsgReturnVoid(pItem, ("Current item should be selected!\n"));
    712712
     
    744744}
    745745
    746 void UISelectorWindow::sltPerformStartOrShowMachine()
     746void UIVirtualBoxManager::sltPerformStartOrShowMachine()
    747747{
    748748    /* Start selected VMs in corresponding mode: */
    749     QList<UIVMItem*> items = currentItems();
     749    QList<UIVirtualMachineItem*> items = currentItems();
    750750    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    751751    performStartOrShowVirtualMachines(items, VBoxGlobal::LaunchMode_Invalid);
    752752}
    753753
    754 void UISelectorWindow::sltPerformStartMachineNormal()
     754void UIVirtualBoxManager::sltPerformStartMachineNormal()
    755755{
    756756    /* Start selected VMs in corresponding mode: */
    757     QList<UIVMItem*> items = currentItems();
     757    QList<UIVirtualMachineItem*> items = currentItems();
    758758    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    759759    performStartOrShowVirtualMachines(items, VBoxGlobal::LaunchMode_Default);
    760760}
    761761
    762 void UISelectorWindow::sltPerformStartMachineHeadless()
     762void UIVirtualBoxManager::sltPerformStartMachineHeadless()
    763763{
    764764    /* Start selected VMs in corresponding mode: */
    765     QList<UIVMItem*> items = currentItems();
     765    QList<UIVirtualMachineItem*> items = currentItems();
    766766    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    767767    performStartOrShowVirtualMachines(items, VBoxGlobal::LaunchMode_Headless);
    768768}
    769769
    770 void UISelectorWindow::sltPerformStartMachineDetachable()
     770void UIVirtualBoxManager::sltPerformStartMachineDetachable()
    771771{
    772772    /* Start selected VMs in corresponding mode: */
    773     QList<UIVMItem*> items = currentItems();
     773    QList<UIVirtualMachineItem*> items = currentItems();
    774774    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    775775    performStartOrShowVirtualMachines(items, VBoxGlobal::LaunchMode_Separate);
    776776}
    777777
    778 void UISelectorWindow::sltPerformDiscardMachineState()
     778void UIVirtualBoxManager::sltPerformDiscardMachineState()
    779779{
    780780    /* Get selected items: */
    781     QList<UIVMItem*> items = currentItems();
     781    QList<UIVirtualMachineItem*> items = currentItems();
    782782    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    783783
    784784    /* Prepare the list of the machines to be discarded: */
    785785    QStringList machineNames;
    786     QList<UIVMItem*> itemsToDiscard;
    787     foreach (UIVMItem *pItem, items)
    788         if (isActionEnabled(UIActionIndexST_M_Group_S_Discard, QList<UIVMItem*>() << pItem))
     786    QList<UIVirtualMachineItem*> itemsToDiscard;
     787    foreach (UIVirtualMachineItem *pItem, items)
     788        if (isActionEnabled(UIActionIndexST_M_Group_S_Discard, QList<UIVirtualMachineItem*>() << pItem))
    789789        {
    790790            machineNames << pItem->name();
     
    798798
    799799    /* For every confirmed item: */
    800     foreach (UIVMItem *pItem, itemsToDiscard)
     800    foreach (UIVirtualMachineItem *pItem, itemsToDiscard)
    801801    {
    802802        /* Open a session to modify VM: */
     
    816816}
    817817
    818 void UISelectorWindow::sltPerformPauseOrResumeMachine(bool fPause)
     818void UIVirtualBoxManager::sltPerformPauseOrResumeMachine(bool fPause)
    819819{
    820820    /* Get selected items: */
    821     QList<UIVMItem*> items = currentItems();
     821    QList<UIVirtualMachineItem*> items = currentItems();
    822822    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    823823
    824824    /* For every selected item: */
    825     foreach (UIVMItem *pItem, items)
     825    foreach (UIVirtualMachineItem *pItem, items)
    826826    {
    827827        /* Get item state: */
     
    829829
    830830        /* Check if current item could be paused/resumed: */
    831         if (!isActionEnabled(UIActionIndexST_M_Group_T_Pause, QList<UIVMItem*>() << pItem))
     831        if (!isActionEnabled(UIActionIndexST_M_Group_T_Pause, QList<UIVirtualMachineItem*>() << pItem))
    832832            continue;
    833833
     
    871871}
    872872
    873 void UISelectorWindow::sltPerformResetMachine()
     873void UIVirtualBoxManager::sltPerformResetMachine()
    874874{
    875875    /* Get selected items: */
    876     QList<UIVMItem*> items = currentItems();
     876    QList<UIVirtualMachineItem*> items = currentItems();
    877877    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    878878
    879879    /* Prepare the list of the machines to be reseted: */
    880880    QStringList machineNames;
    881     QList<UIVMItem*> itemsToReset;
    882     foreach (UIVMItem *pItem, items)
    883         if (isActionEnabled(UIActionIndexST_M_Group_S_Reset, QList<UIVMItem*>() << pItem))
     881    QList<UIVirtualMachineItem*> itemsToReset;
     882    foreach (UIVirtualMachineItem *pItem, items)
     883        if (isActionEnabled(UIActionIndexST_M_Group_S_Reset, QList<UIVirtualMachineItem*>() << pItem))
    884884        {
    885885            machineNames << pItem->name();
     
    893893
    894894    /* For each selected item: */
    895     foreach (UIVMItem *pItem, itemsToReset)
     895    foreach (UIVirtualMachineItem *pItem, itemsToReset)
    896896    {
    897897        /* Open a session to modify VM state: */
     
    910910}
    911911
    912 void UISelectorWindow::sltPerformDetachMachineUI()
     912void UIVirtualBoxManager::sltPerformDetachMachineUI()
    913913{
    914914    /* Get selected items: */
    915     QList<UIVMItem*> items = currentItems();
     915    QList<UIVirtualMachineItem*> items = currentItems();
    916916    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    917917
    918918    /* For each selected item: */
    919     foreach (UIVMItem *pItem, items)
     919    foreach (UIVirtualMachineItem *pItem, items)
    920920    {
    921921        /* Check if current item could be detached: */
    922         if (!isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Detach, QList<UIVMItem*>() << pItem))
     922        if (!isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Detach, QList<UIVirtualMachineItem*>() << pItem))
    923923            continue;
    924924
     
    928928}
    929929
    930 void UISelectorWindow::sltPerformSaveMachineState()
     930void UIVirtualBoxManager::sltPerformSaveMachineState()
    931931{
    932932    /* Get selected items: */
    933     QList<UIVMItem*> items = currentItems();
     933    QList<UIVirtualMachineItem*> items = currentItems();
    934934    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    935935
    936936    /* For each selected item: */
    937     foreach (UIVMItem *pItem, items)
     937    foreach (UIVirtualMachineItem *pItem, items)
    938938    {
    939939        /* Check if current item could be saved: */
    940         if (!isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_SaveState, QList<UIVMItem*>() << pItem))
     940        if (!isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_SaveState, QList<UIVirtualMachineItem*>() << pItem))
    941941            continue;
    942942
     
    975975}
    976976
    977 void UISelectorWindow::sltPerformShutdownMachine()
     977void UIVirtualBoxManager::sltPerformShutdownMachine()
    978978{
    979979    /* Get selected items: */
    980     QList<UIVMItem*> items = currentItems();
     980    QList<UIVirtualMachineItem*> items = currentItems();
    981981    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    982982
    983983    /* Prepare the list of the machines to be shutdowned: */
    984984    QStringList machineNames;
    985     QList<UIVMItem*> itemsToShutdown;
    986     foreach (UIVMItem *pItem, items)
    987         if (isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Shutdown, QList<UIVMItem*>() << pItem))
     985    QList<UIVirtualMachineItem*> itemsToShutdown;
     986    foreach (UIVirtualMachineItem *pItem, items)
     987        if (isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Shutdown, QList<UIVirtualMachineItem*>() << pItem))
    988988        {
    989989            machineNames << pItem->name();
     
    997997
    998998    /* For each selected item: */
    999     foreach (UIVMItem *pItem, itemsToShutdown)
     999    foreach (UIVirtualMachineItem *pItem, itemsToShutdown)
    10001000    {
    10011001        /* Open a session to modify VM state: */
     
    10161016}
    10171017
    1018 void UISelectorWindow::sltPerformPowerOffMachine()
     1018void UIVirtualBoxManager::sltPerformPowerOffMachine()
    10191019{
    10201020    /* Get selected items: */
    1021     QList<UIVMItem*> items = currentItems();
     1021    QList<UIVirtualMachineItem*> items = currentItems();
    10221022    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    10231023
    10241024    /* Prepare the list of the machines to be powered off: */
    10251025    QStringList machineNames;
    1026     QList<UIVMItem*> itemsToPowerOff;
    1027     foreach (UIVMItem *pItem, items)
    1028         if (isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_PowerOff, QList<UIVMItem*>() << pItem))
     1026    QList<UIVirtualMachineItem*> itemsToPowerOff;
     1027    foreach (UIVirtualMachineItem *pItem, items)
     1028        if (isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_PowerOff, QList<UIVirtualMachineItem*>() << pItem))
    10291029        {
    10301030            machineNames << pItem->name();
     
    10381038
    10391039    /* For each selected item: */
    1040     foreach (UIVMItem *pItem, itemsToPowerOff)
     1040    foreach (UIVirtualMachineItem *pItem, itemsToPowerOff)
    10411041    {
    10421042        /* Open a session to modify VM state: */
     
    10651065}
    10661066
    1067 void UISelectorWindow::sltOpenMachineLogDialog()
     1067void UIVirtualBoxManager::sltOpenMachineLogDialog()
    10681068{
    10691069    /* Get selected items: */
    1070     QList<UIVMItem*> items = currentItems();
     1070    QList<UIVirtualMachineItem*> items = currentItems();
    10711071    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    10721072
     
    10791079
    10801080    /* For each selected item: */
    1081     foreach (UIVMItem *pItem, items)
     1081    foreach (UIVirtualMachineItem *pItem, items)
    10821082    {
    10831083        /* Check if log could be show for the current item: */
    1084         if (!isActionEnabled(UIActionIndexST_M_Group_S_ShowLogDialog, QList<UIVMItem*>() << pItem))
     1084        if (!isActionEnabled(UIActionIndexST_M_Group_S_ShowLogDialog, QList<UIVirtualMachineItem*>() << pItem))
    10851085            continue;
    10861086
     
    10951095                m_logViewers[pItem->machine().GetHardwareUUID()] = pLogViewerDialog;
    10961096                connect(pLogViewerDialog, &QIManagerDialog::sigClose,
    1097                         this, &UISelectorWindow::sltCloseLogViewerWindow);
     1097                        this, &UIVirtualBoxManager::sltCloseLogViewerWindow);
    10981098            }
    10991099        }
     
    11121112}
    11131113
    1114 void UISelectorWindow::sltCloseLogViewerWindow()
     1114void UIVirtualBoxManager::sltCloseLogViewerWindow()
    11151115{
    11161116    QMap<QString, QIManagerDialog*>::iterator sendersIterator = m_logViewers.begin();
     
    11341134}
    11351135
    1136 void UISelectorWindow::sltShowMachineInFileManager()
     1136void UIVirtualBoxManager::sltShowMachineInFileManager()
    11371137{
    11381138    /* Get selected items: */
    1139     QList<UIVMItem*> items = currentItems();
     1139    QList<UIVirtualMachineItem*> items = currentItems();
    11401140    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    11411141
    11421142    /* For each selected item: */
    1143     foreach (UIVMItem *pItem, items)
     1143    foreach (UIVirtualMachineItem *pItem, items)
    11441144    {
    11451145        /* Check if that item could be shown in file-browser: */
    1146         if (!isActionEnabled(UIActionIndexST_M_Group_S_ShowInFileManager, QList<UIVMItem*>() << pItem))
     1146        if (!isActionEnabled(UIActionIndexST_M_Group_S_ShowInFileManager, QList<UIVirtualMachineItem*>() << pItem))
    11471147            continue;
    11481148
     
    11521152}
    11531153
    1154 void UISelectorWindow::sltPerformCreateMachineShortcut()
     1154void UIVirtualBoxManager::sltPerformCreateMachineShortcut()
    11551155{
    11561156    /* Get selected items: */
    1157     QList<UIVMItem*> items = currentItems();
     1157    QList<UIVirtualMachineItem*> items = currentItems();
    11581158    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    11591159
    11601160    /* For each selected item: */
    1161     foreach (UIVMItem *pItem, items)
     1161    foreach (UIVirtualMachineItem *pItem, items)
    11621162    {
    11631163        /* Check if shortcuts could be created for this item: */
    1164         if (!isActionEnabled(UIActionIndexST_M_Group_S_CreateShortcut, QList<UIVMItem*>() << pItem))
     1164        if (!isActionEnabled(UIActionIndexST_M_Group_S_CreateShortcut, QList<UIVirtualMachineItem*>() << pItem))
    11651165            continue;
    11661166
     
    11731173}
    11741174
    1175 void UISelectorWindow::sltGroupCloseMenuAboutToShow()
     1175void UIVirtualBoxManager::sltGroupCloseMenuAboutToShow()
    11761176{
    11771177    /* Get selected items: */
    1178     QList<UIVMItem*> items = currentItems();
     1178    QList<UIVirtualMachineItem*> items = currentItems();
    11791179    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    11801180
     
    11821182}
    11831183
    1184 void UISelectorWindow::sltMachineCloseMenuAboutToShow()
     1184void UIVirtualBoxManager::sltMachineCloseMenuAboutToShow()
    11851185{
    11861186    /* Get selected items: */
    1187     QList<UIVMItem*> items = currentItems();
     1187    QList<UIVirtualMachineItem*> items = currentItems();
    11881188    AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n"));
    11891189
     
    11911191}
    11921192
    1193 void UISelectorWindow::sltHandleToolsTypeSwitch()
     1193void UIVirtualBoxManager::sltHandleToolsTypeSwitch()
    11941194{
    11951195    /* If Machine tool button is checked => go backward: */
     
    12101210}
    12111211
    1212 void UISelectorWindow::sltHandleShowTabBarMachine()
     1212void UIVirtualBoxManager::sltHandleShowTabBarMachine()
    12131213{
    12141214    m_pActionTabBarGlobal->setVisible(false);
     
    12161216}
    12171217
    1218 void UISelectorWindow::sltHandleShowTabBarGlobal()
     1218void UIVirtualBoxManager::sltHandleShowTabBarGlobal()
    12191219{
    12201220    m_pActionTabBarMachine->setVisible(false);
     
    12221222}
    12231223
    1224 void UISelectorWindow::sltHandleToolOpenedMachine(ToolTypeMachine enmType)
     1224void UIVirtualBoxManager::sltHandleToolOpenedMachine(ToolTypeMachine enmType)
    12251225{
    12261226    /* First, make sure corresponding tool set opened: */
     
    12381238    if (enmType == ToolTypeMachine_Snapshots || enmType == ToolTypeMachine_LogViewer)
    12391239    {
    1240         UIVMItem *pItem = currentItem();
     1240        UIVirtualMachineItem *pItem = currentItem();
    12411241        m_pPaneToolsMachine->setMachine(pItem ? pItem->machine() : CMachine());
    12421242    }
    12431243}
    12441244
    1245 void UISelectorWindow::sltHandleToolOpenedGlobal(ToolTypeGlobal enmType)
     1245void UIVirtualBoxManager::sltHandleToolOpenedGlobal(ToolTypeGlobal enmType)
    12461246{
    12471247    /* First, make sure corresponding tool set opened: */
     
    12541254}
    12551255
    1256 void UISelectorWindow::sltHandleToolClosedMachine(ToolTypeMachine enmType)
     1256void UIVirtualBoxManager::sltHandleToolClosedMachine(ToolTypeMachine enmType)
    12571257{
    12581258    /* Close corresponding tool: */
     
    12601260}
    12611261
    1262 void UISelectorWindow::sltHandleToolClosedGlobal(ToolTypeGlobal enmType)
     1262void UIVirtualBoxManager::sltHandleToolClosedGlobal(ToolTypeGlobal enmType)
    12631263{
    12641264    /* Close corresponding tool: */
     
    12661266}
    12671267
    1268 UIVMItem* UISelectorWindow::currentItem() const
     1268UIVirtualMachineItem* UIVirtualBoxManager::currentItem() const
    12691269{
    12701270    return m_pPaneChooser->currentItem();
    12711271}
    12721272
    1273 QList<UIVMItem*> UISelectorWindow::currentItems() const
     1273QList<UIVirtualMachineItem*> UIVirtualBoxManager::currentItems() const
    12741274{
    12751275    return m_pPaneChooser->currentItems();
    12761276}
    12771277
    1278 void UISelectorWindow::retranslateUi()
     1278void UIVirtualBoxManager::retranslateUi()
    12791279{
    12801280    /* Set window title: */
     
    13031303}
    13041304
    1305 bool UISelectorWindow::event(QEvent *pEvent)
     1305bool UIVirtualBoxManager::event(QEvent *pEvent)
    13061306{
    13071307    /* Which event do we have? */
     
    13741374}
    13751375
    1376 void UISelectorWindow::showEvent(QShowEvent *pEvent)
     1376void UIVirtualBoxManager::showEvent(QShowEvent *pEvent)
    13771377{
    13781378    /* Call to base-class: */
     
    13891389}
    13901390
    1391 void UISelectorWindow::polishEvent(QShowEvent*)
     1391void UIVirtualBoxManager::polishEvent(QShowEvent*)
    13921392{
    13931393    /* Make sure user warned about inaccessible medium(s)
     
    14001400
    14011401#ifdef VBOX_WS_MAC
    1402 bool UISelectorWindow::eventFilter(QObject *pObject, QEvent *pEvent)
     1402bool UIVirtualBoxManager::eventFilter(QObject *pObject, QEvent *pEvent)
    14031403{
    14041404    /* Ignore for non-active window except for FileOpen event which should be always processed: */
     
    14291429#endif /* VBOX_WS_MAC */
    14301430
    1431 void UISelectorWindow::closeEvent(QCloseEvent *pEvent)
     1431void UIVirtualBoxManager::closeEvent(QCloseEvent *pEvent)
    14321432{
    14331433    /* Call to base-class: */
     
    14381438}
    14391439
    1440 void UISelectorWindow::prepare()
     1440void UIVirtualBoxManager::prepare()
    14411441{
    14421442#ifdef VBOX_WS_X11
     
    14871487}
    14881488
    1489 void UISelectorWindow::prepareIcon()
     1489void UIVirtualBoxManager::prepareIcon()
    14901490{
    14911491    /* Prepare application icon.
     
    15011501}
    15021502
    1503 void UISelectorWindow::prepareMenuBar()
     1503void UIVirtualBoxManager::prepareMenuBar()
    15041504{
    15051505#ifndef VBOX_WS_MAC
     
    15491549}
    15501550
    1551 void UISelectorWindow::prepareMenuFile(QMenu *pMenu)
     1551void UIVirtualBoxManager::prepareMenuFile(QMenu *pMenu)
    15521552{
    15531553    /* Do not touch if filled already: */
     
    16451645}
    16461646
    1647 void UISelectorWindow::prepareMenuGroup(QMenu *pMenu)
     1647void UIVirtualBoxManager::prepareMenuGroup(QMenu *pMenu)
    16481648{
    16491649    /* Do not touch if filled already: */
     
    17101710}
    17111711
    1712 void UISelectorWindow::prepareMenuMachine(QMenu *pMenu)
     1712void UIVirtualBoxManager::prepareMenuMachine(QMenu *pMenu)
    17131713{
    17141714    /* Do not touch if filled already: */
     
    17831783}
    17841784
    1785 void UISelectorWindow::prepareMenuGroupStartOrShow(QMenu *pMenu)
     1785void UIVirtualBoxManager::prepareMenuGroupStartOrShow(QMenu *pMenu)
    17861786{
    17871787    /* Do not touch if filled already: */
     
    18121812}
    18131813
    1814 void UISelectorWindow::prepareMenuMachineStartOrShow(QMenu *pMenu)
     1814void UIVirtualBoxManager::prepareMenuMachineStartOrShow(QMenu *pMenu)
    18151815{
    18161816    /* Do not touch if filled already: */
     
    18411841}
    18421842
    1843 void UISelectorWindow::prepareMenuGroupClose(QMenu *pMenu)
     1843void UIVirtualBoxManager::prepareMenuGroupClose(QMenu *pMenu)
    18441844{
    18451845    /* Do not touch if filled already: */
     
    18731873}
    18741874
    1875 void UISelectorWindow::prepareMenuMachineClose(QMenu *pMenu)
     1875void UIVirtualBoxManager::prepareMenuMachineClose(QMenu *pMenu)
    18761876{
    18771877    /* Do not touch if filled already: */
     
    19051905}
    19061906
    1907 void UISelectorWindow::prepareStatusBar()
     1907void UIVirtualBoxManager::prepareStatusBar()
    19081908{
    19091909#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     
    19241924}
    19251925
    1926 void UISelectorWindow::prepareToolbar()
     1926void UIVirtualBoxManager::prepareToolbar()
    19271927{
    19281928    /* Create Main toolbar: */
     
    19831983
    19841984        /* Create Tools toolbar: */
    1985         m_pToolbarTools = new UIToolsToolbar(actionPool());
     1985        m_pToolbarTools = new UIToolbarTools(actionPool());
    19861986        if (m_pToolbarTools)
    19871987        {
    19881988            /* Configure toolbar: */
    19891989            m_pToolbarTools->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);
    1990             connect(m_pToolbarTools, &UIToolsToolbar::sigShowTabBarMachine,
    1991                     this, &UISelectorWindow::sltHandleShowTabBarMachine);
    1992             connect(m_pToolbarTools, &UIToolsToolbar::sigShowTabBarGlobal,
    1993                     this, &UISelectorWindow::sltHandleShowTabBarGlobal);
     1990            connect(m_pToolbarTools, &UIToolbarTools::sigShowTabBarMachine,
     1991                    this, &UIVirtualBoxManager::sltHandleShowTabBarMachine);
     1992            connect(m_pToolbarTools, &UIToolbarTools::sigShowTabBarGlobal,
     1993                    this, &UIVirtualBoxManager::sltHandleShowTabBarGlobal);
    19941994            m_pToolbarTools->setTabBars(m_pTabBarMachine, m_pTabBarGlobal);
    19951995
     
    20212021}
    20222022
    2023 void UISelectorWindow::prepareWidgets()
     2023void UIVirtualBoxManager::prepareWidgets()
    20242024{
    20252025    /* Create central-widget: */
     
    20602060
    20612061                    /* Create Chooser-pane: */
    2062                     m_pPaneChooser = new UIGChooser(this);
     2062                    m_pPaneChooser = new UIChooser(this);
    20632063                    AssertPtrReturnVoid(m_pPaneChooser);
    20642064                    {
     
    20682068
    20692069                    /* Create Machine Tools-pane: */
    2070                     m_pPaneToolsMachine = new UIToolsPaneMachine(actionPool());
     2070                    m_pPaneToolsMachine = new UIToolPaneMachine(actionPool());
    20712071                    AssertPtrReturnVoid(m_pPaneToolsMachine);
    20722072                    {
     
    20842084
    20852085                /* Create Global Tools-pane: */
    2086                 m_pPaneToolsGlobal = new UIToolsPaneGlobal(actionPool());
     2086                m_pPaneToolsGlobal = new UIToolPaneGlobal(actionPool());
    20872087                AssertPtrReturnVoid(m_pPaneToolsGlobal);
    20882088
     
    21002100}
    21012101
    2102 void UISelectorWindow::prepareConnections()
     2102void UIVirtualBoxManager::prepareConnections()
    21032103{
    21042104#ifdef VBOX_WS_X11
     
    21732173    /* 'Tools' actions connections: */
    21742174    connect(actionPool()->action(UIActionIndexST_M_Tools_T_Machine), &UIAction::toggled,
    2175             this, &UISelectorWindow::sltHandleToolsTypeSwitch);
     2175            this, &UIVirtualBoxManager::sltHandleToolsTypeSwitch);
    21762176    connect(actionPool()->action(UIActionIndexST_M_Tools_T_Global), &UIAction::toggled,
    2177             this, &UISelectorWindow::sltHandleToolsTypeSwitch);
     2177            this, &UIVirtualBoxManager::sltHandleToolsTypeSwitch);
    21782178
    21792179    /* Status-bar connections: */
     
    21952195    ::darwinRegisterForUnifiedToolbarContextMenuEvents(this);
    21962196#endif /* VBOX_WS_MAC */
    2197     connect(m_pToolbarTools, &UIToolsToolbar::sigToolOpenedMachine, this, &UISelectorWindow::sltHandleToolOpenedMachine);
    2198     connect(m_pToolbarTools, &UIToolsToolbar::sigToolOpenedGlobal,  this, &UISelectorWindow::sltHandleToolOpenedGlobal);
    2199     connect(m_pToolbarTools, &UIToolsToolbar::sigToolClosedMachine, this, &UISelectorWindow::sltHandleToolClosedMachine);
    2200     connect(m_pToolbarTools, &UIToolsToolbar::sigToolClosedGlobal,  this, &UISelectorWindow::sltHandleToolClosedGlobal);
     2197    connect(m_pToolbarTools, &UIToolbarTools::sigToolOpenedMachine, this, &UIVirtualBoxManager::sltHandleToolOpenedMachine);
     2198    connect(m_pToolbarTools, &UIToolbarTools::sigToolOpenedGlobal,  this, &UIVirtualBoxManager::sltHandleToolOpenedGlobal);
     2199    connect(m_pToolbarTools, &UIToolbarTools::sigToolClosedMachine, this, &UIVirtualBoxManager::sltHandleToolClosedMachine);
     2200    connect(m_pToolbarTools, &UIToolbarTools::sigToolClosedGlobal,  this, &UIVirtualBoxManager::sltHandleToolClosedGlobal);
    22012201
    22022202    /* VM desktop connections: */
     
    22092209}
    22102210
    2211 void UISelectorWindow::loadSettings()
     2211void UIVirtualBoxManager::loadSettings()
    22122212{
    22132213    /* Restore window geometry: */
     
    22172217
    22182218        /* Restore geometry: */
    2219         LogRel2(("GUI: UISelectorWindow: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n",
     2219        LogRel2(("GUI: UIVirtualBoxManager: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n",
    22202220                 m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height()));
    22212221        restoreGeometry();
     
    22772277}
    22782278
    2279 void UISelectorWindow::saveSettings()
     2279void UIVirtualBoxManager::saveSettings()
    22802280{
    22812281    /* Save toolbar Machine/Global tools orders: */
     
    23042304        gEDataManager->setSelectorWindowGeometry(m_geometry, isMaximized());
    23052305#endif /* !VBOX_WS_MAC */
    2306         LogRel2(("GUI: UISelectorWindow: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",
     2306        LogRel2(("GUI: UIVirtualBoxManager: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",
    23072307                 m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height()));
    23082308    }
    23092309}
    23102310
    2311 void UISelectorWindow::cleanupConnections()
     2311void UIVirtualBoxManager::cleanupConnections()
    23122312{
    23132313#ifdef VBOX_WS_MAC
     
    23172317}
    23182318
    2319 void UISelectorWindow::cleanupMenuBar()
     2319void UIVirtualBoxManager::cleanupMenuBar()
    23202320{
    23212321#ifdef VBOX_WS_MAC
     
    23282328}
    23292329
    2330 void UISelectorWindow::cleanup()
     2330void UIVirtualBoxManager::cleanup()
    23312331{
    23322332    /* Close the sub-dialogs first: */
     
    23422342}
    23432343
    2344 void UISelectorWindow::performStartOrShowVirtualMachines(const QList<UIVMItem*> &items, VBoxGlobal::LaunchMode enmLaunchMode)
     2344void UIVirtualBoxManager::performStartOrShowVirtualMachines(const QList<UIVirtualMachineItem*> &items, VBoxGlobal::LaunchMode enmLaunchMode)
    23452345{
    23462346    /* Do nothing while group saving is in progress: */
     
    23502350    /* Compose the list of startable items: */
    23512351    QStringList startableMachineNames;
    2352     QList<UIVMItem*> startableItems;
    2353     foreach (UIVMItem *pItem, items)
    2354         if (isAtLeastOneItemCanBeStarted(QList<UIVMItem*>() << pItem))
     2352    QList<UIVirtualMachineItem*> startableItems;
     2353    foreach (UIVirtualMachineItem *pItem, items)
     2354        if (isAtLeastOneItemCanBeStarted(QList<UIVirtualMachineItem*>() << pItem))
    23552355        {
    23562356            startableItems << pItem;
     
    23662366
    23672367    /* For every item => check if it could be launched: */
    2368     foreach (UIVMItem *pItem, items)
    2369         if (   isAtLeastOneItemCanBeShown(QList<UIVMItem*>() << pItem)
    2370             || (   isAtLeastOneItemCanBeStarted(QList<UIVMItem*>() << pItem)
     2368    foreach (UIVirtualMachineItem *pItem, items)
     2369        if (   isAtLeastOneItemCanBeShown(QList<UIVirtualMachineItem*>() << pItem)
     2370            || (   isAtLeastOneItemCanBeStarted(QList<UIVirtualMachineItem*>() << pItem)
    23712371                && fStartConfirmed))
    23722372        {
     
    23742374            VBoxGlobal::LaunchMode enmItemLaunchMode = enmLaunchMode;
    23752375            if (enmItemLaunchMode == VBoxGlobal::LaunchMode_Invalid)
    2376                 enmItemLaunchMode = UIVMItem::isItemRunningHeadless(pItem)         ? VBoxGlobal::LaunchMode_Separate :
     2376                enmItemLaunchMode = UIVirtualMachineItem::isItemRunningHeadless(pItem)         ? VBoxGlobal::LaunchMode_Separate :
    23772377                                    qApp->keyboardModifiers() == Qt::ShiftModifier ? VBoxGlobal::LaunchMode_Headless :
    23782378                                                                                     VBoxGlobal::LaunchMode_Default;
     
    23842384}
    23852385
    2386 void UISelectorWindow::updateActionsVisibility()
     2386void UIVirtualBoxManager::updateActionsVisibility()
    23872387{
    23882388    /* Determine whether Machine or Group menu should be shown at all: */
     
    24132413}
    24142414
    2415 void UISelectorWindow::updateActionsAppearance()
     2415void UIVirtualBoxManager::updateActionsAppearance()
    24162416{
    24172417    /* Get current items: */
    2418     QList<UIVMItem*> items = currentItems();
     2418    QList<UIVirtualMachineItem*> items = currentItems();
    24192419
    24202420    /* Enable/disable group actions: */
     
    24722472
    24732473    /* Get current item: */
    2474     UIVMItem *pItem = currentItem();
     2474    UIVirtualMachineItem *pItem = currentItem();
    24752475
    24762476    /* Start/Show action is deremined by 1st item: */
    24772477    if (pItem && pItem->accessible())
    24782478    {
    2479         actionPool()->action(UIActionIndexST_M_Group_M_StartOrShow)->toActionPolymorphicMenu()->setState(UIVMItem::isItemPoweredOff(pItem) ? 0 : 1);
    2480         actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)->toActionPolymorphicMenu()->setState(UIVMItem::isItemPoweredOff(pItem) ? 0 : 1);
     2479        actionPool()->action(UIActionIndexST_M_Group_M_StartOrShow)->toActionPolymorphicMenu()->setState(UIVirtualMachineItem::isItemPoweredOff(pItem) ? 0 : 1);
     2480        actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)->toActionPolymorphicMenu()->setState(UIVirtualMachineItem::isItemPoweredOff(pItem) ? 0 : 1);
    24812481        QToolButton *pButton = qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)));
    24822482        if (pButton)
    2483             pButton->setPopupMode(UIVMItem::isItemPoweredOff(pItem) ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup);
     2483            pButton->setPopupMode(UIVirtualMachineItem::isItemPoweredOff(pItem) ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup);
    24842484    }
    24852485    else
     
    24892489        QToolButton *pButton = qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)));
    24902490        if (pButton)
    2491             pButton->setPopupMode(UIVMItem::isItemPoweredOff(pItem) ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup);
     2491            pButton->setPopupMode(UIVirtualMachineItem::isItemPoweredOff(pItem) ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup);
    24922492    }
    24932493
    24942494    /* Pause/Resume action is deremined by 1st started item: */
    2495     UIVMItem *pFirstStartedAction = 0;
    2496     foreach (UIVMItem *pSelectedItem, items)
    2497         if (UIVMItem::isItemStarted(pSelectedItem))
     2495    UIVirtualMachineItem *pFirstStartedAction = 0;
     2496    foreach (UIVirtualMachineItem *pSelectedItem, items)
     2497        if (UIVirtualMachineItem::isItemStarted(pSelectedItem))
    24982498        {
    24992499            pFirstStartedAction = pSelectedItem;
     
    25022502    /* Update the group Pause/Resume action appearance: */
    25032503    actionPool()->action(UIActionIndexST_M_Group_T_Pause)->blockSignals(true);
    2504     actionPool()->action(UIActionIndexST_M_Group_T_Pause)->setChecked(pFirstStartedAction && UIVMItem::isItemPaused(pFirstStartedAction));
     2504    actionPool()->action(UIActionIndexST_M_Group_T_Pause)->setChecked(pFirstStartedAction && UIVirtualMachineItem::isItemPaused(pFirstStartedAction));
    25052505    actionPool()->action(UIActionIndexST_M_Group_T_Pause)->retranslateUi();
    25062506    actionPool()->action(UIActionIndexST_M_Group_T_Pause)->blockSignals(false);
    25072507    /* Update the machine Pause/Resume action appearance: */
    25082508    actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->blockSignals(true);
    2509     actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->setChecked(pFirstStartedAction && UIVMItem::isItemPaused(pFirstStartedAction));
     2509    actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->setChecked(pFirstStartedAction && UIVirtualMachineItem::isItemPaused(pFirstStartedAction));
    25102510    actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->retranslateUi();
    25112511    actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->blockSignals(false);
     
    25182518}
    25192519
    2520 bool UISelectorWindow::isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items)
     2520bool UIVirtualBoxManager::isActionEnabled(int iActionIndex, const QList<UIVirtualMachineItem*> &items)
    25212521{
    25222522    /* No actions enabled for empty item list: */
     
    25252525
    25262526    /* Get first item: */
    2527     UIVMItem *pItem = items.first();
     2527    UIVirtualMachineItem *pItem = items.first();
    25282528
    25292529    /* For known action types: */
     
    25522552            return !m_pPaneChooser->isGroupSavingInProgress() &&
    25532553                   items.size() == 1 &&
    2554                    UIVMItem::isItemEditable(pItem);
     2554                   UIVirtualMachineItem::isItemEditable(pItem);
    25552555        }
    25562556        case UIActionIndexST_M_Machine_S_Remove:
     
    26592659
    26602660/* static */
    2661 bool UISelectorWindow::isItemsPoweredOff(const QList<UIVMItem*> &items)
    2662 {
    2663     foreach (UIVMItem *pItem, items)
    2664         if (!UIVMItem::isItemPoweredOff(pItem))
     2661bool UIVirtualBoxManager::isItemsPoweredOff(const QList<UIVirtualMachineItem*> &items)
     2662{
     2663    foreach (UIVirtualMachineItem *pItem, items)
     2664        if (!UIVirtualMachineItem::isItemPoweredOff(pItem))
    26652665            return false;
    26662666    return true;
     
    26682668
    26692669/* static */
    2670 bool UISelectorWindow::isAtLeastOneItemAbleToShutdown(const QList<UIVMItem*> &items)
     2670bool UIVirtualBoxManager::isAtLeastOneItemAbleToShutdown(const QList<UIVirtualMachineItem*> &items)
    26712671{
    26722672    /* Enumerate all the passed items: */
    2673     foreach (UIVMItem *pItem, items)
     2673    foreach (UIVirtualMachineItem *pItem, items)
    26742674    {
    26752675        /* Skip non-running machines: */
    2676         if (!UIVMItem::isItemRunning(pItem))
     2676        if (!UIVirtualMachineItem::isItemRunning(pItem))
    26772677            continue;
    26782678        /* Skip session failures: */
     
    27012701
    27022702/* static */
    2703 bool UISelectorWindow::isAtLeastOneItemSupportsShortcuts(const QList<UIVMItem*> &items)
    2704 {
    2705     foreach (UIVMItem *pItem, items)
     2703bool UIVirtualBoxManager::isAtLeastOneItemSupportsShortcuts(const QList<UIVirtualMachineItem*> &items)
     2704{
     2705    foreach (UIVirtualMachineItem *pItem, items)
    27062706        if (pItem->accessible()
    27072707#ifdef VBOX_WS_MAC
     
    27152715
    27162716/* static */
    2717 bool UISelectorWindow::isAtLeastOneItemAccessible(const QList<UIVMItem*> &items)
    2718 {
    2719     foreach (UIVMItem *pItem, items)
     2717bool UIVirtualBoxManager::isAtLeastOneItemAccessible(const QList<UIVirtualMachineItem*> &items)
     2718{
     2719    foreach (UIVirtualMachineItem *pItem, items)
    27202720        if (pItem->accessible())
    27212721            return true;
     
    27242724
    27252725/* static */
    2726 bool UISelectorWindow::isAtLeastOneItemInaccessible(const QList<UIVMItem*> &items)
    2727 {
    2728     foreach (UIVMItem *pItem, items)
     2726bool UIVirtualBoxManager::isAtLeastOneItemInaccessible(const QList<UIVirtualMachineItem*> &items)
     2727{
     2728    foreach (UIVirtualMachineItem *pItem, items)
    27292729        if (!pItem->accessible())
    27302730            return true;
     
    27332733
    27342734/* static */
    2735 bool UISelectorWindow::isAtLeastOneItemRemovable(const QList<UIVMItem*> &items)
    2736 {
    2737     foreach (UIVMItem *pItem, items)
    2738         if (!pItem->accessible() || UIVMItem::isItemEditable(pItem))
     2735bool UIVirtualBoxManager::isAtLeastOneItemRemovable(const QList<UIVirtualMachineItem*> &items)
     2736{
     2737    foreach (UIVirtualMachineItem *pItem, items)
     2738        if (!pItem->accessible() || UIVirtualMachineItem::isItemEditable(pItem))
    27392739            return true;
    27402740    return false;
     
    27422742
    27432743/* static */
    2744 bool UISelectorWindow::isAtLeastOneItemCanBeStarted(const QList<UIVMItem*> &items)
    2745 {
    2746     foreach (UIVMItem *pItem, items)
    2747     {
    2748         if (UIVMItem::isItemPoweredOff(pItem) && UIVMItem::isItemEditable(pItem))
     2744bool UIVirtualBoxManager::isAtLeastOneItemCanBeStarted(const QList<UIVirtualMachineItem*> &items)
     2745{
     2746    foreach (UIVirtualMachineItem *pItem, items)
     2747    {
     2748        if (UIVirtualMachineItem::isItemPoweredOff(pItem) && UIVirtualMachineItem::isItemEditable(pItem))
    27492749            return true;
    27502750    }
     
    27532753
    27542754/* static */
    2755 bool UISelectorWindow::isAtLeastOneItemCanBeShown(const QList<UIVMItem*> &items)
    2756 {
    2757     foreach (UIVMItem *pItem, items)
    2758     {
    2759         if (UIVMItem::isItemStarted(pItem) && (pItem->canSwitchTo() || UIVMItem::isItemRunningHeadless(pItem)))
     2755bool UIVirtualBoxManager::isAtLeastOneItemCanBeShown(const QList<UIVirtualMachineItem*> &items)
     2756{
     2757    foreach (UIVirtualMachineItem *pItem, items)
     2758    {
     2759        if (UIVirtualMachineItem::isItemStarted(pItem) && (pItem->canSwitchTo() || UIVirtualMachineItem::isItemRunningHeadless(pItem)))
    27602760            return true;
    27612761    }
     
    27642764
    27652765/* static */
    2766 bool UISelectorWindow::isAtLeastOneItemCanBeStartedOrShown(const QList<UIVMItem*> &items)
    2767 {
    2768     foreach (UIVMItem *pItem, items)
    2769     {
    2770         if ((UIVMItem::isItemPoweredOff(pItem) && UIVMItem::isItemEditable(pItem)) ||
    2771             (UIVMItem::isItemStarted(pItem) && (pItem->canSwitchTo() || UIVMItem::isItemRunningHeadless(pItem))))
     2766bool UIVirtualBoxManager::isAtLeastOneItemCanBeStartedOrShown(const QList<UIVirtualMachineItem*> &items)
     2767{
     2768    foreach (UIVirtualMachineItem *pItem, items)
     2769    {
     2770        if ((UIVirtualMachineItem::isItemPoweredOff(pItem) && UIVirtualMachineItem::isItemEditable(pItem)) ||
     2771            (UIVirtualMachineItem::isItemStarted(pItem) && (pItem->canSwitchTo() || UIVirtualMachineItem::isItemRunningHeadless(pItem))))
    27722772            return true;
    27732773    }
     
    27762776
    27772777/* static */
    2778 bool UISelectorWindow::isAtLeastOneItemDiscardable(const QList<UIVMItem*> &items)
    2779 {
    2780     foreach (UIVMItem *pItem, items)
    2781         if (UIVMItem::isItemSaved(pItem) && UIVMItem::isItemEditable(pItem))
     2778bool UIVirtualBoxManager::isAtLeastOneItemDiscardable(const QList<UIVirtualMachineItem*> &items)
     2779{
     2780    foreach (UIVirtualMachineItem *pItem, items)
     2781        if (UIVirtualMachineItem::isItemSaved(pItem) && UIVirtualMachineItem::isItemEditable(pItem))
    27822782            return true;
    27832783    return false;
     
    27852785
    27862786/* static */
    2787 bool UISelectorWindow::isAtLeastOneItemStarted(const QList<UIVMItem*> &items)
    2788 {
    2789     foreach (UIVMItem *pItem, items)
    2790         if (UIVMItem::isItemStarted(pItem))
     2787bool UIVirtualBoxManager::isAtLeastOneItemStarted(const QList<UIVirtualMachineItem*> &items)
     2788{
     2789    foreach (UIVirtualMachineItem *pItem, items)
     2790        if (UIVirtualMachineItem::isItemStarted(pItem))
    27912791            return true;
    27922792    return false;
     
    27942794
    27952795/* static */
    2796 bool UISelectorWindow::isAtLeastOneItemRunning(const QList<UIVMItem*> &items)
    2797 {
    2798     foreach (UIVMItem *pItem, items)
    2799         if (UIVMItem::isItemRunning(pItem))
     2796bool UIVirtualBoxManager::isAtLeastOneItemRunning(const QList<UIVirtualMachineItem*> &items)
     2797{
     2798    foreach (UIVirtualMachineItem *pItem, items)
     2799        if (UIVirtualMachineItem::isItemRunning(pItem))
    28002800            return true;
    28012801    return false;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UISelectorWindow class declaration.
     3 * VBox Qt GUI - UIVirtualBoxManager class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef ___UISelectorWindow_h___
    19 #define ___UISelectorWindow_h___
     18#ifndef ___UIVirtualBoxManager_h___
     19#define ___UIVirtualBoxManager_h___
    2020
    2121/* Qt includes: */
     
    2525#include "QIMainWindow.h"
    2626#include "QIWithRetranslateUI.h"
    27 #include "UIToolsPaneGlobal.h"
    28 #include "UIToolsPaneMachine.h"
     27#include "UIToolPaneGlobal.h"
     28#include "UIToolPaneMachine.h"
    2929#include "VBoxGlobal.h"
    3030
     
    3535class UIAction;
    3636class UIActionPool;
    37 class UIGChooser;
     37class UIChooser;
    3838class UISlidingWidget;
    3939class UITabBar;
    4040class UIToolBar;
    41 class UIToolsToolbar;
    42 class UIVMItem;
     41class UIToolbarTools;
     42class UIVirtualMachineItem;
    4343
    4444/* Type definitions: */
     
    4747/** Singleton QIMainWindow extension
    4848  * used as VirtualBox Manager (selector-window) instance. */
    49 class UISelectorWindow : public QIWithRetranslateUI<QIMainWindow>
     49class UIVirtualBoxManager : public QIWithRetranslateUI<QIMainWindow>
    5050{
    5151    Q_OBJECT;
     
    6363    static void destroy();
    6464    /** Static instance provider. */
    65     static UISelectorWindow* instance() { return m_spInstance; }
     65    static UIVirtualBoxManager *instance() { return m_spInstance; }
    6666
    6767    /** Returns the action-pool instance. */
     
    7171
    7272    /** Constructs selector-window. */
    73     UISelectorWindow();
     73    UIVirtualBoxManager();
    7474    /** Destructs selector-window. */
    75     ~UISelectorWindow();
     75    ~UIVirtualBoxManager();
    7676
    7777    /** Returns whether the window should be maximized when geometry being restored. */
     
    222222
    223223    /** Returns current-item. */
    224     UIVMItem* currentItem() const;
     224    UIVirtualMachineItem* currentItem() const;
    225225    /** Returns a list of current-items. */
    226     QList<UIVMItem*> currentItems() const;
     226    QList<UIVirtualMachineItem*> currentItems() const;
    227227
    228228    /** @name Event handling stuff.
     
    291291      * @{ */
    292292        /** Launches or shows virtual machines represented by passed @a items in corresponding @a enmLaunchMode (for launch). */
    293         void performStartOrShowVirtualMachines(const QList<UIVMItem*> &items, VBoxGlobal::LaunchMode enmLaunchMode);
     293        void performStartOrShowVirtualMachines(const QList<UIVirtualMachineItem*> &items, VBoxGlobal::LaunchMode enmLaunchMode);
    294294    /** @} */
    295295
     
    303303        /** Returns whether the action with @a iActionIndex is enabled.
    304304          * @param items used to calculate verdict about should the action be enabled. */
    305         bool isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items);
     305        bool isActionEnabled(int iActionIndex, const QList<UIVirtualMachineItem*> &items);
    306306
    307307        /** Returns whether all passed @a items are powered off. */
    308         static bool isItemsPoweredOff(const QList<UIVMItem*> &items);
     308        static bool isItemsPoweredOff(const QList<UIVirtualMachineItem*> &items);
    309309        /** Returns whether at least one of passed @a items is able to shutdown. */
    310         static bool isAtLeastOneItemAbleToShutdown(const QList<UIVMItem*> &items);
     310        static bool isAtLeastOneItemAbleToShutdown(const QList<UIVirtualMachineItem*> &items);
    311311        /** Returns whether at least one of passed @a items supports shortcut creation. */
    312         static bool isAtLeastOneItemSupportsShortcuts(const QList<UIVMItem*> &items);
     312        static bool isAtLeastOneItemSupportsShortcuts(const QList<UIVirtualMachineItem*> &items);
    313313        /** Returns whether at least one of passed @a items is accessible. */
    314         static bool isAtLeastOneItemAccessible(const QList<UIVMItem*> &items);
     314        static bool isAtLeastOneItemAccessible(const QList<UIVirtualMachineItem*> &items);
    315315        /** Returns whether at least one of passed @a items is inaccessible. */
    316         static bool isAtLeastOneItemInaccessible(const QList<UIVMItem*> &items);
     316        static bool isAtLeastOneItemInaccessible(const QList<UIVirtualMachineItem*> &items);
    317317        /** Returns whether at least one of passed @a items is removable. */
    318         static bool isAtLeastOneItemRemovable(const QList<UIVMItem*> &items);
     318        static bool isAtLeastOneItemRemovable(const QList<UIVirtualMachineItem*> &items);
    319319        /** Returns whether at least one of passed @a items can be started. */
    320         static bool isAtLeastOneItemCanBeStarted(const QList<UIVMItem*> &items);
     320        static bool isAtLeastOneItemCanBeStarted(const QList<UIVirtualMachineItem*> &items);
    321321        /** Returns whether at least one of passed @a items can be shown. */
    322         static bool isAtLeastOneItemCanBeShown(const QList<UIVMItem*> &items);
     322        static bool isAtLeastOneItemCanBeShown(const QList<UIVirtualMachineItem*> &items);
    323323        /** Returns whether at least one of passed @a items can be started or shown. */
    324         static bool isAtLeastOneItemCanBeStartedOrShown(const QList<UIVMItem*> &items);
     324        static bool isAtLeastOneItemCanBeStartedOrShown(const QList<UIVirtualMachineItem*> &items);
    325325        /** Returns whether at least one of passed @a items can be discarded. */
    326         static bool isAtLeastOneItemDiscardable(const QList<UIVMItem*> &items);
     326        static bool isAtLeastOneItemDiscardable(const QList<UIVirtualMachineItem*> &items);
    327327        /** Returns whether at least one of passed @a items is started. */
    328         static bool isAtLeastOneItemStarted(const QList<UIVMItem*> &items);
     328        static bool isAtLeastOneItemStarted(const QList<UIVirtualMachineItem*> &items);
    329329        /** Returns whether at least one of passed @a items is running. */
    330         static bool isAtLeastOneItemRunning(const QList<UIVMItem*> &items);
     330        static bool isAtLeastOneItemRunning(const QList<UIVirtualMachineItem*> &items);
    331331    /** @} */
    332332
    333333    /** Holds the static instance. */
    334     static UISelectorWindow *m_spInstance;
     334    static UIVirtualBoxManager *m_spInstance;
    335335
    336336    /** Holds whether the dialog is polished. */
     
    361361
    362362    /** Holds the Tools-toolbar instance. */
    363     UIToolsToolbar *m_pToolbarTools;
     363    UIToolbarTools *m_pToolbarTools;
    364364
    365365    /** Holds the Machine Tools order. */
     
    369369
    370370    /** Holds the Chooser-pane instance. */
    371     UIGChooser         *m_pPaneChooser;
     371    UIChooser         *m_pPaneChooser;
    372372    /** Holds the Machine Tools-pane instance. */
    373     UIToolsPaneMachine *m_pPaneToolsMachine;
     373    UIToolPaneMachine *m_pPaneToolsMachine;
    374374    /** Holds the Global Tools-pane instance. */
    375     UIToolsPaneGlobal  *m_pPaneToolsGlobal;
     375    UIToolPaneGlobal  *m_pPaneToolsGlobal;
    376376
    377377    /** Holds the list of Group menu actions. */
     
    393393};
    394394
    395 #define gpSelectorWindow UISelectorWindow::instance()
    396 
    397 #endif /* !___UISelectorWindow_h___ */
    398 
     395#define gpManager UIVirtualBoxManager::instance()
     396
     397#endif /* !___UIVirtualBoxManager_h___ */
     398
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVMItem class implementation.
     3 * VBox Qt GUI - UIVirtualMachineItem class implementation.
    44 */
    55
     
    2626
    2727/* GUI includes: */
    28 # include "UIVMItem.h"
     28# include "UIVirtualMachineItem.h"
    2929# include "VBoxGlobal.h"
    3030# include "UIConverter.h"
     
    141141#endif
    142142
    143 UIVMItem::UIVMItem(const CMachine &aMachine)
     143UIVirtualMachineItem::UIVirtualMachineItem(const CMachine &aMachine)
    144144    : m_machine(aMachine)
    145145{
     
    147147}
    148148
    149 UIVMItem::~UIVMItem()
     149UIVirtualMachineItem::~UIVirtualMachineItem()
    150150{
    151151}
     
    154154////////////////////////////////////////////////////////////////////////////////
    155155
    156 QPixmap UIVMItem::osPixmap(QSize *pLogicalSize /* = 0 */) const
     156QPixmap UIVirtualMachineItem::osPixmap(QSize *pLogicalSize /* = 0 */) const
    157157{
    158158    if (pLogicalSize)
     
    161161}
    162162
    163 QString UIVMItem::machineStateName() const
     163QString UIVirtualMachineItem::machineStateName() const
    164164{
    165165    return m_fAccessible ? gpConverter->toString(m_machineState) :
     
    167167}
    168168
    169 QIcon UIVMItem::machineStateIcon() const
     169QIcon UIVirtualMachineItem::machineStateIcon() const
    170170{
    171171    return m_fAccessible ? gpConverter->toIcon(m_machineState) :
     
    173173}
    174174
    175 QString UIVMItem::sessionStateName() const
     175QString UIVirtualMachineItem::sessionStateName() const
    176176{
    177177    return m_fAccessible ? gpConverter->toString(m_sessionState) :
     
    179179}
    180180
    181 QString UIVMItem::toolTipText() const
     181QString UIVirtualMachineItem::toolTipText() const
    182182{
    183183    QString dateTime = (m_lastStateChange.date() == QDate::currentDate()) ?
     
    215215}
    216216
    217 const QStringList& UIVMItem::groups()
     217const QStringList& UIVirtualMachineItem::groups()
    218218{
    219219    return m_groups;
    220220}
    221221
    222 bool UIVMItem::recache()
     222bool UIVirtualMachineItem::recache()
    223223{
    224224    bool needsResort = true;
     
    313313}
    314314
    315 void UIVMItem::recachePixmap()
     315void UIVirtualMachineItem::recachePixmap()
    316316{
    317317    /* If machine is accessible: */
     
    336336 * foreground, and @a false otherwise.
    337337 */
    338 bool UIVMItem::canSwitchTo() const
     338bool UIVirtualMachineItem::canSwitchTo() const
    339339{
    340340    return const_cast <CMachine &>(m_machine).CanShowConsoleWindow();
     
    351351 * @return true if successfully switched and false otherwise.
    352352 */
    353 bool UIVMItem::switchTo()
     353bool UIVirtualMachineItem::switchTo()
    354354{
    355355#ifdef VBOX_WS_MAC
     
    464464
    465465/* static */
    466 bool UIVMItem::isItemEditable(UIVMItem *pItem)
     466bool UIVirtualMachineItem::isItemEditable(UIVirtualMachineItem *pItem)
    467467{
    468468    return pItem &&
     
    472472
    473473/* static */
    474 bool UIVMItem::isItemSaved(UIVMItem *pItem)
     474bool UIVirtualMachineItem::isItemSaved(UIVirtualMachineItem *pItem)
    475475{
    476476    return pItem &&
     
    480480
    481481/* static */
    482 bool UIVMItem::isItemPoweredOff(UIVMItem *pItem)
     482bool UIVirtualMachineItem::isItemPoweredOff(UIVirtualMachineItem *pItem)
    483483{
    484484    return pItem &&
     
    491491
    492492/* static */
    493 bool UIVMItem::isItemStarted(UIVMItem *pItem)
     493bool UIVirtualMachineItem::isItemStarted(UIVirtualMachineItem *pItem)
    494494{
    495495    return isItemRunning(pItem) || isItemPaused(pItem);
     
    497497
    498498/* static */
    499 bool UIVMItem::isItemRunning(UIVMItem *pItem)
     499bool UIVirtualMachineItem::isItemRunning(UIVirtualMachineItem *pItem)
    500500{
    501501    return pItem &&
     
    507507
    508508/* static */
    509 bool UIVMItem::isItemRunningHeadless(UIVMItem *pItem)
     509bool UIVirtualMachineItem::isItemRunningHeadless(UIVirtualMachineItem *pItem)
    510510{
    511511    if (isItemRunning(pItem))
     
    527527
    528528/* static */
    529 bool UIVMItem::isItemPaused(UIVMItem *pItem)
     529bool UIVirtualMachineItem::isItemPaused(UIVirtualMachineItem *pItem)
    530530{
    531531    return pItem &&
     
    536536
    537537/* static */
    538 bool UIVMItem::isItemStuck(UIVMItem *pItem)
     538bool UIVirtualMachineItem::isItemStuck(UIVirtualMachineItem *pItem)
    539539{
    540540    return pItem &&
     
    543543}
    544544
    545 QString UIVMItemMimeData::m_type = "application/org.virtualbox.gui.vmselector.uivmitem";
    546 
    547 UIVMItemMimeData::UIVMItemMimeData(UIVMItem *pItem)
     545QString UIVirtualMachineItemMimeData::m_type = "application/org.virtualbox.gui.vmselector.UIVirtualMachineItem";
     546
     547UIVirtualMachineItemMimeData::UIVirtualMachineItemMimeData(UIVirtualMachineItem *pItem)
    548548  : m_pItem(pItem)
    549549{
    550550}
    551551
    552 UIVMItem *UIVMItemMimeData::item() const
     552UIVirtualMachineItem *UIVirtualMachineItemMimeData::item() const
    553553{
    554554    return m_pItem;
    555555}
    556556
    557 QStringList UIVMItemMimeData::formats() const
     557QStringList UIVirtualMachineItemMimeData::formats() const
    558558{
    559559    QStringList types;
     
    563563
    564564/* static */
    565 QString UIVMItemMimeData::type()
     565QString UIVirtualMachineItemMimeData::type()
    566566{
    567567    return m_type;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIVMItem class declarations.
     3 * VBox Qt GUI - UIVirtualMachineItem class declarations.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIVMItem_h__
    19 #define __UIVMItem_h__
     18#ifndef __UIVirtualMachineItem_h__
     19#define __UIVirtualMachineItem_h__
    2020
    2121/* Qt includes: */
     
    3535using namespace UISettingsDefs;
    3636
    37 class UIVMItem
     37class UIVirtualMachineItem
    3838{
    3939public:
    4040
    41     UIVMItem(const CMachine &aMachine);
    42     virtual ~UIVMItem();
     41    UIVirtualMachineItem(const CMachine &aMachine);
     42    virtual ~UIVirtualMachineItem();
    4343
    4444    CMachine machine() const { return m_machine; }
     
    7878    ConfigurationAccessLevel configurationAccessLevel() const { return m_configurationAccessLevel; }
    7979
    80     static bool isItemEditable(UIVMItem *pItem);
    81     static bool isItemSaved(UIVMItem *pItem);
    82     static bool isItemPoweredOff(UIVMItem *pItem);
    83     static bool isItemStarted(UIVMItem *pItem);
    84     static bool isItemRunning(UIVMItem *pItem);
    85     static bool isItemRunningHeadless(UIVMItem *pItem);
    86     static bool isItemPaused(UIVMItem *pItem);
    87     static bool isItemStuck(UIVMItem *pItem);
     80    static bool isItemEditable(UIVirtualMachineItem *pItem);
     81    static bool isItemSaved(UIVirtualMachineItem *pItem);
     82    static bool isItemPoweredOff(UIVirtualMachineItem *pItem);
     83    static bool isItemStarted(UIVirtualMachineItem *pItem);
     84    static bool isItemRunning(UIVirtualMachineItem *pItem);
     85    static bool isItemRunningHeadless(UIVirtualMachineItem *pItem);
     86    static bool isItemPaused(UIVirtualMachineItem *pItem);
     87    static bool isItemStuck(UIVirtualMachineItem *pItem);
    8888
    8989private:
     
    119119
    120120/* Make the pointer of this class public to the QVariant framework */
    121 Q_DECLARE_METATYPE(UIVMItem *);
     121Q_DECLARE_METATYPE(UIVirtualMachineItem *);
    122122
    123 class UIVMItemMimeData: public QMimeData
     123class UIVirtualMachineItemMimeData: public QMimeData
    124124{
    125125    Q_OBJECT;
     
    127127public:
    128128
    129     UIVMItemMimeData(UIVMItem *pItem);
     129    UIVirtualMachineItemMimeData(UIVirtualMachineItem *pItem);
    130130
    131     UIVMItem *item() const;
     131    UIVirtualMachineItem *item() const;
    132132    QStringList formats() const;
    133133
     
    137137
    138138    /* Private member vars */
    139     UIVMItem *m_pItem;
     139    UIVirtualMachineItem *m_pItem;
    140140
    141141    static QString m_type;
    142142};
    143143
    144 #endif /* __UIVMItem_h__ */
     144#endif /* __UIVirtualMachineItem_h__ */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIWelcomePane.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIDesktopPane class implementation.
     3 * VBox Qt GUI - UIWelcomePane class implementation.
    44 */
    55
     
    3636/* GUI includes */
    3737# include "QIWithRetranslateUI.h"
    38 # include "UIDesktopPane.h"
     38# include "UIWelcomePane.h"
    3939# include "VBoxUtils.h"
    4040
     
    6060
    6161/** QScrollArea extension to wrap a tools pane. */
    62 class UIToolScrollArea : public QScrollArea
     62class UIScrollAreaTools : public QScrollArea
    6363{
    6464    Q_OBJECT;
     
    6767
    6868    /** Constructs scroll-area passing @a pParent to the base-class. */
    69     UIToolScrollArea(QWidget *pParent = 0);
     69    UIScrollAreaTools(QWidget *pParent = 0);
    7070
    7171protected:
     
    8383  * hints calculation which is very stupid taking into account
    8484  * QLayout "eats it raw" and tries to be dynamical on it's basis. */
    85 class UILabel : public QLabel
     85class UIWrappableLabel : public QLabel
    8686{
    8787    Q_OBJECT;
     
    9090
    9191    /** Constructs scroll-area passing @a pParent to the base-class. */
    92     UILabel(QWidget *pParent = 0);
     92    UIWrappableLabel(QWidget *pParent = 0);
    9393
    9494protected:
     
    108108
    109109
    110 /** Our own skinnable implementation of tool widget for UIDesktopPane. */
    111 class UIToolWidget : public QWidget
     110/** Our own skinnable implementation of tool widget for UIWelcomePane. */
     111class UIWidgetTool : public QWidget
    112112{
    113113    Q_OBJECT;
     
    116116
    117117    /** Constructs tool widget on the basis of passed @a pAction and @a strDescription. */
    118     UIToolWidget(QAction *pAction, const QString &strDescription);
     118    UIWidgetTool(QAction *pAction, const QString &strDescription);
    119119
    120120protected:
     
    157157  * 2. Error pane reflecting information about currently chosen
    158158  *    inaccessible VM and allowing to operate over it. */
    159 class UIDesktopPanePrivate : public QIWithRetranslateUI<QStackedWidget>
     159class UIWelcomePanePrivate : public QIWithRetranslateUI<QStackedWidget>
    160160{
    161161    Q_OBJECT;
     
    165165    /** Constructs private desktop pane passing @a pParent to the base-class.
    166166      * @param  pRefreshAction  Brings the refresh action reference. */
    167     UIDesktopPanePrivate(QWidget *pParent, QAction *pRefreshAction);
     167    UIWelcomePanePrivate(QWidget *pParent, QAction *pRefreshAction);
    168168
    169169    /** Assigns @a strError and switches to error pane. */
     
    212212
    213213    /** Holds the tools pane scroll-area instance. */
    214     UIToolScrollArea *m_pScrollArea;
     214    UIScrollAreaTools *m_pScrollArea;
    215215    /** Holds the tools pane instance. */
    216216    QWidget          *m_pToolsPane;
     
    228228
    229229/*********************************************************************************************************************************
    230 *   Class UIToolScrollArea implementation.                                                                                       *
     230*   Class UIScrollAreaTools implementation.                                                                                       *
    231231*********************************************************************************************************************************/
    232232
    233 UIToolScrollArea::UIToolScrollArea(QWidget *pParent /* = 0 */)
     233UIScrollAreaTools::UIScrollAreaTools(QWidget *pParent /* = 0 */)
    234234    : QScrollArea(pParent)
    235235{
    236236}
    237237
    238 QSize UIToolScrollArea::minimumSizeHint() const
     238QSize UIScrollAreaTools::minimumSizeHint() const
    239239{
    240240    // WORKAROUND:
     
    250250
    251251/*********************************************************************************************************************************
    252 *   Class UILabel implementation.                                                                                                *
     252*   Class UIWrappableLabel implementation.                                                                                                *
    253253*********************************************************************************************************************************/
    254254
    255 UILabel::UILabel(QWidget *pParent /* = 0 */)
     255UIWrappableLabel::UIWrappableLabel(QWidget *pParent /* = 0 */)
    256256    : QLabel(pParent)
    257257{
    258258}
    259259
    260 void UILabel::resizeEvent(QResizeEvent *pEvent)
     260void UIWrappableLabel::resizeEvent(QResizeEvent *pEvent)
    261261{
    262262    /* Call to base-class: */
     
    270270}
    271271
    272 bool UILabel::hasHeightForWidth() const
     272bool UIWrappableLabel::hasHeightForWidth() const
    273273{
    274274    // WORKAROUND:
     
    280280}
    281281
    282 QSize UILabel::minimumSizeHint() const /* override */
     282QSize UIWrappableLabel::minimumSizeHint() const /* override */
    283283{
    284284    // WORKAROUND:
     
    290290}
    291291
    292 QSize UILabel::sizeHint() const /* override */
     292QSize UIWrappableLabel::sizeHint() const /* override */
    293293{
    294294    // WORKAROUND:
     
    299299
    300300/*********************************************************************************************************************************
    301 *   Class UIToolWidget implementation.                                                                                           *
     301*   Class UIWidgetTool implementation.                                                                                           *
    302302*********************************************************************************************************************************/
    303303
    304 UIToolWidget::UIToolWidget(QAction *pAction, const QString &strDescription)
     304UIWidgetTool::UIWidgetTool(QAction *pAction, const QString &strDescription)
    305305    : m_pAction(pAction)
    306306    , m_strDescription(strDescription)
     
    315315}
    316316
    317 bool UIToolWidget::event(QEvent *pEvent)
     317bool UIWidgetTool::event(QEvent *pEvent)
    318318{
    319319    /* Handle known event types: */
     
    356356}
    357357
    358 void UIToolWidget::paintEvent(QPaintEvent * /* pEvent */)
     358void UIWidgetTool::paintEvent(QPaintEvent * /* pEvent */)
    359359{
    360360    /* Prepare painter: */
     
    457457}
    458458
    459 void UIToolWidget::prepare()
     459void UIWidgetTool::prepare()
    460460{
    461461    /* Configure self: */
     
    493493
    494494        /* Create description label: */
    495         m_pLabelDescription = new UILabel;
     495        m_pLabelDescription = new UIWrappableLabel;
    496496        AssertPtrReturnVoid(m_pLabelDescription);
    497497        {
     
    524524}
    525525
    526 void UIToolWidget::updatePixmap()
     526void UIWidgetTool::updatePixmap()
    527527{
    528528    const int iMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * 1.375;
     
    532532
    533533/*********************************************************************************************************************************
    534 *   Class UIDesktopPanePrivate implementation.                                                                                   *
     534*   Class UIWelcomePanePrivate implementation.                                                                                   *
    535535*********************************************************************************************************************************/
    536536
    537 UIDesktopPanePrivate::UIDesktopPanePrivate(QWidget *pParent, QAction *pRefreshAction)
     537UIWelcomePanePrivate::UIWelcomePanePrivate(QWidget *pParent, QAction *pRefreshAction)
    538538    : QIWithRetranslateUI<QStackedWidget>(pParent)
    539539    , m_pErrBox(0), m_pErrLabel(0), m_pErrText(0)
     
    545545}
    546546
    547 void UIDesktopPanePrivate::setError(const QString &strError)
     547void UIWelcomePanePrivate::setError(const QString &strError)
    548548{
    549549    /* Prepare error pane if necessary: */
     
    557557}
    558558
    559 void UIDesktopPanePrivate::setToolsPaneText(const QString &strText)
     559void UIWelcomePanePrivate::setToolsPaneText(const QString &strText)
    560560{
    561561    /* Prepare tools pane if necessary: */
     
    569569}
    570570
    571 void UIDesktopPanePrivate::setToolsPaneIcon(const QIcon &icon)
     571void UIWelcomePanePrivate::setToolsPaneIcon(const QIcon &icon)
    572572{
    573573    /* Prepare tools pane if necessary: */
     
    583583}
    584584
    585 void UIDesktopPanePrivate::addToolDescription(QAction *pAction, const QString &strDescription)
     585void UIWelcomePanePrivate::addToolDescription(QAction *pAction, const QString &strDescription)
    586586{
    587587    /* Prepare tools pane if necessary: */
     
    589589
    590590    /* Add tool widget on the basis of passed description: */
    591     UIToolWidget *pWidget = new UIToolWidget(pAction, strDescription);
     591    UIWidgetTool *pWidget = new UIWidgetTool(pAction, strDescription);
    592592    AssertPtrReturnVoid(pWidget);
    593593    {
     
    600600}
    601601
    602 void UIDesktopPanePrivate::removeToolDescriptions()
     602void UIWelcomePanePrivate::removeToolDescriptions()
    603603{
    604604    /* Clear the layout: */
     
    614614}
    615615
    616 bool UIDesktopPanePrivate::event(QEvent *pEvent)
     616bool UIWelcomePanePrivate::event(QEvent *pEvent)
    617617{
    618618    /* Handle know event types: */
     
    634634}
    635635
    636 void UIDesktopPanePrivate::retranslateUi()
     636void UIWelcomePanePrivate::retranslateUi()
    637637{
    638638    /* Translate error-label text: */
     
    652652}
    653653
    654 void UIDesktopPanePrivate::prepareErrorPane()
     654void UIWelcomePanePrivate::prepareErrorPane()
    655655{
    656656    if (m_pErrBox)
     
    709709}
    710710
    711 void UIDesktopPanePrivate::prepareToolsPane()
     711void UIWelcomePanePrivate::prepareToolsPane()
    712712{
    713713    /* Do nothing if already exists: */
     
    716716
    717717    /* Create scroll-area: */
    718     m_pScrollArea = new UIToolScrollArea;
     718    m_pScrollArea = new UIScrollAreaTools;
    719719    AssertPtrReturnVoid(m_pScrollArea);
    720720    {
     
    740740
    741741                    /* Create welcome text label: */
    742                     m_pLabelToolsPaneText = new UILabel;
     742                    m_pLabelToolsPaneText = new UIWrappableLabel;
    743743                    AssertPtrReturnVoid(m_pLabelToolsPaneText);
    744744                    {
     
    790790}
    791791
    792 void UIDesktopPanePrivate::updatePixmap()
     792void UIWelcomePanePrivate::updatePixmap()
    793793{
    794794    /* Assign corresponding icon: */
     
    801801
    802802/*********************************************************************************************************************************
    803 *   Class UIDesktopPane implementation.                                                                                          *
     803*   Class UIWelcomePane implementation.                                                                                          *
    804804*********************************************************************************************************************************/
    805805
    806 UIDesktopPane::UIDesktopPane(QAction *pRefreshAction /* = 0 */, QWidget *pParent /* = 0 */)
     806UIWelcomePane::UIWelcomePane(QAction *pRefreshAction /* = 0 */, QWidget *pParent /* = 0 */)
    807807    : QWidget(pParent)
    808808{
     
    812812
    813813    /* Create desktop pane: */
    814     m_pDesktopPrivate = new UIDesktopPanePrivate(this, pRefreshAction);
     814    m_pDesktopPrivate = new UIWelcomePanePrivate(this, pRefreshAction);
    815815
    816816    /* Add it to the layout: */
     
    818818}
    819819
    820 void UIDesktopPane::updateDetailsError(const QString &strError)
     820void UIWelcomePane::updateDetailsError(const QString &strError)
    821821{
    822822    m_pDesktopPrivate->setError(strError);
    823823}
    824824
    825 void UIDesktopPane::setToolsPaneText(const QString &strText)
     825void UIWelcomePane::setToolsPaneText(const QString &strText)
    826826{
    827827    m_pDesktopPrivate->setToolsPaneText(strText);
    828828}
    829829
    830 void UIDesktopPane::setToolsPaneIcon(const QIcon &icon)
     830void UIWelcomePane::setToolsPaneIcon(const QIcon &icon)
    831831{
    832832    m_pDesktopPrivate->setToolsPaneIcon(icon);
    833833}
    834834
    835 void UIDesktopPane::addToolDescription(QAction *pAction, const QString &strDescription)
     835void UIWelcomePane::addToolDescription(QAction *pAction, const QString &strDescription)
    836836{
    837837    m_pDesktopPrivate->addToolDescription(pAction, strDescription);
    838838}
    839839
    840 void UIDesktopPane::removeToolDescriptions()
     840void UIWelcomePane::removeToolDescriptions()
    841841{
    842842    m_pDesktopPrivate->removeToolDescriptions();
    843843}
    844844
    845 #include "UIDesktopPane.moc"
    846 
     845#include "UIWelcomePane.moc"
     846
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIWelcomePane.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIDesktopPane class declaration.
     3 * VBox Qt GUI - UIWelcomePane class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef ___UIDesktopPane_h___
    19 #define ___UIDesktopPane_h___
     18#ifndef ___UIWelcomePane_h___
     19#define ___UIWelcomePane_h___
    2020
    2121/* Qt includes: */
     
    2626class QIcon;
    2727class QString;
    28 class UIDesktopPanePrivate;
     28class UIWelcomePanePrivate;
    2929
    3030
     
    3333  * 2. Error details pane reflecting information about currently chosen
    3434  *    inaccessible VM and allowing to operate over it. */
    35 class UIDesktopPane : public QWidget
     35class UIWelcomePane : public QWidget
    3636{
    3737    Q_OBJECT;
     
    4141    /** Constructs desktop pane passing @a pParent to the base-class.
    4242      * @param  pRefreshAction  Brings the refresh action reference. */
    43     UIDesktopPane(QAction *pRefreshAction = 0, QWidget *pParent = 0);
     43    UIWelcomePane(QAction *pRefreshAction = 0, QWidget *pParent = 0);
    4444
    4545    /** Updates @a strError details and switches to error details pane. */
     
    6060
    6161    /** Holds the private desktop pane instance. */
    62     UIDesktopPanePrivate *m_pDesktopPrivate;
     62    UIWelcomePanePrivate *m_pDesktopPrivate;
    6363};
    6464
    65 #endif /* !___UIDesktopPane_h___ */
     65#endif /* !___UIWelcomePane_h___ */
    6666
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooser class implementation.
     3 * VBox Qt GUI - UIChooser class implementation.
    44 */
    55
     
    2626
    2727/* GUI includes: */
    28 # include "UIGChooser.h"
    29 # include "UIGChooserModel.h"
    30 # include "UIGChooserView.h"
    31 # include "UISelectorWindow.h"
     28# include "UIChooser.h"
     29# include "UIChooserModel.h"
     30# include "UIChooserView.h"
     31# include "UIVirtualBoxManager.h"
    3232# include "VBoxGlobal.h"
    3333
     
    3535
    3636
    37 UIGChooser::UIGChooser(UISelectorWindow *pParent)
     37UIChooser::UIChooser(UIVirtualBoxManager *pParent)
    3838    : QWidget(pParent)
    3939    , m_pSelectorWindow(pParent)
     
    6161}
    6262
    63 UIGChooser::~UIGChooser()
     63UIChooser::~UIChooser()
    6464{
    6565    /* Save: */
     
    6767}
    6868
    69 UIActionPool* UIGChooser::actionPool() const
     69UIActionPool* UIChooser::actionPool() const
    7070{
    7171    return selector()->actionPool();
    7272}
    7373
    74 UIVMItem* UIGChooser::currentItem() const
     74UIVirtualMachineItem* UIChooser::currentItem() const
    7575{
    7676    return m_pChooserModel->currentMachineItem();
    7777}
    7878
    79 QList<UIVMItem*> UIGChooser::currentItems() const
     79QList<UIVirtualMachineItem*> UIChooser::currentItems() const
    8080{
    8181    return m_pChooserModel->currentMachineItems();
    8282}
    8383
    84 bool UIGChooser::isSingleGroupSelected() const
     84bool UIChooser::isSingleGroupSelected() const
    8585{
    8686    return m_pChooserModel->isSingleGroupSelected();
    8787}
    8888
    89 bool UIGChooser::isAllItemsOfOneGroupSelected() const
     89bool UIChooser::isAllItemsOfOneGroupSelected() const
    9090{
    9191    return m_pChooserModel->isAllItemsOfOneGroupSelected();
    9292}
    9393
    94 bool UIGChooser::isGroupSavingInProgress() const
     94bool UIChooser::isGroupSavingInProgress() const
    9595{
    9696    return m_pChooserModel->isGroupSavingInProgress();
    9797}
    9898
    99 void UIGChooser::preparePalette()
     99void UIChooser::preparePalette()
    100100{
    101101    /* Setup palette: */
     
    106106}
    107107
    108 void UIGChooser::prepareLayout()
     108void UIChooser::prepareLayout()
    109109{
    110110    /* Setup main-layout: */
     
    115115}
    116116
    117 void UIGChooser::prepareModel()
     117void UIChooser::prepareModel()
    118118{
    119119    /* Setup chooser-model: */
    120     m_pChooserModel = new UIGChooserModel(this);
     120    m_pChooserModel = new UIChooserModel(this);
    121121}
    122122
    123 void UIGChooser::prepareView()
     123void UIChooser::prepareView()
    124124{
    125125    /* Setup chooser-view: */
    126     m_pChooserView = new UIGChooserView(this);
     126    m_pChooserView = new UIChooserView(this);
    127127    m_pChooserView->setScene(m_pChooserModel->scene());
    128128    m_pChooserView->show();
     
    131131}
    132132
    133 void UIGChooser::prepareConnections()
     133void UIChooser::prepareConnections()
    134134{
    135135    /* Setup chooser-model connections: */
     
    138138    connect(m_pChooserModel, SIGNAL(sigRootItemMinimumHeightHintChanged(int)),
    139139            m_pChooserView, SLOT(sltMinimumHeightHintChanged(int)));
    140     connect(m_pChooserModel, SIGNAL(sigFocusChanged(UIGChooserItem*)),
    141             m_pChooserView, SLOT(sltFocusChanged(UIGChooserItem*)));
     140    connect(m_pChooserModel, SIGNAL(sigFocusChanged(UIChooserItem*)),
     141            m_pChooserView, SLOT(sltFocusChanged(UIChooserItem*)));
    142142
    143143    /* Setup chooser-view connections: */
     
    146146}
    147147
    148 void UIGChooser::load()
     148void UIChooser::load()
    149149{
    150150    /* Prepare model: */
     
    152152}
    153153
    154 void UIGChooser::save()
     154void UIChooser::save()
    155155{
    156156    /* Cleanup model: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooser class declaration.
     3 * VBox Qt GUI - UIChooser class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGChooser_h__
    19 #define __UIGChooser_h__
     18#ifndef __UIChooser_h__
     19#define __UIChooser_h__
    2020
    2121/* Qt includes: */
     
    2323
    2424/* GUI includes: */
    25 #include "UIGChooserItem.h"
     25#include "UIChooserItem.h"
    2626
    2727/* Forward declartions: */
    28 class UIVMItem;
     28class UIVirtualMachineItem;
    2929class QVBoxLayout;
    30 class UISelectorWindow;
     30class UIVirtualBoxManager;
    3131class UIActionPool;
    32 class UIGChooserModel;
    33 class UIGChooserView;
     32class UIChooserModel;
     33class UIChooserView;
    3434class QStatusBar;
    3535
    3636/* Graphics selector widget: */
    37 class UIGChooser : public QWidget
     37class UIChooser : public QWidget
    3838{
    3939    Q_OBJECT;
     
    5757
    5858    /* Constructor/destructor: */
    59     UIGChooser(UISelectorWindow *pParent);
    60     ~UIGChooser();
     59    UIChooser(UIVirtualBoxManager *pParent);
     60    ~UIChooser();
    6161
    6262    /** Returns the selector-window reference. */
    63     UISelectorWindow* selector() const { return m_pSelectorWindow; }
     63    UIVirtualBoxManager* selector() const { return m_pSelectorWindow; }
    6464    /** Returns the action-pool reference. */
    6565    UIActionPool* actionPool() const;
    6666
    6767    /** Return the Chooser-model instance. */
    68     UIGChooserModel *model() const { return m_pChooserModel; }
     68    UIChooserModel *model() const { return m_pChooserModel; }
    6969    /** Return the Chooser-view instance. */
    70     UIGChooserView *view() const { return m_pChooserView; }
     70    UIChooserView *view() const { return m_pChooserView; }
    7171
    7272    /* API: Current-item stuff: */
    73     UIVMItem* currentItem() const;
    74     QList<UIVMItem*> currentItems() const;
     73    UIVirtualMachineItem* currentItem() const;
     74    QList<UIVirtualMachineItem*> currentItems() const;
    7575    bool isSingleGroupSelected() const;
    7676    bool isAllItemsOfOneGroupSelected() const;
     
    9393
    9494    /** Holds the selector-window reference. */
    95     UISelectorWindow* m_pSelectorWindow;
     95    UIVirtualBoxManager* m_pSelectorWindow;
    9696
    9797    /* Variables: */
    9898    QVBoxLayout *m_pMainLayout;
    99     UIGChooserModel *m_pChooserModel;
    100     UIGChooserView *m_pChooserView;
     99    UIChooserModel *m_pChooserModel;
     100    UIChooserView *m_pChooserView;
    101101};
    102102
    103 #endif /* __UIGChooser_h__ */
     103#endif /* __UIChooser_h__ */
    104104
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerKeyboard.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserHandlerKeyboard class implementation.
     3 * VBox Qt GUI - UIChooserHandlerKeyboard class implementation.
    44 */
    55
     
    2424
    2525/* GUI incluedes: */
    26 # include "UIGChooserHandlerKeyboard.h"
    27 # include "UIGChooserModel.h"
    28 # include "UIGChooserItemGroup.h"
     26# include "UIChooserHandlerKeyboard.h"
     27# include "UIChooserModel.h"
     28# include "UIChooserItemGroup.h"
    2929
    3030#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3131
    3232
    33 UIGChooserHandlerKeyboard::UIGChooserHandlerKeyboard(UIGChooserModel *pParent)
     33UIChooserHandlerKeyboard::UIChooserHandlerKeyboard(UIChooserModel *pParent)
    3434    : QObject(pParent)
    3535    , m_pModel(pParent)
     
    4242}
    4343
    44 bool UIGChooserHandlerKeyboard::handle(QKeyEvent *pEvent, UIKeyboardEventType type) const
     44bool UIChooserHandlerKeyboard::handle(QKeyEvent *pEvent, UIKeyboardEventType type) const
    4545{
    4646    /* Process passed event: */
     
    5454}
    5555
    56 UIGChooserModel* UIGChooserHandlerKeyboard::model() const
     56UIChooserModel* UIChooserHandlerKeyboard::model() const
    5757{
    5858    return m_pModel;
    5959}
    6060
    61 bool UIGChooserHandlerKeyboard::handleKeyPress(QKeyEvent *pEvent) const
     61bool UIChooserHandlerKeyboard::handleKeyPress(QKeyEvent *pEvent) const
    6262{
    6363    /* Which key it was? */
     
    9797                int iPosition = model()->navigationList().indexOf(model()->focusItem());
    9898                /* Determine 'previous' item: */
    99                 UIGChooserItem *pPreviousItem = 0;
     99                UIChooserItem *pPreviousItem = 0;
    100100                if (iPosition > 0)
    101101                {
     
    110110                    pPreviousItem->makeSureItsVisible();
    111111                    /* Calculate positions: */
    112                     UIGChooserItem *pFirstItem = model()->currentItem();
     112                    UIChooserItem *pFirstItem = model()->currentItem();
    113113                    int iFirstPosition = model()->navigationList().indexOf(pFirstItem);
    114114                    int iPreviousPosition = model()->navigationList().indexOf(pPreviousItem);
    115115                    /* Populate list of items from 'first' to 'previous': */
    116                     QList<UIGChooserItem*> items;
     116                    QList<UIChooserItem*> items;
    117117                    if (iFirstPosition <= iPreviousPosition)
    118118                        for (int i = iFirstPosition; i <= iPreviousPosition; ++i)
     
    140140                int iPosition = model()->navigationList().indexOf(model()->focusItem());
    141141                /* Determine 'previous' item: */
    142                 UIGChooserItem *pPreviousItem = 0;
     142                UIChooserItem *pPreviousItem = 0;
    143143                if (iPosition > 0)
    144144                {
     
    194194                int iPosition = model()->navigationList().indexOf(model()->focusItem());
    195195                /* Determine 'next' item: */
    196                 UIGChooserItem *pNextItem = 0;
     196                UIChooserItem *pNextItem = 0;
    197197                if (iPosition < model()->navigationList().size() - 1)
    198198                {
     
    207207                    pNextItem->makeSureItsVisible();
    208208                    /* Calculate positions: */
    209                     UIGChooserItem *pFirstItem = model()->currentItem();
     209                    UIChooserItem *pFirstItem = model()->currentItem();
    210210                    int iFirstPosition = model()->navigationList().indexOf(pFirstItem);
    211211                    int iNextPosition = model()->navigationList().indexOf(pNextItem);
    212212                    /* Populate list of items from 'first' to 'next': */
    213                     QList<UIGChooserItem*> items;
     213                    QList<UIChooserItem*> items;
    214214                    if (iFirstPosition <= iNextPosition)
    215215                        for (int i = iFirstPosition; i <= iNextPosition; ++i)
     
    237237                int iPosition = model()->navigationList().indexOf(model()->focusItem());
    238238                /* Determine 'next' item: */
    239                 UIGChooserItem *pNextItem = 0;
     239                UIChooserItem *pNextItem = 0;
    240240                if (iPosition < model()->navigationList().size() - 1)
    241241                {
     
    262262        {
    263263            /* If there is a focus item: */
    264             if (UIGChooserItem *pFocusItem = model()->focusItem())
     264            if (UIChooserItem *pFocusItem = model()->focusItem())
    265265            {
    266266                /* Of the known type: */
    267267                switch (pFocusItem->type())
    268268                {
    269                     case UIGChooserItemType_Group:
    270                     case UIGChooserItemType_Machine:
     269                    case UIChooserItemType_Group:
     270                    case UIChooserItemType_Machine:
    271271                    {
    272272                        /* Unindent root if its NOT main: */
     
    286286        {
    287287            /* If there is focus item: */
    288             if (UIGChooserItem *pFocusItem = model()->focusItem())
     288            if (UIChooserItem *pFocusItem = model()->focusItem())
    289289            {
    290290                /* Of the group type: */
    291                 if (pFocusItem->type() == UIGChooserItemType_Group)
     291                if (pFocusItem->type() == UIChooserItemType_Group)
    292292                {
    293293                    /* Indent root with this item: */
     
    302302        {
    303303            /* If this item is of group type: */
    304             if (model()->focusItem()->type() == UIGChooserItemType_Group)
     304            if (model()->focusItem()->type() == UIChooserItemType_Group)
    305305            {
    306306                /* Start embedded editing focus item: */
     
    331331            }
    332332            /* If there is a focus item: */
    333             else if (UIGChooserItem *pFocusItem = model()->focusItem())
     333            else if (UIChooserItem *pFocusItem = model()->focusItem())
    334334            {
    335335                /* Of the group type: */
    336                 if (pFocusItem->type() == UIGChooserItemType_Group)
     336                if (pFocusItem->type() == UIChooserItemType_Group)
    337337                {
    338338                    /* Toggle that group: */
    339                     UIGChooserItemGroup *pGroupItem = pFocusItem->toGroupItem();
     339                    UIChooserItemGroup *pGroupItem = pFocusItem->toGroupItem();
    340340                    if (pGroupItem->isClosed())
    341341                        pGroupItem->open();
     
    362362}
    363363
    364 bool UIGChooserHandlerKeyboard::handleKeyRelease(QKeyEvent*) const
     364bool UIChooserHandlerKeyboard::handleKeyRelease(QKeyEvent*) const
    365365{
    366366    /* Pass all events: */
     
    368368}
    369369
    370 void UIGChooserHandlerKeyboard::shift(UIItemShiftDirection direction, UIItemShiftSize size) const
     370void UIChooserHandlerKeyboard::shift(UIItemShiftDirection direction, UIItemShiftSize size) const
    371371{
    372372    /* Get focus-item and his parent: */
    373     UIGChooserItem *pFocusItem = model()->focusItem();
    374     UIGChooserItem *pParentItem = pFocusItem->parentItem();
     373    UIChooserItem *pFocusItem = model()->focusItem();
     374    UIChooserItem *pParentItem = pFocusItem->parentItem();
    375375    /* Get the list of focus-item neighbours: */
    376     UIGChooserItemType type = (UIGChooserItemType)pFocusItem->type();
    377     QList<UIGChooserItem*> items = pParentItem->items(type);
     376    UIChooserItemType type = (UIChooserItemType)pFocusItem->type();
     377    QList<UIChooserItem*> items = pParentItem->items(type);
    378378    /* Get focus-item position: */
    379379    int iFocusPosition = items.indexOf(pFocusItem);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerKeyboard.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserHandlerKeyboard class declaration.
     3 * VBox Qt GUI - UIChooserHandlerKeyboard class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGChooserHandlerKeyboard_h__
    19 #define __UIGChooserHandlerKeyboard_h__
     18#ifndef __UIChooserHandlerKeyboard_h__
     19#define __UIChooserHandlerKeyboard_h__
    2020
    2121/* Qt includes: */
     
    2424
    2525/* Forward declarations: */
    26 class UIGChooserModel;
     26class UIChooserModel;
    2727class QKeyEvent;
    2828
     
    4949
    5050/* Keyboard handler for graphics selector: */
    51 class UIGChooserHandlerKeyboard : public QObject
     51class UIChooserHandlerKeyboard : public QObject
    5252{
    5353    Q_OBJECT;
     
    5656
    5757    /* Constructor: */
    58     UIGChooserHandlerKeyboard(UIGChooserModel *pParent);
     58    UIChooserHandlerKeyboard(UIChooserModel *pParent);
    5959
    6060    /* API: Model keyboard-event handler delegate: */
     
    6464
    6565    /* API: Model wrapper: */
    66     UIGChooserModel* model() const;
     66    UIChooserModel* model() const;
    6767
    6868    /* Helpers: Model keyboard-event handler delegates: */
     
    7474
    7575    /* Variables: */
    76     UIGChooserModel *m_pModel;
     76    UIChooserModel *m_pModel;
    7777    QMap<int, UIItemShiftSize> m_shiftMap;
    7878};
    7979
    80 #endif /* __UIGChooserHandlerKeyboard_h__ */
     80#endif /* __UIChooserHandlerKeyboard_h__ */
    8181
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerMouse.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserHandlerMouse class implementation.
     3 * VBox Qt GUI - UIChooserHandlerMouse class implementation.
    44 */
    55
     
    2424
    2525/* GUI incluedes: */
    26 # include "UIGChooserHandlerMouse.h"
    27 # include "UIGChooserModel.h"
    28 # include "UIGChooserItemGroup.h"
    29 # include "UIGChooserItemMachine.h"
     26# include "UIChooserHandlerMouse.h"
     27# include "UIChooserModel.h"
     28# include "UIChooserItemGroup.h"
     29# include "UIChooserItemMachine.h"
    3030
    3131#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3232
    3333
    34 UIGChooserHandlerMouse::UIGChooserHandlerMouse(UIGChooserModel *pParent)
     34UIChooserHandlerMouse::UIChooserHandlerMouse(UIChooserModel *pParent)
    3535    : QObject(pParent)
    3636    , m_pModel(pParent)
     
    3838}
    3939
    40 bool UIGChooserHandlerMouse::handle(QGraphicsSceneMouseEvent *pEvent, UIMouseEventType type) const
     40bool UIChooserHandlerMouse::handle(QGraphicsSceneMouseEvent *pEvent, UIMouseEventType type) const
    4141{
    4242    /* Process passed event: */
     
    5151}
    5252
    53 UIGChooserModel* UIGChooserHandlerMouse::model() const
     53UIChooserModel* UIChooserHandlerMouse::model() const
    5454{
    5555    return m_pModel;
    5656}
    5757
    58 bool UIGChooserHandlerMouse::handleMousePress(QGraphicsSceneMouseEvent *pEvent) const
     58bool UIChooserHandlerMouse::handleMousePress(QGraphicsSceneMouseEvent *pEvent) const
    5959{
    6060    /* Get item under mouse cursor: */
     
    6969            {
    7070                /* Which item we just clicked? */
    71                 UIGChooserItem *pClickedItem = 0;
     71                UIChooserItem *pClickedItem = 0;
    7272                /* Was that a group item? */
    73                 if (UIGChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIGChooserItemGroup*>(pItemUnderMouse))
     73                if (UIChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIChooserItemGroup*>(pItemUnderMouse))
    7474                    pClickedItem = pGroupItem;
    7575                /* Or a machine one? */
    76                 else if (UIGChooserItemMachine *pMachineItem = qgraphicsitem_cast<UIGChooserItemMachine*>(pItemUnderMouse))
     76                else if (UIChooserItemMachine *pMachineItem = qgraphicsitem_cast<UIChooserItemMachine*>(pItemUnderMouse))
    7777                    pClickedItem = pMachineItem;
    7878                /* If we had clicked one of required item types: */
     
    8383                    {
    8484                        /* Calculate positions: */
    85                         UIGChooserItem *pFirstItem = model()->currentItem();
     85                        UIChooserItem *pFirstItem = model()->currentItem();
    8686                        int iFirstPosition = model()->navigationList().indexOf(pFirstItem);
    8787                        int iClickedPosition = model()->navigationList().indexOf(pClickedItem);
    8888                        /* Populate list of items from 'first' to 'clicked': */
    89                         QList<UIGChooserItem*> items;
     89                        QList<UIChooserItem*> items;
    9090                        if (iFirstPosition <= iClickedPosition)
    9191                            for (int i = iFirstPosition; i <= iClickedPosition; ++i)
     
    124124            {
    125125                /* Which item we just clicked? */
    126                 UIGChooserItem *pClickedItem = 0;
     126                UIChooserItem *pClickedItem = 0;
    127127                /* Was that a group item? */
    128                 if (UIGChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIGChooserItemGroup*>(pItemUnderMouse))
     128                if (UIChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIChooserItemGroup*>(pItemUnderMouse))
    129129                    pClickedItem = pGroupItem;
    130130                /* Or a machine one? */
    131                 else if (UIGChooserItemMachine *pMachineItem = qgraphicsitem_cast<UIGChooserItemMachine*>(pItemUnderMouse))
     131                else if (UIChooserItemMachine *pMachineItem = qgraphicsitem_cast<UIChooserItemMachine*>(pItemUnderMouse))
    132132                    pClickedItem = pMachineItem;
    133133                /* If we had clicked one of required item types: */
     
    148148}
    149149
    150 bool UIGChooserHandlerMouse::handleMouseRelease(QGraphicsSceneMouseEvent*) const
     150bool UIChooserHandlerMouse::handleMouseRelease(QGraphicsSceneMouseEvent*) const
    151151{
    152152    /* Pass all events: */
     
    154154}
    155155
    156 bool UIGChooserHandlerMouse::handleMouseDoubleClick(QGraphicsSceneMouseEvent *pEvent) const
     156bool UIChooserHandlerMouse::handleMouseDoubleClick(QGraphicsSceneMouseEvent *pEvent) const
    157157{
    158158    /* Get item under mouse cursor: */
     
    167167            {
    168168                /* Was that a group item? */
    169                 if (UIGChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIGChooserItemGroup*>(pItemUnderMouse))
     169                if (UIChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIChooserItemGroup*>(pItemUnderMouse))
    170170                {
    171171                    /* Prepare variables: */
     
    209209                }
    210210                /* Or a machine one? */
    211                 else if (pItemUnderMouse->type() == UIGChooserItemType_Machine)
     211                else if (pItemUnderMouse->type() == UIChooserItemType_Machine)
    212212                {
    213213                    /* Activate machine item: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerMouse.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserHandlerMouse class declaration.
     3 * VBox Qt GUI - UIChooserHandlerMouse class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGChooserHandlerMouse_h__
    19 #define __UIGChooserHandlerMouse_h__
     18#ifndef __UIChooserHandlerMouse_h__
     19#define __UIChooserHandlerMouse_h__
    2020
    2121/* Qt includes: */
     
    2323
    2424/* Forward declarations: */
    25 class UIGChooserModel;
     25class UIChooserModel;
    2626class QGraphicsSceneMouseEvent;
    27 class UIGChooserItem;
     27class UIChooserItem;
    2828
    2929/* Mouse event type: */
     
    3636
    3737/* Mouse handler for graphics selector: */
    38 class UIGChooserHandlerMouse : public QObject
     38class UIChooserHandlerMouse : public QObject
    3939{
    4040    Q_OBJECT;
     
    4343
    4444    /* Constructor: */
    45     UIGChooserHandlerMouse(UIGChooserModel *pParent);
     45    UIChooserHandlerMouse(UIChooserModel *pParent);
    4646
    4747    /* API: Model mouse-event handler delegate: */
     
    5151
    5252    /* API: Model wrapper: */
    53     UIGChooserModel* model() const;
     53    UIChooserModel* model() const;
    5454
    5555    /* Helpers: Model mouse-event handler delegates: */
     
    5959
    6060    /* Variables: */
    61     UIGChooserModel *m_pModel;
     61    UIChooserModel *m_pModel;
    6262};
    6363
    64 #endif /* __UIGChooserHandlerMouse_h__ */
     64#endif /* __UIChooserHandlerMouse_h__ */
    6565
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserItem class definition.
     3 * VBox Qt GUI - UIChooserItem class definition.
    44 */
    55
     
    3434
    3535/* GUI includes: */
    36 # include "UIGChooser.h"
    37 # include "UIGChooserItem.h"
    38 # include "UIGChooserView.h"
    39 # include "UIGChooserModel.h"
    40 # include "UIGChooserItemGroup.h"
    41 # include "UIGChooserItemMachine.h"
     36# include "UIChooser.h"
     37# include "UIChooserItem.h"
     38# include "UIChooserView.h"
     39# include "UIChooserModel.h"
     40# include "UIChooserItemGroup.h"
     41# include "UIChooserItemMachine.h"
    4242
    4343#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    4545
    4646/** QAccessibleObject extension used as an accessibility interface for Chooser-view items. */
    47 class UIAccessibilityInterfaceForUIGChooserItem : public QAccessibleObject
     47class UIAccessibilityInterfaceForUIChooserItem : public QAccessibleObject
    4848{
    4949public:
     
    5353    {
    5454        /* Creating Chooser-view accessibility interface: */
    55         if (pObject && strClassname == QLatin1String("UIGChooserItem"))
    56             return new UIAccessibilityInterfaceForUIGChooserItem(pObject);
     55        if (pObject && strClassname == QLatin1String("UIChooserItem"))
     56            return new UIAccessibilityInterfaceForUIChooserItem(pObject);
    5757
    5858        /* Null by default: */
     
    6161
    6262    /** Constructs an accessibility interface passing @a pObject to the base-class. */
    63     UIAccessibilityInterfaceForUIGChooserItem(QObject *pObject)
     63    UIAccessibilityInterfaceForUIChooserItem(QObject *pObject)
    6464        : QAccessibleObject(pObject)
    6565    {}
     
    8282
    8383        /* Return the number of group children: */
    84         if (item()->type() == UIGChooserItemType_Group)
     84        if (item()->type() == UIChooserItemType_Group)
    8585            return item()->items().size();
    8686
     
    149149
    150150        /* Return the role of group: */
    151         if (item()->type() == UIGChooserItemType_Group)
     151        if (item()->type() == UIChooserItemType_Group)
    152152            return QAccessible::List;
    153153
     
    176176
    177177        /* Compose the state of group: */
    178         if (item()->type() == UIGChooserItemType_Group)
     178        if (item()->type() == UIChooserItemType_Group)
    179179        {
    180180            state.expandable = true;
     
    190190
    191191    /** Returns corresponding Chooser-view item. */
    192     UIGChooserItem *item() const { return qobject_cast<UIGChooserItem*>(object()); }
     192    UIChooserItem *item() const { return qobject_cast<UIChooserItem*>(object()); }
    193193};
    194194
    195195
    196 UIGChooserItem::UIGChooserItem(UIGChooserItem *pParent, bool fTemporary)
     196UIChooserItem::UIChooserItem(UIChooserItem *pParent, bool fTemporary)
    197197    : m_fRoot(!pParent)
    198198    , m_fTemporary(fTemporary)
     
    212212{
    213213    /* Install Chooser-view item accessibility interface factory: */
    214     QAccessible::installFactory(UIAccessibilityInterfaceForUIGChooserItem::pFactory);
     214    QAccessible::installFactory(UIAccessibilityInterfaceForUIChooserItem::pFactory);
    215215
    216216    /* Basic item setup: */
     
    258258}
    259259
    260 UIGChooserItemGroup* UIGChooserItem::toGroupItem()
    261 {
    262     UIGChooserItemGroup *pItem = qgraphicsitem_cast<UIGChooserItemGroup*>(this);
    263     AssertMsg(pItem, ("Trying to cast invalid item type to UIGChooserItemGroup!"));
     260UIChooserItemGroup* UIChooserItem::toGroupItem()
     261{
     262    UIChooserItemGroup *pItem = qgraphicsitem_cast<UIChooserItemGroup*>(this);
     263    AssertMsg(pItem, ("Trying to cast invalid item type to UIChooserItemGroup!"));
    264264    return pItem;
    265265}
    266266
    267 UIGChooserItemMachine* UIGChooserItem::toMachineItem()
    268 {
    269     UIGChooserItemMachine *pItem = qgraphicsitem_cast<UIGChooserItemMachine*>(this);
    270     AssertMsg(pItem, ("Trying to cast invalid item type to UIGChooserItemMachine!"));
     267UIChooserItemMachine* UIChooserItem::toMachineItem()
     268{
     269    UIChooserItemMachine *pItem = qgraphicsitem_cast<UIChooserItemMachine*>(this);
     270    AssertMsg(pItem, ("Trying to cast invalid item type to UIChooserItemMachine!"));
    271271    return pItem;
    272272}
    273273
    274 UIGChooserModel* UIGChooserItem::model() const
    275 {
    276     UIGChooserModel *pModel = qobject_cast<UIGChooserModel*>(QIGraphicsWidget::scene()->parent());
     274UIChooserModel* UIChooserItem::model() const
     275{
     276    UIChooserModel *pModel = qobject_cast<UIChooserModel*>(QIGraphicsWidget::scene()->parent());
    277277    AssertMsg(pModel, ("Incorrect graphics scene parent set!"));
    278278    return pModel;
    279279}
    280280
    281 UIActionPool* UIGChooserItem::actionPool() const
     281UIActionPool* UIChooserItem::actionPool() const
    282282{
    283283    return model()->actionPool();
    284284}
    285285
    286 UIGChooserItem* UIGChooserItem::parentItem() const
     286UIChooserItem* UIChooserItem::parentItem() const
    287287{
    288288    return m_pParent;
    289289}
    290290
    291 void UIGChooserItem::show()
     291void UIChooserItem::show()
    292292{
    293293    /* Call to base-class: */
     
    295295}
    296296
    297 void UIGChooserItem::hide()
     297void UIChooserItem::hide()
    298298{
    299299    /* Call to base-class: */
     
    301301}
    302302
    303 void UIGChooserItem::setRoot(bool fRoot)
     303void UIChooserItem::setRoot(bool fRoot)
    304304{
    305305    m_fRoot = fRoot;
     
    307307}
    308308
    309 bool UIGChooserItem::isRoot() const
     309bool UIChooserItem::isRoot() const
    310310{
    311311    return m_fRoot;
    312312}
    313313
    314 bool UIGChooserItem::isHovered() const
     314bool UIChooserItem::isHovered() const
    315315{
    316316    return m_fHovered;
    317317}
    318318
    319 void UIGChooserItem::setHovered(bool fHovered)
     319void UIChooserItem::setHovered(bool fHovered)
    320320{
    321321    m_fHovered = fHovered;
     
    326326}
    327327
    328 void UIGChooserItem::updateGeometry()
     328void UIChooserItem::updateGeometry()
    329329{
    330330    /* Call to base-class: */
     
    357357}
    358358
    359 void UIGChooserItem::makeSureItsVisible()
     359void UIChooserItem::makeSureItsVisible()
    360360{
    361361    /* If item is not visible: */
     
    363363    {
    364364        /* Get parrent item, assert if can't: */
    365         if (UIGChooserItemGroup *pParentItem = parentItem()->toGroupItem())
     365        if (UIChooserItemGroup *pParentItem = parentItem()->toGroupItem())
    366366        {
    367367            /* We should make parent visible: */
     
    374374}
    375375
    376 void UIGChooserItem::setDragTokenPlace(DragToken where)
     376void UIChooserItem::setDragTokenPlace(DragToken where)
    377377{
    378378    /* Something changed? */
     
    384384}
    385385
    386 DragToken UIGChooserItem::dragTokenPlace() const
     386DragToken UIChooserItem::dragTokenPlace() const
    387387{
    388388    return m_dragTokenPlace;
     
    390390
    391391
    392 bool UIGChooserItem::isTemporary() const
     392bool UIChooserItem::isTemporary() const
    393393{
    394394    return m_fTemporary;
    395395}
    396396
    397 void UIGChooserItem::hoverMoveEvent(QGraphicsSceneHoverEvent*)
     397void UIChooserItem::hoverMoveEvent(QGraphicsSceneHoverEvent*)
    398398{
    399399    if (!m_fHovered)
     
    405405}
    406406
    407 void UIGChooserItem::hoverLeaveEvent(QGraphicsSceneHoverEvent*)
     407void UIChooserItem::hoverLeaveEvent(QGraphicsSceneHoverEvent*)
    408408{
    409409    if (m_fHovered)
     
    415415}
    416416
    417 void UIGChooserItem::mousePressEvent(QGraphicsSceneMouseEvent *pEvent)
     417void UIChooserItem::mousePressEvent(QGraphicsSceneMouseEvent *pEvent)
    418418{
    419419    /* By default, non-moveable and non-selectable items
     
    426426}
    427427
    428 void UIGChooserItem::mouseMoveEvent(QGraphicsSceneMouseEvent *pEvent)
     428void UIChooserItem::mouseMoveEvent(QGraphicsSceneMouseEvent *pEvent)
    429429{
    430430    /* Make sure item is really dragged: */
     
    442442}
    443443
    444 void UIGChooserItem::dragMoveEvent(QGraphicsSceneDragDropEvent *pEvent)
     444void UIChooserItem::dragMoveEvent(QGraphicsSceneDragDropEvent *pEvent)
    445445{
    446446    /* Make sure we are non-root: */
     
    449449        /* Allow drag tokens only for the same item type as current: */
    450450        bool fAllowDragToken = false;
    451         if ((type() == UIGChooserItemType_Group &&
    452              pEvent->mimeData()->hasFormat(UIGChooserItemGroup::className())) ||
    453             (type() == UIGChooserItemType_Machine &&
    454              pEvent->mimeData()->hasFormat(UIGChooserItemMachine::className())))
     451        if ((type() == UIChooserItemType_Group &&
     452             pEvent->mimeData()->hasFormat(UIChooserItemGroup::className())) ||
     453            (type() == UIChooserItemType_Machine &&
     454             pEvent->mimeData()->hasFormat(UIChooserItemMachine::className())))
    455455            fAllowDragToken = true;
    456456        /* Do we need a drag-token? */
     
    470470}
    471471
    472 void UIGChooserItem::dragLeaveEvent(QGraphicsSceneDragDropEvent*)
     472void UIChooserItem::dragLeaveEvent(QGraphicsSceneDragDropEvent*)
    473473{
    474474    resetDragToken();
    475475}
    476476
    477 void UIGChooserItem::dropEvent(QGraphicsSceneDragDropEvent *pEvent)
     477void UIChooserItem::dropEvent(QGraphicsSceneDragDropEvent *pEvent)
    478478{
    479479    /* Do we have token active? */
     
    495495}
    496496
    497 void UIGChooserItem::handleRootStatusChange()
     497void UIChooserItem::handleRootStatusChange()
    498498{
    499499    /* Reset minimum size hints for non-root items: */
     
    506506
    507507/* static */
    508 void UIGChooserItem::configurePainterShape(QPainter *pPainter,
     508void UIChooserItem::configurePainterShape(QPainter *pPainter,
    509509                                           const QStyleOptionGraphicsItem *pOption,
    510510                                           int iRadius)
     
    521521
    522522/* static */
    523 void UIGChooserItem::paintFrameRect(QPainter *pPainter, const QRect &rect, bool fIsSelected, int iRadius)
     523void UIChooserItem::paintFrameRect(QPainter *pPainter, const QRect &rect, bool fIsSelected, int iRadius)
    524524{
    525525    pPainter->save();
     
    535535
    536536/* static */
    537 void UIGChooserItem::paintPixmap(QPainter *pPainter, const QPoint &point, const QPixmap &pixmap)
     537void UIChooserItem::paintPixmap(QPainter *pPainter, const QPoint &point, const QPixmap &pixmap)
    538538{
    539539    pPainter->drawPixmap(point, pixmap);
     
    541541
    542542/* static */
    543 void UIGChooserItem::paintText(QPainter *pPainter, QPoint point,
     543void UIChooserItem::paintText(QPainter *pPainter, QPoint point,
    544544                               const QFont &font, QPaintDevice *pPaintDevice,
    545545                               const QString &strText)
     
    557557
    558558/* static */
    559 QSize UIGChooserItem::textSize(const QFont &font, QPaintDevice *pPaintDevice, const QString &strText)
     559QSize UIChooserItem::textSize(const QFont &font, QPaintDevice *pPaintDevice, const QString &strText)
    560560{
    561561    /* Make sure text is not empty: */
     
    569569
    570570/* static */
    571 int UIGChooserItem::textWidth(const QFont &font, QPaintDevice *pPaintDevice, int iCount)
     571int UIChooserItem::textWidth(const QFont &font, QPaintDevice *pPaintDevice, int iCount)
    572572{
    573573    /* Return text width: */
     
    579579
    580580/* static */
    581 QString UIGChooserItem::compressText(const QFont &font, QPaintDevice *pPaintDevice, QString strText, int iWidth)
     581QString UIChooserItem::compressText(const QFont &font, QPaintDevice *pPaintDevice, QString strText, int iWidth)
    582582{
    583583    /* Check if passed text is empty: */
     
    598598}
    599599
    600 UIGChooserItemMimeData::UIGChooserItemMimeData(UIGChooserItem *pItem)
     600UIChooserItemMimeData::UIChooserItemMimeData(UIChooserItem *pItem)
    601601    : m_pItem(pItem)
    602602{
    603603}
    604604
    605 bool UIGChooserItemMimeData::hasFormat(const QString &strMimeType) const
     605bool UIChooserItemMimeData::hasFormat(const QString &strMimeType) const
    606606{
    607607    if (strMimeType == QString(m_pItem->metaObject()->className()))
     
    610610}
    611611
    612 UIGChooserItem* UIGChooserItemMimeData::item() const
     612UIChooserItem* UIChooserItemMimeData::item() const
    613613{
    614614    return m_pItem;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserItem class declaration.
     3 * VBox Qt GUI - UIChooserItem class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGChooserItem_h__
    19 #define __UIGChooserItem_h__
     18#ifndef __UIChooserItem_h__
     19#define __UIChooserItem_h__
    2020
    2121/* Qt includes: */
     
    3131/* Forward declaration: */
    3232class UIActionPool;
    33 class UIGChooserModel;
    34 class UIGChooserItemGroup;
    35 class UIGChooserItemMachine;
     33class UIChooserModel;
     34class UIChooserItemGroup;
     35class UIChooserItemMachine;
    3636class QGraphicsSceneHoverEvent;
    3737class QGraphicsSceneMouseEvent;
     
    4040class QPropertyAnimation;
    4141
    42 /* UIGChooserItem types: */
    43 enum UIGChooserItemType
    44 {
    45     UIGChooserItemType_Any     = QGraphicsItem::UserType,
    46     UIGChooserItemType_Group   = QGraphicsItem::UserType + 1,
    47     UIGChooserItemType_Machine = QGraphicsItem::UserType + 2
     42/* UIChooserItem types: */
     43enum UIChooserItemType
     44{
     45    UIChooserItemType_Any     = QGraphicsItem::UserType,
     46    UIChooserItemType_Group   = QGraphicsItem::UserType + 1,
     47    UIChooserItemType_Machine = QGraphicsItem::UserType + 2
    4848};
    4949
    5050/* Item search flags: */
    51 enum UIGChooserItemSearchFlag
    52 {
    53     UIGChooserItemSearchFlag_Machine   = RT_BIT(0),
    54     UIGChooserItemSearchFlag_Group     = RT_BIT(1),
    55     UIGChooserItemSearchFlag_ExactName = RT_BIT(2)
     51enum UIChooserItemSearchFlag
     52{
     53    UIChooserItemSearchFlag_Machine   = RT_BIT(0),
     54    UIChooserItemSearchFlag_Group     = RT_BIT(1),
     55    UIChooserItemSearchFlag_ExactName = RT_BIT(2)
    5656};
    5757
     
    6161/* Graphics item interface
    6262 * for graphics selector model/view architecture: */
    63 class UIGChooserItem : public QIWithRetranslateUI4<QIGraphicsWidget>
     63class UIChooserItem : public QIWithRetranslateUI4<QIGraphicsWidget>
    6464{
    6565    Q_OBJECT;
     
    7979
    8080    /* Constructor: */
    81     UIGChooserItem(UIGChooserItem *pParent, bool fTemporary);
     81    UIChooserItem(UIChooserItem *pParent, bool fTemporary);
    8282
    8383    /* API: Cast stuff: */
    84     UIGChooserItemGroup* toGroupItem();
    85     UIGChooserItemMachine* toMachineItem();
     84    UIChooserItemGroup* toGroupItem();
     85    UIChooserItemMachine* toMachineItem();
    8686
    8787    /* API: Model stuff: */
    88     UIGChooserModel* model() const;
     88    UIChooserModel* model() const;
    8989
    9090    /** Returns the action-pool reference. */
     
    9292
    9393    /* API: Parent stuff: */
    94     UIGChooserItem* parentItem() const;
     94    UIChooserItem* parentItem() const;
    9595
    9696    /* API: Basic stuff: */
     
    109109
    110110    /* API: Children stuff: */
    111     virtual void addItem(UIGChooserItem *pItem, int iPosition) = 0;
    112     virtual void removeItem(UIGChooserItem *pItem) = 0;
    113     virtual void setItems(const QList<UIGChooserItem*> &items, UIGChooserItemType type) = 0;
    114     virtual QList<UIGChooserItem*> items(UIGChooserItemType type = UIGChooserItemType_Any) const = 0;
    115     virtual bool hasItems(UIGChooserItemType type = UIGChooserItemType_Any) const = 0;
    116     virtual void clearItems(UIGChooserItemType type = UIGChooserItemType_Any) = 0;
     111    virtual void addItem(UIChooserItem *pItem, int iPosition) = 0;
     112    virtual void removeItem(UIChooserItem *pItem) = 0;
     113    virtual void setItems(const QList<UIChooserItem*> &items, UIChooserItemType type) = 0;
     114    virtual QList<UIChooserItem*> items(UIChooserItemType type = UIChooserItemType_Any) const = 0;
     115    virtual bool hasItems(UIChooserItemType type = UIChooserItemType_Any) const = 0;
     116    virtual void clearItems(UIChooserItemType type = UIChooserItemType_Any) = 0;
    117117    virtual void updateAll(const QString &strId) = 0;
    118118    virtual void removeAll(const QString &strId) = 0;
    119     virtual UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags) = 0;
    120     virtual UIGChooserItemMachine* firstMachineItem() = 0;
     119    virtual UIChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags) = 0;
     120    virtual UIChooserItemMachine* firstMachineItem() = 0;
    121121    virtual void sortItems() = 0;
    122122
     
    133133    virtual QPixmap toPixmap() = 0;
    134134    virtual bool isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where = DragToken_Off) const = 0;
    135     virtual void processDrop(QGraphicsSceneDragDropEvent *pEvent, UIGChooserItem *pFromWho = 0, DragToken where = DragToken_Off) = 0;
     135    virtual void processDrop(QGraphicsSceneDragDropEvent *pEvent, UIChooserItem *pFromWho = 0, DragToken where = DragToken_Off) = 0;
    136136    virtual void resetDragToken() = 0;
    137137    void setDragTokenPlace(DragToken where);
     
    195195    bool m_fRoot;
    196196    bool m_fTemporary;
    197     UIGChooserItem *m_pParent;
     197    UIChooserItem *m_pParent;
    198198    QRectF m_previousGeometry;
    199199    int m_iPreviousMinimumWidthHint;
     
    214214
    215215/* Mime-data for graphics item interface: */
    216 class UIGChooserItemMimeData : public QMimeData
     216class UIChooserItemMimeData : public QMimeData
    217217{
    218218    Q_OBJECT;
     
    221221
    222222    /* Constructor: */
    223     UIGChooserItemMimeData(UIGChooserItem *pItem);
     223    UIChooserItemMimeData(UIChooserItem *pItem);
    224224
    225225    /* API: Format checker: */
     
    227227
    228228    /* API: Item getter: */
    229     UIGChooserItem* item() const;
     229    UIChooserItem* item() const;
    230230
    231231private:
    232232
    233233    /* Variables: */
    234     UIGChooserItem *m_pItem;
    235 };
    236 
    237 #endif /* __UIGChooserItem_h__ */
    238 
     234    UIChooserItem *m_pItem;
     235};
     236
     237#endif /* __UIChooserItem_h__ */
     238
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserItemGroup class implementation.
     3 * VBox Qt GUI - UIChooserItemGroup class implementation.
    44 */
    55
     
    3030
    3131/* GUI includes: */
    32 # include "UIGChooserItemGroup.h"
    33 # include "UIGChooserItemMachine.h"
    34 # include "UIGChooserModel.h"
    35 # include "UIGChooserView.h"
     32# include "UIChooserItemGroup.h"
     33# include "UIChooserItemMachine.h"
     34# include "UIChooserModel.h"
     35# include "UIChooserView.h"
    3636# include "UIGraphicsRotatorButton.h"
    3737# include "UIIconPool.h"
    38 # include "UISelectorWindow.h"
     38# include "UIVirtualBoxManager.h"
    3939
    4040#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    4444
    4545/* static */
    46 QString UIGChooserItemGroup::className() { return "UIGChooserItemGroup"; }
    47 
    48 UIGChooserItemGroup::UIGChooserItemGroup(QGraphicsScene *pScene)
    49     : UIGChooserItem(0, false /* temporary? */)
     46QString UIChooserItemGroup::className() { return "UIChooserItemGroup"; }
     47
     48UIChooserItemGroup::UIChooserItemGroup(QGraphicsScene *pScene)
     49    : UIChooserItem(0, false /* temporary? */)
    5050    , m_fClosed(false)
    5151    , m_fMainRoot(true)
     
    6868}
    6969
    70 UIGChooserItemGroup::UIGChooserItemGroup(QGraphicsScene *pScene,
    71                                          UIGChooserItemGroup *pCopyFrom,
     70UIChooserItemGroup::UIChooserItemGroup(QGraphicsScene *pScene,
     71                                         UIChooserItemGroup *pCopyFrom,
    7272                                         bool fMainRoot)
    73     : UIGChooserItem(0, true /* temporary? */)
     73    : UIChooserItem(0, true /* temporary? */)
    7474    , m_fClosed(pCopyFrom->isClosed())
    7575    , m_fMainRoot(fMainRoot)
     
    9595}
    9696
    97 UIGChooserItemGroup::UIGChooserItemGroup(UIGChooserItem *pParent,
     97UIChooserItemGroup::UIChooserItemGroup(UIChooserItem *pParent,
    9898                                         const QString &strName,
    9999                                         bool fOpened /* = false */,
    100100                                         int iPosition /* = -1 */)
    101     : UIGChooserItem(pParent, pParent->isTemporary())
     101    : UIChooserItem(pParent, pParent->isTemporary())
    102102    , m_fClosed(!fOpened)
    103103    , m_fMainRoot(false)
     
    113113    connect(this, SIGNAL(sigToggleStarted()), model(), SIGNAL(sigToggleStarted()));
    114114    connect(this, SIGNAL(sigToggleFinished()), model(), SIGNAL(sigToggleFinished()), Qt::QueuedConnection);
    115     connect(gpSelectorWindow, &UISelectorWindow::sigWindowRemapped,
    116             this, &UIGChooserItemGroup::sltHandleWindowRemapped);
     115    connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped,
     116            this, &UIChooserItemGroup::sltHandleWindowRemapped);
    117117
    118118    /* Translate finally: */
     
    132132}
    133133
    134 UIGChooserItemGroup::UIGChooserItemGroup(UIGChooserItem *pParent,
    135                                          UIGChooserItemGroup *pCopyFrom,
     134UIChooserItemGroup::UIChooserItemGroup(UIChooserItem *pParent,
     135                                         UIChooserItemGroup *pCopyFrom,
    136136                                         int iPosition /* = -1 */)
    137     : UIGChooserItem(pParent, pParent->isTemporary())
     137    : UIChooserItem(pParent, pParent->isTemporary())
    138138    , m_fClosed(pCopyFrom->isClosed())
    139139    , m_fMainRoot(false)
     
    149149    connect(this, SIGNAL(sigToggleStarted()), model(), SIGNAL(sigToggleStarted()));
    150150    connect(this, SIGNAL(sigToggleFinished()), model(), SIGNAL(sigToggleFinished()));
    151     connect(gpSelectorWindow, &UISelectorWindow::sigWindowRemapped,
    152             this, &UIGChooserItemGroup::sltHandleWindowRemapped);
     151    connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped,
     152            this, &UIChooserItemGroup::sltHandleWindowRemapped);
    153153
    154154    /* Copy content to 'this': */
     
    165165}
    166166
    167 UIGChooserItemGroup::~UIGChooserItemGroup()
     167UIChooserItemGroup::~UIChooserItemGroup()
    168168{
    169169    /* Delete all the items: */
     
    194194}
    195195
    196 QString UIGChooserItemGroup::name() const
     196QString UIChooserItemGroup::name() const
    197197{
    198198    return m_strName;
    199199}
    200200
    201 QString UIGChooserItemGroup::description() const
     201QString UIChooserItemGroup::description() const
    202202{
    203203    return m_strDescription;
    204204}
    205205
    206 QString UIGChooserItemGroup::fullName() const
     206QString UIChooserItemGroup::fullName() const
    207207{
    208208    /* Return "/" for main root-item: */
     
    218218}
    219219
    220 QString UIGChooserItemGroup::definition() const
     220QString UIChooserItemGroup::definition() const
    221221{
    222222    return QString("g=%1").arg(name());
    223223}
    224224
    225 void UIGChooserItemGroup::setName(const QString &strName)
     225void UIChooserItemGroup::setName(const QString &strName)
    226226{
    227227    /* Something changed? */
     
    237237}
    238238
    239 bool UIGChooserItemGroup::isClosed() const
     239bool UIChooserItemGroup::isClosed() const
    240240{
    241241    return m_fClosed && !isRoot();
    242242}
    243243
    244 bool UIGChooserItemGroup::isOpened() const
     244bool UIChooserItemGroup::isOpened() const
    245245{
    246246    return !m_fClosed || isRoot();
    247247}
    248248
    249 void UIGChooserItemGroup::close(bool fAnimated /* = true */)
     249void UIChooserItemGroup::close(bool fAnimated /* = true */)
    250250{
    251251    AssertMsg(!isRoot(), ("Can't close root-item!"));
     
    253253}
    254254
    255 void UIGChooserItemGroup::open(bool fAnimated /* = true */)
     255void UIChooserItemGroup::open(bool fAnimated /* = true */)
    256256{
    257257    AssertMsg(!isRoot(), ("Can't open root-item!"));
     
    259259}
    260260
    261 bool UIGChooserItemGroup::isContainsMachine(const QString &strId) const
     261bool UIChooserItemGroup::isContainsMachine(const QString &strId) const
    262262{
    263263    /* Check each machine-item: */
    264     foreach (UIGChooserItem *pItem, m_machineItems)
     264    foreach (UIChooserItem *pItem, m_machineItems)
    265265        if (pItem->toMachineItem()->id() == strId)
    266266            return true;
     
    269269}
    270270
    271 bool UIGChooserItemGroup::isContainsLockedMachine()
     271bool UIChooserItemGroup::isContainsLockedMachine()
    272272{
    273273    /* Check each machine-item: */
    274     foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Machine))
     274    foreach (UIChooserItem *pItem, items(UIChooserItemType_Machine))
    275275        if (pItem->toMachineItem()->isLockedMachine())
    276276            return true;
    277277    /* Check each group-item: */
    278     foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Group))
     278    foreach (UIChooserItem *pItem, items(UIChooserItemType_Group))
    279279        if (pItem->toGroupItem()->isContainsLockedMachine())
    280280            return true;
     
    283283}
    284284
    285 void UIGChooserItemGroup::sltHandleWindowRemapped()
     285void UIChooserItemGroup::sltHandleWindowRemapped()
    286286{
    287287    /* Update pixmaps: */
     
    289289}
    290290
    291 void UIGChooserItemGroup::sltNameEditingFinished()
     291void UIChooserItemGroup::sltNameEditingFinished()
    292292{
    293293    /* Not for root: */
     
    300300    /* Enumerate all the group names: */
    301301    QStringList groupNames;
    302     foreach (UIGChooserItem *pItem, parentItem()->items(UIGChooserItemType_Group))
     302    foreach (UIChooserItem *pItem, parentItem()->items(UIChooserItemType_Group))
    303303        groupNames << pItem->name();
    304304    /* If proposed name is empty or not unique, reject it: */
     
    316316}
    317317
    318 void UIGChooserItemGroup::sltGroupToggleStart()
     318void UIChooserItemGroup::sltGroupToggleStart()
    319319{
    320320    /* Not for root: */
     
    349349}
    350350
    351 void UIGChooserItemGroup::sltGroupToggleFinish(bool fToggled)
     351void UIChooserItemGroup::sltGroupToggleFinish(bool fToggled)
    352352{
    353353    /* Not for root: */
     
    371371}
    372372
    373 void UIGChooserItemGroup::sltIndentRoot()
     373void UIChooserItemGroup::sltIndentRoot()
    374374{
    375375    /* Unhover before indenting: */
     
    380380}
    381381
    382 void UIGChooserItemGroup::sltUnindentRoot()
     382void UIChooserItemGroup::sltUnindentRoot()
    383383{
    384384    /* Unhover before unindenting: */
     
    389389}
    390390
    391 QVariant UIGChooserItemGroup::data(int iKey) const
     391QVariant UIChooserItemGroup::data(int iKey) const
    392392{
    393393    /* Provide other members with required data: */
     
    407407}
    408408
    409 void UIGChooserItemGroup::prepare()
     409void UIChooserItemGroup::prepare()
    410410{
    411411    /* Buttons: */
     
    440440
    441441        /* Setup name-editor: */
    442         m_pNameEditorWidget = new UIGroupRenameEditor(name(), this);
     442        m_pNameEditorWidget = new UIEditorGroupRename(name(), this);
    443443        m_pNameEditorWidget->setFont(m_nameFont);
    444444        connect(m_pNameEditorWidget, SIGNAL(sigEditingFinished()), this, SLOT(sltNameEditingFinished()));
     
    465465
    466466/* static */
    467 void UIGChooserItemGroup::copyContent(UIGChooserItemGroup *pFrom, UIGChooserItemGroup *pTo)
     467void UIChooserItemGroup::copyContent(UIChooserItemGroup *pFrom, UIChooserItemGroup *pTo)
    468468{
    469469    /* Copy group-items: */
    470     foreach (UIGChooserItem *pGroupItem, pFrom->items(UIGChooserItemType_Group))
    471         new UIGChooserItemGroup(pTo, pGroupItem->toGroupItem());
     470    foreach (UIChooserItem *pGroupItem, pFrom->items(UIChooserItemType_Group))
     471        new UIChooserItemGroup(pTo, pGroupItem->toGroupItem());
    472472    /* Copy machine-items: */
    473     foreach (UIGChooserItem *pMachineItem, pFrom->items(UIGChooserItemType_Machine))
    474         new UIGChooserItemMachine(pTo, pMachineItem->toMachineItem());
    475 }
    476 
    477 void UIGChooserItemGroup::handleRootStatusChange()
     473    foreach (UIChooserItem *pMachineItem, pFrom->items(UIChooserItemType_Machine))
     474        new UIChooserItemMachine(pTo, pMachineItem->toMachineItem());
     475}
     476
     477void UIChooserItemGroup::handleRootStatusChange()
    478478{
    479479    /* Call to base-class: */
    480     UIGChooserItem::handleRootStatusChange();
     480    UIChooserItem::handleRootStatusChange();
    481481
    482482    /* Update linked values: */
     
    485485}
    486486
    487 void UIGChooserItemGroup::updateVisibleName()
     487void UIChooserItemGroup::updateVisibleName()
    488488{
    489489    /* Not for main root: */
     
    552552}
    553553
    554 void UIGChooserItemGroup::updatePixmaps()
     554void UIChooserItemGroup::updatePixmaps()
    555555{
    556556    const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
    557     m_groupsPixmap = UIIconPool::iconSet(":/group_abstract_16px.png").pixmap(gpSelectorWindow->windowHandle(),
     557    m_groupsPixmap = UIIconPool::iconSet(":/group_abstract_16px.png").pixmap(gpManager->windowHandle(),
    558558                                                                             QSize(iIconMetric, iIconMetric));
    559     m_machinesPixmap = UIIconPool::iconSet(":/machine_abstract_16px.png").pixmap(gpSelectorWindow->windowHandle(),
     559    m_machinesPixmap = UIIconPool::iconSet(":/machine_abstract_16px.png").pixmap(gpManager->windowHandle(),
    560560                                                                                 QSize(iIconMetric, iIconMetric));
    561561    m_pixmapSizeGroups = m_groupsPixmap.size() / m_groupsPixmap.devicePixelRatio();
     
    563563}
    564564
    565 void UIGChooserItemGroup::updateItemCountInfo()
     565void UIChooserItemGroup::updateItemCountInfo()
    566566{
    567567    /* Not for main root: */
     
    605605}
    606606
    607 void UIGChooserItemGroup::updateMinimumHeaderSize()
     607void UIChooserItemGroup::updateMinimumHeaderSize()
    608608{
    609609    /* Not for main root: */
     
    678678}
    679679
    680 void UIGChooserItemGroup::updateToolTip()
     680void UIChooserItemGroup::updateToolTip()
    681681{
    682682    /* Not for main root: */
     
    698698
    699699    /* Should we add group info? */
    700     if (!items(UIGChooserItemType_Group).isEmpty())
     700    if (!items(UIChooserItemType_Group).isEmpty())
    701701    {
    702702        /* Template: */
    703         QString strGroupCount = tr("%n group(s)", "Group item tool-tip / Group info", items(UIGChooserItemType_Group).size());
     703        QString strGroupCount = tr("%n group(s)", "Group item tool-tip / Group info", items(UIChooserItemType_Group).size());
    704704
    705705        /* Append value: */
     
    709709
    710710    /* Should we add machine info? */
    711     if (!items(UIGChooserItemType_Machine).isEmpty())
     711    if (!items(UIChooserItemType_Machine).isEmpty())
    712712    {
    713713        /* Check if 'this' group contains started VMs: */
    714714        int iCountOfStartedMachineItems = 0;
    715         foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Machine))
    716             if (UIVMItem::isItemStarted(pItem->toMachineItem()))
     715        foreach (UIChooserItem *pItem, items(UIChooserItemType_Machine))
     716            if (UIVirtualMachineItem::isItemStarted(pItem->toMachineItem()))
    717717                ++iCountOfStartedMachineItems;
    718718        /* Template: */
    719         QString strMachineCount = tr("%n machine(s)", "Group item tool-tip / Machine info", items(UIGChooserItemType_Machine).size());
     719        QString strMachineCount = tr("%n machine(s)", "Group item tool-tip / Machine info", items(UIChooserItemType_Machine).size());
    720720        QString strStartedMachineCount = tr("(%n running)", "Group item tool-tip / Running machine info", iCountOfStartedMachineItems);
    721721
     
    731731}
    732732
    733 void UIGChooserItemGroup::updateToggleButtonToolTip()
     733void UIChooserItemGroup::updateToggleButtonToolTip()
    734734{
    735735    /* Is toggle-button created? */
     
    741741}
    742742
    743 void UIGChooserItemGroup::retranslateUi()
     743void UIChooserItemGroup::retranslateUi()
    744744{
    745745    /* Update description: */
     
    757757}
    758758
    759 void UIGChooserItemGroup::show()
     759void UIChooserItemGroup::show()
    760760{
    761761    /* Call to base-class: */
    762     UIGChooserItem::show();
     762    UIChooserItem::show();
    763763    /* Show children: */
    764764    if (!isClosed())
    765         foreach (UIGChooserItem *pItem, items())
     765        foreach (UIChooserItem *pItem, items())
    766766            pItem->show();
    767767}
    768768
    769 void UIGChooserItemGroup::hide()
     769void UIChooserItemGroup::hide()
    770770{
    771771    /* Call to base-class: */
    772     UIGChooserItem::hide();
     772    UIChooserItem::hide();
    773773    /* Hide children: */
    774     foreach (UIGChooserItem *pItem, items())
     774    foreach (UIChooserItem *pItem, items())
    775775        pItem->hide();
    776776}
    777777
    778 void UIGChooserItemGroup::startEditing()
     778void UIChooserItemGroup::startEditing()
    779779{
    780780    /* Not for root: */
     
    792792}
    793793
    794 void UIGChooserItemGroup::addItem(UIGChooserItem *pItem, int iPosition)
     794void UIChooserItemGroup::addItem(UIChooserItem *pItem, int iPosition)
    795795{
    796796    /* Check item type: */
    797797    switch (pItem->type())
    798798    {
    799         case UIGChooserItemType_Group:
     799        case UIChooserItemType_Group:
    800800        {
    801801            AssertMsg(!m_groupItems.contains(pItem), ("Group-item already added!"));
     
    807807            break;
    808808        }
    809         case UIGChooserItemType_Machine:
     809        case UIChooserItemType_Machine:
    810810        {
    811811            AssertMsg(!m_machineItems.contains(pItem), ("Machine-item already added!"));
     
    830830}
    831831
    832 void UIGChooserItemGroup::removeItem(UIGChooserItem *pItem)
     832void UIChooserItemGroup::removeItem(UIChooserItem *pItem)
    833833{
    834834    /* Check item type: */
    835835    switch (pItem->type())
    836836    {
    837         case UIGChooserItemType_Group:
     837        case UIChooserItemType_Group:
    838838        {
    839839            AssertMsg(m_groupItems.contains(pItem), ("Group-item was not found!"));
     
    842842            break;
    843843        }
    844         case UIGChooserItemType_Machine:
     844        case UIChooserItemType_Machine:
    845845        {
    846846            AssertMsg(m_machineItems.contains(pItem), ("Machine-item was not found!"));
     
    862862}
    863863
    864 void UIGChooserItemGroup::setItems(const QList<UIGChooserItem*> &items, UIGChooserItemType type)
     864void UIChooserItemGroup::setItems(const QList<UIChooserItem*> &items, UIChooserItemType type)
    865865{
    866866    /* Check item type: */
    867867    switch (type)
    868868    {
    869         case UIGChooserItemType_Group: m_groupItems = items; break;
    870         case UIGChooserItemType_Machine: m_machineItems = items; break;
     869        case UIChooserItemType_Group: m_groupItems = items; break;
     870        case UIChooserItemType_Machine: m_machineItems = items; break;
    871871        default: AssertMsgFailed(("Invalid item type!")); break;
    872872    }
     
    878878}
    879879
    880 QList<UIGChooserItem*> UIGChooserItemGroup::items(UIGChooserItemType type /* = UIGChooserItemType_Any */) const
     880QList<UIChooserItem*> UIChooserItemGroup::items(UIChooserItemType type /* = UIChooserItemType_Any */) const
    881881{
    882882    switch (type)
    883883    {
    884         case UIGChooserItemType_Any: return items(UIGChooserItemType_Group) + items(UIGChooserItemType_Machine);
    885         case UIGChooserItemType_Group: return m_groupItems;
    886         case UIGChooserItemType_Machine: return m_machineItems;
     884        case UIChooserItemType_Any: return items(UIChooserItemType_Group) + items(UIChooserItemType_Machine);
     885        case UIChooserItemType_Group: return m_groupItems;
     886        case UIChooserItemType_Machine: return m_machineItems;
    887887        default: break;
    888888    }
    889     return QList<UIGChooserItem*>();
    890 }
    891 
    892 bool UIGChooserItemGroup::hasItems(UIGChooserItemType type /* = UIGChooserItemType_Any */) const
     889    return QList<UIChooserItem*>();
     890}
     891
     892bool UIChooserItemGroup::hasItems(UIChooserItemType type /* = UIChooserItemType_Any */) const
    893893{
    894894    switch (type)
    895895    {
    896         case UIGChooserItemType_Any:
    897             return hasItems(UIGChooserItemType_Group) || hasItems(UIGChooserItemType_Machine);
    898         case UIGChooserItemType_Group:
     896        case UIChooserItemType_Any:
     897            return hasItems(UIChooserItemType_Group) || hasItems(UIChooserItemType_Machine);
     898        case UIChooserItemType_Group:
    899899            return !m_groupItems.isEmpty();
    900         case UIGChooserItemType_Machine:
     900        case UIChooserItemType_Machine:
    901901            return !m_machineItems.isEmpty();
    902902    }
     
    904904}
    905905
    906 void UIGChooserItemGroup::clearItems(UIGChooserItemType type /* = UIGChooserItemType_Any */)
     906void UIChooserItemGroup::clearItems(UIChooserItemType type /* = UIChooserItemType_Any */)
    907907{
    908908    switch (type)
    909909    {
    910         case UIGChooserItemType_Any:
    911         {
    912             clearItems(UIGChooserItemType_Group);
    913             clearItems(UIGChooserItemType_Machine);
     910        case UIChooserItemType_Any:
     911        {
     912            clearItems(UIChooserItemType_Group);
     913            clearItems(UIChooserItemType_Machine);
    914914            break;
    915915        }
    916         case UIGChooserItemType_Group:
     916        case UIChooserItemType_Group:
    917917        {
    918918            while (!m_groupItems.isEmpty()) { delete m_groupItems.last(); }
     
    920920            break;
    921921        }
    922         case UIGChooserItemType_Machine:
     922        case UIChooserItemType_Machine:
    923923        {
    924924            while (!m_machineItems.isEmpty()) { delete m_machineItems.last(); }
     
    934934}
    935935
    936 void UIGChooserItemGroup::updateAll(const QString &strId)
     936void UIChooserItemGroup::updateAll(const QString &strId)
    937937{
    938938    /* Update all the required items recursively: */
    939     foreach (UIGChooserItem *pItem, items())
     939    foreach (UIChooserItem *pItem, items())
    940940        pItem->updateAll(strId);
    941941}
    942942
    943 void UIGChooserItemGroup::removeAll(const QString &strId)
     943void UIChooserItemGroup::removeAll(const QString &strId)
    944944{
    945945    /* Remove all the required items recursively: */
    946     foreach (UIGChooserItem *pItem, items())
     946    foreach (UIChooserItem *pItem, items())
    947947        pItem->removeAll(strId);
    948948}
    949949
    950 UIGChooserItem* UIGChooserItemGroup::searchForItem(const QString &strSearchTag, int iItemSearchFlags)
     950UIChooserItem* UIChooserItemGroup::searchForItem(const QString &strSearchTag, int iItemSearchFlags)
    951951{
    952952    /* Are we searching among group-items? */
    953     if (iItemSearchFlags & UIGChooserItemSearchFlag_Group)
     953    if (iItemSearchFlags & UIChooserItemSearchFlag_Group)
    954954    {
    955955        /* Are we searching by the exact name? */
    956         if (iItemSearchFlags & UIGChooserItemSearchFlag_ExactName)
     956        if (iItemSearchFlags & UIChooserItemSearchFlag_ExactName)
    957957        {
    958958            /* Exact name matches? */
     
    970970
    971971    /* Search among all the children, but machines first: */
    972     foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Machine))
    973         if (UIGChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iItemSearchFlags))
     972    foreach (UIChooserItem *pItem, items(UIChooserItemType_Machine))
     973        if (UIChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iItemSearchFlags))
    974974            return pFoundItem;
    975     foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Group))
    976         if (UIGChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iItemSearchFlags))
     975    foreach (UIChooserItem *pItem, items(UIChooserItemType_Group))
     976        if (UIChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iItemSearchFlags))
    977977            return pFoundItem;
    978978
     
    981981}
    982982
    983 UIGChooserItemMachine* UIGChooserItemGroup::firstMachineItem()
     983UIChooserItemMachine* UIChooserItemGroup::firstMachineItem()
    984984{
    985985    /* If this group-item have at least one machine-item: */
    986     if (hasItems(UIGChooserItemType_Machine))
     986    if (hasItems(UIChooserItemType_Machine))
    987987        /* Return the first machine-item: */
    988         return items(UIGChooserItemType_Machine).first()->firstMachineItem();
     988        return items(UIChooserItemType_Machine).first()->firstMachineItem();
    989989    /* If this group-item have at least one group-item: */
    990     else if (hasItems(UIGChooserItemType_Group))
     990    else if (hasItems(UIChooserItemType_Group))
    991991        /* Return the first machine-item of the first group-item: */
    992         return items(UIGChooserItemType_Group).first()->firstMachineItem();
     992        return items(UIChooserItemType_Group).first()->firstMachineItem();
    993993    /* Found nothing? */
    994994    return 0;
    995995}
    996996
    997 void UIGChooserItemGroup::sortItems()
     997void UIChooserItemGroup::sortItems()
    998998{
    999999    /* Sort group-items: */
    1000     QMap<QString, UIGChooserItem*> sorter;
    1001     foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Group))
     1000    QMap<QString, UIChooserItem*> sorter;
     1001    foreach (UIChooserItem *pItem, items(UIChooserItemType_Group))
    10021002        sorter.insert(pItem->name().toLower(), pItem);
    1003     setItems(sorter.values(), UIGChooserItemType_Group);
     1003    setItems(sorter.values(), UIChooserItemType_Group);
    10041004
    10051005    /* Sort machine-items: */
    10061006    sorter.clear();
    1007     foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Machine))
     1007    foreach (UIChooserItem *pItem, items(UIChooserItemType_Machine))
    10081008        sorter.insert(pItem->name().toLower(), pItem);
    1009     setItems(sorter.values(), UIGChooserItemType_Machine);
     1009    setItems(sorter.values(), UIChooserItemType_Machine);
    10101010
    10111011    /* Update model: */
     
    10141014}
    10151015
    1016 void UIGChooserItemGroup::updateLayout()
     1016void UIChooserItemGroup::updateLayout()
    10171017{
    10181018    /* Prepare variables: */
     
    11161116    {
    11171117        /* Hide all the items: */
    1118         foreach (UIGChooserItem *pItem, items())
     1118        foreach (UIChooserItem *pItem, items())
    11191119            pItem->hide();
    11201120    }
     
    11301130
    11311131        /* Layout all the items: */
    1132         foreach (UIGChooserItem *pItem, items())
     1132        foreach (UIChooserItem *pItem, items())
    11331133        {
    11341134            /* Show if hidden: */
     
    11481148}
    11491149
    1150 int UIGChooserItemGroup::minimumWidthHint(bool fOpenedGroup) const
     1150int UIChooserItemGroup::minimumWidthHint(bool fOpenedGroup) const
    11511151{
    11521152    /* Calculating proposed width: */
     
    11641164            /* We have to take every child width into account: */
    11651165            int iMaximumChildWidth = 0;
    1166             foreach (UIGChooserItem *pItem, items())
     1166            foreach (UIChooserItem *pItem, items())
    11671167                iMaximumChildWidth = qMax(iMaximumChildWidth, pItem->minimumWidthHint());
    11681168            iProposedWidth += iMaximumChildWidth;
     
    11861186            /* We have to take every child width into account: */
    11871187            int iMaximumChildWidth = 0;
    1188             foreach (UIGChooserItem *pItem, items())
     1188            foreach (UIChooserItem *pItem, items())
    11891189                iMaximumChildWidth = qMax(iMaximumChildWidth, pItem->minimumWidthHint());
    11901190            iProposedWidth = qMax(iProposedWidth, iMaximumChildWidth);
     
    11991199}
    12001200
    1201 int UIGChooserItemGroup::minimumHeightHint(bool fOpenedGroup) const
     1201int UIChooserItemGroup::minimumHeightHint(bool fOpenedGroup) const
    12021202{
    12031203    /* Prepare variables: */
     
    12191219            iProposedHeight += 2 * iRootIndent;
    12201220            /* And every existing: */
    1221             foreach (UIGChooserItem *pItem, items())
     1221            foreach (UIChooserItem *pItem, items())
    12221222            {
    12231223                /* Child height: */
     
    12501250            iProposedHeight += iVerticalMargin;
    12511251            /* Every existing: */
    1252             foreach (UIGChooserItem *pItem, items())
     1252            foreach (UIChooserItem *pItem, items())
    12531253            {
    12541254                /* Child height: */
     
    12721272}
    12731273
    1274 int UIGChooserItemGroup::minimumWidthHint() const
     1274int UIChooserItemGroup::minimumWidthHint() const
    12751275{
    12761276    return minimumWidthHint(isOpened());
    12771277}
    12781278
    1279 int UIGChooserItemGroup::minimumHeightHint() const
     1279int UIChooserItemGroup::minimumHeightHint() const
    12801280{
    12811281    return minimumHeightHint(isOpened());
    12821282}
    12831283
    1284 QSizeF UIGChooserItemGroup::minimumSizeHint(bool fOpenedGroup) const
     1284QSizeF UIChooserItemGroup::minimumSizeHint(bool fOpenedGroup) const
    12851285{
    12861286    return QSizeF(minimumWidthHint(fOpenedGroup), minimumHeightHint(fOpenedGroup));
    12871287}
    12881288
    1289 QSizeF UIGChooserItemGroup::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const
     1289QSizeF UIChooserItemGroup::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const
    12901290{
    12911291    /* If Qt::MinimumSize requested: */
     
    12931293        return minimumSizeHint(isOpened());
    12941294    /* Else call to base-class: */
    1295     return UIGChooserItem::sizeHint(which, constraint);
    1296 }
    1297 
    1298 QPixmap UIGChooserItemGroup::toPixmap()
     1295    return UIChooserItem::sizeHint(which, constraint);
     1296}
     1297
     1298QPixmap UIChooserItemGroup::toPixmap()
    12991299{
    13001300    /* Ask item to paint itself into pixmap: */
     
    13101310}
    13111311
    1312 bool UIGChooserItemGroup::isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const
     1312bool UIChooserItemGroup::isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const
    13131313{
    13141314    /* No drops while saving groups: */
     
    13211321        return parentItem()->isDropAllowed(pEvent);
    13221322    /* Else we should check mime format: */
    1323     if (pMimeData->hasFormat(UIGChooserItemGroup::className()))
     1323    if (pMimeData->hasFormat(UIChooserItemGroup::className()))
    13241324    {
    13251325        /* Get passed group-item: */
    1326         const UIGChooserItemMimeData *pCastedMimeData = qobject_cast<const UIGChooserItemMimeData*>(pMimeData);
    1327         AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UIGChooserItemMimeData!"));
    1328         UIGChooserItem *pItem = pCastedMimeData->item();
     1326        const UIChooserItemMimeData *pCastedMimeData = qobject_cast<const UIChooserItemMimeData*>(pMimeData);
     1327        AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UIChooserItemMimeData!"));
     1328        UIChooserItem *pItem = pCastedMimeData->item();
    13291329        /* Make sure passed group is mutable within this group: */
    13301330        if (pItem->toGroupItem()->isContainsLockedMachine() &&
    1331             !items(UIGChooserItemType_Group).contains(pItem))
     1331            !items(UIChooserItemType_Group).contains(pItem))
    13321332            return false;
    13331333        /* Make sure passed group is not 'this': */
     
    13351335            return false;
    13361336        /* Make sure passed group is not among our parents: */
    1337         const UIGChooserItem *pTestedWidget = this;
    1338         while (UIGChooserItem *pParentOfTestedWidget = pTestedWidget->parentItem())
     1337        const UIChooserItem *pTestedWidget = this;
     1338        while (UIChooserItem *pParentOfTestedWidget = pTestedWidget->parentItem())
    13391339        {
    13401340            if (pItem == pParentOfTestedWidget)
     
    13441344        return true;
    13451345    }
    1346     else if (pMimeData->hasFormat(UIGChooserItemMachine::className()))
     1346    else if (pMimeData->hasFormat(UIChooserItemMachine::className()))
    13471347    {
    13481348        /* Get passed machine-item: */
    1349         const UIGChooserItemMimeData *pCastedMimeData = qobject_cast<const UIGChooserItemMimeData*>(pMimeData);
    1350         AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UIGChooserItemMimeData!"));
    1351         UIGChooserItem *pItem = pCastedMimeData->item();
     1349        const UIChooserItemMimeData *pCastedMimeData = qobject_cast<const UIChooserItemMimeData*>(pMimeData);
     1350        AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UIChooserItemMimeData!"));
     1351        UIChooserItem *pItem = pCastedMimeData->item();
    13521352        /* Make sure passed machine is mutable within this group: */
    13531353        if (pItem->toMachineItem()->isLockedMachine() &&
    1354             !items(UIGChooserItemType_Machine).contains(pItem))
     1354            !items(UIChooserItemType_Machine).contains(pItem))
    13551355            return false;
    13561356        switch (pEvent->proposedAction())
     
    13731373}
    13741374
    1375 void UIGChooserItemGroup::processDrop(QGraphicsSceneDragDropEvent *pEvent, UIGChooserItem *pFromWho, DragToken where)
     1375void UIChooserItemGroup::processDrop(QGraphicsSceneDragDropEvent *pEvent, UIChooserItem *pFromWho, DragToken where)
    13761376{
    13771377    /* Get mime: */
    13781378    const QMimeData *pMime = pEvent->mimeData();
    13791379    /* Check mime format: */
    1380     if (pMime->hasFormat(UIGChooserItemGroup::className()))
     1380    if (pMime->hasFormat(UIChooserItemGroup::className()))
    13811381    {
    13821382        switch (pEvent->proposedAction())
     
    13861386            {
    13871387                /* Remember scene: */
    1388                 UIGChooserModel *pModel = model();
     1388                UIChooserModel *pModel = model();
    13891389
    13901390                /* Get passed group-item: */
    1391                 const UIGChooserItemMimeData *pCastedMime = qobject_cast<const UIGChooserItemMimeData*>(pMime);
    1392                 AssertMsg(pCastedMime, ("Can't cast passed mime-data to UIGChooserItemMimeData!"));
    1393                 UIGChooserItem *pItem = pCastedMime->item();
     1391                const UIChooserItemMimeData *pCastedMime = qobject_cast<const UIChooserItemMimeData*>(pMime);
     1392                AssertMsg(pCastedMime, ("Can't cast passed mime-data to UIChooserItemMimeData!"));
     1393                UIChooserItem *pItem = pCastedMime->item();
    13941394
    13951395                /* Check if we have position information: */
     
    14081408
    14091409                /* Copy passed item into this group: */
    1410                 UIGChooserItem *pNewGroupItem = new UIGChooserItemGroup(this, pItem->toGroupItem(), iPosition);
     1410                UIChooserItem *pNewGroupItem = new UIChooserItemGroup(this, pItem->toGroupItem(), iPosition);
    14111411                if (isClosed())
    14121412                    open(false);
     
    14311431        }
    14321432    }
    1433     else if (pMime->hasFormat(UIGChooserItemMachine::className()))
     1433    else if (pMime->hasFormat(UIChooserItemMachine::className()))
    14341434    {
    14351435        switch (pEvent->proposedAction())
     
    14391439            {
    14401440                /* Remember scene: */
    1441                 UIGChooserModel *pModel = model();
     1441                UIChooserModel *pModel = model();
    14421442
    14431443                /* Get passed item: */
    1444                 const UIGChooserItemMimeData *pCastedMime = qobject_cast<const UIGChooserItemMimeData*>(pMime);
    1445                 AssertMsg(pCastedMime, ("Can't cast passed mime-data to UIGChooserItemMimeData!"));
    1446                 UIGChooserItem *pItem = pCastedMime->item();
     1444                const UIChooserItemMimeData *pCastedMime = qobject_cast<const UIChooserItemMimeData*>(pMime);
     1445                AssertMsg(pCastedMime, ("Can't cast passed mime-data to UIChooserItemMimeData!"));
     1446                UIChooserItem *pItem = pCastedMime->item();
    14471447
    14481448                /* Check if we have position information: */
     
    14611461
    14621462                /* Copy passed machine-item into this group: */
    1463                 UIGChooserItem *pNewMachineItem = new UIGChooserItemMachine(this, pItem->toMachineItem(), iPosition);
     1463                UIChooserItem *pNewMachineItem = new UIChooserItemMachine(this, pItem->toMachineItem(), iPosition);
    14641464                if (isClosed())
    14651465                    open(false);
     
    14861486}
    14871487
    1488 void UIGChooserItemGroup::resetDragToken()
     1488void UIChooserItemGroup::resetDragToken()
    14891489{
    14901490    /* Reset drag token for this item: */
     
    14951495    }
    14961496    /* Reset drag tokens for all the items: */
    1497     foreach (UIGChooserItem *pItem, items())
     1497    foreach (UIChooserItem *pItem, items())
    14981498        pItem->resetDragToken();
    14991499}
    15001500
    1501 QMimeData* UIGChooserItemGroup::createMimeData()
    1502 {
    1503     return new UIGChooserItemMimeData(this);
    1504 }
    1505 
    1506 void UIGChooserItemGroup::showEvent(QShowEvent *pEvent)
     1501QMimeData* UIChooserItemGroup::createMimeData()
     1502{
     1503    return new UIChooserItemMimeData(this);
     1504}
     1505
     1506void UIChooserItemGroup::showEvent(QShowEvent *pEvent)
    15071507{
    15081508    /* Call to base-class: */
    1509     UIGChooserItem::showEvent(pEvent);
     1509    UIChooserItem::showEvent(pEvent);
    15101510
    15111511    /* Update pixmaps: */
     
    15131513}
    15141514
    1515 void UIGChooserItemGroup::resizeEvent(QGraphicsSceneResizeEvent *pEvent)
     1515void UIChooserItemGroup::resizeEvent(QGraphicsSceneResizeEvent *pEvent)
    15161516{
    15171517    /* Call to base-class: */
    1518     UIGChooserItem::resizeEvent(pEvent);
     1518    UIChooserItem::resizeEvent(pEvent);
    15191519
    15201520    /* What is the new geometry? */
     
    15291529}
    15301530
    1531 void UIGChooserItemGroup::hoverMoveEvent(QGraphicsSceneHoverEvent *pEvent)
     1531void UIChooserItemGroup::hoverMoveEvent(QGraphicsSceneHoverEvent *pEvent)
    15321532{
    15331533    /* Skip if hovered: */
     
    15451545
    15461546    /* Call to base-class: */
    1547     UIGChooserItem::hoverMoveEvent(pEvent);
     1547    UIChooserItem::hoverMoveEvent(pEvent);
    15481548
    15491549    /* Update linked values: */
     
    15511551}
    15521552
    1553 void UIGChooserItemGroup::hoverLeaveEvent(QGraphicsSceneHoverEvent *pEvent)
     1553void UIChooserItemGroup::hoverLeaveEvent(QGraphicsSceneHoverEvent *pEvent)
    15541554{
    15551555    /* Skip if not hovered: */
     
    15581558
    15591559    /* Call to base-class: */
    1560     UIGChooserItem::hoverLeaveEvent(pEvent);
     1560    UIChooserItem::hoverLeaveEvent(pEvent);
    15611561
    15621562    /* Update linked values: */
     
    15641564}
    15651565
    1566 void UIGChooserItemGroup::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget* /* pWidget = 0 */)
     1566void UIChooserItemGroup::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget* /* pWidget = 0 */)
    15671567{
    15681568    /* Setup: */
     
    15761576}
    15771577
    1578 void UIGChooserItemGroup::paintBackground(QPainter *pPainter, const QRect &rect)
     1578void UIChooserItemGroup::paintBackground(QPainter *pPainter, const QRect &rect)
    15791579{
    15801580    /* Save painter: */
     
    17051705}
    17061706
    1707 void UIGChooserItemGroup::paintHeader(QPainter *pPainter, const QRect &rect)
     1707void UIChooserItemGroup::paintHeader(QPainter *pPainter, const QRect &rect)
    17081708{
    17091709    /* Not for main root: */
     
    18381838}
    18391839
    1840 void UIGChooserItemGroup::updateAnimationParameters()
     1840void UIChooserItemGroup::updateAnimationParameters()
    18411841{
    18421842    /* Only for item with button: */
     
    18511851}
    18521852
    1853 void UIGChooserItemGroup::setAdditionalHeight(int iAdditionalHeight)
     1853void UIChooserItemGroup::setAdditionalHeight(int iAdditionalHeight)
    18541854{
    18551855    m_iAdditionalHeight = iAdditionalHeight;
     
    18581858}
    18591859
    1860 int UIGChooserItemGroup::additionalHeight() const
     1860int UIChooserItemGroup::additionalHeight() const
    18611861{
    18621862    return m_iAdditionalHeight;
    18631863}
    18641864
    1865 UIGroupRenameEditor::UIGroupRenameEditor(const QString &strName, UIGChooserItem *pParent)
     1865UIEditorGroupRename::UIEditorGroupRename(const QString &strName, UIChooserItem *pParent)
    18661866    : m_pParent(pParent)
    18671867    , m_pLineEdit(0)
     
    18811881}
    18821882
    1883 QString UIGroupRenameEditor::text() const
     1883QString UIEditorGroupRename::text() const
    18841884{
    18851885    return m_pLineEdit->text();
    18861886}
    18871887
    1888 void UIGroupRenameEditor::setText(const QString &strText)
     1888void UIEditorGroupRename::setText(const QString &strText)
    18891889{
    18901890    m_pLineEdit->setText(strText);
    18911891}
    18921892
    1893 void UIGroupRenameEditor::setFont(const QFont &font)
     1893void UIEditorGroupRename::setFont(const QFont &font)
    18941894{
    18951895    QWidget::setFont(font);
     
    18971897}
    18981898
    1899 void UIGroupRenameEditor::setFocus()
     1899void UIEditorGroupRename::setFocus()
    19001900{
    19011901    m_pLineEdit->setFocus();
    19021902}
    19031903
    1904 bool UIGroupRenameEditor::eventFilter(QObject *pWatched, QEvent *pEvent)
     1904bool UIEditorGroupRename::eventFilter(QObject *pWatched, QEvent *pEvent)
    19051905{
    19061906    /* Process only events sent to line-edit: */
     
    19321932}
    19331933
    1934 void UIGroupRenameEditor::handleContextMenuEvent(QContextMenuEvent *pContextMenuEvent)
     1934void UIEditorGroupRename::handleContextMenuEvent(QContextMenuEvent *pContextMenuEvent)
    19351935{
    19361936    /* Prepare variables: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserItemGroup class declaration.
     3 * VBox Qt GUI - UIChooserItemGroup class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGChooserItemGroup_h__
    19 #define __UIGChooserItemGroup_h__
     18#ifndef __UIChooserItemGroup_h__
     19#define __UIChooserItemGroup_h__
    2020
    2121/* Qt includes: */
     
    2424
    2525/* GUI includes: */
    26 #include "UIGChooserItem.h"
     26#include "UIChooserItem.h"
    2727
    2828/* Forward declarations: */
     
    3232class UIGraphicsButton;
    3333class UIGraphicsRotatorButton;
    34 class UIGroupRenameEditor;
     34class UIEditorGroupRename;
    3535
    3636/* Graphics group-item
    3737 * for graphics selector model/view architecture: */
    38 class UIGChooserItemGroup : public UIGChooserItem
     38class UIChooserItemGroup : public UIChooserItem
    3939{
    4040    Q_OBJECT;
     
    5353
    5454    /* Graphics-item type: */
    55     enum { Type = UIGChooserItemType_Group };
     55    enum { Type = UIChooserItemType_Group };
    5656    int type() const { return Type; }
    5757
    5858    /* Constructor (main-root-item): */
    59     UIGChooserItemGroup(QGraphicsScene *pScene);
     59    UIChooserItemGroup(QGraphicsScene *pScene);
    6060    /* Constructor (temporary main-root-item/root-item copy): */
    61     UIGChooserItemGroup(QGraphicsScene *pScene, UIGChooserItemGroup *pCopyFrom, bool fMainRoot);
     61    UIChooserItemGroup(QGraphicsScene *pScene, UIChooserItemGroup *pCopyFrom, bool fMainRoot);
    6262    /* Constructor (new non-root-item): */
    63     UIGChooserItemGroup(UIGChooserItem *pParent, const QString &strName, bool fOpened = false, int iPosition  = -1);
     63    UIChooserItemGroup(UIChooserItem *pParent, const QString &strName, bool fOpened = false, int iPosition  = -1);
    6464    /* Constructor (new non-root-item copy): */
    65     UIGChooserItemGroup(UIGChooserItem *pParent, UIGChooserItemGroup *pCopyFrom, int iPosition = -1);
     65    UIChooserItemGroup(UIChooserItem *pParent, UIChooserItemGroup *pCopyFrom, int iPosition = -1);
    6666    /* Destructor: */
    67     ~UIGChooserItemGroup();
     67    ~UIChooserItemGroup();
    6868
    6969    /* API: Basic stuff: */
     
    116116    /* Helpers: Prepare stuff: */
    117117    void prepare();
    118     static void copyContent(UIGChooserItemGroup *pFrom, UIGChooserItemGroup *pTo);
     118    static void copyContent(UIChooserItemGroup *pFrom, UIChooserItemGroup *pTo);
    119119
    120120    /* Helpers: Update stuff: */
     
    137137
    138138    /* Helpers: Children stuff: */
    139     void addItem(UIGChooserItem *pItem, int iPosition);
    140     void removeItem(UIGChooserItem *pItem);
    141     void setItems(const QList<UIGChooserItem*> &items, UIGChooserItemType type);
    142     QList<UIGChooserItem*> items(UIGChooserItemType type = UIGChooserItemType_Any) const;
    143     bool hasItems(UIGChooserItemType type = UIGChooserItemType_Any) const;
    144     void clearItems(UIGChooserItemType type = UIGChooserItemType_Any);
     139    void addItem(UIChooserItem *pItem, int iPosition);
     140    void removeItem(UIChooserItem *pItem);
     141    void setItems(const QList<UIChooserItem*> &items, UIChooserItemType type);
     142    QList<UIChooserItem*> items(UIChooserItemType type = UIChooserItemType_Any) const;
     143    bool hasItems(UIChooserItemType type = UIChooserItemType_Any) const;
     144    void clearItems(UIChooserItemType type = UIChooserItemType_Any);
    145145    void updateAll(const QString &strId);
    146146    void removeAll(const QString &strId);
    147     UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags);
    148     UIGChooserItemMachine* firstMachineItem();
     147    UIChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags);
     148    UIChooserItemMachine* firstMachineItem();
    149149    void sortItems();
    150150
     
    168168    QPixmap toPixmap();
    169169    bool isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const;
    170     void processDrop(QGraphicsSceneDragDropEvent *pEvent, UIGChooserItem *pFromWho, DragToken where);
     170    void processDrop(QGraphicsSceneDragDropEvent *pEvent, UIChooserItem *pFromWho, DragToken where);
    171171    void resetDragToken();
    172172    QMimeData* createMimeData();
     
    200200    UIGraphicsButton *m_pEnterButton;
    201201    UIGraphicsButton *m_pExitButton;
    202     UIGroupRenameEditor *m_pNameEditorWidget;
     202    UIEditorGroupRename *m_pNameEditorWidget;
    203203    QGraphicsProxyWidget *m_pNameEditor;
    204     QList<UIGChooserItem*> m_groupItems;
    205     QList<UIGChooserItem*> m_machineItems;
     204    QList<UIChooserItem*> m_groupItems;
     205    QList<UIChooserItem*> m_machineItems;
    206206    int m_iAdditionalHeight;
    207207    int m_iCornerRadius;
     
    229229};
    230230
    231 class UIGroupRenameEditor : public QWidget
     231class UIEditorGroupRename : public QWidget
    232232{
    233233    Q_OBJECT;
     
    241241
    242242    /* Constructor: */
    243     UIGroupRenameEditor(const QString &strName, UIGChooserItem *pParent);
     243    UIEditorGroupRename(const QString &strName, UIChooserItem *pParent);
    244244
    245245    /* API: Text stuff: */
     
    264264
    265265    /* Variables: */
    266     UIGChooserItem *m_pParent;
     266    UIChooserItem *m_pParent;
    267267    QLineEdit *m_pLineEdit;
    268268    QMenu *m_pTemporaryMenu;
    269269};
    270270
    271 #endif /* __UIGChooserItemGroup_h__ */
    272 
     271#endif /* __UIChooserItemGroup_h__ */
     272
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserItemMachine class implementation.
     3 * VBox Qt GUI - UIChooserItemMachine class implementation.
    44 */
    55
     
    2727/* GUI includes: */
    2828# include "VBoxGlobal.h"
    29 # include "UIGChooserItemGroup.h"
    30 # include "UIGChooserItemMachine.h"
    31 # include "UIGChooserModel.h"
     29# include "UIChooserItemGroup.h"
     30# include "UIChooserItemMachine.h"
     31# include "UIChooserModel.h"
    3232# include "UIGraphicsToolBar.h"
    3333# include "UIActionPoolSelector.h"
     
    3535# include "UIIconPool.h"
    3636# include "UIImageTools.h"
    37 # include "UISelectorWindow.h"
     37# include "UIVirtualBoxManager.h"
    3838
    3939/* COM includes: */
     
    4545
    4646/* static */
    47 QString UIGChooserItemMachine::className() { return "UIGChooserItemMachine"; }
    48 
    49 UIGChooserItemMachine::UIGChooserItemMachine(UIGChooserItem *pParent,
     47QString UIChooserItemMachine::className() { return "UIChooserItemMachine"; }
     48
     49UIChooserItemMachine::UIChooserItemMachine(UIChooserItem *pParent,
    5050                                             const CMachine &machine,
    5151                                             int iPosition /* = -1 */)
    52     : UIGChooserItem(pParent, pParent->isTemporary())
    53     , UIVMItem(machine)
     52    : UIChooserItem(pParent, pParent->isTemporary())
     53    , UIVirtualMachineItem(machine)
    5454{
    5555    /* Prepare: */
     
    6262
    6363    /* Configure connections: */
    64     connect(gpSelectorWindow, &UISelectorWindow::sigWindowRemapped,
    65             this, &UIGChooserItemMachine::sltHandleWindowRemapped);
     64    connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped,
     65            this, &UIChooserItemMachine::sltHandleWindowRemapped);
    6666
    6767    /* Init: */
     
    7474}
    7575
    76 UIGChooserItemMachine::UIGChooserItemMachine(UIGChooserItem *pParent,
    77                                              UIGChooserItemMachine *pCopyFrom,
     76UIChooserItemMachine::UIChooserItemMachine(UIChooserItem *pParent,
     77                                             UIChooserItemMachine *pCopyFrom,
    7878                                             int iPosition /* = -1 */)
    79     : UIGChooserItem(pParent, pParent->isTemporary())
    80     , UIVMItem(pCopyFrom->machine())
     79    : UIChooserItem(pParent, pParent->isTemporary())
     80    , UIVirtualMachineItem(pCopyFrom->machine())
    8181{
    8282    /* Prepare: */
     
    8989
    9090    /* Configure connections: */
    91     connect(gpSelectorWindow, &UISelectorWindow::sigWindowRemapped,
    92             this, &UIGChooserItemMachine::sltHandleWindowRemapped);
     91    connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped,
     92            this, &UIChooserItemMachine::sltHandleWindowRemapped);
    9393
    9494    /* Init: */
     
    101101}
    102102
    103 UIGChooserItemMachine::~UIGChooserItemMachine()
     103UIChooserItemMachine::~UIChooserItemMachine()
    104104{
    105105    /* If that item is focused: */
     
    127127}
    128128
    129 QString UIGChooserItemMachine::name() const
    130 {
    131     return UIVMItem::name();
    132 }
    133 
    134 QString UIGChooserItemMachine::description() const
     129QString UIChooserItemMachine::name() const
     130{
     131    return UIVirtualMachineItem::name();
     132}
     133
     134QString UIChooserItemMachine::description() const
    135135{
    136136    return m_strDescription;
    137137}
    138138
    139 QString UIGChooserItemMachine::fullName() const
     139QString UIChooserItemMachine::fullName() const
    140140{
    141141    /* Get full parent name, append with '/' if not yet appended: */
     
    148148}
    149149
    150 QString UIGChooserItemMachine::definition() const
     150QString UIChooserItemMachine::definition() const
    151151{
    152152    return QString("m=%1").arg(name());
    153153}
    154154
    155 bool UIGChooserItemMachine::isLockedMachine() const
     155bool UIChooserItemMachine::isLockedMachine() const
    156156{
    157157    KMachineState state = machineState();
     
    163163
    164164/* static */
    165 void UIGChooserItemMachine::enumerateMachineItems(const QList<UIGChooserItem*> &il,
    166                                                   QList<UIGChooserItemMachine*> &ol,
     165void UIChooserItemMachine::enumerateMachineItems(const QList<UIChooserItem*> &il,
     166                                                  QList<UIChooserItemMachine*> &ol,
    167167                                                  int iEnumerationFlags /* = 0 */)
    168168{
    169169    /* Enumerate all the passed items: */
    170     foreach (UIGChooserItem *pItem, il)
     170    foreach (UIChooserItem *pItem, il)
    171171    {
    172172        /* If that is machine-item: */
    173         if (pItem->type() == UIGChooserItemType_Machine)
     173        if (pItem->type() == UIChooserItemType_Machine)
    174174        {
    175175            /* Get the iterated machine-item: */
    176             UIGChooserItemMachine *pMachineItem = pItem->toMachineItem();
     176            UIChooserItemMachine *pMachineItem = pItem->toMachineItem();
    177177            /* Skip if exactly this item is already enumerated: */
    178178            if (ol.contains(pMachineItem))
    179179                continue;
    180180            /* Skip if item with same ID is already enumerated but we need unique: */
    181             if ((iEnumerationFlags & UIGChooserItemMachineEnumerationFlag_Unique) &&
     181            if ((iEnumerationFlags & UIChooserItemMachineEnumerationFlag_Unique) &&
    182182                contains(ol, pMachineItem))
    183183                continue;
    184184            /* Skip if this item is accessible and we no need it: */
    185             if ((iEnumerationFlags & UIGChooserItemMachineEnumerationFlag_Inaccessible) &&
     185            if ((iEnumerationFlags & UIChooserItemMachineEnumerationFlag_Inaccessible) &&
    186186                pMachineItem->accessible())
    187187                continue;
     
    190190        }
    191191        /* If that is group-item: */
    192         else if (pItem->type() == UIGChooserItemType_Group)
     192        else if (pItem->type() == UIChooserItemType_Group)
    193193        {
    194194            /* Enumerate all the machine-items recursively: */
    195             enumerateMachineItems(pItem->items(UIGChooserItemType_Machine), ol, iEnumerationFlags);
     195            enumerateMachineItems(pItem->items(UIChooserItemType_Machine), ol, iEnumerationFlags);
    196196            /* Enumerate all the group-items recursively: */
    197             enumerateMachineItems(pItem->items(UIGChooserItemType_Group), ol, iEnumerationFlags);
     197            enumerateMachineItems(pItem->items(UIChooserItemType_Group), ol, iEnumerationFlags);
    198198        }
    199199    }
    200200}
    201201
    202 void UIGChooserItemMachine::sltHandleWindowRemapped()
     202void UIChooserItemMachine::sltHandleWindowRemapped()
    203203{
    204204    /* Recache and update pixmaps: */
     
    207207}
    208208
    209 QVariant UIGChooserItemMachine::data(int iKey) const
     209QVariant UIChooserItemMachine::data(int iKey) const
    210210{
    211211    /* Provide other members with required data: */
     
    233233}
    234234
    235 void UIGChooserItemMachine::updatePixmaps()
     235void UIChooserItemMachine::updatePixmaps()
    236236{
    237237    /* Update pixmap: */
     
    242242}
    243243
    244 void UIGChooserItemMachine::updatePixmap()
     244void UIChooserItemMachine::updatePixmap()
    245245{
    246246    /* Get new pixmap and pixmap-size: */
     
    261261}
    262262
    263 void UIGChooserItemMachine::updateStatePixmap()
     263void UIChooserItemMachine::updateStatePixmap()
    264264{
    265265    /* Determine the icon metric: */
     
    270270    AssertReturnVoid(!stateIcon.isNull());
    271271    const QSize statePixmapSize = QSize(iIconMetric, iIconMetric);
    272     const QPixmap statePixmap = stateIcon.pixmap(gpSelectorWindow->windowHandle(), statePixmapSize);
     272    const QPixmap statePixmap = stateIcon.pixmap(gpManager->windowHandle(), statePixmapSize);
    273273    /* Update linked values: */
    274274    if (m_statePixmapSize != statePixmapSize)
     
    284284}
    285285
    286 void UIGChooserItemMachine::updateName()
     286void UIChooserItemMachine::updateName()
    287287{
    288288    /* Get new name: */
     
    299299}
    300300
    301 void UIGChooserItemMachine::updateSnapshotName()
     301void UIChooserItemMachine::updateSnapshotName()
    302302{
    303303    /* Get new snapshot-name: */
     
    314314}
    315315
    316 void UIGChooserItemMachine::updateFirstRowMaximumWidth()
     316void UIChooserItemMachine::updateFirstRowMaximumWidth()
    317317{
    318318    /* Prepare variables: */
     
    343343}
    344344
    345 void UIGChooserItemMachine::updateMinimumNameWidth()
     345void UIChooserItemMachine::updateMinimumNameWidth()
    346346{
    347347    /* Calculate new minimum name width: */
     
    359359}
    360360
    361 void UIGChooserItemMachine::updateMinimumSnapshotNameWidth()
     361void UIChooserItemMachine::updateMinimumSnapshotNameWidth()
    362362{
    363363    /* Calculate new minimum snapshot-name width: */
     
    383383}
    384384
    385 void UIGChooserItemMachine::updateMaximumNameWidth()
     385void UIChooserItemMachine::updateMaximumNameWidth()
    386386{
    387387    /* Calculate new maximum name width: */
     
    405405}
    406406
    407 void UIGChooserItemMachine::updateMaximumSnapshotNameWidth()
     407void UIChooserItemMachine::updateMaximumSnapshotNameWidth()
    408408{
    409409    /* Prepare variables: */
     
    423423}
    424424
    425 void UIGChooserItemMachine::updateVisibleName()
     425void UIChooserItemMachine::updateVisibleName()
    426426{
    427427    /* Prepare variables: */
     
    446446}
    447447
    448 void UIGChooserItemMachine::updateVisibleSnapshotName()
     448void UIChooserItemMachine::updateVisibleSnapshotName()
    449449{
    450450    /* Prepare variables: */
     
    471471}
    472472
    473 void UIGChooserItemMachine::updateStateText()
     473void UIChooserItemMachine::updateStateText()
    474474{
    475475    /* Get new state-text and state-text size: */
     
    490490}
    491491
    492 void UIGChooserItemMachine::retranslateUi()
     492void UIChooserItemMachine::retranslateUi()
    493493{
    494494    /* Update description: */
     
    502502}
    503503
    504 void UIGChooserItemMachine::startEditing()
     504void UIChooserItemMachine::startEditing()
    505505{
    506506    AssertMsgFailed(("Machine graphics item do NOT support editing yet!"));
    507507}
    508508
    509 void UIGChooserItemMachine::updateToolTip()
     509void UIChooserItemMachine::updateToolTip()
    510510{
    511511    setToolTip(toolTipText());
    512512}
    513513
    514 void UIGChooserItemMachine::addItem(UIGChooserItem*, int)
     514void UIChooserItemMachine::addItem(UIChooserItem*, int)
    515515{
    516516    AssertMsgFailed(("Machine graphics item do NOT support children!"));
    517517}
    518518
    519 void UIGChooserItemMachine::removeItem(UIGChooserItem*)
     519void UIChooserItemMachine::removeItem(UIChooserItem*)
    520520{
    521521    AssertMsgFailed(("Machine graphics item do NOT support children!"));
    522522}
    523523
    524 void UIGChooserItemMachine::setItems(const QList<UIGChooserItem*>&, UIGChooserItemType)
     524void UIChooserItemMachine::setItems(const QList<UIChooserItem*>&, UIChooserItemType)
    525525{
    526526    AssertMsgFailed(("Machine graphics item do NOT support children!"));
    527527}
    528528
    529 QList<UIGChooserItem*> UIGChooserItemMachine::items(UIGChooserItemType) const
     529QList<UIChooserItem*> UIChooserItemMachine::items(UIChooserItemType) const
    530530{
    531531    AssertMsgFailed(("Machine graphics item do NOT support children!"));
    532     return QList<UIGChooserItem*>();
    533 }
    534 
    535 bool UIGChooserItemMachine::hasItems(UIGChooserItemType) const
     532    return QList<UIChooserItem*>();
     533}
     534
     535bool UIChooserItemMachine::hasItems(UIChooserItemType) const
    536536{
    537537    AssertMsgFailed(("Machine graphics item do NOT support children!"));
     
    539539}
    540540
    541 void UIGChooserItemMachine::clearItems(UIGChooserItemType)
     541void UIChooserItemMachine::clearItems(UIChooserItemType)
    542542{
    543543    AssertMsgFailed(("Machine graphics item do NOT support children!"));
    544544}
    545545
    546 void UIGChooserItemMachine::updateAll(const QString &strId)
     546void UIChooserItemMachine::updateAll(const QString &strId)
    547547{
    548548    /* Skip other ids: */
     
    563563}
    564564
    565 void UIGChooserItemMachine::removeAll(const QString &strId)
     565void UIChooserItemMachine::removeAll(const QString &strId)
    566566{
    567567    /* Skip wrong id: */
     
    580580}
    581581
    582 UIGChooserItem* UIGChooserItemMachine::searchForItem(const QString &strSearchTag, int iItemSearchFlags)
     582UIChooserItem* UIChooserItemMachine::searchForItem(const QString &strSearchTag, int iItemSearchFlags)
    583583{
    584584    /* Ignoring if we are not searching for the machine-item? */
    585     if (!(iItemSearchFlags & UIGChooserItemSearchFlag_Machine))
     585    if (!(iItemSearchFlags & UIChooserItemSearchFlag_Machine))
    586586        return 0;
    587587
    588588    /* Are we searching by the exact name? */
    589     if (iItemSearchFlags & UIGChooserItemSearchFlag_ExactName)
     589    if (iItemSearchFlags & UIChooserItemSearchFlag_ExactName)
    590590    {
    591591        /* Exact name doesn't match? */
     
    605605}
    606606
    607 UIGChooserItemMachine* UIGChooserItemMachine::firstMachineItem()
     607UIChooserItemMachine* UIChooserItemMachine::firstMachineItem()
    608608{
    609609    return this;
    610610}
    611611
    612 void UIGChooserItemMachine::sortItems()
     612void UIChooserItemMachine::sortItems()
    613613{
    614614    AssertMsgFailed(("Machine graphics item do NOT support children!"));
    615615}
    616616
    617 void UIGChooserItemMachine::updateLayout()
     617void UIChooserItemMachine::updateLayout()
    618618{
    619619    /* Update tool-bar: */
     
    644644}
    645645
    646 int UIGChooserItemMachine::minimumWidthHint() const
     646int UIChooserItemMachine::minimumWidthHint() const
    647647{
    648648    /* Prepare variables: */
     
    677677}
    678678
    679 int UIGChooserItemMachine::minimumHeightHint() const
     679int UIChooserItemMachine::minimumHeightHint() const
    680680{
    681681    /* Prepare variables: */
     
    706706}
    707707
    708 QSizeF UIGChooserItemMachine::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const
     708QSizeF UIChooserItemMachine::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const
    709709{
    710710    /* If Qt::MinimumSize requested: */
     
    712712        return QSizeF(minimumWidthHint(), minimumHeightHint());
    713713    /* Else call to base-class: */
    714     return UIGChooserItem::sizeHint(which, constraint);
    715 }
    716 
    717 QPixmap UIGChooserItemMachine::toPixmap()
     714    return UIChooserItem::sizeHint(which, constraint);
     715}
     716
     717QPixmap UIChooserItemMachine::toPixmap()
    718718{
    719719    /* Ask item to paint itself into pixmap: */
     
    727727}
    728728
    729 bool UIGChooserItemMachine::isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const
     729bool UIChooserItemMachine::isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const
    730730{
    731731    /* No drops while saving groups: */
     
    744744        return false;
    745745    /* Else we should try to cast mime to known classes: */
    746     if (pMimeData->hasFormat(UIGChooserItemMachine::className()))
     746    if (pMimeData->hasFormat(UIChooserItemMachine::className()))
    747747    {
    748748        /* Make sure passed item id is not ours: */
    749         const UIGChooserItemMimeData *pCastedMimeData = qobject_cast<const UIGChooserItemMimeData*>(pMimeData);
    750         AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UIGChooserItemMimeData!"));
    751         UIGChooserItem *pItem = pCastedMimeData->item();
    752         UIGChooserItemMachine *pMachineItem = pItem->toMachineItem();
     749        const UIChooserItemMimeData *pCastedMimeData = qobject_cast<const UIChooserItemMimeData*>(pMimeData);
     750        AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UIChooserItemMimeData!"));
     751        UIChooserItem *pItem = pCastedMimeData->item();
     752        UIChooserItemMachine *pMachineItem = pItem->toMachineItem();
    753753        /* Make sure passed machine is mutable: */
    754754        if (pMachineItem->isLockedMachine())
     
    760760}
    761761
    762 void UIGChooserItemMachine::processDrop(QGraphicsSceneDragDropEvent *pEvent, UIGChooserItem *pFromWho, DragToken where)
     762void UIChooserItemMachine::processDrop(QGraphicsSceneDragDropEvent *pEvent, UIChooserItem *pFromWho, DragToken where)
    763763{
    764764    /* Get mime: */
     
    768768    Q_UNUSED(pFromWho);
    769769    Q_UNUSED(where);
    770     if (pMime->hasFormat(UIGChooserItemMachine::className()))
     770    if (pMime->hasFormat(UIChooserItemMachine::className()))
    771771    {
    772772        switch (pEvent->proposedAction())
     
    776776            {
    777777                /* Remember scene: */
    778                 UIGChooserModel *pModel = model();
     778                UIChooserModel *pModel = model();
    779779
    780780                /* Get passed item: */
    781                 const UIGChooserItemMimeData *pCastedMime = qobject_cast<const UIGChooserItemMimeData*>(pMime);
    782                 AssertMsg(pCastedMime, ("Can't cast passed mime-data to UIGChooserItemMimeData!"));
    783                 UIGChooserItem *pItem = pCastedMime->item();
     781                const UIChooserItemMimeData *pCastedMime = qobject_cast<const UIChooserItemMimeData*>(pMime);
     782                AssertMsg(pCastedMime, ("Can't cast passed mime-data to UIChooserItemMimeData!"));
     783                UIChooserItem *pItem = pCastedMime->item();
    784784
    785785                /* Group passed item with current item into the new group: */
    786                 UIGChooserItemGroup *pNewGroupItem = new UIGChooserItemGroup(parentItem(),
    787                                                                              UIGChooserModel::uniqueGroupName(parentItem()),
     786                UIChooserItemGroup *pNewGroupItem = new UIChooserItemGroup(parentItem(),
     787                                                                             UIChooserModel::uniqueGroupName(parentItem()),
    788788                                                                             true);
    789                 new UIGChooserItemMachine(pNewGroupItem, this);
    790                 new UIGChooserItemMachine(pNewGroupItem, pItem->toMachineItem());
     789                new UIChooserItemMachine(pNewGroupItem, this);
     790                new UIChooserItemMachine(pNewGroupItem, pItem->toMachineItem());
    791791
    792792                /* If proposed action is 'move': */
     
    813813}
    814814
    815 void UIGChooserItemMachine::resetDragToken()
     815void UIChooserItemMachine::resetDragToken()
    816816{
    817817    /* Reset drag token for this item: */
     
    823823}
    824824
    825 QMimeData* UIGChooserItemMachine::createMimeData()
    826 {
    827     return new UIGChooserItemMimeData(this);
    828 }
    829 
    830 void UIGChooserItemMachine::showEvent(QShowEvent *pEvent)
     825QMimeData* UIChooserItemMachine::createMimeData()
     826{
     827    return new UIChooserItemMimeData(this);
     828}
     829
     830void UIChooserItemMachine::showEvent(QShowEvent *pEvent)
    831831{
    832832    /* Call to base-class: */
    833     UIGChooserItem::showEvent(pEvent);
     833    UIChooserItem::showEvent(pEvent);
    834834
    835835    /* Recache and update pixmaps: */
     
    838838}
    839839
    840 void UIGChooserItemMachine::resizeEvent(QGraphicsSceneResizeEvent *pEvent)
     840void UIChooserItemMachine::resizeEvent(QGraphicsSceneResizeEvent *pEvent)
    841841{
    842842    /* Call to base-class: */
    843     UIGChooserItem::resizeEvent(pEvent);
     843    UIChooserItem::resizeEvent(pEvent);
    844844
    845845    /* What is the new geometry? */
     
    854854}
    855855
    856 void UIGChooserItemMachine::mousePressEvent(QGraphicsSceneMouseEvent *pEvent)
     856void UIChooserItemMachine::mousePressEvent(QGraphicsSceneMouseEvent *pEvent)
    857857{
    858858    /* Call to base-class: */
    859     UIGChooserItem::mousePressEvent(pEvent);
     859    UIChooserItem::mousePressEvent(pEvent);
    860860    /* No drag for inaccessible: */
    861861    if (!accessible())
     
    863863}
    864864
    865 void UIGChooserItemMachine::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget* /* pWidget = 0 */)
     865void UIChooserItemMachine::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget* /* pWidget = 0 */)
    866866{
    867867    /* Setup: */
     
    875875}
    876876
    877 void UIGChooserItemMachine::paintDecorations(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)
     877void UIChooserItemMachine::paintDecorations(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)
    878878{
    879879    /* Prepare variables: */
     
    887887}
    888888
    889 void UIGChooserItemMachine::paintBackground(QPainter *pPainter, const QRect &rect)
     889void UIChooserItemMachine::paintBackground(QPainter *pPainter, const QRect &rect)
    890890{
    891891    /* Save painter: */
     
    947947}
    948948
    949 void UIGChooserItemMachine::paintFrameRectangle(QPainter *pPainter, const QRect &rect)
     949void UIChooserItemMachine::paintFrameRectangle(QPainter *pPainter, const QRect &rect)
    950950{
    951951    /* Only chosen and/or hovered item should have a frame: */
     
    964964}
    965965
    966 void UIGChooserItemMachine::paintMachineInfo(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)
     966void UIChooserItemMachine::paintMachineInfo(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)
    967967{
    968968    /* Prepare variables: */
     
    11291129}
    11301130
    1131 void UIGChooserItemMachine::prepare()
     1131void UIChooserItemMachine::prepare()
    11321132{
    11331133    /* Tool-bar/buttons: */
     
    12101210
    12111211/* static */
    1212 bool UIGChooserItemMachine::contains(const QList<UIGChooserItemMachine*> &list, UIGChooserItemMachine *pItem)
     1212bool UIChooserItemMachine::contains(const QList<UIChooserItemMachine*> &list, UIChooserItemMachine *pItem)
    12131213{
    12141214    /* Check if passed list contains passed machine-item id: */
    1215     foreach (UIGChooserItemMachine *pIteratedItem, list)
     1215    foreach (UIChooserItemMachine *pIteratedItem, list)
    12161216        if (pIteratedItem->id() == pItem->id())
    12171217            return true;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserItemMachine class declaration.
     3 * VBox Qt GUI - UIChooserItemMachine class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGChooserItemMachine_h__
    19 #define __UIGChooserItemMachine_h__
     18#ifndef __UIChooserItemMachine_h__
     19#define __UIChooserItemMachine_h__
    2020
    2121/* GUI includes: */
    22 #include "UIVMItem.h"
    23 #include "UIGChooserItem.h"
     22#include "UIVirtualMachineItem.h"
     23#include "UIChooserItem.h"
    2424
    2525/* Forward declarations: */
     
    2929
    3030/* Machine-item enumeration flags: */
    31 enum UIGChooserItemMachineEnumerationFlag
     31enum UIChooserItemMachineEnumerationFlag
    3232{
    33     UIGChooserItemMachineEnumerationFlag_Unique       = RT_BIT(0),
    34     UIGChooserItemMachineEnumerationFlag_Inaccessible = RT_BIT(1)
     33    UIChooserItemMachineEnumerationFlag_Unique       = RT_BIT(0),
     34    UIChooserItemMachineEnumerationFlag_Inaccessible = RT_BIT(1)
    3535};
    3636
    3737/* Graphics machine item
    3838 * for graphics selector model/view architecture: */
    39 class UIGChooserItemMachine : public UIGChooserItem, public UIVMItem
     39class UIChooserItemMachine : public UIChooserItem, public UIVirtualMachineItem
    4040{
    4141    Q_OBJECT;
     
    4747
    4848    /* Graphics-item type: */
    49     enum { Type = UIGChooserItemType_Machine };
     49    enum { Type = UIChooserItemType_Machine };
    5050    int type() const { return Type; }
    5151
    5252    /* Constructor (new item): */
    53     UIGChooserItemMachine(UIGChooserItem *pParent, const CMachine &machine, int iPosition = -1);
     53    UIChooserItemMachine(UIChooserItem *pParent, const CMachine &machine, int iPosition = -1);
    5454    /* Constructor (new item copy): */
    55     UIGChooserItemMachine(UIGChooserItem *pParent, UIGChooserItemMachine *pCopyFrom, int iPosition = -1);
     55    UIChooserItemMachine(UIChooserItem *pParent, UIChooserItemMachine *pCopyFrom, int iPosition = -1);
    5656    /* Destructor: */
    57     ~UIGChooserItemMachine();
     57    ~UIChooserItemMachine();
    5858
    5959    /* API: Basic stuff: */
     
    6565
    6666    /* API: Machine-item enumeration stuff: */
    67     static void enumerateMachineItems(const QList<UIGChooserItem*> &il,
    68                                       QList<UIGChooserItemMachine*> &ol,
     67    static void enumerateMachineItems(const QList<UIChooserItem*> &il,
     68                                      QList<UIChooserItemMachine*> &ol,
    6969                                      int iEnumerationFlags = 0);
    7070
     
    119119
    120120    /* Helpers: Children stuff: */
    121     void addItem(UIGChooserItem *pItem, int iPosition);
    122     void removeItem(UIGChooserItem *pItem);
    123     void setItems(const QList<UIGChooserItem*> &items, UIGChooserItemType type);
    124     QList<UIGChooserItem*> items(UIGChooserItemType type) const;
    125     bool hasItems(UIGChooserItemType type) const;
    126     void clearItems(UIGChooserItemType type);
     121    void addItem(UIChooserItem *pItem, int iPosition);
     122    void removeItem(UIChooserItem *pItem);
     123    void setItems(const QList<UIChooserItem*> &items, UIChooserItemType type);
     124    QList<UIChooserItem*> items(UIChooserItemType type) const;
     125    bool hasItems(UIChooserItemType type) const;
     126    void clearItems(UIChooserItemType type);
    127127    void updateAll(const QString &strId);
    128128    void removeAll(const QString &strId);
    129     UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags);
    130     UIGChooserItemMachine* firstMachineItem();
     129    UIChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags);
     130    UIChooserItemMachine* firstMachineItem();
    131131    void sortItems();
    132132
     
    140140    QPixmap toPixmap();
    141141    bool isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const;
    142     void processDrop(QGraphicsSceneDragDropEvent *pEvent, UIGChooserItem *pFromWho, DragToken where);
     142    void processDrop(QGraphicsSceneDragDropEvent *pEvent, UIChooserItem *pFromWho, DragToken where);
    143143    void resetDragToken();
    144144    QMimeData* createMimeData();
     
    164164
    165165    /* Helper: Machine-item enumeration stuff: */
    166     static bool contains(const QList<UIGChooserItemMachine*> &list,
    167                          UIGChooserItemMachine *pItem);
     166    static bool contains(const QList<UIChooserItemMachine*> &list,
     167                         UIChooserItemMachine *pItem);
    168168
    169169    /* Variables: */
     
    200200};
    201201
    202 #endif /* __UIGChooserItemMachine_h__ */
    203 
     202#endif /* __UIChooserItemMachine_h__ */
     203
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserModel class implementation.
     3 * VBox Qt GUI - UIChooserModel class implementation.
    44 */
    55
     
    3434# include "QIMessageBox.h"
    3535# include "VBoxGlobal.h"
    36 # include "UIGChooser.h"
    37 # include "UIGChooserModel.h"
    38 # include "UIGChooserItemGroup.h"
    39 # include "UIGChooserItemMachine.h"
     36# include "UIChooser.h"
     37# include "UIChooserModel.h"
     38# include "UIChooserItemGroup.h"
     39# include "UIChooserItemMachine.h"
    4040# include "UIExtraDataDefs.h"
    4141# include "UIMessageCenter.h"
    4242# include "UIExtraDataManager.h"
    4343# include "UIActionPoolSelector.h"
    44 # include "UIGChooserHandlerMouse.h"
    45 # include "UIGChooserHandlerKeyboard.h"
     44# include "UIChooserHandlerMouse.h"
     45# include "UIChooserHandlerKeyboard.h"
    4646# include "UIWizardNewVM.h"
    47 # include "UISelectorWindow.h"
     47# include "UIVirtualBoxManager.h"
    4848# include "UIVirtualBoxEventHandler.h"
    4949# include "UIModalWindowManager.h"
     
    6363
    6464
    65 UIGChooserModel::UIGChooserModel(UIGChooser *pParent)
     65UIChooserModel::UIChooserModel(UIChooser *pParent)
    6666    : QObject(pParent)
    6767    , m_pChooser(pParent)
     
    9898}
    9999
    100 UIGChooserModel::~UIGChooserModel()
     100UIChooserModel::~UIChooserModel()
    101101{
    102102    /* Cleanup handlers: */
     
    116116 }
    117117
    118 void UIGChooserModel::prepare()
     118void UIChooserModel::prepare()
    119119{
    120120    /* Load group tree: */
     
    131131}
    132132
    133 void UIGChooserModel::cleanup()
     133void UIChooserModel::cleanup()
    134134{
    135135    /* Save last selected item: */
     
    147147}
    148148
    149 UIActionPool* UIGChooserModel::actionPool() const
     149UIActionPool* UIChooserModel::actionPool() const
    150150{
    151151    return chooser()->actionPool();
    152152}
    153153
    154 QGraphicsScene* UIGChooserModel::scene() const
     154QGraphicsScene* UIChooserModel::scene() const
    155155{
    156156    return m_pScene;
    157157}
    158158
    159 QPaintDevice* UIGChooserModel::paintDevice() const
     159QPaintDevice* UIChooserModel::paintDevice() const
    160160{
    161161    if (!m_pScene || m_pScene->views().isEmpty())
     
    164164}
    165165
    166 QGraphicsItem* UIGChooserModel::itemAt(const QPointF &position, const QTransform &deviceTransform /* = QTransform() */) const
     166QGraphicsItem* UIChooserModel::itemAt(const QPointF &position, const QTransform &deviceTransform /* = QTransform() */) const
    167167{
    168168    return scene()->itemAt(position, deviceTransform);
    169169}
    170170
    171 void UIGChooserModel::updateLayout()
     171void UIChooserModel::updateLayout()
    172172{
    173173    /* No layout updates while sliding: */
     
    190190}
    191191
    192 const QList<UIGChooserItem*>& UIGChooserModel::navigationList() const
     192const QList<UIChooserItem*>& UIChooserModel::navigationList() const
    193193{
    194194    return m_navigationList;
    195195}
    196196
    197 void UIGChooserModel::removeFromNavigationList(UIGChooserItem *pItem)
     197void UIChooserModel::removeFromNavigationList(UIChooserItem *pItem)
    198198{
    199199    AssertMsg(pItem, ("Passed item is invalid!"));
     
    201201}
    202202
    203 void UIGChooserModel::updateNavigation()
     203void UIChooserModel::updateNavigation()
    204204{
    205205    m_navigationList.clear();
     
    207207}
    208208
    209 UIVMItem* UIGChooserModel::currentMachineItem() const
     209UIVirtualMachineItem* UIChooserModel::currentMachineItem() const
    210210{
    211211    /* Return first machine-item of the current-item: */
     
    213213}
    214214
    215 QList<UIVMItem*> UIGChooserModel::currentMachineItems() const
     215QList<UIVirtualMachineItem*> UIChooserModel::currentMachineItems() const
    216216{
    217217    /* Gather list of current unique machine-items: */
    218     QList<UIGChooserItemMachine*> currentMachineItemList;
    219     UIGChooserItemMachine::enumerateMachineItems(currentItems(), currentMachineItemList,
    220                                                  UIGChooserItemMachineEnumerationFlag_Unique);
     218    QList<UIChooserItemMachine*> currentMachineItemList;
     219    UIChooserItemMachine::enumerateMachineItems(currentItems(), currentMachineItemList,
     220                                                 UIChooserItemMachineEnumerationFlag_Unique);
    221221
    222222    /* Reintegrate machine-items into valid format: */
    223     QList<UIVMItem*> currentMachineList;
    224     foreach (UIGChooserItemMachine *pItem, currentMachineItemList)
     223    QList<UIVirtualMachineItem*> currentMachineList;
     224    foreach (UIChooserItemMachine *pItem, currentMachineItemList)
    225225        currentMachineList << pItem;
    226226    return currentMachineList;
    227227}
    228228
    229 UIGChooserItem* UIGChooserModel::currentItem() const
     229UIChooserItem* UIChooserModel::currentItem() const
    230230{
    231231    /* Return first of current items, if any: */
     
    233233}
    234234
    235 const QList<UIGChooserItem*>& UIGChooserModel::currentItems() const
     235const QList<UIChooserItem*>& UIChooserModel::currentItems() const
    236236{
    237237    return m_currentItems;
    238238}
    239239
    240 void UIGChooserModel::setCurrentItems(const QList<UIGChooserItem*> &items)
     240void UIChooserModel::setCurrentItems(const QList<UIChooserItem*> &items)
    241241{
    242242    /* Is there something seems to be changed? */
     
    245245
    246246    /* Remember old current-item list: */
    247     QList<UIGChooserItem*> oldCurrentItems = m_currentItems;
     247    QList<UIChooserItem*> oldCurrentItems = m_currentItems;
    248248
    249249    /* Clear current current-item list: */
     
    251251
    252252    /* Iterate over all the passed items: */
    253     foreach (UIGChooserItem *pItem, items)
     253    foreach (UIChooserItem *pItem, items)
    254254    {
    255255        /* If navigation list contains iterated-item: */
     
    268268
    269269    /* Update all the old items (they are no longer selected): */
    270     foreach (UIGChooserItem *pItem, oldCurrentItems)
     270    foreach (UIChooserItem *pItem, oldCurrentItems)
    271271        pItem->update();
    272272
    273273    /* Update all the new items (they are selected): */
    274     foreach (UIGChooserItem *pItem, m_currentItems)
     274    foreach (UIChooserItem *pItem, m_currentItems)
    275275        pItem->update();
    276276
     
    279279}
    280280
    281 void UIGChooserModel::setCurrentItem(UIGChooserItem *pItem)
     281void UIChooserModel::setCurrentItem(UIChooserItem *pItem)
    282282{
    283283    /* Call for wrapper above: */
    284     QList<UIGChooserItem*> items;
     284    QList<UIChooserItem*> items;
    285285    if (pItem)
    286286        items << pItem;
     
    291291}
    292292
    293 void UIGChooserModel::setCurrentItem(const QString &strDefinition)
     293void UIChooserModel::setCurrentItem(const QString &strDefinition)
    294294{
    295295    /* Ignore if empty definition passed: */
     
    298298
    299299    /* Parse definition: */
    300     UIGChooserItem *pItem = 0;
     300    UIChooserItem *pItem = 0;
    301301    QString strItemType = strDefinition.section('=', 0, 0);
    302302    QString strItemDescriptor = strDefinition.section('=', 1, -1);
     
    306306        /* Search for group-item with passed descriptor (name): */
    307307        pItem = mainRoot()->searchForItem(strItemDescriptor,
    308                                           UIGChooserItemSearchFlag_Group |
    309                                           UIGChooserItemSearchFlag_ExactName);
     308                                          UIChooserItemSearchFlag_Group |
     309                                          UIChooserItemSearchFlag_ExactName);
    310310    }
    311311    /* Its a machine-item definition? */
     
    318318            /* Search for machine-item with required name: */
    319319            pItem = mainRoot()->searchForItem(machine.GetName(),
    320                                               UIGChooserItemSearchFlag_Machine |
    321                                               UIGChooserItemSearchFlag_ExactName);
     320                                              UIChooserItemSearchFlag_Machine |
     321                                              UIChooserItemSearchFlag_ExactName);
    322322        }
    323323    }
     
    331331}
    332332
    333 void UIGChooserModel::unsetCurrentItem()
     333void UIChooserModel::unsetCurrentItem()
    334334{
    335335    /* Call for wrapper above: */
     
    337337}
    338338
    339 void UIGChooserModel::addToCurrentItems(UIGChooserItem *pItem)
     339void UIChooserModel::addToCurrentItems(UIChooserItem *pItem)
    340340{
    341341    /* Call for wrapper above: */
    342     setCurrentItems(QList<UIGChooserItem*>(m_currentItems) << pItem);
    343 }
    344 
    345 void UIGChooserModel::removeFromCurrentItems(UIGChooserItem *pItem)
     342    setCurrentItems(QList<UIChooserItem*>(m_currentItems) << pItem);
     343}
     344
     345void UIChooserModel::removeFromCurrentItems(UIChooserItem *pItem)
    346346{
    347347    /* Prepare filtered list: */
    348     QList<UIGChooserItem*> list(m_currentItems);
     348    QList<UIChooserItem*> list(m_currentItems);
    349349    list.removeAll(pItem);
    350350    /* Call for wrapper above: */
     
    352352}
    353353
    354 UIGChooserItem *UIGChooserModel::findClosestUnselectedItem() const
     354UIChooserItem *UIChooserModel::findClosestUnselectedItem() const
    355355{
    356356    /* Take the focus item (if any) as a starting point
    357357     * and find the closest non-selected item. */
    358     UIGChooserItem *pItem = focusItem();
     358    UIChooserItem *pItem = focusItem();
    359359    if (!pItem)
    360360        pItem = currentItem();
     
    384384}
    385385
    386 void UIGChooserModel::makeSureSomeItemIsSelected()
     386void UIChooserModel::makeSureSomeItemIsSelected()
    387387{
    388388    /* Make sure selection item list is never empty
     
    392392}
    393393
    394 void UIGChooserModel::notifyCurrentItemChanged()
     394void UIChooserModel::notifyCurrentItemChanged()
    395395{
    396396    /* Notify listeners about selection change: */
     
    398398}
    399399
    400 bool UIGChooserModel::isSingleGroupSelected() const
     400bool UIChooserModel::isSingleGroupSelected() const
    401401{
    402402    return currentItems().size() == 1 &&
    403            currentItem()->type() == UIGChooserItemType_Group;
    404 }
    405 
    406 bool UIGChooserModel::isAllItemsOfOneGroupSelected() const
     403           currentItem()->type() == UIChooserItemType_Group;
     404}
     405
     406bool UIChooserModel::isAllItemsOfOneGroupSelected() const
    407407{
    408408    /* Make sure at least one item selected: */
     
    411411
    412412    /* Determine the parent group of the first item: */
    413     UIGChooserItem *pFirstParent = currentItem()->parentItem();
     413    UIChooserItem *pFirstParent = currentItem()->parentItem();
    414414
    415415    /* Make sure this parent is not main root-item: */
     
    418418
    419419    /* Enumerate current-item set: */
    420     QSet<UIGChooserItem*> currentItemSet;
    421     foreach (UIGChooserItem *pCurrentItem, currentItems())
     420    QSet<UIChooserItem*> currentItemSet;
     421    foreach (UIChooserItem *pCurrentItem, currentItems())
    422422        currentItemSet << pCurrentItem;
    423423
    424424    /* Enumerate first parent children set: */
    425     QSet<UIGChooserItem*> firstParentItemSet;
    426     foreach (UIGChooserItem *pFirstParentItem, pFirstParent->items())
     425    QSet<UIChooserItem*> firstParentItemSet;
     426    foreach (UIChooserItem *pFirstParentItem, pFirstParent->items())
    427427        firstParentItemSet << pFirstParentItem;
    428428
     
    431431}
    432432
    433 UIGChooserItem* UIGChooserModel::focusItem() const
     433UIChooserItem* UIChooserModel::focusItem() const
    434434{
    435435    return m_pFocusItem;
    436436}
    437437
    438 void UIGChooserModel::setFocusItem(UIGChooserItem *pItem)
     438void UIChooserModel::setFocusItem(UIChooserItem *pItem)
    439439{
    440440    /* Make sure real focus unset: */
     
    446446
    447447    /* Remember old focus-item: */
    448     UIGChooserItem *pOldFocusItem = m_pFocusItem;
     448    UIChooserItem *pOldFocusItem = m_pFocusItem;
    449449
    450450    /* Set new focus-item: */
     
    462462}
    463463
    464 UIGChooserItem* UIGChooserModel::mainRoot() const
     464UIChooserItem* UIChooserModel::mainRoot() const
    465465{
    466466    return m_rootStack.first();
    467467}
    468468
    469 UIGChooserItem* UIGChooserModel::root() const
     469UIChooserItem* UIChooserModel::root() const
    470470{
    471471    return m_rootStack.last();
    472472}
    473473
    474 void UIGChooserModel::indentRoot(UIGChooserItem *pNewRootItem)
     474void UIChooserModel::indentRoot(UIChooserItem *pNewRootItem)
    475475{
    476476    /* Do nothing if sliding already: */
     
    487487    /* Create left root: */
    488488    bool fLeftRootIsMain = root() == mainRoot();
    489     m_pLeftRoot = new UIGChooserItemGroup(scene(), root()->toGroupItem(), fLeftRootIsMain);
     489    m_pLeftRoot = new UIChooserItemGroup(scene(), root()->toGroupItem(), fLeftRootIsMain);
    490490    m_pLeftRoot->setPos(0, 0);
    491491    m_pLeftRoot->resize(root()->geometry().size());
    492492
    493493    /* Create right root: */
    494     m_pRightRoot = new UIGChooserItemGroup(scene(), pNewRootItem->toGroupItem(), false);
     494    m_pRightRoot = new UIChooserItemGroup(scene(), pNewRootItem->toGroupItem(), false);
    495495    m_pRightRoot->setPos(root()->geometry().width(), 0);
    496496    m_pRightRoot->resize(root()->geometry().size());
     
    506506}
    507507
    508 void UIGChooserModel::unindentRoot()
     508void UIChooserModel::unindentRoot()
    509509{
    510510    /* Do nothing if sliding already: */
     
    522522    /* Create left root: */
    523523    bool fLeftRootIsMain = m_rootStack.at(m_rootStack.size() - 2) == mainRoot();
    524     m_pLeftRoot = new UIGChooserItemGroup(scene(), m_rootStack.at(m_rootStack.size() - 2)->toGroupItem(), fLeftRootIsMain);
     524    m_pLeftRoot = new UIChooserItemGroup(scene(), m_rootStack.at(m_rootStack.size() - 2)->toGroupItem(), fLeftRootIsMain);
    525525    m_pLeftRoot->setPos(- root()->geometry().width(), 0);
    526526    m_pLeftRoot->resize(root()->geometry().size());
    527527
    528528    /* Create right root: */
    529     m_pRightRoot = new UIGChooserItemGroup(scene(), root()->toGroupItem(), false);
     529    m_pRightRoot = new UIChooserItemGroup(scene(), root()->toGroupItem(), false);
    530530    m_pRightRoot->setPos(0, 0);
    531531    m_pRightRoot->resize(root()->geometry().size());
     
    540540}
    541541
    542 bool UIGChooserModel::isSlidingInProgress() const
     542bool UIChooserModel::isSlidingInProgress() const
    543543{
    544544    return m_fSliding;
    545545}
    546546
    547 void UIGChooserModel::startEditingGroupItemName()
     547void UIChooserModel::startEditingGroupItemName()
    548548{
    549549    sltEditGroupName();
    550550}
    551551
    552 void UIGChooserModel::cleanupGroupTree()
     552void UIChooserModel::cleanupGroupTree()
    553553{
    554554    cleanupGroupTree(mainRoot());
     
    556556
    557557/* static */
    558 QString UIGChooserModel::uniqueGroupName(UIGChooserItem *pRoot)
     558QString UIChooserModel::uniqueGroupName(UIChooserItem *pRoot)
    559559{
    560560    /* Enumerate all the group names: */
    561561    QStringList groupNames;
    562     foreach (UIGChooserItem *pItem, pRoot->items(UIGChooserItemType_Group))
     562    foreach (UIChooserItem *pItem, pRoot->items(UIChooserItemType_Group))
    563563        groupNames << pItem->name();
    564564
     
    587587}
    588588
    589 void UIGChooserModel::activateMachineItem()
     589void UIChooserModel::activateMachineItem()
    590590{
    591591    actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)->activate(QAction::Trigger);
    592592}
    593593
    594 void UIGChooserModel::setCurrentDragObject(QDrag *pDragObject)
     594void UIChooserModel::setCurrentDragObject(QDrag *pDragObject)
    595595{
    596596    /* Make sure real focus unset: */
     
    602602}
    603603
    604 void UIGChooserModel::lookFor(const QString &strLookupSymbol)
     604void UIChooserModel::lookFor(const QString &strLookupSymbol)
    605605{
    606606    /* Restart timer to reset lookup-string: */
     
    608608
    609609    /* Prepare item: */
    610     UIGChooserItem *pItem = 0;
     610    UIChooserItem *pItem = 0;
    611611
    612612    /* We are starting to look from the current position: */
     
    626626        for (int iIndex = iFirstIndex; iIndex < navigationList().size(); ++iIndex)
    627627        {
    628             UIGChooserItem *pIteratedItem = navigationList().at(iIndex);
     628            UIChooserItem *pIteratedItem = navigationList().at(iIndex);
    629629            if (pIteratedItem->name().startsWith(strLookupString, Qt::CaseInsensitive))
    630630            {
     
    641641        for (int iIndex = 0; iIndex < iFirstIndex; ++iIndex)
    642642        {
    643             UIGChooserItem *pIteratedItem = navigationList().at(iIndex);
     643            UIChooserItem *pIteratedItem = navigationList().at(iIndex);
    644644            if (pIteratedItem->name().startsWith(strLookupString, Qt::CaseInsensitive))
    645645            {
     
    662662}
    663663
    664 bool UIGChooserModel::isLookupInProgress() const
     664bool UIChooserModel::isLookupInProgress() const
    665665{
    666666    return m_pLookupTimer->isActive();
    667667}
    668668
    669 void UIGChooserModel::saveGroupSettings()
     669void UIChooserModel::saveGroupSettings()
    670670{
    671671    emit sigStartGroupSaving();
    672672}
    673673
    674 bool UIGChooserModel::isGroupSavingInProgress() const
    675 {
    676     return UIGroupDefinitionSaveThread::instance() ||
    677            UIGroupOrderSaveThread::instance();
    678 }
    679 
    680 void UIGChooserModel::sltMachineStateChanged(QString strId, KMachineState)
     674bool UIChooserModel::isGroupSavingInProgress() const
     675{
     676    return UIThreadGroupDefinitionSave::instance() ||
     677           UIThreadGroupOrderSave::instance();
     678}
     679
     680void UIChooserModel::sltMachineStateChanged(QString strId, KMachineState)
    681681{
    682682    /* Update machine-items with passed id: */
     
    684684}
    685685
    686 void UIGChooserModel::sltMachineDataChanged(QString strId)
     686void UIChooserModel::sltMachineDataChanged(QString strId)
    687687{
    688688    /* Update machine-items with passed id: */
     
    690690}
    691691
    692 void UIGChooserModel::sltMachineRegistered(QString strId, bool fRegistered)
     692void UIChooserModel::sltMachineRegistered(QString strId, bool fRegistered)
    693693{
    694694    /* New VM registered? */
     
    709709            {
    710710                setCurrentItem(mainRoot()->searchForItem(machine.GetName(),
    711                                                          UIGChooserItemSearchFlag_Machine |
    712                                                          UIGChooserItemSearchFlag_ExactName));
     711                                                         UIChooserItemSearchFlag_Machine |
     712                                                         UIChooserItemSearchFlag_ExactName));
    713713            }
    714714        }
     
    734734}
    735735
    736 void UIGChooserModel::sltSessionStateChanged(QString strId, KSessionState)
     736void UIChooserModel::sltSessionStateChanged(QString strId, KSessionState)
    737737{
    738738    /* Update machine-items with passed id: */
     
    740740}
    741741
    742 void UIGChooserModel::sltSnapshotChanged(QString strId, QString)
     742void UIChooserModel::sltSnapshotChanged(QString strId, QString)
    743743{
    744744    /* Update machine-items with passed id: */
     
    746746}
    747747
    748 void UIGChooserModel::sltHandleViewResized()
     748void UIChooserModel::sltHandleViewResized()
    749749{
    750750    /* Relayout: */
     
    752752}
    753753
    754 void UIGChooserModel::sltFocusItemDestroyed()
     754void UIChooserModel::sltFocusItemDestroyed()
    755755{
    756756    AssertMsgFailed(("Focus item destroyed!"));
    757757}
    758758
    759 void UIGChooserModel::sltLeftRootSlidingProgress()
     759void UIChooserModel::sltLeftRootSlidingProgress()
    760760{
    761761    /* Update left root: */
     
    764764}
    765765
    766 void UIGChooserModel::sltRightRootSlidingProgress()
     766void UIChooserModel::sltRightRootSlidingProgress()
    767767{
    768768    /* Update right root: */
     
    771771}
    772772
    773 void UIGChooserModel::sltSlidingComplete()
     773void UIChooserModel::sltSlidingComplete()
    774774{
    775775    /* Delete temporary roots: */
     
    803803}
    804804
    805 void UIGChooserModel::sltEditGroupName()
     805void UIChooserModel::sltEditGroupName()
    806806{
    807807    /* Check if action is enabled: */
     
    817817}
    818818
    819 void UIGChooserModel::sltSortGroup()
     819void UIChooserModel::sltSortGroup()
    820820{
    821821    /* Check if action is enabled: */
     
    831831}
    832832
    833 void UIGChooserModel::sltUngroupSelectedGroup()
     833void UIChooserModel::sltUngroupSelectedGroup()
    834834{
    835835    /* Check if action is enabled: */
     
    838838
    839839    /* Make sure focus item is of group type! */
    840     AssertMsg(focusItem()->type() == UIGChooserItemType_Group, ("This is not group-item!"));
     840    AssertMsg(focusItem()->type() == UIChooserItemType_Group, ("This is not group-item!"));
    841841
    842842    /* Check if we have collisions with our siblings: */
    843     UIGChooserItem *pFocusItem = focusItem();
    844     UIGChooserItem *pParentItem = pFocusItem->parentItem();
    845     QList<UIGChooserItem*> siblings = pParentItem->items();
    846     QList<UIGChooserItem*> toBeRenamed;
    847     QList<UIGChooserItem*> toBeRemoved;
    848     foreach (UIGChooserItem *pItem, pFocusItem->items())
     843    UIChooserItem *pFocusItem = focusItem();
     844    UIChooserItem *pParentItem = pFocusItem->parentItem();
     845    QList<UIChooserItem*> siblings = pParentItem->items();
     846    QList<UIChooserItem*> toBeRenamed;
     847    QList<UIChooserItem*> toBeRemoved;
     848    foreach (UIChooserItem *pItem, pFocusItem->items())
    849849    {
    850850        QString strItemName = pItem->name();
    851         UIGChooserItem *pCollisionSibling = 0;
    852         foreach (UIGChooserItem *pSibling, siblings)
     851        UIChooserItem *pCollisionSibling = 0;
     852        foreach (UIChooserItem *pSibling, siblings)
    853853            if (pSibling != pFocusItem && pSibling->name() == strItemName)
    854854                pCollisionSibling = pSibling;
    855855        if (pCollisionSibling)
    856856        {
    857             if (pItem->type() == UIGChooserItemType_Machine)
     857            if (pItem->type() == UIChooserItemType_Machine)
    858858            {
    859                 if (pCollisionSibling->type() == UIGChooserItemType_Machine)
     859                if (pCollisionSibling->type() == UIChooserItemType_Machine)
    860860                    toBeRemoved << pItem;
    861                 else if (pCollisionSibling->type() == UIGChooserItemType_Group)
     861                else if (pCollisionSibling->type() == UIChooserItemType_Group)
    862862                {
    863863                    msgCenter().cannotResolveCollisionAutomatically(strItemName, pParentItem->name());
     
    865865                }
    866866            }
    867             else if (pItem->type() == UIGChooserItemType_Group)
     867            else if (pItem->type() == UIChooserItemType_Group)
    868868            {
    869869                if (msgCenter().confirmAutomaticCollisionResolve(strItemName, pParentItem->name()))
     
    876876
    877877    /* Copy all the children into our parent: */
    878     foreach (UIGChooserItem *pItem, pFocusItem->items())
     878    foreach (UIChooserItem *pItem, pFocusItem->items())
    879879    {
    880880        if (toBeRemoved.contains(pItem))
     
    882882        switch (pItem->type())
    883883        {
    884             case UIGChooserItemType_Group:
     884            case UIChooserItemType_Group:
    885885            {
    886                 UIGChooserItemGroup *pGroupItem = new UIGChooserItemGroup(pParentItem, pItem->toGroupItem());
     886                UIChooserItemGroup *pGroupItem = new UIChooserItemGroup(pParentItem, pItem->toGroupItem());
    887887                if (toBeRenamed.contains(pItem))
    888888                    pGroupItem->setName(uniqueGroupName(pParentItem));
    889889                break;
    890890            }
    891             case UIGChooserItemType_Machine:
     891            case UIChooserItemType_Machine:
    892892            {
    893                 new UIGChooserItemMachine(pParentItem, pItem->toMachineItem());
     893                new UIChooserItemMachine(pParentItem, pItem->toMachineItem());
    894894                break;
    895895            }
     
    907907}
    908908
    909 void UIGChooserModel::sltCreateNewMachine()
     909void UIChooserModel::sltCreateNewMachine()
    910910{
    911911    /* Check if action is enabled: */
     
    914914
    915915    /* Choose the parent: */
    916     UIGChooserItem *pGroup = 0;
     916    UIChooserItem *pGroup = 0;
    917917    if (isSingleGroupSelected())
    918918        pGroup = currentItem();
     
    946946}
    947947
    948 void UIGChooserModel::sltGroupSelectedMachines()
     948void UIChooserModel::sltGroupSelectedMachines()
    949949{
    950950    /* Check if action is enabled: */
     
    953953
    954954    /* Create new group in the current root: */
    955     UIGChooserItemGroup *pNewGroupItem = new UIGChooserItemGroup(root(), uniqueGroupName(root()), true);
     955    UIChooserItemGroup *pNewGroupItem = new UIChooserItemGroup(root(), uniqueGroupName(root()), true);
    956956    /* Enumerate all the currently chosen items: */
    957957    QStringList busyGroupNames;
    958958    QStringList busyMachineNames;
    959     QList<UIGChooserItem*> selectedItems = currentItems();
    960     foreach (UIGChooserItem *pItem, selectedItems)
     959    QList<UIChooserItem*> selectedItems = currentItems();
     960    foreach (UIChooserItem *pItem, selectedItems)
    961961    {
    962962        /* For each of known types: */
    963963        switch (pItem->type())
    964964        {
    965             case UIGChooserItemType_Group:
     965            case UIChooserItemType_Group:
    966966            {
    967967                /* Avoid name collisions: */
     
    971971                busyGroupNames << pItem->name();
    972972                /* Copy or move group-item: */
    973                 new UIGChooserItemGroup(pNewGroupItem, pItem->toGroupItem());
     973                new UIChooserItemGroup(pNewGroupItem, pItem->toGroupItem());
    974974                delete pItem;
    975975                break;
    976976            }
    977             case UIGChooserItemType_Machine:
     977            case UIChooserItemType_Machine:
    978978            {
    979979                /* Avoid name collisions: */
     
    983983                busyMachineNames << pItem->name();
    984984                /* Copy or move machine item: */
    985                 new UIGChooserItemMachine(pNewGroupItem, pItem->toMachineItem());
     985                new UIChooserItemMachine(pNewGroupItem, pItem->toMachineItem());
    986986                delete pItem;
    987987                break;
     
    997997}
    998998
    999 void UIGChooserModel::sltReloadMachine(const QString &strId)
     999void UIChooserModel::sltReloadMachine(const QString &strId)
    10001000{
    10011001    /* Remove all the items first: */
     
    10211021}
    10221022
    1023 void UIGChooserModel::sltSortParentGroup()
     1023void UIChooserModel::sltSortParentGroup()
    10241024{
    10251025    /* Check if action is enabled: */
     
    10351035}
    10361036
    1037 void UIGChooserModel::sltPerformRefreshAction()
     1037void UIChooserModel::sltPerformRefreshAction()
    10381038{
    10391039    /* Check if action is enabled: */
     
    10421042
    10431043    /* Gather list of current unique inaccessible machine-items: */
    1044     QList<UIGChooserItemMachine*> inaccessibleMachineItemList;
    1045     UIGChooserItemMachine::enumerateMachineItems(currentItems(), inaccessibleMachineItemList,
    1046                                                  UIGChooserItemMachineEnumerationFlag_Unique |
    1047                                                  UIGChooserItemMachineEnumerationFlag_Inaccessible);
     1044    QList<UIChooserItemMachine*> inaccessibleMachineItemList;
     1045    UIChooserItemMachine::enumerateMachineItems(currentItems(), inaccessibleMachineItemList,
     1046                                                 UIChooserItemMachineEnumerationFlag_Unique |
     1047                                                 UIChooserItemMachineEnumerationFlag_Inaccessible);
    10481048
    10491049    /* For each machine-item: */
    1050     UIGChooserItem *pSelectedItem = 0;
    1051     foreach (UIGChooserItemMachine *pItem, inaccessibleMachineItemList)
     1050    UIChooserItem *pSelectedItem = 0;
     1051    foreach (UIChooserItemMachine *pItem, inaccessibleMachineItemList)
    10521052    {
    10531053        /* Recache: */
     
    10631063            if (!pSelectedItem)
    10641064                pSelectedItem = mainRoot()->searchForItem(strMachineName,
    1065                                                           UIGChooserItemSearchFlag_Machine |
    1066                                                           UIGChooserItemSearchFlag_ExactName);
     1065                                                          UIChooserItemSearchFlag_Machine |
     1066                                                          UIChooserItemSearchFlag_ExactName);
    10671067        }
    10681068    }
     
    10761076}
    10771077
    1078 void UIGChooserModel::sltRemoveSelectedMachine()
     1078void UIChooserModel::sltRemoveSelectedMachine()
    10791079{
    10801080    /* Check if action is enabled: */
     
    10831083
    10841084    /* Enumerate all the selected machine-items: */
    1085     QList<UIGChooserItemMachine*> selectedMachineItemList;
    1086     UIGChooserItemMachine::enumerateMachineItems(currentItems(), selectedMachineItemList);
     1085    QList<UIChooserItemMachine*> selectedMachineItemList;
     1086    UIChooserItemMachine::enumerateMachineItems(currentItems(), selectedMachineItemList);
    10871087    /* Enumerate all the existing machine-items: */
    1088     QList<UIGChooserItemMachine*> existingMachineItemList;
    1089     UIGChooserItemMachine::enumerateMachineItems(mainRoot()->items(), existingMachineItemList);
     1088    QList<UIChooserItemMachine*> existingMachineItemList;
     1089    UIChooserItemMachine::enumerateMachineItems(mainRoot()->items(), existingMachineItemList);
    10901090
    10911091    /* Prepare arrays: */
    10921092    QMap<QString, bool> verdicts;
    1093     QList<UIGChooserItem*> itemsToRemove;
     1093    QList<UIChooserItem*> itemsToRemove;
    10941094    QStringList machinesToUnregister;
    10951095
    10961096    /* For each selected machine-item: */
    1097     foreach (UIGChooserItem *pItem, selectedMachineItemList)
     1097    foreach (UIChooserItem *pItem, selectedMachineItemList)
    10981098    {
    10991099        /* Get machine-item id: */
     
    11111111        /* Selected copy count: */
    11121112        int iSelectedCopyCount = 0;
    1113         foreach (UIGChooserItem *pSelectedItem, selectedMachineItemList)
     1113        foreach (UIChooserItem *pSelectedItem, selectedMachineItemList)
    11141114            if (pSelectedItem->toMachineItem()->id() == strId)
    11151115                ++iSelectedCopyCount;
    11161116        /* Existing copy count: */
    11171117        int iExistingCopyCount = 0;
    1118         foreach (UIGChooserItem *pExistingItem, existingMachineItemList)
     1118        foreach (UIChooserItem *pExistingItem, existingMachineItemList)
    11191119            if (pExistingItem->toMachineItem()->id() == strId)
    11201120                ++iExistingCopyCount;
     
    11381138}
    11391139
    1140 void UIGChooserModel::sltStartScrolling()
     1140void UIChooserModel::sltStartScrolling()
    11411141{
    11421142    /* Should we scroll? */
     
    11831183}
    11841184
    1185 void UIGChooserModel::sltCurrentDragObjectDestroyed()
     1185void UIChooserModel::sltCurrentDragObjectDestroyed()
    11861186{
    11871187    root()->resetDragToken();
    11881188}
    11891189
    1190 void UIGChooserModel::sltEraseLookupTimer()
     1190void UIChooserModel::sltEraseLookupTimer()
    11911191{
    11921192    m_pLookupTimer->stop();
     
    11941194}
    11951195
    1196 void UIGChooserModel::sltGroupSavingStart()
     1196void UIChooserModel::sltGroupSavingStart()
    11971197{
    11981198    saveGroupDefinitions();
     
    12001200}
    12011201
    1202 void UIGChooserModel::sltGroupDefinitionsSaveComplete()
     1202void UIChooserModel::sltGroupDefinitionsSaveComplete()
    12031203{
    12041204    makeSureGroupDefinitionsSaveIsFinished();
     
    12061206}
    12071207
    1208 void UIGChooserModel::sltGroupOrdersSaveComplete()
     1208void UIChooserModel::sltGroupOrdersSaveComplete()
    12091209{
    12101210    makeSureGroupOrdersSaveIsFinished();
     
    12121212}
    12131213
    1214 QVariant UIGChooserModel::data(int iKey) const
     1214QVariant UIChooserModel::data(int iKey) const
    12151215{
    12161216    switch (iKey)
     
    12221222}
    12231223
    1224 void UIGChooserModel::prepareScene()
     1224void UIChooserModel::prepareScene()
    12251225{
    12261226    m_pScene = new QGraphicsScene(this);
     
    12281228}
    12291229
    1230 void UIGChooserModel::prepareRoot()
    1231 {
    1232     m_rootStack << new UIGChooserItemGroup(scene());
    1233 }
    1234 
    1235 void UIGChooserModel::prepareLookup()
     1230void UIChooserModel::prepareRoot()
     1231{
     1232    m_rootStack << new UIChooserItemGroup(scene());
     1233}
     1234
     1235void UIChooserModel::prepareLookup()
    12361236{
    12371237    m_pLookupTimer = new QTimer(this);
     
    12411241}
    12421242
    1243 void UIGChooserModel::prepareContextMenu()
     1243void UIChooserModel::prepareContextMenu()
    12441244{
    12451245    /* Context menu for group(s): */
     
    13111311}
    13121312
    1313 void UIGChooserModel::prepareHandlers()
    1314 {
    1315     m_pMouseHandler = new UIGChooserHandlerMouse(this);
    1316     m_pKeyboardHandler = new UIGChooserHandlerKeyboard(this);
    1317 }
    1318 
    1319 void UIGChooserModel::prepareConnections()
     1313void UIChooserModel::prepareHandlers()
     1314{
     1315    m_pMouseHandler = new UIChooserHandlerMouse(this);
     1316    m_pKeyboardHandler = new UIChooserHandlerKeyboard(this);
     1317}
     1318
     1319void UIChooserModel::prepareConnections()
    13201320{
    13211321    /* Setup parent connections: */
     
    13501350}
    13511351
    1352 void UIGChooserModel::loadLastSelectedItem()
     1352void UIChooserModel::loadLastSelectedItem()
    13531353{
    13541354    /* Load last selected item (choose first if unable to load): */
     
    13581358}
    13591359
    1360 void UIGChooserModel::saveLastSelectedItem()
     1360void UIChooserModel::saveLastSelectedItem()
    13611361{
    13621362    /* Save last selected item: */
     
    13641364}
    13651365
    1366 void UIGChooserModel::cleanupHandlers()
     1366void UIChooserModel::cleanupHandlers()
    13671367{
    13681368    delete m_pKeyboardHandler;
     
    13721372}
    13731373
    1374 void UIGChooserModel::cleanupContextMenu()
     1374void UIChooserModel::cleanupContextMenu()
    13751375{
    13761376    delete m_pContextMenuGroup;
     
    13801380}
    13811381
    1382 void UIGChooserModel::cleanupLookup()
     1382void UIChooserModel::cleanupLookup()
    13831383{
    13841384    delete m_pLookupTimer;
     
    13861386}
    13871387
    1388 void UIGChooserModel::cleanupRoot()
     1388void UIChooserModel::cleanupRoot()
    13891389{
    13901390    delete mainRoot();
     
    13921392}
    13931393
    1394 void UIGChooserModel::cleanupScene()
     1394void UIChooserModel::cleanupScene()
    13951395{
    13961396    delete m_pScene;
     
    13981398}
    13991399
    1400 bool UIGChooserModel::eventFilter(QObject *pWatched, QEvent *pEvent)
     1400bool UIChooserModel::eventFilter(QObject *pWatched, QEvent *pEvent)
    14011401{
    14021402    /* Process only scene events: */
     
    14391439}
    14401440
    1441 QList<UIGChooserItem*> UIGChooserModel::createNavigationList(UIGChooserItem *pItem)
     1441QList<UIChooserItem*> UIChooserModel::createNavigationList(UIChooserItem *pItem)
    14421442{
    14431443    /* Prepare navigation list: */
    1444     QList<UIGChooserItem*> navigationItems;
     1444    QList<UIChooserItem*> navigationItems;
    14451445
    14461446    /* Iterate over all the group-items: */
    1447     foreach (UIGChooserItem *pGroupItem, pItem->items(UIGChooserItemType_Group))
     1447    foreach (UIChooserItem *pGroupItem, pItem->items(UIChooserItemType_Group))
    14481448    {
    14491449        navigationItems << pGroupItem;
     
    14521452    }
    14531453    /* Iterate over all the machine-items: */
    1454     foreach (UIGChooserItem *pMachineItem, pItem->items(UIGChooserItemType_Machine))
     1454    foreach (UIChooserItem *pMachineItem, pItem->items(UIChooserItemType_Machine))
    14551455        navigationItems << pMachineItem;
    14561456
     
    14591459}
    14601460
    1461 void UIGChooserModel::clearRealFocus()
     1461void UIChooserModel::clearRealFocus()
    14621462{
    14631463    /* Set the real focus to null: */
     
    14651465}
    14661466
    1467 void UIGChooserModel::slideRoot(bool fForward)
     1467void UIChooserModel::slideRoot(bool fForward)
    14681468{
    14691469    /* Animation group: */
     
    15031503}
    15041504
    1505 void UIGChooserModel::cleanupGroupTree(UIGChooserItem *pParent)
     1505void UIChooserModel::cleanupGroupTree(UIChooserItem *pParent)
    15061506{
    15071507    /* Cleanup all the group-items recursively first: */
    1508     foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Group))
     1508    foreach (UIChooserItem *pItem, pParent->items(UIChooserItemType_Group))
    15091509        cleanupGroupTree(pItem);
    15101510    /* If parent has no items: */
     
    15201520}
    15211521
    1522 void UIGChooserModel::removeItems(const QList<UIGChooserItem*> &itemsToRemove)
     1522void UIChooserModel::removeItems(const QList<UIChooserItem*> &itemsToRemove)
    15231523{
    15241524    /* Confirm machine-items removal: */
    15251525    QStringList names;
    1526     foreach (UIGChooserItem *pItem, itemsToRemove)
     1526    foreach (UIChooserItem *pItem, itemsToRemove)
    15271527        names << pItem->name();
    15281528    if (!msgCenter().confirmMachineItemRemoval(names))
     
    15301530
    15311531    /* Remove all the passed items: */
    1532     foreach (UIGChooserItem *pItem, itemsToRemove)
     1532    foreach (UIChooserItem *pItem, itemsToRemove)
    15331533        delete pItem;
    15341534
     
    15441544}
    15451545
    1546 void UIGChooserModel::unregisterMachines(const QStringList &ids)
     1546void UIChooserModel::unregisterMachines(const QStringList &ids)
    15471547{
    15481548    /* Populate machine list: */
     
    16121612}
    16131613
    1614 bool UIGChooserModel::processContextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent)
     1614bool UIChooserModel::processContextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent)
    16151615{
    16161616    /* Whats the reason? */
     
    16251625                switch (pItem->type())
    16261626                {
    1627                     case UIGChooserItemType_Group:
     1627                    case UIChooserItemType_Group:
    16281628                    {
    16291629                        /* Get group-item: */
    1630                         UIGChooserItem *pGroupItem = qgraphicsitem_cast<UIGChooserItemGroup*>(pItem);
     1630                        UIChooserItem *pGroupItem = qgraphicsitem_cast<UIChooserItemGroup*>(pItem);
    16311631                        /* Make sure thats not root: */
    16321632                        if (pGroupItem->isRoot())
     
    16411641                    }
    16421642                    RT_FALL_THRU();
    1643                     case UIGChooserItemType_Machine:
     1643                    case UIChooserItemType_Machine:
    16441644                    {
    16451645                        /* Machine context menu for other Group/Machine cases: */
     
    16561656        {
    16571657            /* Get first selected item: */
    1658             if (UIGChooserItem *pItem = currentItem())
     1658            if (UIChooserItem *pItem = currentItem())
    16591659            {
    16601660                /* If this item of known type? */
    16611661                switch (pItem->type())
    16621662                {
    1663                     case UIGChooserItemType_Group:
     1663                    case UIChooserItemType_Group:
    16641664                    {
    16651665                        /* Is this group-item only the one selected? */
     
    16721672                    }
    16731673                    RT_FALL_THRU();
    1674                     case UIGChooserItemType_Machine:
     1674                    case UIChooserItemType_Machine:
    16751675                    {
    16761676                        /* Machine context menu for other Group/Machine cases: */
     
    16911691}
    16921692
    1693 void UIGChooserModel::popupContextMenu(UIGraphicsSelectorContextMenuType type, QPoint point)
     1693void UIChooserModel::popupContextMenu(UIGraphicsSelectorContextMenuType type, QPoint point)
    16941694{
    16951695    /* Which type of context-menu requested? */
     
    17111711}
    17121712
    1713 bool UIGChooserModel::processDragMoveEvent(QGraphicsSceneDragDropEvent *pEvent)
     1713bool UIChooserModel::processDragMoveEvent(QGraphicsSceneDragDropEvent *pEvent)
    17141714{
    17151715    /* Do we scrolling already? */
     
    17351735}
    17361736
    1737 bool UIGChooserModel::processDragLeaveEvent(QGraphicsSceneDragDropEvent *pEvent)
     1737bool UIChooserModel::processDragLeaveEvent(QGraphicsSceneDragDropEvent *pEvent)
    17381738{
    17391739    /* Event object is not required here: */
     
    17481748}
    17491749
    1750 void UIGChooserModel::loadGroupTree()
     1750void UIChooserModel::loadGroupTree()
    17511751{
    17521752    /* Add all the approved machines we have into the group-tree: */
    1753     LogRelFlow(("UIGChooserModel: Loading VMs...\n"));
     1753    LogRelFlow(("UIChooserModel: Loading VMs...\n"));
    17541754    foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines())
    17551755    {
     
    17581758            addMachineIntoTheTree(machine);
    17591759    }
    1760     LogRelFlow(("UIGChooserModel: VMs loaded.\n"));
    1761 }
    1762 
    1763 void UIGChooserModel::addMachineIntoTheTree(const CMachine &machine, bool fMakeItVisible /* = false */)
     1760    LogRelFlow(("UIChooserModel: VMs loaded.\n"));
     1761}
     1762
     1763void UIChooserModel::addMachineIntoTheTree(const CMachine &machine, bool fMakeItVisible /* = false */)
    17641764{
    17651765    /* Make sure passed VM is not NULL: */
    17661766    if (machine.isNull())
    1767         LogRelFlow(("UIGChooserModel: ERROR: Passed VM is NULL!\n"));
     1767        LogRelFlow(("UIChooserModel: ERROR: Passed VM is NULL!\n"));
    17681768    AssertReturnVoid(!machine.isNull());
    17691769
    17701770    /* Which VM we are loading: */
    1771     LogRelFlow(("UIGChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toUtf8().constData()));
     1771    LogRelFlow(("UIChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toUtf8().constData()));
    17721772    /* Is that machine accessible? */
    17731773    if (machine.GetAccessible())
     
    17751775        /* VM is accessible: */
    17761776        QString strName = machine.GetName();
    1777         LogRelFlow(("UIGChooserModel:  VM {%s} is accessible.\n", strName.toUtf8().constData()));
     1777        LogRelFlow(("UIChooserModel:  VM {%s} is accessible.\n", strName.toUtf8().constData()));
    17781778        /* Which groups passed machine attached to? */
    17791779        QVector<QString> groups = machine.GetGroups();
    17801780        QStringList groupList = groups.toList();
    17811781        QString strGroups = groupList.join(", ");
    1782         LogRelFlow(("UIGChooserModel:  VM {%s} has groups: {%s}.\n", strName.toUtf8().constData(),
     1782        LogRelFlow(("UIChooserModel:  VM {%s} has groups: {%s}.\n", strName.toUtf8().constData(),
    17831783                                                                     strGroups.toUtf8().constData()));
    17841784        foreach (QString strGroup, groups)
     
    17881788                strGroup.truncate(strGroup.size() - 1);
    17891789            /* Create machine-item with found group-item as parent: */
    1790             LogRelFlow(("UIGChooserModel:   Creating item for VM {%s} in group {%s}.\n", strName.toUtf8().constData(),
     1790            LogRelFlow(("UIChooserModel:   Creating item for VM {%s} in group {%s}.\n", strName.toUtf8().constData(),
    17911791                                                                                         strGroup.toUtf8().constData()));
    17921792            createMachineItem(machine, getGroupItem(strGroup, mainRoot(), fMakeItVisible));
     
    17991799    {
    18001800        /* VM is accessible: */
    1801         LogRelFlow(("UIGChooserModel:  VM {%s} is inaccessible.\n", machine.GetId().toUtf8().constData()));
     1801        LogRelFlow(("UIChooserModel:  VM {%s} is inaccessible.\n", machine.GetId().toUtf8().constData()));
    18021802        /* Create machine-item with main-root group-item as parent: */
    18031803        createMachineItem(machine, mainRoot());
     
    18051805}
    18061806
    1807 UIGChooserItem* UIGChooserModel::getGroupItem(const QString &strName, UIGChooserItem *pParentItem, bool fAllGroupsOpened)
     1807UIChooserItem* UIChooserModel::getGroupItem(const QString &strName, UIChooserItem *pParentItem, bool fAllGroupsOpened)
    18081808{
    18091809    /* Check passed stuff: */
     
    18231823        AssertMsg(!strFirstSuffix.isEmpty(), ("Invalid group name!"));
    18241824        /* Trying to get group-item among our children: */
    1825         foreach (UIGChooserItem *pGroupItem, pParentItem->items(UIGChooserItemType_Group))
     1825        foreach (UIChooserItem *pGroupItem, pParentItem->items(UIChooserItemType_Group))
    18261826        {
    18271827            if (pGroupItem->name() == strSecondSubName)
    18281828            {
    1829                 UIGChooserItem *pFoundItem = getGroupItem(strFirstSuffix, pGroupItem, fAllGroupsOpened);
    1830                 if (UIGChooserItemGroup *pFoundGroupItem = pFoundItem->toGroupItem())
     1829                UIChooserItem *pFoundItem = getGroupItem(strFirstSuffix, pGroupItem, fAllGroupsOpened);
     1830                if (UIChooserItemGroup *pFoundGroupItem = pFoundItem->toGroupItem())
    18311831                    if (fAllGroupsOpened && pFoundGroupItem->isClosed())
    18321832                        pFoundGroupItem->open(false);
     
    18371837
    18381838    /* Found nothing? Creating: */
    1839     UIGChooserItemGroup *pNewGroupItem =
    1840             new UIGChooserItemGroup(/* Parent item and desired group name: */
     1839    UIChooserItemGroup *pNewGroupItem =
     1840            new UIChooserItemGroup(/* Parent item and desired group name: */
    18411841                                    pParentItem, strSecondSubName,
    18421842                                    /* Should be new group opened when created? */
    18431843                                    fAllGroupsOpened || shouldBeGroupOpened(pParentItem, strSecondSubName),
    18441844                                    /* Which position new group-item should be placed in? */
    1845                                     getDesiredPosition(pParentItem, UIGChooserItemType_Group, strSecondSubName));
     1845                                    getDesiredPosition(pParentItem, UIChooserItemType_Group, strSecondSubName));
    18461846    return strSecondSuffix.isEmpty() ? pNewGroupItem : getGroupItem(strFirstSuffix, pNewGroupItem, fAllGroupsOpened);
    18471847}
    18481848
    1849 bool UIGChooserModel::shouldBeGroupOpened(UIGChooserItem *pParentItem, const QString &strName)
     1849bool UIChooserModel::shouldBeGroupOpened(UIChooserItem *pParentItem, const QString &strName)
    18501850{
    18511851    /* Read group definitions: */
     
    18751875}
    18761876
    1877 int UIGChooserModel::getDesiredPosition(UIGChooserItem *pParentItem, UIGChooserItemType type, const QString &strName)
     1877int UIChooserModel::getDesiredPosition(UIChooserItem *pParentItem, UIChooserItemType type, const QString &strName)
    18781878{
    18791879    /* End of list (by default)? */
     
    18871887        iNewItemDesiredPosition = 0;
    18881888        /* We have to check all the existing item positions: */
    1889         QList<UIGChooserItem*> items = pParentItem->items(type);
     1889        QList<UIChooserItem*> items = pParentItem->items(type);
    18901890        for (int i = items.size() - 1; i >= 0; --i)
    18911891        {
    18921892            /* Get current item: */
    1893             UIGChooserItem *pItem = items[i];
     1893            UIChooserItem *pItem = items[i];
    18941894            /* Which position should be current item placed by definitions? */
    1895             QString strDefinitionName = pItem->type() == UIGChooserItemType_Group ? pItem->name() :
    1896                                         pItem->type() == UIGChooserItemType_Machine ? pItem->toMachineItem()->id() :
     1895            QString strDefinitionName = pItem->type() == UIChooserItemType_Group ? pItem->name() :
     1896                                        pItem->type() == UIChooserItemType_Machine ? pItem->toMachineItem()->id() :
    18971897                                        QString();
    18981898            AssertMsg(!strDefinitionName.isEmpty(), ("Wrong definition name!"));
     
    19141914}
    19151915
    1916 int UIGChooserModel::positionFromDefinitions(UIGChooserItem *pParentItem, UIGChooserItemType type, const QString &strName)
     1916int UIChooserModel::positionFromDefinitions(UIChooserItem *pParentItem, UIChooserItemType type, const QString &strName)
    19171917{
    19181918    /* Read group definitions: */
     
    19271927    switch (type)
    19281928    {
    1929         case UIGChooserItemType_Group:
     1929        case UIChooserItemType_Group:
    19301930            strDefinitionTemplateShort = QString("^g(\\S)*=");
    19311931            strDefinitionTemplateFull = QString("^g(\\S)*=%1$").arg(strName);
    19321932            break;
    1933         case UIGChooserItemType_Machine:
     1933        case UIChooserItemType_Machine:
    19341934            strDefinitionTemplateShort = QString("^m=");
    19351935            strDefinitionTemplateFull = QString("^m=%1$").arg(strName);
     
    19581958}
    19591959
    1960 void UIGChooserModel::createMachineItem(const CMachine &machine, UIGChooserItem *pParentItem)
     1960void UIChooserModel::createMachineItem(const CMachine &machine, UIChooserItem *pParentItem)
    19611961{
    19621962    /* Create corresponding item: */
    1963     new UIGChooserItemMachine(/* Parent item and corresponding machine: */
     1963    new UIChooserItemMachine(/* Parent item and corresponding machine: */
    19641964                              pParentItem, machine,
    19651965                              /* Which position new group-item should be placed in? */
    1966                               getDesiredPosition(pParentItem, UIGChooserItemType_Machine, machine.GetId()));
    1967 }
    1968 
    1969 void UIGChooserModel::saveGroupDefinitions()
     1966                              getDesiredPosition(pParentItem, UIChooserItemType_Machine, machine.GetId()));
     1967}
     1968
     1969void UIChooserModel::saveGroupDefinitions()
    19701970{
    19711971    /* Make sure there is no group save activity: */
    1972     if (UIGroupDefinitionSaveThread::instance())
     1972    if (UIThreadGroupDefinitionSave::instance())
    19731973        return;
    19741974
     
    19781978
    19791979    /* Save information in other thread: */
    1980     UIGroupDefinitionSaveThread::prepare();
     1980    UIThreadGroupDefinitionSave::prepare();
    19811981    emit sigGroupSavingStateChanged();
    1982     connect(UIGroupDefinitionSaveThread::instance(), SIGNAL(sigReload(QString)),
     1982    connect(UIThreadGroupDefinitionSave::instance(), SIGNAL(sigReload(QString)),
    19831983            this, SLOT(sltReloadMachine(QString)));
    1984     UIGroupDefinitionSaveThread::instance()->configure(this, m_groups, groups);
    1985     UIGroupDefinitionSaveThread::instance()->start();
     1984    UIThreadGroupDefinitionSave::instance()->configure(this, m_groups, groups);
     1985    UIThreadGroupDefinitionSave::instance()->start();
    19861986    m_groups = groups;
    19871987}
    19881988
    1989 void UIGChooserModel::saveGroupOrders()
     1989void UIChooserModel::saveGroupOrders()
    19901990{
    19911991    /* Make sure there is no group save activity: */
    1992     if (UIGroupOrderSaveThread::instance())
     1992    if (UIThreadGroupOrderSave::instance())
    19931993        return;
    19941994
     
    19981998
    19991999    /* Save information in other thread: */
    2000     UIGroupOrderSaveThread::prepare();
     2000    UIThreadGroupOrderSave::prepare();
    20012001    emit sigGroupSavingStateChanged();
    2002     UIGroupOrderSaveThread::instance()->configure(this, groups);
    2003     UIGroupOrderSaveThread::instance()->start();
    2004 }
    2005 
    2006 void UIGChooserModel::gatherGroupDefinitions(QMap<QString, QStringList> &groups,
    2007                                              UIGChooserItem *pParentGroup)
     2002    UIThreadGroupOrderSave::instance()->configure(this, groups);
     2003    UIThreadGroupOrderSave::instance()->start();
     2004}
     2005
     2006void UIChooserModel::gatherGroupDefinitions(QMap<QString, QStringList> &groups,
     2007                                             UIChooserItem *pParentGroup)
    20082008{
    20092009    /* Iterate over all the machine-items: */
    2010     foreach (UIGChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Machine))
    2011         if (UIGChooserItemMachine *pMachineItem = pItem->toMachineItem())
     2010    foreach (UIChooserItem *pItem, pParentGroup->items(UIChooserItemType_Machine))
     2011        if (UIChooserItemMachine *pMachineItem = pItem->toMachineItem())
    20122012            if (pMachineItem->accessible())
    20132013                groups[pMachineItem->id()] << pParentGroup->fullName();
    20142014    /* Iterate over all the group-items: */
    2015     foreach (UIGChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Group))
     2015    foreach (UIChooserItem *pItem, pParentGroup->items(UIChooserItemType_Group))
    20162016        gatherGroupDefinitions(groups, pItem);
    20172017}
    20182018
    2019 void UIGChooserModel::gatherGroupOrders(QMap<QString, QStringList> &groups,
    2020                                         UIGChooserItem *pParentItem)
     2019void UIChooserModel::gatherGroupOrders(QMap<QString, QStringList> &groups,
     2020                                        UIChooserItem *pParentItem)
    20212021{
    20222022    /* Prepare extra-data key for current group: */
    20232023    const QString strExtraDataKey = pParentItem->fullName();
    20242024    /* Iterate over all the group-items: */
    2025     foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Group))
     2025    foreach (UIChooserItem *pItem, pParentItem->items(UIChooserItemType_Group))
    20262026    {
    20272027        QString strGroupDescriptor(pItem->toGroupItem()->isOpened() ? "go" : "gc");
     
    20302030    }
    20312031    /* Iterate over all the machine-items: */
    2032     foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Machine))
     2032    foreach (UIChooserItem *pItem, pParentItem->items(UIChooserItemType_Machine))
    20332033        groups[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id());
    20342034}
    20352035
    2036 void UIGChooserModel::makeSureGroupDefinitionsSaveIsFinished()
     2036void UIChooserModel::makeSureGroupDefinitionsSaveIsFinished()
    20372037{
    20382038    /* Cleanup if necessary: */
    2039     if (UIGroupDefinitionSaveThread::instance())
    2040         UIGroupDefinitionSaveThread::cleanup();
    2041 }
    2042 
    2043 void UIGChooserModel::makeSureGroupOrdersSaveIsFinished()
     2039    if (UIThreadGroupDefinitionSave::instance())
     2040        UIThreadGroupDefinitionSave::cleanup();
     2041}
     2042
     2043void UIChooserModel::makeSureGroupOrdersSaveIsFinished()
    20442044{
    20452045    /* Cleanup if necessary: */
    2046     if (UIGroupOrderSaveThread::instance())
    2047         UIGroupOrderSaveThread::cleanup();
     2046    if (UIThreadGroupOrderSave::instance())
     2047        UIThreadGroupOrderSave::cleanup();
    20482048}
    20492049
    20502050/* static */
    2051 UIGroupDefinitionSaveThread* UIGroupDefinitionSaveThread::m_spInstance = 0;
     2051UIThreadGroupDefinitionSave* UIThreadGroupDefinitionSave::m_spInstance = 0;
    20522052
    20532053/* static */
    2054 UIGroupDefinitionSaveThread* UIGroupDefinitionSaveThread::instance()
     2054UIThreadGroupDefinitionSave* UIThreadGroupDefinitionSave::instance()
    20552055{
    20562056    return m_spInstance;
     
    20582058
    20592059/* static */
    2060 void UIGroupDefinitionSaveThread::prepare()
     2060void UIThreadGroupDefinitionSave::prepare()
    20612061{
    20622062    /* Make sure instance not prepared: */
     
    20652065
    20662066    /* Crate instance: */
    2067     new UIGroupDefinitionSaveThread;
     2067    new UIThreadGroupDefinitionSave;
    20682068}
    20692069
    20702070/* static */
    2071 void UIGroupDefinitionSaveThread::cleanup()
     2071void UIThreadGroupDefinitionSave::cleanup()
    20722072{
    20732073    /* Make sure instance prepared: */
     
    20792079}
    20802080
    2081 void UIGroupDefinitionSaveThread::configure(QObject *pParent,
     2081void UIThreadGroupDefinitionSave::configure(QObject *pParent,
    20822082                                            const QMap<QString, QStringList> &oldLists,
    20832083                                            const QMap<QString, QStringList> &newLists)
     
    20882088}
    20892089
    2090 UIGroupDefinitionSaveThread::UIGroupDefinitionSaveThread()
     2090UIThreadGroupDefinitionSave::UIThreadGroupDefinitionSave()
    20912091{
    20922092    /* Assign instance: */
     
    20942094}
    20952095
    2096 UIGroupDefinitionSaveThread::~UIGroupDefinitionSaveThread()
     2096UIThreadGroupDefinitionSave::~UIThreadGroupDefinitionSave()
    20972097{
    20982098    /* Wait: */
     
    21032103}
    21042104
    2105 void UIGroupDefinitionSaveThread::run()
     2105void UIThreadGroupDefinitionSave::run()
    21062106{
    21072107    /* COM prepare: */
     
    21712171
    21722172/* static */
    2173 UIGroupOrderSaveThread* UIGroupOrderSaveThread::m_spInstance = 0;
     2173UIThreadGroupOrderSave* UIThreadGroupOrderSave::m_spInstance = 0;
    21742174
    21752175/* static */
    2176 UIGroupOrderSaveThread* UIGroupOrderSaveThread::instance()
     2176UIThreadGroupOrderSave* UIThreadGroupOrderSave::instance()
    21772177{
    21782178    return m_spInstance;
     
    21802180
    21812181/* static */
    2182 void UIGroupOrderSaveThread::prepare()
     2182void UIThreadGroupOrderSave::prepare()
    21832183{
    21842184    /* Make sure instance not prepared: */
     
    21872187
    21882188    /* Crate instance: */
    2189     new UIGroupOrderSaveThread;
     2189    new UIThreadGroupOrderSave;
    21902190}
    21912191
    21922192/* static */
    2193 void UIGroupOrderSaveThread::cleanup()
     2193void UIThreadGroupOrderSave::cleanup()
    21942194{
    21952195    /* Make sure instance prepared: */
     
    22012201}
    22022202
    2203 void UIGroupOrderSaveThread::configure(QObject *pParent,
     2203void UIThreadGroupOrderSave::configure(QObject *pParent,
    22042204                                       const QMap<QString, QStringList> &groups)
    22052205{
     
    22082208}
    22092209
    2210 UIGroupOrderSaveThread::UIGroupOrderSaveThread()
     2210UIThreadGroupOrderSave::UIThreadGroupOrderSave()
    22112211{
    22122212    /* Assign instance: */
     
    22142214}
    22152215
    2216 UIGroupOrderSaveThread::~UIGroupOrderSaveThread()
     2216UIThreadGroupOrderSave::~UIThreadGroupOrderSave()
    22172217{
    22182218    /* Wait: */
     
    22232223}
    22242224
    2225 void UIGroupOrderSaveThread::run()
     2225void UIThreadGroupOrderSave::run()
    22262226{
    22272227    /* COM prepare: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserModel class declaration.
     3 * VBox Qt GUI - UIChooserModel class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGChooserModel_h__
    19 #define __UIGChooserModel_h__
     18#ifndef __UIChooserModel_h__
     19#define __UIChooserModel_h__
    2020
    2121/* Qt includes: */
     
    2727
    2828/* GUI includes: */
    29 #include "UIGChooserItem.h"
     29#include "UIChooserItem.h"
    3030
    3131/* COM includes: */
     
    4141class QTimer;
    4242class QPaintDevice;
    43 class UIVMItem;
    44 class UIGChooser;
     43class UIVirtualMachineItem;
     44class UIChooser;
    4545class UIActionPool;
    46 class UIGChooserHandlerMouse;
    47 class UIGChooserHandlerKeyboard;
     46class UIChooserHandlerMouse;
     47class UIChooserHandlerKeyboard;
    4848class CMachine;
    4949
     
    5656
    5757/* Graphics chooser-model: */
    58 class UIGChooserModel : public QObject
     58class UIChooserModel : public QObject
    5959{
    6060    Q_OBJECT;
     
    6666
    6767    /* Notifier: Focus-item stuff: */
    68     void sigFocusChanged(UIGChooserItem *pFocusItem);
     68    void sigFocusChanged(UIChooserItem *pFocusItem);
    6969
    7070    /* Notifiers: Root-item stuff: */
     
    8484
    8585    /* Constructor/destructor: */
    86     UIGChooserModel(UIGChooser *pParent);
    87     ~UIGChooserModel();
     86    UIChooserModel(UIChooser *pParent);
     87    ~UIChooserModel();
    8888
    8989    /* API: Prepare/cleanup stuff: */
     
    9292
    9393    /** Returns the chooser reference. */
    94     UIGChooser* chooser() const { return m_pChooser; }
     94    UIChooser* chooser() const { return m_pChooser; }
    9595    /** Returns the action-pool reference. */
    9696    UIActionPool* actionPool() const;
     
    105105
    106106    /* API: Navigation stuff: */
    107     const QList<UIGChooserItem*>& navigationList() const;
    108     void removeFromNavigationList(UIGChooserItem *pItem);
     107    const QList<UIChooserItem*>& navigationList() const;
     108    void removeFromNavigationList(UIChooserItem *pItem);
    109109    void updateNavigation();
    110110
    111111    /* API: Current-item stuff: */
    112     UIVMItem* currentMachineItem() const;
    113     QList<UIVMItem*> currentMachineItems() const;
    114     UIGChooserItem* currentItem() const;
    115     const QList<UIGChooserItem*>& currentItems() const;
    116     void setCurrentItems(const QList<UIGChooserItem*> &items);
    117     void setCurrentItem(UIGChooserItem *pItem);
     112    UIVirtualMachineItem* currentMachineItem() const;
     113    QList<UIVirtualMachineItem*> currentMachineItems() const;
     114    UIChooserItem* currentItem() const;
     115    const QList<UIChooserItem*>& currentItems() const;
     116    void setCurrentItems(const QList<UIChooserItem*> &items);
     117    void setCurrentItem(UIChooserItem *pItem);
    118118    void setCurrentItem(const QString &strDefinition);
    119119    void unsetCurrentItem();
    120     void addToCurrentItems(UIGChooserItem *pItem);
    121     void removeFromCurrentItems(UIGChooserItem *pItem);
    122     UIGChooserItem *findClosestUnselectedItem() const;
     120    void addToCurrentItems(UIChooserItem *pItem);
     121    void removeFromCurrentItems(UIChooserItem *pItem);
     122    UIChooserItem *findClosestUnselectedItem() const;
    123123    void makeSureSomeItemIsSelected();
    124124    void notifyCurrentItemChanged();
     
    127127
    128128    /* API: Focus-item stuff: */
    129     UIGChooserItem* focusItem() const;
    130     void setFocusItem(UIGChooserItem *pItem);
     129    UIChooserItem* focusItem() const;
     130    void setFocusItem(UIChooserItem *pItem);
    131131
    132132    /* API: Root-item stuff: */
    133     UIGChooserItem* mainRoot() const;
    134     UIGChooserItem* root() const;
    135     void indentRoot(UIGChooserItem *pNewRootItem);
     133    UIChooserItem* mainRoot() const;
     134    UIChooserItem* root() const;
     135    void indentRoot(UIChooserItem *pNewRootItem);
    136136    void unindentRoot();
    137137    bool isSlidingInProgress() const;
     
    140140    void startEditingGroupItemName();
    141141    void cleanupGroupTree();
    142     static QString uniqueGroupName(UIGChooserItem *pRoot);
     142    static QString uniqueGroupName(UIChooserItem *pRoot);
    143143
    144144    /* API: Machine-item stuff: */
     
    234234
    235235    /* Helper: Navigation stuff: */
    236     QList<UIGChooserItem*> createNavigationList(UIGChooserItem *pItem);
     236    QList<UIChooserItem*> createNavigationList(UIChooserItem *pItem);
    237237
    238238    /* Helper: Focus-item stuff: */
     
    243243
    244244    /* Helper: Group-item stuff: */
    245     void cleanupGroupTree(UIGChooserItem *pGroupItem);
     245    void cleanupGroupTree(UIChooserItem *pGroupItem);
    246246
    247247    /* Helpers: Machine-item stuff: */
    248     void removeItems(const QList<UIGChooserItem*> &itemsToRemove);
     248    void removeItems(const QList<UIChooserItem*> &itemsToRemove);
    249249    void unregisterMachines(const QStringList &ids);
    250250
     
    260260    void loadGroupTree();
    261261    void addMachineIntoTheTree(const CMachine &machine, bool fMakeItVisible = false);
    262     UIGChooserItem* getGroupItem(const QString &strName, UIGChooserItem *pParentItem, bool fAllGroupsOpened);
    263     bool shouldBeGroupOpened(UIGChooserItem *pParentItem, const QString &strName);
    264     int getDesiredPosition(UIGChooserItem *pParentItem, UIGChooserItemType type, const QString &strName);
    265     int positionFromDefinitions(UIGChooserItem *pParentItem, UIGChooserItemType type, const QString &strName);
    266     void createMachineItem(const CMachine &machine, UIGChooserItem *pParentItem);
     262    UIChooserItem* getGroupItem(const QString &strName, UIChooserItem *pParentItem, bool fAllGroupsOpened);
     263    bool shouldBeGroupOpened(UIChooserItem *pParentItem, const QString &strName);
     264    int getDesiredPosition(UIChooserItem *pParentItem, UIChooserItemType type, const QString &strName);
     265    int positionFromDefinitions(UIChooserItem *pParentItem, UIChooserItemType type, const QString &strName);
     266    void createMachineItem(const CMachine &machine, UIChooserItem *pParentItem);
    267267
    268268    /* Helpers: Saving stuff: */
    269269    void saveGroupDefinitions();
    270270    void saveGroupOrders();
    271     void gatherGroupDefinitions(QMap<QString, QStringList> &groups, UIGChooserItem *pParentGroup);
    272     void gatherGroupOrders(QMap<QString, QStringList> &groups, UIGChooserItem *pParentItem);
     271    void gatherGroupDefinitions(QMap<QString, QStringList> &groups, UIChooserItem *pParentGroup);
     272    void gatherGroupOrders(QMap<QString, QStringList> &groups, UIChooserItem *pParentItem);
    273273    void makeSureGroupDefinitionsSaveIsFinished();
    274274    void makeSureGroupOrdersSaveIsFinished();
    275275
    276276    /** Holds the chooser reference. */
    277     UIGChooser *m_pChooser;
     277    UIChooser *m_pChooser;
    278278
    279279    /* Variables: */
    280280    QGraphicsScene *m_pScene;
    281281
    282     QList<UIGChooserItem*> m_rootStack;
     282    QList<UIChooserItem*> m_rootStack;
    283283    bool m_fSliding;
    284     UIGChooserItem *m_pLeftRoot;
    285     UIGChooserItem *m_pRightRoot;
    286     QPointer<UIGChooserItem> m_pAfterSlidingFocus;
     284    UIChooserItem *m_pLeftRoot;
     285    UIChooserItem *m_pRightRoot;
     286    QPointer<UIChooserItem> m_pAfterSlidingFocus;
    287287
    288288    QMap<QString, QStringList> m_groups;
    289     QList<UIGChooserItem*> m_navigationList;
    290     QList<UIGChooserItem*> m_currentItems;
    291     UIGChooserHandlerMouse *m_pMouseHandler;
    292     UIGChooserHandlerKeyboard *m_pKeyboardHandler;
     289    QList<UIChooserItem*> m_navigationList;
     290    QList<UIChooserItem*> m_currentItems;
     291    UIChooserHandlerMouse *m_pMouseHandler;
     292    UIChooserHandlerKeyboard *m_pKeyboardHandler;
    293293    QPointer<QDrag> m_pCurrentDragObject;
    294294    int m_iScrollingTokenSize;
    295295    bool m_fIsScrollingInProgress;
    296     QPointer<UIGChooserItem> m_pFocusItem;
     296    QPointer<UIChooserItem> m_pFocusItem;
    297297    QMenu *m_pContextMenuGroup;
    298298    QMenu *m_pContextMenuMachine;
     
    307307
    308308/* Allows to save group definitions asynchronously: */
    309 class UIGroupDefinitionSaveThread : public QThread
     309class UIThreadGroupDefinitionSave : public QThread
    310310{
    311311    Q_OBJECT;
     
    322322
    323323    /* Singleton stuff: */
    324     static UIGroupDefinitionSaveThread* instance();
     324    static UIThreadGroupDefinitionSave* instance();
    325325    static void prepare();
    326326    static void cleanup();
     
    334334
    335335    /* Constructor/destructor: */
    336     UIGroupDefinitionSaveThread();
    337     ~UIGroupDefinitionSaveThread();
     336    UIThreadGroupDefinitionSave();
     337    ~UIThreadGroupDefinitionSave();
    338338
    339339    /* Worker thread stuff: */
     
    341341
    342342    /* Variables: */
    343     static UIGroupDefinitionSaveThread *m_spInstance;
     343    static UIThreadGroupDefinitionSave *m_spInstance;
    344344    QMap<QString, QStringList> m_oldLists;
    345345    QMap<QString, QStringList> m_newLists;
     
    347347
    348348/* Allows to save group order asynchronously: */
    349 class UIGroupOrderSaveThread : public QThread
     349class UIThreadGroupOrderSave : public QThread
    350350{
    351351    Q_OBJECT;
     
    359359
    360360    /* Singleton stuff: */
    361     static UIGroupOrderSaveThread* instance();
     361    static UIThreadGroupOrderSave* instance();
    362362    static void prepare();
    363363    static void cleanup();
     
    369369
    370370    /* Constructor/destructor: */
    371     UIGroupOrderSaveThread();
    372     ~UIGroupOrderSaveThread();
     371    UIThreadGroupOrderSave();
     372    ~UIThreadGroupOrderSave();
    373373
    374374    /* Worker thread stuff: */
     
    376376
    377377    /* Variables: */
    378     static UIGroupOrderSaveThread *m_spInstance;
     378    static UIThreadGroupOrderSave *m_spInstance;
    379379    QMap<QString, QStringList> m_groups;
    380380};
    381381
    382 #endif /* __UIGChooserModel_h__ */
    383 
     382#endif /* __UIChooserModel_h__ */
     383
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserView class implementation.
     3 * VBox Qt GUI - UIChooserView class implementation.
    44 */
    55
     
    2525
    2626/* GUI includes: */
    27 # include "UIGChooser.h"
    28 # include "UIGChooserModel.h"
    29 # include "UIGChooserView.h"
    30 # include "UIGChooserItem.h"
     27# include "UIChooser.h"
     28# include "UIChooserModel.h"
     29# include "UIChooserView.h"
     30# include "UIChooserItem.h"
    3131
    3232/* Other VBox includes: */
     
    3737
    3838/** QAccessibleWidget extension used as an accessibility interface for Chooser-view. */
    39 class UIAccessibilityInterfaceForUIGChooserView : public QAccessibleWidget
     39class UIAccessibilityInterfaceForUIChooserView : public QAccessibleWidget
    4040{
    4141public:
     
    4545    {
    4646        /* Creating Chooser-view accessibility interface: */
    47         if (pObject && strClassname == QLatin1String("UIGChooserView"))
    48             return new UIAccessibilityInterfaceForUIGChooserView(qobject_cast<QWidget*>(pObject));
     47        if (pObject && strClassname == QLatin1String("UIChooserView"))
     48            return new UIAccessibilityInterfaceForUIChooserView(qobject_cast<QWidget*>(pObject));
    4949
    5050        /* Null by default: */
     
    5353
    5454    /** Constructs an accessibility interface passing @a pWidget to the base-class. */
    55     UIAccessibilityInterfaceForUIGChooserView(QWidget *pWidget)
     55    UIAccessibilityInterfaceForUIChooserView(QWidget *pWidget)
    5656        : QAccessibleWidget(pWidget, QAccessible::List)
    5757    {}
     
    9393
    9494    /** Returns corresponding Chooser-view. */
    95     UIGChooserView *view() const { return qobject_cast<UIGChooserView*>(widget()); }
     95    UIChooserView *view() const { return qobject_cast<UIChooserView*>(widget()); }
    9696};
    9797
    9898
    99 UIGChooserView::UIGChooserView(UIGChooser *pParent)
     99UIChooserView::UIChooserView(UIChooser *pParent)
    100100    : QIWithRetranslateUI<QIGraphicsView>(pParent)
    101101    , m_pChooser(pParent)
     
    104104{
    105105    /* Install Chooser-view accessibility interface factory: */
    106     QAccessible::installFactory(UIAccessibilityInterfaceForUIGChooserView::pFactory);
     106    QAccessible::installFactory(UIAccessibilityInterfaceForUIChooserView::pFactory);
    107107
    108108    /* Setup frame: */
     
    121121}
    122122
    123 void UIGChooserView::sltMinimumWidthHintChanged(int iMinimumWidthHint)
     123void UIChooserView::sltMinimumWidthHintChanged(int iMinimumWidthHint)
    124124{
    125125    /* Is there something changed? */
     
    137137}
    138138
    139 void UIGChooserView::sltMinimumHeightHintChanged(int iMinimumHeightHint)
     139void UIChooserView::sltMinimumHeightHintChanged(int iMinimumHeightHint)
    140140{
    141141    /* Is there something changed? */
     
    150150}
    151151
    152 void UIGChooserView::sltFocusChanged(UIGChooserItem *pFocusItem)
     152void UIChooserView::sltFocusChanged(UIChooserItem *pFocusItem)
    153153{
    154154    /* Make sure focus-item set: */
     
    162162}
    163163
    164 void UIGChooserView::retranslateUi()
     164void UIChooserView::retranslateUi()
    165165{
    166166    /* Translate this: */
     
    168168}
    169169
    170 void UIGChooserView::resizeEvent(QResizeEvent *pEvent)
     170void UIChooserView::resizeEvent(QResizeEvent *pEvent)
    171171{
    172172    /* Call to base-class: */
     
    176176}
    177177
    178 void UIGChooserView::updateSceneRect()
     178void UIChooserView::updateSceneRect()
    179179{
    180180    setSceneRect(0, 0, m_iMinimumWidthHint, m_iMinimumHeightHint);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGChooserView class declaration.
     3 * VBox Qt GUI - UIChooserView class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGChooserView_h__
    19 #define __UIGChooserView_h__
     18#ifndef __UIChooserView_h__
     19#define __UIChooserView_h__
    2020
    2121/* GUI includes: */
     
    2424
    2525/* Forward declarations: */
    26 class UIGChooser;
    27 class UIGChooserItem;
     26class UIChooser;
     27class UIChooserItem;
    2828
    2929/* Graphics chooser-view: */
    30 class UIGChooserView : public QIWithRetranslateUI<QIGraphicsView>
     30class UIChooserView : public QIWithRetranslateUI<QIGraphicsView>
    3131{
    3232    Q_OBJECT;
     
    4141    /** Constructs a chooser-view passing @a pParent to the base-class.
    4242      * @param  pParent  Brings the chooser container to embed into. */
    43     UIGChooserView(UIGChooser *pParent);
     43    UIChooserView(UIChooser *pParent);
    4444
    4545    /** Returns the chooser reference. */
    46     UIGChooser *chooser() const { return m_pChooser; }
     46    UIChooser *chooser() const { return m_pChooser; }
    4747
    4848private slots:
     
    5353
    5454    /* Handler: Focus-item stuff: */
    55     void sltFocusChanged(UIGChooserItem *pFocusItem);
     55    void sltFocusChanged(UIChooserItem *pFocusItem);
    5656
    5757private:
     
    6767
    6868    /** Holds the chooser reference. */
    69     UIGChooser *m_pChooser;
     69    UIChooser *m_pChooser;
    7070
    7171    /* Variables: */
     
    7474};
    7575
    76 #endif /* __UIGChooserView_h__ */
     76#endif /* __UIChooserView_h__ */
    7777
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetails class implementation.
     3 * VBox Qt GUI - UIDetails class implementation.
    44 */
    55
     
    2626
    2727/* GUI includes: */
    28 # include "UIGDetails.h"
    29 # include "UIGDetailsModel.h"
    30 # include "UIGDetailsView.h"
     28# include "UIDetails.h"
     29# include "UIDetailsModel.h"
     30# include "UIDetailsView.h"
    3131
    3232#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3333
    3434
    35 UIGDetails::UIGDetails(QWidget *pParent /* = 0 */)
     35UIDetails::UIDetails(QWidget *pParent /* = 0 */)
    3636    : QWidget(pParent)
    3737    , m_pMainLayout(0)
     
    5555}
    5656
    57 void UIGDetails::setItems(const QList<UIVMItem*> &items)
     57void UIDetails::setItems(const QList<UIVirtualMachineItem*> &items)
    5858{
    5959    /* Propagate to details-model: */
     
    6161}
    6262
    63 void UIGDetails::preparePalette()
     63void UIDetails::preparePalette()
    6464{
    6565    /* Setup palette: */
     
    7070}
    7171
    72 void UIGDetails::prepareLayout()
     72void UIDetails::prepareLayout()
    7373{
    7474    /* Setup main-layout: */
     
    7979}
    8080
    81 void UIGDetails::prepareModel()
     81void UIDetails::prepareModel()
    8282{
    8383    /* Setup details-model: */
    84     m_pDetailsModel = new UIGDetailsModel(this);
     84    m_pDetailsModel = new UIDetailsModel(this);
    8585}
    8686
    87 void UIGDetails::prepareView()
     87void UIDetails::prepareView()
    8888{
    8989    /* Setup details-view: */
    90     m_pDetailsView = new UIGDetailsView(this);
     90    m_pDetailsView = new UIDetailsView(this);
    9191    m_pDetailsView->setScene(m_pDetailsModel->scene());
    9292    m_pDetailsView->show();
     
    9595}
    9696
    97 void UIGDetails::prepareConnections()
     97void UIDetails::prepareConnections()
    9898{
    9999    /* Setup details-model connections: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetails class declaration.
     3 * VBox Qt GUI - UIDetails class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGDetails_h__
    19 #define __UIGDetails_h__
     18#ifndef __UIDetails_h__
     19#define __UIDetails_h__
    2020
    2121/* Qt includes: */
     
    2424/* Forward declartions: */
    2525class QVBoxLayout;
    26 class UIGDetailsModel;
    27 class UIGDetailsView;
    28 class UIVMItem;
     26class UIDetailsModel;
     27class UIDetailsView;
     28class UIVirtualMachineItem;
    2929
    3030/* Details widget: */
    31 class UIGDetails : public QWidget
     31class UIDetails : public QWidget
    3232{
    3333    Q_OBJECT;
     
    4848
    4949    /* Constructor: */
    50     UIGDetails(QWidget *pParent = 0);
     50    UIDetails(QWidget *pParent = 0);
    5151
    5252    /** Return the Details-model instance. */
    53     UIGDetailsModel *model() const { return m_pDetailsModel; }
     53    UIDetailsModel *model() const { return m_pDetailsModel; }
    5454    /** Return the Details-view instance. */
    55     UIGDetailsView *view() const { return m_pDetailsView; }
     55    UIDetailsView *view() const { return m_pDetailsView; }
    5656
    5757    /* API: Current item(s) stuff: */
    58     void setItems(const QList<UIVMItem*> &items);
     58    void setItems(const QList<UIVirtualMachineItem*> &items);
    5959
    6060private:
     
    6969    /* Variables: */
    7070    QVBoxLayout *m_pMainLayout;
    71     UIGDetailsModel *m_pDetailsModel;
    72     UIGDetailsView *m_pDetailsView;
     71    UIDetailsModel *m_pDetailsModel;
     72    UIDetailsView *m_pDetailsView;
    7373};
    7474
    75 #endif /* __UIGDetails_h__ */
     75#endif /* __UIDetails_h__ */
    7676
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsElement class implementation.
     3 * VBox Qt GUI - UIDetailsElement class implementation.
    44 */
    55
     
    2929
    3030/* GUI includes: */
    31 # include "UIGDetailsElement.h"
    32 # include "UIGDetailsSet.h"
    33 # include "UIGDetailsModel.h"
     31# include "UIDetailsElement.h"
     32# include "UIDetailsSet.h"
     33# include "UIDetailsModel.h"
    3434# include "UIGraphicsRotatorButton.h"
    3535# include "UIGraphicsTextPane.h"
     
    3737# include "UIConverter.h"
    3838# include "UIIconPool.h"
    39 # include "UISelectorWindow.h"
     39# include "UIVirtualBoxManager.h"
    4040# include "VBoxGlobal.h"
    4141
     
    4343
    4444
    45 UIGDetailsElement::UIGDetailsElement(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened)
    46     : UIGDetailsItem(pParent)
     45UIDetailsElement::UIDetailsElement(UIDetailsSet *pParent, DetailsElementType type, bool fOpened)
     46    : UIDetailsItem(pParent)
    4747    , m_pSet(pParent)
    4848    , m_type(type)
     
    8080}
    8181
    82 UIGDetailsElement::~UIGDetailsElement()
     82UIDetailsElement::~UIDetailsElement()
    8383{
    8484    /* Remove item from the parent: */
     
    8787}
    8888
    89 void UIGDetailsElement::close(bool fAnimated /* = true */)
     89void UIDetailsElement::close(bool fAnimated /* = true */)
    9090{
    9191    m_pButton->setToggled(false, fAnimated);
    9292}
    9393
    94 void UIGDetailsElement::open(bool fAnimated /* = true */)
     94void UIDetailsElement::open(bool fAnimated /* = true */)
    9595{
    9696    m_pButton->setToggled(true, fAnimated);
    9797}
    9898
    99 void UIGDetailsElement::updateAppearance()
     99void UIDetailsElement::updateAppearance()
    100100{
    101101    /* Reset name hover state: */
     
    109109}
    110110
    111 void UIGDetailsElement::markAnimationFinished()
     111void UIDetailsElement::markAnimationFinished()
    112112{
    113113    /* Mark animation as non-running: */
     
    120120}
    121121
    122 UITextTable &UIGDetailsElement::text() const
     122UITextTable &UIDetailsElement::text() const
    123123{
    124124    /* Retrieve text from text-pane: */
     
    126126}
    127127
    128 void UIGDetailsElement::setText(const UITextTable &text)
     128void UIDetailsElement::setText(const UITextTable &text)
    129129{
    130130    /* Pass text to text-pane: */
     
    132132}
    133133
    134 void UIGDetailsElement::sltHandleWindowRemapped()
     134void UIDetailsElement::sltHandleWindowRemapped()
    135135{
    136136    /* Update icon: */
     
    138138}
    139139
    140 void UIGDetailsElement::sltToggleButtonClicked()
     140void UIDetailsElement::sltToggleButtonClicked()
    141141{
    142142    emit sigToggleElement(m_type, closed());
    143143}
    144144
    145 void UIGDetailsElement::sltElementToggleStart()
     145void UIDetailsElement::sltElementToggleStart()
    146146{
    147147    /* Mark animation running: */
     
    155155}
    156156
    157 void UIGDetailsElement::sltElementToggleFinish(bool fToggled)
     157void UIDetailsElement::sltElementToggleFinish(bool fToggled)
    158158{
    159159    /* Update toggle-state: */
     
    164164}
    165165
    166 void UIGDetailsElement::sltHandleAnchorClicked(const QString &strAnchor)
     166void UIDetailsElement::sltHandleAnchorClicked(const QString &strAnchor)
    167167{
    168168    /* Current anchor role: */
     
    193193}
    194194
    195 void UIGDetailsElement::sltMountStorageMedium()
     195void UIDetailsElement::sltMountStorageMedium()
    196196{
    197197    /* Sender action: */
     
    206206}
    207207
    208 void UIGDetailsElement::showEvent(QShowEvent *pEvent)
     208void UIDetailsElement::showEvent(QShowEvent *pEvent)
    209209{
    210210    /* Call to base-class: */
    211     UIGDetailsItem::showEvent(pEvent);
     211    UIDetailsItem::showEvent(pEvent);
    212212
    213213    /* Update icon: */
     
    215215}
    216216
    217 void UIGDetailsElement::resizeEvent(QGraphicsSceneResizeEvent*)
     217void UIDetailsElement::resizeEvent(QGraphicsSceneResizeEvent*)
    218218{
    219219    /* Update layout: */
     
    221221}
    222222
    223 QString UIGDetailsElement::description() const
     223QString UIDetailsElement::description() const
    224224{
    225225    return tr("%1 details", "like 'General details' or 'Storage details'").arg(m_strName);
    226226}
    227227
    228 QVariant UIGDetailsElement::data(int iKey) const
     228QVariant UIDetailsElement::data(int iKey) const
    229229{
    230230    /* Provide other members with required data: */
     
    240240}
    241241
    242 void UIGDetailsElement::updateMinimumHeaderWidth()
     242void UIDetailsElement::updateMinimumHeaderWidth()
    243243{
    244244    /* Prepare variables: */
     
    251251}
    252252
    253 void UIGDetailsElement::updateMinimumHeaderHeight()
     253void UIDetailsElement::updateMinimumHeaderHeight()
    254254{
    255255    /* Update minimum-header-height: */
     
    258258}
    259259
    260 void UIGDetailsElement::updateIcon()
     260void UIDetailsElement::updateIcon()
    261261{
    262262    /* Prepare whole icon first of all: */
     
    276276        m_pixmapSize = QSize(iIconMetric, iIconMetric);
    277277        /* Acquire the icon of corresponding size (taking top-level widget DPI into account): */
    278         m_pixmap = icon.pixmap(gpSelectorWindow->windowHandle(), m_pixmapSize);
     278        m_pixmap = icon.pixmap(gpManager->windowHandle(), m_pixmapSize);
    279279    }
    280280
     
    284284}
    285285
    286 void UIGDetailsElement::setName(const QString &strName)
     286void UIDetailsElement::setName(const QString &strName)
    287287{
    288288    /* Cache name: */
     
    296296}
    297297
    298 const CMachine& UIGDetailsElement::machine()
     298const CMachine& UIDetailsElement::machine()
    299299{
    300300    return m_pSet->machine();
    301301}
    302302
    303 int UIGDetailsElement::minimumWidthHint() const
     303int UIDetailsElement::minimumWidthHint() const
    304304{
    305305    /* Prepare variables: */
     
    317317}
    318318
    319 int UIGDetailsElement::minimumHeightHint(bool fClosed) const
     319int UIDetailsElement::minimumHeightHint(bool fClosed) const
    320320{
    321321    /* Prepare variables: */
     
    345345}
    346346
    347 int UIGDetailsElement::minimumHeightHint() const
     347int UIDetailsElement::minimumHeightHint() const
    348348{
    349349    return minimumHeightHint(m_fClosed);
    350350}
    351351
    352 void UIGDetailsElement::updateLayout()
     352void UIDetailsElement::updateLayout()
    353353{
    354354    /* Prepare variables: */
     
    386386}
    387387
    388 void UIGDetailsElement::setAdditionalHeight(int iAdditionalHeight)
     388void UIDetailsElement::setAdditionalHeight(int iAdditionalHeight)
    389389{
    390390    /* Cache new value: */
     
    396396}
    397397
    398 void UIGDetailsElement::addItem(UIGDetailsItem*)
     398void UIDetailsElement::addItem(UIDetailsItem*)
    399399{
    400400    AssertMsgFailed(("Details element do NOT support children!"));
    401401}
    402402
    403 void UIGDetailsElement::removeItem(UIGDetailsItem*)
     403void UIDetailsElement::removeItem(UIDetailsItem*)
    404404{
    405405    AssertMsgFailed(("Details element do NOT support children!"));
    406406}
    407407
    408 QList<UIGDetailsItem*> UIGDetailsElement::items(UIGDetailsItemType) const
     408QList<UIDetailsItem*> UIDetailsElement::items(UIDetailsItemType) const
    409409{
    410410    AssertMsgFailed(("Details element do NOT support children!"));
    411     return QList<UIGDetailsItem*>();
    412 }
    413 
    414 bool UIGDetailsElement::hasItems(UIGDetailsItemType) const
     411    return QList<UIDetailsItem*>();
     412}
     413
     414bool UIDetailsElement::hasItems(UIDetailsItemType) const
    415415{
    416416    AssertMsgFailed(("Details element do NOT support children!"));
     
    418418}
    419419
    420 void UIGDetailsElement::clearItems(UIGDetailsItemType)
     420void UIDetailsElement::clearItems(UIDetailsItemType)
    421421{
    422422    AssertMsgFailed(("Details element do NOT support children!"));
    423423}
    424424
    425 void UIGDetailsElement::prepareElement()
     425void UIDetailsElement::prepareElement()
    426426{
    427427    /* Initialization: */
     
    466466
    467467    /* Configure connections: */
    468     connect(gpSelectorWindow, &UISelectorWindow::sigWindowRemapped,
    469             this, &UIGDetailsElement::sltHandleWindowRemapped);
     468    connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped,
     469            this, &UIDetailsElement::sltHandleWindowRemapped);
    470470    connect(this, SIGNAL(sigToggleElement(DetailsElementType, bool)),
    471471            model(), SLOT(sltToggleElements(DetailsElementType, bool)));
     
    474474}
    475475
    476 void UIGDetailsElement::prepareButton()
     476void UIDetailsElement::prepareButton()
    477477{
    478478    /* Setup toggle-button: */
     
    485485}
    486486
    487 void UIGDetailsElement::prepareTextPane()
     487void UIDetailsElement::prepareTextPane()
    488488{
    489489    /* Create text-pane: */
     
    493493}
    494494
    495 void UIGDetailsElement::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget*)
     495void UIDetailsElement::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget*)
    496496{
    497497    /* Update button visibility: */
     
    508508}
    509509
    510 void UIGDetailsElement::paintDecorations(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)
     510void UIDetailsElement::paintDecorations(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)
    511511{
    512512    /* Paint background: */
     
    514514}
    515515
    516 void UIGDetailsElement::paintElementInfo(QPainter *pPainter, const QStyleOptionGraphicsItem*)
     516void UIDetailsElement::paintElementInfo(QPainter *pPainter, const QStyleOptionGraphicsItem*)
    517517{
    518518    /* Initialize some necessary variables: */
     
    561561}
    562562
    563 void UIGDetailsElement::paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)
     563void UIDetailsElement::paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)
    564564{
    565565    /* Save painter: */
     
    617617}
    618618
    619 void UIGDetailsElement::hoverMoveEvent(QGraphicsSceneHoverEvent *pEvent)
     619void UIDetailsElement::hoverMoveEvent(QGraphicsSceneHoverEvent *pEvent)
    620620{
    621621    /* Update hover state: */
     
    630630}
    631631
    632 void UIGDetailsElement::hoverLeaveEvent(QGraphicsSceneHoverEvent *pEvent)
     632void UIDetailsElement::hoverLeaveEvent(QGraphicsSceneHoverEvent *pEvent)
    633633{
    634634    /* Update hover state: */
     
    643643}
    644644
    645 void UIGDetailsElement::mousePressEvent(QGraphicsSceneMouseEvent *pEvent)
     645void UIDetailsElement::mousePressEvent(QGraphicsSceneMouseEvent *pEvent)
    646646{
    647647    /* Only for hovered header: */
     
    660660}
    661661
    662 void UIGDetailsElement::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *pEvent)
     662void UIDetailsElement::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *pEvent)
    663663{
    664664    /* Only for left-button: */
     
    670670}
    671671
    672 void UIGDetailsElement::updateButtonVisibility()
     672void UIDetailsElement::updateButtonVisibility()
    673673{
    674674    if (m_fHovered && !m_pButton->isVisible())
     
    678678}
    679679
    680 void UIGDetailsElement::handleHoverEvent(QGraphicsSceneHoverEvent *pEvent)
     680void UIDetailsElement::handleHoverEvent(QGraphicsSceneHoverEvent *pEvent)
    681681{
    682682    /* Not for 'preview' element type: */
     
    703703}
    704704
    705 void UIGDetailsElement::updateNameHoverLink()
     705void UIDetailsElement::updateNameHoverLink()
    706706{
    707707    if (m_fNameHovered)
     
    712712}
    713713
    714 void UIGDetailsElement::updateAnimationParameters()
     714void UIDetailsElement::updateAnimationParameters()
    715715{
    716716    /* Recalculate animation parameters: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsElement class declaration.
     3 * VBox Qt GUI - UIDetailsElement class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGDetailsElement_h__
    19 #define __UIGDetailsElement_h__
     18#ifndef __UIDetailsElement_h__
     19#define __UIDetailsElement_h__
    2020
    2121/* Qt includes: */
     
    2323
    2424/* GUI includes: */
    25 #include "UIGDetailsItem.h"
     25#include "UIDetailsItem.h"
    2626#include "UIExtraDataDefs.h"
    2727
    2828/* Forward declarations: */
    29 class UIGDetailsSet;
     29class UIDetailsSet;
    3030class CMachine;
    3131class UIGraphicsRotatorButton;
     
    4242/* Details element
    4343 * for graphics details model/view architecture: */
    44 class UIGDetailsElement : public UIGDetailsItem
     44class UIDetailsElement : public UIDetailsItem
    4545{
    4646    Q_OBJECT;
     
    6464
    6565    /* Graphics-item type: */
    66     enum { Type = UIGDetailsItemType_Element };
     66    enum { Type = UIDetailsItemType_Element };
    6767    int type() const { return Type; }
    6868
    6969    /* Constructor/destructor: */
    70     UIGDetailsElement(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened);
    71     ~UIGDetailsElement();
     70    UIDetailsElement(UIDetailsSet *pParent, DetailsElementType type, bool fOpened);
     71    ~UIDetailsElement();
    7272
    7373    /* API: Element type: */
     
    166166
    167167    /* API: Children stuff: */
    168     void addItem(UIGDetailsItem *pItem);
    169     void removeItem(UIGDetailsItem *pItem);
    170     QList<UIGDetailsItem*> items(UIGDetailsItemType type) const;
    171     bool hasItems(UIGDetailsItemType type) const;
    172     void clearItems(UIGDetailsItemType type);
     168    void addItem(UIDetailsItem *pItem);
     169    void removeItem(UIDetailsItem *pItem);
     170    QList<UIDetailsItem*> items(UIDetailsItemType type) const;
     171    bool hasItems(UIDetailsItemType type) const;
     172    void clearItems(UIDetailsItemType type);
    173173
    174174    /* Helpers: Prepare stuff: */
     
    198198
    199199    /* Variables: */
    200     UIGDetailsSet *m_pSet;
     200    UIDetailsSet *m_pSet;
    201201    DetailsElementType m_type;
    202202    QPixmap m_pixmap;
     
    232232
    233233    /* Friends: */
    234     friend class UIGDetailsSet;
     234    friend class UIDetailsSet;
    235235};
    236236
    237 #endif /* __UIGDetailsElement_h__ */
    238 
     237#endif /* __UIDetailsElement_h__ */
     238
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElements.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsElement[Name] classes implementation.
     3 * VBox Qt GUI - UIDetailsElement[Name] classes implementation.
    44 */
    55
     
    2626
    2727/* GUI includes: */
    28 # include "UIGDetailsElements.h"
    29 # include "UIGDetailsModel.h"
    30 # include "UIGMachinePreview.h"
     28# include "UIDetailsElements.h"
     29# include "UIDetailsModel.h"
     30# include "UIMachinePreview.h"
    3131# include "UIGraphicsRotatorButton.h"
    3232# include "VBoxGlobal.h"
     
    5555
    5656
    57 UIGDetailsUpdateTask::UIGDetailsUpdateTask(const CMachine &machine)
     57UIDetailsUpdateTask::UIDetailsUpdateTask(const CMachine &machine)
    5858    : UITask(UITask::Type_DetailsPopulation)
    5959{
     
    6262}
    6363
    64 UIGDetailsElementInterface::UIGDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened)
    65     : UIGDetailsElement(pParent, type, fOpened)
     64UIDetailsElementInterface::UIDetailsElementInterface(UIDetailsSet *pParent, DetailsElementType type, bool fOpened)
     65    : UIDetailsElement(pParent, type, fOpened)
    6666    , m_pTask(0)
    6767{
     
    7474}
    7575
    76 void UIGDetailsElementInterface::retranslateUi()
     76void UIDetailsElementInterface::retranslateUi()
    7777{
    7878    /* Assign corresponding name: */
     
    8080}
    8181
    82 void UIGDetailsElementInterface::updateAppearance()
     82void UIDetailsElementInterface::updateAppearance()
    8383{
    8484    /* Call to base-class: */
    85     UIGDetailsElement::updateAppearance();
     85    UIDetailsElement::updateAppearance();
    8686
    8787    /* Prepare/start update task: */
     
    9595}
    9696
    97 void UIGDetailsElementInterface::sltUpdateAppearanceFinished(UITask *pTask)
     97void UIDetailsElementInterface::sltUpdateAppearanceFinished(UITask *pTask)
    9898{
    9999    /* Make sure that is one of our tasks: */
     
    118118
    119119
    120 UIGDetailsElementPreview::UIGDetailsElementPreview(UIGDetailsSet *pParent, bool fOpened)
    121     : UIGDetailsElement(pParent, DetailsElementType_Preview, fOpened)
     120UIDetailsElementPreview::UIDetailsElementPreview(UIDetailsSet *pParent, bool fOpened)
     121    : UIDetailsElement(pParent, DetailsElementType_Preview, fOpened)
    122122{
    123123    /* Create preview: */
    124     m_pPreview = new UIGMachinePreview(this);
     124    m_pPreview = new UIMachinePreview(this);
    125125    AssertPtr(m_pPreview);
    126126    {
     
    134134}
    135135
    136 void UIGDetailsElementPreview::sltPreviewSizeHintChanged()
     136void UIDetailsElementPreview::sltPreviewSizeHintChanged()
    137137{
    138138    /* Recursively update size-hints: */
     
    142142}
    143143
    144 void UIGDetailsElementPreview::retranslateUi()
     144void UIDetailsElementPreview::retranslateUi()
    145145{
    146146    /* Assign corresponding name: */
     
    148148}
    149149
    150 int UIGDetailsElementPreview::minimumWidthHint() const
     150int UIDetailsElementPreview::minimumWidthHint() const
    151151{
    152152    /* Prepare variables: */
     
    166166}
    167167
    168 int UIGDetailsElementPreview::minimumHeightHint(bool fClosed) const
     168int UIDetailsElementPreview::minimumHeightHint(bool fClosed) const
    169169{
    170170    /* Prepare variables: */
     
    197197}
    198198
    199 void UIGDetailsElementPreview::updateLayout()
     199void UIDetailsElementPreview::updateLayout()
    200200{
    201201    /* Call to base-class: */
    202     UIGDetailsElement::updateLayout();
     202    UIDetailsElement::updateLayout();
    203203
    204204    /* Show/hide preview: */
     
    214214}
    215215
    216 void UIGDetailsElementPreview::updateAppearance()
     216void UIDetailsElementPreview::updateAppearance()
    217217{
    218218    /* Call to base-class: */
    219     UIGDetailsElement::updateAppearance();
     219    UIDetailsElement::updateAppearance();
    220220
    221221    /* Set new machine attribute directly: */
     
    226226
    227227
    228 void UIGDetailsUpdateTaskGeneral::run()
     228void UIDetailsUpdateTaskGeneral::run()
    229229{
    230230    /* Acquire corresponding machine: */
     
    240240    {
    241241        /* Machine name: */
    242         table << UITextTableLine(QApplication::translate("UIGDetails", "Name", "details (general)"), machine.GetName());
     242        table << UITextTableLine(QApplication::translate("UIDetails", "Name", "details (general)"), machine.GetName());
    243243
    244244        /* Operating system type: */
    245         table << UITextTableLine(QApplication::translate("UIGDetails", "Operating System", "details (general)"),
     245        table << UITextTableLine(QApplication::translate("UIDetails", "Operating System", "details (general)"),
    246246                                 vboxGlobal().vmGuestOSTypeDescription(machine.GetOSTypeId()));
    247247
     
    250250        if (!strSettingsFilePath.isEmpty())
    251251        {
    252             table << UITextTableLine(QApplication::translate("UIGDetails", "Settings File Location", "details (general)"),
     252            table << UITextTableLine(QApplication::translate("UIDetails", "Settings File Location", "details (general)"),
    253253                                     QDir::toNativeSeparators(QFileInfo(strSettingsFilePath).absolutePath()));
    254254        }
     
    270270                    strGroup.remove(0, 1);
    271271            }
    272             table << UITextTableLine(QApplication::translate("UIGDetails", "Groups", "details (general)"), groups.join(", "));
    273         }
    274     }
    275     else
    276         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString());
    277 
    278     /* Save the table as property: */
    279     setProperty("table", QVariant::fromValue(table));
    280 }
    281 
    282 
    283 void UIGDetailsUpdateTaskSystem::run()
     272            table << UITextTableLine(QApplication::translate("UIDetails", "Groups", "details (general)"), groups.join(", "));
     273        }
     274    }
     275    else
     276        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
     277
     278    /* Save the table as property: */
     279    setProperty("table", QVariant::fromValue(table));
     280}
     281
     282
     283void UIDetailsUpdateTaskSystem::run()
    284284{
    285285    /* Acquire corresponding machine: */
     
    295295    {
    296296        /* Base memory: */
    297         table << UITextTableLine(QApplication::translate("UIGDetails", "Base Memory", "details (system)"),
    298                                  QApplication::translate("UIGDetails", "%1 MB", "details").arg(machine.GetMemorySize()));
     297        table << UITextTableLine(QApplication::translate("UIDetails", "Base Memory", "details (system)"),
     298                                 QApplication::translate("UIDetails", "%1 MB", "details").arg(machine.GetMemorySize()));
    299299
    300300        /* CPU count: */
    301301        int cCPU = machine.GetCPUCount();
    302302        if (cCPU > 1)
    303             table << UITextTableLine(QApplication::translate("UIGDetails", "Processors", "details (system)"),
     303            table << UITextTableLine(QApplication::translate("UIDetails", "Processors", "details (system)"),
    304304                                     QString::number(cCPU));
    305305
     
    307307        int iCPUExecCap = machine.GetCPUExecutionCap();
    308308        if (iCPUExecCap < 100)
    309             table << UITextTableLine(QApplication::translate("UIGDetails", "Execution Cap", "details (system)"),
    310                                      QApplication::translate("UIGDetails", "%1%", "details").arg(iCPUExecCap));
     309            table << UITextTableLine(QApplication::translate("UIDetails", "Execution Cap", "details (system)"),
     310                                     QApplication::translate("UIDetails", "%1%", "details").arg(iCPUExecCap));
    311311
    312312        /* Boot-order: */
     
    321321        if (bootOrder.isEmpty())
    322322            bootOrder << gpConverter->toString(KDeviceType_Null);
    323         table << UITextTableLine(QApplication::translate("UIGDetails", "Boot Order", "details (system)"), bootOrder.join(", "));
     323        table << UITextTableLine(QApplication::translate("UIDetails", "Boot Order", "details (system)"), bootOrder.join(", "));
    324324
    325325        /* Chipset type: */
    326326        const KChipsetType enmChipsetType = machine.GetChipsetType();
    327327        if (enmChipsetType == KChipsetType_ICH9)
    328             table << UITextTableLine(QApplication::translate("UIGDetails", "Chipset Type", "details (system)"),
     328            table << UITextTableLine(QApplication::translate("UIDetails", "Chipset Type", "details (system)"),
    329329                                     gpConverter->toString(enmChipsetType));
    330330
     
    337337            case KFirmwareType_EFIDUAL:
    338338            {
    339                 table << UITextTableLine(QApplication::translate("UIGDetails", "EFI", "details (system)"),
    340                                          QApplication::translate("UIGDetails", "Enabled", "details (system/EFI)"));
     339                table << UITextTableLine(QApplication::translate("UIDetails", "EFI", "details (system)"),
     340                                         QApplication::translate("UIDetails", "Enabled", "details (system/EFI)"));
    341341                break;
    342342            }
     
    344344            {
    345345                // For NLS purpose:
    346                 QApplication::translate("UIGDetails", "Disabled", "details (system/EFI)");
     346                QApplication::translate("UIDetails", "Disabled", "details (system/EFI)");
    347347                break;
    348348            }
     
    356356            if (machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled))
    357357            {
    358                 acceleration << QApplication::translate("UIGDetails", "VT-x/AMD-V", "details (system)");
     358                acceleration << QApplication::translate("UIDetails", "VT-x/AMD-V", "details (system)");
    359359                /* Nested Paging (only when hw virt is enabled): */
    360360                if (machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging))
    361                     acceleration << QApplication::translate("UIGDetails", "Nested Paging", "details (system)");
     361                    acceleration << QApplication::translate("UIDetails", "Nested Paging", "details (system)");
    362362            }
    363363        }
    364364        if (machine.GetCPUProperty(KCPUPropertyType_PAE))
    365             acceleration << QApplication::translate("UIGDetails", "PAE/NX", "details (system)");
     365            acceleration << QApplication::translate("UIDetails", "PAE/NX", "details (system)");
    366366        switch (machine.GetEffectiveParavirtProvider())
    367367        {
    368             case KParavirtProvider_Minimal: acceleration << QApplication::translate("UIGDetails", "Minimal Paravirtualization", "details (system)"); break;
    369             case KParavirtProvider_HyperV:  acceleration << QApplication::translate("UIGDetails", "Hyper-V Paravirtualization", "details (system)"); break;
    370             case KParavirtProvider_KVM:     acceleration << QApplication::translate("UIGDetails", "KVM Paravirtualization", "details (system)"); break;
     368            case KParavirtProvider_Minimal: acceleration << QApplication::translate("UIDetails", "Minimal Paravirtualization", "details (system)"); break;
     369            case KParavirtProvider_HyperV:  acceleration << QApplication::translate("UIDetails", "Hyper-V Paravirtualization", "details (system)"); break;
     370            case KParavirtProvider_KVM:     acceleration << QApplication::translate("UIDetails", "KVM Paravirtualization", "details (system)"); break;
    371371            default: break;
    372372        }
    373373        if (!acceleration.isEmpty())
    374             table << UITextTableLine(QApplication::translate("UIGDetails", "Acceleration", "details (system)"),
     374            table << UITextTableLine(QApplication::translate("UIDetails", "Acceleration", "details (system)"),
    375375                                     acceleration.join(", "));
    376376    }
    377377    else
    378         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"),
     378        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"),
    379379                                 QString());
    380380
     
    384384
    385385
    386 void UIGDetailsUpdateTaskDisplay::run()
     386void UIDetailsUpdateTaskDisplay::run()
    387387{
    388388    /* Acquire corresponding machine: */
     
    398398    {
    399399        /* Video memory: */
    400         table << UITextTableLine(QApplication::translate("UIGDetails", "Video Memory", "details (display)"),
    401                                  QApplication::translate("UIGDetails", "%1 MB", "details").arg(machine.GetVRAMSize()));
     400        table << UITextTableLine(QApplication::translate("UIDetails", "Video Memory", "details (display)"),
     401                                 QApplication::translate("UIDetails", "%1 MB", "details").arg(machine.GetVRAMSize()));
    402402
    403403        /* Screen count: */
    404404        int cGuestScreens = machine.GetMonitorCount();
    405405        if (cGuestScreens > 1)
    406             table << UITextTableLine(QApplication::translate("UIGDetails", "Screens", "details (display)"),
     406            table << UITextTableLine(QApplication::translate("UIDetails", "Screens", "details (display)"),
    407407                                     QString::number(cGuestScreens));
    408408
     
    418418            /* Append information: */
    419419            if (dValue != 1.0)
    420                 table << UITextTableLine(QApplication::translate("UIGDetails", "Scale-factor", "details (display)"),
     420                table << UITextTableLine(QApplication::translate("UIDetails", "Scale-factor", "details (display)"),
    421421                                         QString::number(dValue, 'f', 2));
    422422        }
     
    426426        /* 2D acceleration: */
    427427        if (machine.GetAccelerate2DVideoEnabled())
    428             acceleration << QApplication::translate("UIGDetails", "2D Video", "details (display)");
     428            acceleration << QApplication::translate("UIDetails", "2D Video", "details (display)");
    429429#endif /* VBOX_WITH_VIDEOHWACCEL */
    430430        /* 3D acceleration: */
    431431        if (machine.GetAccelerate3DEnabled())
    432             acceleration << QApplication::translate("UIGDetails", "3D", "details (display)");
     432            acceleration << QApplication::translate("UIDetails", "3D", "details (display)");
    433433        if (!acceleration.isEmpty())
    434             table << UITextTableLine(QApplication::translate("UIGDetails", "Acceleration", "details (display)"),
     434            table << UITextTableLine(QApplication::translate("UIDetails", "Acceleration", "details (display)"),
    435435                                     acceleration.join(", "));
    436436
     
    440440        {
    441441            if (srv.GetEnabled())
    442                 table << UITextTableLine(QApplication::translate("UIGDetails", "Remote Desktop Server Port", "details (display/vrde)"),
     442                table << UITextTableLine(QApplication::translate("UIDetails", "Remote Desktop Server Port", "details (display/vrde)"),
    443443                                         srv.GetVRDEProperty("TCP/Ports"));
    444444            else
    445                 table << UITextTableLine(QApplication::translate("UIGDetails", "Remote Desktop Server", "details (display/vrde)"),
    446                                          QApplication::translate("UIGDetails", "Disabled", "details (display/vrde/VRDE server)"));
     445                table << UITextTableLine(QApplication::translate("UIDetails", "Remote Desktop Server", "details (display/vrde)"),
     446                                         QApplication::translate("UIDetails", "Disabled", "details (display/vrde/VRDE server)"));
    447447        }
    448448
     
    450450        if (machine.GetVideoCaptureEnabled())
    451451        {
    452             table << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture File", "details (display/video capture)"),
     452            table << UITextTableLine(QApplication::translate("UIDetails", "Video Capture File", "details (display/video capture)"),
    453453                                     machine.GetVideoCaptureFile());
    454             table << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture Attributes", "details (display/video capture)"),
    455                                      QApplication::translate("UIGDetails", "Frame Size: %1x%2, Frame Rate: %3fps, Bit Rate: %4kbps")
     454            table << UITextTableLine(QApplication::translate("UIDetails", "Video Capture Attributes", "details (display/video capture)"),
     455                                     QApplication::translate("UIDetails", "Frame Size: %1x%2, Frame Rate: %3fps, Bit Rate: %4kbps")
    456456                                         .arg(machine.GetVideoCaptureWidth()).arg(machine.GetVideoCaptureHeight())
    457457                                         .arg(machine.GetVideoCaptureFPS()).arg(machine.GetVideoCaptureRate()));
     
    459459        else
    460460        {
    461             table << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture", "details (display/video capture)"),
    462                                      QApplication::translate("UIGDetails", "Disabled", "details (display/video capture)"));
    463         }
    464     }
    465     else
    466         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString());
    467 
    468     /* Save the table as property: */
    469     setProperty("table", QVariant::fromValue(table));
    470 }
    471 
    472 
    473 void UIGDetailsUpdateTaskStorage::run()
     461            table << UITextTableLine(QApplication::translate("UIDetails", "Video Capture", "details (display/video capture)"),
     462                                     QApplication::translate("UIDetails", "Disabled", "details (display/video capture)"));
     463        }
     464    }
     465    else
     466        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
     467
     468    /* Save the table as property: */
     469    setProperty("table", QVariant::fromValue(table));
     470}
     471
     472
     473void UIDetailsUpdateTaskStorage::run()
    474474{
    475475    /* Acquire corresponding machine: */
     
    514514                KDeviceType deviceType = attachment.GetType();
    515515                QString strDeviceType = deviceType == KDeviceType_DVD ?
    516                             QApplication::translate("UIGDetails", "[Optical Drive]", "details (storage)") : QString();
     516                            QApplication::translate("UIDetails", "[Optical Drive]", "details (storage)") : QString();
    517517                if (!strDeviceType.isNull())
    518518                    strDeviceType.append(' ');
     
    541541        }
    542542        if (!fSomeInfo)
    543             table << UITextTableLine(QApplication::translate("UIGDetails", "Not Attached", "details (storage)"), QString());
    544     }
    545     else
    546         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString());
    547 
    548     /* Save the table as property: */
    549     setProperty("table", QVariant::fromValue(table));
    550 }
    551 
    552 
    553 void UIGDetailsUpdateTaskAudio::run()
     543            table << UITextTableLine(QApplication::translate("UIDetails", "Not Attached", "details (storage)"), QString());
     544    }
     545    else
     546        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
     547
     548    /* Save the table as property: */
     549    setProperty("table", QVariant::fromValue(table));
     550}
     551
     552
     553void UIDetailsUpdateTaskAudio::run()
    554554{
    555555    /* Acquire corresponding machine: */
     
    568568        {
    569569            /* Driver: */
    570             table << UITextTableLine(QApplication::translate("UIGDetails", "Host Driver", "details (audio)"),
     570            table << UITextTableLine(QApplication::translate("UIDetails", "Host Driver", "details (audio)"),
    571571                                     gpConverter->toString(audio.GetAudioDriver()));
    572572
    573573            /* Controller: */
    574             table << UITextTableLine(QApplication::translate("UIGDetails", "Controller", "details (audio)"),
     574            table << UITextTableLine(QApplication::translate("UIDetails", "Controller", "details (audio)"),
    575575                                     gpConverter->toString(audio.GetAudioController()));
    576576
    577577#ifdef VBOX_WITH_AUDIO_INOUT_INFO
    578578            /* Output: */
    579             table << UITextTableLine(QApplication::translate("UIGDetails", "Audio Output", "details (audio)"),
     579            table << UITextTableLine(QApplication::translate("UIDetails", "Audio Output", "details (audio)"),
    580580                                     audio.GetEnabledOut() ?
    581                                      QApplication::translate("UIGDetails", "Enabled", "details (audio/output)") :
    582                                      QApplication::translate("UIGDetails", "Disabled", "details (audio/output)"));
     581                                     QApplication::translate("UIDetails", "Enabled", "details (audio/output)") :
     582                                     QApplication::translate("UIDetails", "Disabled", "details (audio/output)"));
    583583
    584584            /* Input: */
    585             table << UITextTableLine(QApplication::translate("UIGDetails", "Audio Input", "details (audio)"),
     585            table << UITextTableLine(QApplication::translate("UIDetails", "Audio Input", "details (audio)"),
    586586                                     audio.GetEnabledIn() ?
    587                                      QApplication::translate("UIGDetails", "Enabled", "details (audio/input)") :
    588                                      QApplication::translate("UIGDetails", "Disabled", "details (audio/input)"));
     587                                     QApplication::translate("UIDetails", "Enabled", "details (audio/input)") :
     588                                     QApplication::translate("UIDetails", "Disabled", "details (audio/input)"));
    589589#endif /* VBOX_WITH_AUDIO_INOUT_INFO */
    590590        }
    591591        else
    592             table << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (audio)"),
     592            table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (audio)"),
    593593                                     QString());
    594594    }
    595595    else
    596         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"),
     596        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"),
    597597                                 QString());
    598598
     
    602602
    603603
    604 void UIGDetailsUpdateTaskNetwork::run()
     604void UIDetailsUpdateTaskNetwork::run()
    605605{
    606606    /* Acquire corresponding machine: */
     
    630630                    case KNetworkAttachmentType_Bridged:
    631631                    {
    632                         strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "Bridged Adapter, %1", "details (network)")
     632                        strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "Bridged Adapter, %1", "details (network)")
    633633                                                                  .arg(adapter.GetBridgedInterface()));
    634634                        break;
     
    636636                    case KNetworkAttachmentType_Internal:
    637637                    {
    638                         strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "Internal Network, '%1'", "details (network)")
     638                        strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "Internal Network, '%1'", "details (network)")
    639639                                                                  .arg(adapter.GetInternalNetwork()));
    640640                        break;
     
    642642                    case KNetworkAttachmentType_HostOnly:
    643643                    {
    644                         strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "Host-only Adapter, '%1'", "details (network)")
     644                        strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "Host-only Adapter, '%1'", "details (network)")
    645645                                                                  .arg(adapter.GetHostOnlyInterface()));
    646646                        break;
     
    650650                        QString strGenericDriverProperties(summarizeGenericProperties(adapter));
    651651                        strAttachmentType = strGenericDriverProperties.isNull() ?
    652                                   strAttachmentType.arg(QApplication::translate("UIGDetails", "Generic Driver, '%1'", "details (network)").arg(adapter.GetGenericDriver())) :
    653                                   strAttachmentType.arg(QApplication::translate("UIGDetails", "Generic Driver, '%1' { %2 }", "details (network)")
     652                                  strAttachmentType.arg(QApplication::translate("UIDetails", "Generic Driver, '%1'", "details (network)").arg(adapter.GetGenericDriver())) :
     653                                  strAttachmentType.arg(QApplication::translate("UIDetails", "Generic Driver, '%1' { %2 }", "details (network)")
    654654                                                        .arg(adapter.GetGenericDriver(), strGenericDriverProperties));
    655655                        break;
     
    657657                    case KNetworkAttachmentType_NATNetwork:
    658658                    {
    659                         strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "NAT Network, '%1'", "details (network)")
     659                        strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "NAT Network, '%1'", "details (network)")
    660660                                                                  .arg(adapter.GetNATNetwork()));
    661661                        break;
     
    667667                    }
    668668                }
    669                 table << UITextTableLine(QApplication::translate("UIGDetails", "Adapter %1", "details (network)").arg(adapter.GetSlot() + 1), strAttachmentType);
     669                table << UITextTableLine(QApplication::translate("UIDetails", "Adapter %1", "details (network)").arg(adapter.GetSlot() + 1), strAttachmentType);
    670670                fSomeInfo = true;
    671671            }
    672672        }
    673673        if (!fSomeInfo)
    674             table << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (network/adapter)"), QString());
    675     }
    676     else
    677         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString());
     674            table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (network/adapter)"), QString());
     675    }
     676    else
     677        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
    678678
    679679    /* Save the table as property: */
     
    682682
    683683/* static */
    684 QString UIGDetailsUpdateTaskNetwork::summarizeGenericProperties(const CNetworkAdapter &adapter)
     684QString UIDetailsUpdateTaskNetwork::summarizeGenericProperties(const CNetworkAdapter &adapter)
    685685{
    686686    QVector<QString> names;
     
    698698
    699699
    700 void UIGDetailsUpdateTaskSerial::run()
     700void UIDetailsUpdateTaskSerial::run()
    701701{
    702702    /* Acquire corresponding machine: */
     
    726726                else
    727727                    data += gpConverter->toString(mode);
    728                 table << UITextTableLine(QApplication::translate("UIGDetails", "Port %1", "details (serial)").arg(port.GetSlot() + 1), data);
     728                table << UITextTableLine(QApplication::translate("UIDetails", "Port %1", "details (serial)").arg(port.GetSlot() + 1), data);
    729729                fSomeInfo = true;
    730730            }
    731731        }
    732732        if (!fSomeInfo)
    733             table << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (serial)"), QString());
    734     }
    735     else
    736         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString());
    737 
    738     /* Save the table as property: */
    739     setProperty("table", QVariant::fromValue(table));
    740 }
    741 
    742 
    743 void UIGDetailsUpdateTaskUSB::run()
     733            table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (serial)"), QString());
     734    }
     735    else
     736        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
     737
     738    /* Save the table as property: */
     739    setProperty("table", QVariant::fromValue(table));
     740}
     741
     742
     743void UIDetailsUpdateTaskUSB::run()
    744744{
    745745    /* Acquire corresponding machine: */
     
    766766                foreach (const CUSBController &controller, controllers)
    767767                    controllerList << gpConverter->toString(controller.GetType());
    768                 table << UITextTableLine(QApplication::translate("UIGDetails", "USB Controller", "details (usb)"),
     768                table << UITextTableLine(QApplication::translate("UIDetails", "USB Controller", "details (usb)"),
    769769                                          controllerList.join(", "));
    770770                /* USB Device Filters info: */
     
    774774                    if (coll[i].GetActive())
    775775                        ++uActive;
    776                 table << UITextTableLine(QApplication::translate("UIGDetails", "Device Filters", "details (usb)"),
    777                                          QApplication::translate("UIGDetails", "%1 (%2 active)", "details (usb)").arg(coll.size()).arg(uActive));
     776                table << UITextTableLine(QApplication::translate("UIDetails", "Device Filters", "details (usb)"),
     777                                         QApplication::translate("UIDetails", "%1 (%2 active)", "details (usb)").arg(coll.size()).arg(uActive));
    778778            }
    779779            else
    780                 table << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (usb)"), QString());
     780                table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (usb)"), QString());
    781781        }
    782782        else
    783             table << UITextTableLine(QApplication::translate("UIGDetails", "USB Controller Inaccessible", "details (usb)"), QString());
    784     }
    785     else
    786         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString());
    787 
    788     /* Save the table as property: */
    789     setProperty("table", QVariant::fromValue(table));
    790 }
    791 
    792 
    793 void UIGDetailsUpdateTaskSF::run()
     783            table << UITextTableLine(QApplication::translate("UIDetails", "USB Controller Inaccessible", "details (usb)"), QString());
     784    }
     785    else
     786        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
     787
     788    /* Save the table as property: */
     789    setProperty("table", QVariant::fromValue(table));
     790}
     791
     792
     793void UIDetailsUpdateTaskSF::run()
    794794{
    795795    /* Acquire corresponding machine: */
     
    807807        ulong uCount = machine.GetSharedFolders().size();
    808808        if (uCount > 0)
    809             table << UITextTableLine(QApplication::translate("UIGDetails", "Shared Folders", "details (shared folders)"), QString::number(uCount));
     809            table << UITextTableLine(QApplication::translate("UIDetails", "Shared Folders", "details (shared folders)"), QString::number(uCount));
    810810        else
    811             table << UITextTableLine(QApplication::translate("UIGDetails", "None", "details (shared folders)"), QString());
    812     }
    813     else
    814         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString());
    815 
    816     /* Save the table as property: */
    817     setProperty("table", QVariant::fromValue(table));
    818 }
    819 
    820 
    821 void UIGDetailsUpdateTaskUI::run()
     811            table << UITextTableLine(QApplication::translate("UIDetails", "None", "details (shared folders)"), QString());
     812    }
     813    else
     814        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
     815
     816    /* Save the table as property: */
     817    setProperty("table", QVariant::fromValue(table));
     818}
     819
     820
     821void UIDetailsUpdateTaskUI::run()
    822822{
    823823    /* Acquire corresponding machine: */
     
    842842                                    strMenubarEnabled == "0");
    843843            /* Append information: */
    844             table << UITextTableLine(QApplication::translate("UIGDetails", "Menu-bar", "details (user interface)"),
    845                                      fEnabled ? QApplication::translate("UIGDetails", "Enabled", "details (user interface/menu-bar)") :
    846                                                 QApplication::translate("UIGDetails", "Disabled", "details (user interface/menu-bar)"));
     844            table << UITextTableLine(QApplication::translate("UIDetails", "Menu-bar", "details (user interface)"),
     845                                     fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/menu-bar)") :
     846                                                QApplication::translate("UIDetails", "Disabled", "details (user interface/menu-bar)"));
    847847        }
    848848#endif /* !VBOX_WS_MAC */
     
    857857                                    strStatusbarEnabled == "0");
    858858            /* Append information: */
    859             table << UITextTableLine(QApplication::translate("UIGDetails", "Status-bar", "details (user interface)"),
    860                                      fEnabled ? QApplication::translate("UIGDetails", "Enabled", "details (user interface/status-bar)") :
    861                                                 QApplication::translate("UIGDetails", "Disabled", "details (user interface/status-bar)"));
     859            table << UITextTableLine(QApplication::translate("UIDetails", "Status-bar", "details (user interface)"),
     860                                     fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/status-bar)") :
     861                                                QApplication::translate("UIDetails", "Disabled", "details (user interface/status-bar)"));
    862862        }
    863863
     
    882882                        /* Append information: */
    883883                        case MiniToolbarAlignment_Top:
    884                             table << UITextTableLine(QApplication::translate("UIGDetails", "Mini-toolbar Position", "details (user interface)"),
    885                                                      QApplication::translate("UIGDetails", "Top", "details (user interface/mini-toolbar position)"));
     884                            table << UITextTableLine(QApplication::translate("UIDetails", "Mini-toolbar Position", "details (user interface)"),
     885                                                     QApplication::translate("UIDetails", "Top", "details (user interface/mini-toolbar position)"));
    886886                            break;
    887887                        /* Append information: */
    888888                        case MiniToolbarAlignment_Bottom:
    889                             table << UITextTableLine(QApplication::translate("UIGDetails", "Mini-toolbar Position", "details (user interface)"),
    890                                                      QApplication::translate("UIGDetails", "Bottom", "details (user interface/mini-toolbar position)"));
     889                            table << UITextTableLine(QApplication::translate("UIDetails", "Mini-toolbar Position", "details (user interface)"),
     890                                                     QApplication::translate("UIDetails", "Bottom", "details (user interface/mini-toolbar position)"));
    891891                            break;
    892892                    }
     
    895895            /* Append information: */
    896896            else
    897                 table << UITextTableLine(QApplication::translate("UIGDetails", "Mini-toolbar", "details (user interface)"),
    898                                          QApplication::translate("UIGDetails", "Disabled", "details (user interface/mini-toolbar)"));
     897                table << UITextTableLine(QApplication::translate("UIDetails", "Mini-toolbar", "details (user interface)"),
     898                                         QApplication::translate("UIDetails", "Disabled", "details (user interface/mini-toolbar)"));
    899899        }
    900900#endif /* !VBOX_WS_MAC */
    901901    }
    902902    else
    903         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString());
    904 
    905     /* Save the table as property: */
    906     setProperty("table", QVariant::fromValue(table));
    907 }
    908 
    909 
    910 void UIGDetailsUpdateTaskDescription::run()
     903        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
     904
     905    /* Save the table as property: */
     906    setProperty("table", QVariant::fromValue(table));
     907}
     908
     909
     910void UIDetailsUpdateTaskDescription::run()
    911911{
    912912    /* Acquire corresponding machine: */
     
    926926            table << UITextTableLine(strDesc, QString());
    927927        else
    928             table << UITextTableLine(QApplication::translate("UIGDetails", "None", "details (description)"), QString());
    929     }
    930     else
    931         table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString());
    932 
    933     /* Save the table as property: */
    934     setProperty("table", QVariant::fromValue(table));
    935 }
     928            table << UITextTableLine(QApplication::translate("UIDetails", "None", "details (description)"), QString());
     929    }
     930    else
     931        table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
     932
     933    /* Save the table as property: */
     934    setProperty("table", QVariant::fromValue(table));
     935}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElements.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsElement[Name] classes declaration.
     3 * VBox Qt GUI - UIDetailsElement[Name] classes declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef ___UIGDetailsElements_h___
    19 #define ___UIGDetailsElements_h___
     18#ifndef ___UIDetailsElements_h___
     19#define ___UIDetailsElements_h___
    2020
    2121/* GUI includes: */
    2222#include "UIThreadPool.h"
    23 #include "UIGDetailsElement.h"
     23#include "UIDetailsElement.h"
    2424
    2525/* Forward declarations: */
    26 class UIGMachinePreview;
     26class UIMachinePreview;
    2727class CNetworkAdapter;
    2828
    2929
    3030/** UITask extension used as update task for the details-element. */
    31 class UIGDetailsUpdateTask : public UITask
     31class UIDetailsUpdateTask : public UITask
    3232{
    3333    Q_OBJECT;
     
    3636
    3737    /** Constructs update task taking @a machine as data. */
    38     UIGDetailsUpdateTask(const CMachine &machine);
    39 };
    40 
    41 /** UIGDetailsElement extension used as a wrapping interface to
     38    UIDetailsUpdateTask(const CMachine &machine);
     39};
     40
     41/** UIDetailsElement extension used as a wrapping interface to
    4242  * extend base-class with async functionality performed by the COM worker-threads. */
    43 class UIGDetailsElementInterface : public UIGDetailsElement
     43class UIDetailsElementInterface : public UIDetailsElement
    4444{
    4545    Q_OBJECT;
     
    5050      * @param type    brings the details-element type this element belongs to.
    5151      * @param fOpened brings whether the details-element should be visually opened. */
    52     UIGDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened);
     52    UIDetailsElementInterface(UIDetailsSet *pParent, DetailsElementType type, bool fOpened);
    5353
    5454protected:
     
    7575
    7676
    77 /** UIGDetailsElementInterface extension for the details-element type 'Preview'. */
    78 class UIGDetailsElementPreview : public UIGDetailsElement
     77/** UIDetailsElementInterface extension for the details-element type 'Preview'. */
     78class UIDetailsElementPreview : public UIDetailsElement
    7979{
    8080    Q_OBJECT;
     
    8484    /** Constructs details-element interface for passed @a pParent set.
    8585      * @param fOpened brings whether the details-element should be opened. */
    86     UIGDetailsElementPreview(UIGDetailsSet *pParent, bool fOpened);
     86    UIDetailsElementPreview(UIDetailsSet *pParent, bool fOpened);
    8787
    8888private slots:
     
    109109
    110110    /** Holds the instance of VM preview. */
    111     UIGMachinePreview *m_pPreview;
     111    UIMachinePreview *m_pPreview;
    112112};
    113113
    114114
    115115/** UITask extension used as update task for the details-element type 'General'. */
    116 class UIGDetailsUpdateTaskGeneral : public UIGDetailsUpdateTask
    117 {
    118     Q_OBJECT;
    119 
    120 public:
    121 
    122     /** Constructs update task passing @a machine to the base-class. */
    123     UIGDetailsUpdateTaskGeneral(const CMachine &machine)
    124         : UIGDetailsUpdateTask(machine) {}
    125 
    126 private:
    127 
    128     /** Contains update task body. */
    129     void run();
    130 };
    131 
    132 /** UIGDetailsElementInterface extension for the details-element type 'General'. */
    133 class UIGDetailsElementGeneral : public UIGDetailsElementInterface
    134 {
    135     Q_OBJECT;
    136 
    137 public:
    138 
    139     /** Constructs details-element object for passed @a pParent set.
    140       * @param fOpened brings whether the details-element should be visually opened. */
    141     UIGDetailsElementGeneral(UIGDetailsSet *pParent, bool fOpened)
    142         : UIGDetailsElementInterface(pParent, DetailsElementType_General, fOpened) {}
    143 
    144 private:
    145 
    146     /** Creates update task for this element. */
    147     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskGeneral(machine()); }
     116class UIDetailsUpdateTaskGeneral : public UIDetailsUpdateTask
     117{
     118    Q_OBJECT;
     119
     120public:
     121
     122    /** Constructs update task passing @a machine to the base-class. */
     123    UIDetailsUpdateTaskGeneral(const CMachine &machine)
     124        : UIDetailsUpdateTask(machine) {}
     125
     126private:
     127
     128    /** Contains update task body. */
     129    void run();
     130};
     131
     132/** UIDetailsElementInterface extension for the details-element type 'General'. */
     133class UIDetailsElementGeneral : public UIDetailsElementInterface
     134{
     135    Q_OBJECT;
     136
     137public:
     138
     139    /** Constructs details-element object for passed @a pParent set.
     140      * @param fOpened brings whether the details-element should be visually opened. */
     141    UIDetailsElementGeneral(UIDetailsSet *pParent, bool fOpened)
     142        : UIDetailsElementInterface(pParent, DetailsElementType_General, fOpened) {}
     143
     144private:
     145
     146    /** Creates update task for this element. */
     147    UITask* createUpdateTask() { return new UIDetailsUpdateTaskGeneral(machine()); }
    148148};
    149149
    150150
    151151/** UITask extension used as update task for the details-element type 'System'. */
    152 class UIGDetailsUpdateTaskSystem : public UIGDetailsUpdateTask
    153 {
    154     Q_OBJECT;
    155 
    156 public:
    157 
    158     /** Constructs update task passing @a machine to the base-class. */
    159     UIGDetailsUpdateTaskSystem(const CMachine &machine)
    160         : UIGDetailsUpdateTask(machine) {}
    161 
    162 private:
    163 
    164     /** Contains update task body. */
    165     void run();
    166 };
    167 
    168 /** UIGDetailsElementInterface extension for the details-element type 'System'. */
    169 class UIGDetailsElementSystem : public UIGDetailsElementInterface
    170 {
    171     Q_OBJECT;
    172 
    173 public:
    174 
    175     /** Constructs details-element object for passed @a pParent set.
    176       * @param fOpened brings whether the details-element should be visually opened. */
    177     UIGDetailsElementSystem(UIGDetailsSet *pParent, bool fOpened)
    178         : UIGDetailsElementInterface(pParent, DetailsElementType_System, fOpened) {}
    179 
    180 private:
    181 
    182     /** Creates update task for this element. */
    183     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskSystem(machine()); }
     152class UIDetailsUpdateTaskSystem : public UIDetailsUpdateTask
     153{
     154    Q_OBJECT;
     155
     156public:
     157
     158    /** Constructs update task passing @a machine to the base-class. */
     159    UIDetailsUpdateTaskSystem(const CMachine &machine)
     160        : UIDetailsUpdateTask(machine) {}
     161
     162private:
     163
     164    /** Contains update task body. */
     165    void run();
     166};
     167
     168/** UIDetailsElementInterface extension for the details-element type 'System'. */
     169class UIDetailsElementSystem : public UIDetailsElementInterface
     170{
     171    Q_OBJECT;
     172
     173public:
     174
     175    /** Constructs details-element object for passed @a pParent set.
     176      * @param fOpened brings whether the details-element should be visually opened. */
     177    UIDetailsElementSystem(UIDetailsSet *pParent, bool fOpened)
     178        : UIDetailsElementInterface(pParent, DetailsElementType_System, fOpened) {}
     179
     180private:
     181
     182    /** Creates update task for this element. */
     183    UITask* createUpdateTask() { return new UIDetailsUpdateTaskSystem(machine()); }
    184184};
    185185
    186186
    187187/** UITask extension used as update task for the details-element type 'Display'. */
    188 class UIGDetailsUpdateTaskDisplay : public UIGDetailsUpdateTask
    189 {
    190     Q_OBJECT;
    191 
    192 public:
    193 
    194     /** Constructs update task passing @a machine to the base-class. */
    195     UIGDetailsUpdateTaskDisplay(const CMachine &machine)
    196         : UIGDetailsUpdateTask(machine) {}
    197 
    198 private:
    199 
    200     /** Contains update task body. */
    201     void run();
    202 };
    203 
    204 /** UIGDetailsElementInterface extension for the details-element type 'Display'. */
    205 class UIGDetailsElementDisplay : public UIGDetailsElementInterface
    206 {
    207     Q_OBJECT;
    208 
    209 public:
    210 
    211     /** Constructs details-element object for passed @a pParent set.
    212       * @param fOpened brings whether the details-element should be visually opened. */
    213     UIGDetailsElementDisplay(UIGDetailsSet *pParent, bool fOpened)
    214         : UIGDetailsElementInterface(pParent, DetailsElementType_Display, fOpened) {}
    215 
    216 private:
    217 
    218     /** Creates update task for this element. */
    219     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskDisplay(machine()); }
     188class UIDetailsUpdateTaskDisplay : public UIDetailsUpdateTask
     189{
     190    Q_OBJECT;
     191
     192public:
     193
     194    /** Constructs update task passing @a machine to the base-class. */
     195    UIDetailsUpdateTaskDisplay(const CMachine &machine)
     196        : UIDetailsUpdateTask(machine) {}
     197
     198private:
     199
     200    /** Contains update task body. */
     201    void run();
     202};
     203
     204/** UIDetailsElementInterface extension for the details-element type 'Display'. */
     205class UIDetailsElementDisplay : public UIDetailsElementInterface
     206{
     207    Q_OBJECT;
     208
     209public:
     210
     211    /** Constructs details-element object for passed @a pParent set.
     212      * @param fOpened brings whether the details-element should be visually opened. */
     213    UIDetailsElementDisplay(UIDetailsSet *pParent, bool fOpened)
     214        : UIDetailsElementInterface(pParent, DetailsElementType_Display, fOpened) {}
     215
     216private:
     217
     218    /** Creates update task for this element. */
     219    UITask* createUpdateTask() { return new UIDetailsUpdateTaskDisplay(machine()); }
    220220};
    221221
    222222
    223223/** UITask extension used as update task for the details-element type 'Storage'. */
    224 class UIGDetailsUpdateTaskStorage : public UIGDetailsUpdateTask
    225 {
    226     Q_OBJECT;
    227 
    228 public:
    229 
    230     /** Constructs update task passing @a machine to the base-class. */
    231     UIGDetailsUpdateTaskStorage(const CMachine &machine)
    232         : UIGDetailsUpdateTask(machine) {}
    233 
    234 private:
    235 
    236     /** Contains update task body. */
    237     void run();
    238 };
    239 
    240 /** UIGDetailsElementInterface extension for the details-element type 'Storage'. */
    241 class UIGDetailsElementStorage : public UIGDetailsElementInterface
    242 {
    243     Q_OBJECT;
    244 
    245 public:
    246 
    247     /** Constructs details-element object for passed @a pParent set.
    248       * @param fOpened brings whether the details-element should be visually opened. */
    249     UIGDetailsElementStorage(UIGDetailsSet *pParent, bool fOpened)
    250         : UIGDetailsElementInterface(pParent, DetailsElementType_Storage, fOpened) {}
    251 
    252 private:
    253 
    254     /** Creates update task for this element. */
    255     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskStorage(machine()); }
     224class UIDetailsUpdateTaskStorage : public UIDetailsUpdateTask
     225{
     226    Q_OBJECT;
     227
     228public:
     229
     230    /** Constructs update task passing @a machine to the base-class. */
     231    UIDetailsUpdateTaskStorage(const CMachine &machine)
     232        : UIDetailsUpdateTask(machine) {}
     233
     234private:
     235
     236    /** Contains update task body. */
     237    void run();
     238};
     239
     240/** UIDetailsElementInterface extension for the details-element type 'Storage'. */
     241class UIDetailsElementStorage : public UIDetailsElementInterface
     242{
     243    Q_OBJECT;
     244
     245public:
     246
     247    /** Constructs details-element object for passed @a pParent set.
     248      * @param fOpened brings whether the details-element should be visually opened. */
     249    UIDetailsElementStorage(UIDetailsSet *pParent, bool fOpened)
     250        : UIDetailsElementInterface(pParent, DetailsElementType_Storage, fOpened) {}
     251
     252private:
     253
     254    /** Creates update task for this element. */
     255    UITask* createUpdateTask() { return new UIDetailsUpdateTaskStorage(machine()); }
    256256};
    257257
    258258
    259259/** UITask extension used as update task for the details-element type 'Audio'. */
    260 class UIGDetailsUpdateTaskAudio : public UIGDetailsUpdateTask
    261 {
    262     Q_OBJECT;
    263 
    264 public:
    265 
    266     /** Constructs update task passing @a machine to the base-class. */
    267     UIGDetailsUpdateTaskAudio(const CMachine &machine)
    268         : UIGDetailsUpdateTask(machine) {}
    269 
    270 private:
    271 
    272     /** Contains update task body. */
    273     void run();
    274 };
    275 
    276 /** UIGDetailsElementInterface extension for the details-element type 'Audio'. */
    277 class UIGDetailsElementAudio : public UIGDetailsElementInterface
    278 {
    279     Q_OBJECT;
    280 
    281 public:
    282 
    283     /** Constructs details-element object for passed @a pParent set.
    284       * @param fOpened brings whether the details-element should be visually opened. */
    285     UIGDetailsElementAudio(UIGDetailsSet *pParent, bool fOpened)
    286         : UIGDetailsElementInterface(pParent, DetailsElementType_Audio, fOpened) {}
    287 
    288 private:
    289 
    290     /** Creates update task for this element. */
    291     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskAudio(machine()); }
     260class UIDetailsUpdateTaskAudio : public UIDetailsUpdateTask
     261{
     262    Q_OBJECT;
     263
     264public:
     265
     266    /** Constructs update task passing @a machine to the base-class. */
     267    UIDetailsUpdateTaskAudio(const CMachine &machine)
     268        : UIDetailsUpdateTask(machine) {}
     269
     270private:
     271
     272    /** Contains update task body. */
     273    void run();
     274};
     275
     276/** UIDetailsElementInterface extension for the details-element type 'Audio'. */
     277class UIDetailsElementAudio : public UIDetailsElementInterface
     278{
     279    Q_OBJECT;
     280
     281public:
     282
     283    /** Constructs details-element object for passed @a pParent set.
     284      * @param fOpened brings whether the details-element should be visually opened. */
     285    UIDetailsElementAudio(UIDetailsSet *pParent, bool fOpened)
     286        : UIDetailsElementInterface(pParent, DetailsElementType_Audio, fOpened) {}
     287
     288private:
     289
     290    /** Creates update task for this element. */
     291    UITask* createUpdateTask() { return new UIDetailsUpdateTaskAudio(machine()); }
    292292};
    293293
    294294
    295295/** UITask extension used as update task for the details-element type 'Network'. */
    296 class UIGDetailsUpdateTaskNetwork : public UIGDetailsUpdateTask
    297 {
    298     Q_OBJECT;
    299 
    300 public:
    301 
    302     /** Constructs update task passing @a machine to the base-class. */
    303     UIGDetailsUpdateTaskNetwork(const CMachine &machine)
    304         : UIGDetailsUpdateTask(machine) {}
     296class UIDetailsUpdateTaskNetwork : public UIDetailsUpdateTask
     297{
     298    Q_OBJECT;
     299
     300public:
     301
     302    /** Constructs update task passing @a machine to the base-class. */
     303    UIDetailsUpdateTaskNetwork(const CMachine &machine)
     304        : UIDetailsUpdateTask(machine) {}
    305305
    306306private:
     
    313313};
    314314
    315 /** UIGDetailsElementInterface extension for the details-element type 'Network'. */
    316 class UIGDetailsElementNetwork : public UIGDetailsElementInterface
    317 {
    318     Q_OBJECT;
    319 
    320 public:
    321 
    322     /** Constructs details-element object for passed @a pParent set.
    323       * @param fOpened brings whether the details-element should be visually opened. */
    324     UIGDetailsElementNetwork(UIGDetailsSet *pParent, bool fOpened)
    325         : UIGDetailsElementInterface(pParent, DetailsElementType_Network, fOpened) {}
    326 
    327 private:
    328 
    329     /** Creates update task for this element. */
    330     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskNetwork(machine()); }
     315/** UIDetailsElementInterface extension for the details-element type 'Network'. */
     316class UIDetailsElementNetwork : public UIDetailsElementInterface
     317{
     318    Q_OBJECT;
     319
     320public:
     321
     322    /** Constructs details-element object for passed @a pParent set.
     323      * @param fOpened brings whether the details-element should be visually opened. */
     324    UIDetailsElementNetwork(UIDetailsSet *pParent, bool fOpened)
     325        : UIDetailsElementInterface(pParent, DetailsElementType_Network, fOpened) {}
     326
     327private:
     328
     329    /** Creates update task for this element. */
     330    UITask* createUpdateTask() { return new UIDetailsUpdateTaskNetwork(machine()); }
    331331};
    332332
    333333
    334334/** UITask extension used as update task for the details-element type 'Serial'. */
    335 class UIGDetailsUpdateTaskSerial : public UIGDetailsUpdateTask
    336 {
    337     Q_OBJECT;
    338 
    339 public:
    340 
    341     /** Constructs update task passing @a machine to the base-class. */
    342     UIGDetailsUpdateTaskSerial(const CMachine &machine)
    343         : UIGDetailsUpdateTask(machine) {}
    344 
    345 private:
    346 
    347     /** Contains update task body. */
    348     void run();
    349 };
    350 
    351 /** UIGDetailsElementInterface extension for the details-element type 'Serial'. */
    352 class UIGDetailsElementSerial : public UIGDetailsElementInterface
    353 {
    354     Q_OBJECT;
    355 
    356 public:
    357 
    358     /** Constructs details-element object for passed @a pParent set.
    359       * @param fOpened brings whether the details-element should be visually opened. */
    360     UIGDetailsElementSerial(UIGDetailsSet *pParent, bool fOpened)
    361         : UIGDetailsElementInterface(pParent, DetailsElementType_Serial, fOpened) {}
    362 
    363 private:
    364 
    365     /** Creates update task for this element. */
    366     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskSerial(machine()); }
     335class UIDetailsUpdateTaskSerial : public UIDetailsUpdateTask
     336{
     337    Q_OBJECT;
     338
     339public:
     340
     341    /** Constructs update task passing @a machine to the base-class. */
     342    UIDetailsUpdateTaskSerial(const CMachine &machine)
     343        : UIDetailsUpdateTask(machine) {}
     344
     345private:
     346
     347    /** Contains update task body. */
     348    void run();
     349};
     350
     351/** UIDetailsElementInterface extension for the details-element type 'Serial'. */
     352class UIDetailsElementSerial : public UIDetailsElementInterface
     353{
     354    Q_OBJECT;
     355
     356public:
     357
     358    /** Constructs details-element object for passed @a pParent set.
     359      * @param fOpened brings whether the details-element should be visually opened. */
     360    UIDetailsElementSerial(UIDetailsSet *pParent, bool fOpened)
     361        : UIDetailsElementInterface(pParent, DetailsElementType_Serial, fOpened) {}
     362
     363private:
     364
     365    /** Creates update task for this element. */
     366    UITask* createUpdateTask() { return new UIDetailsUpdateTaskSerial(machine()); }
    367367};
    368368
    369369
    370370/** UITask extension used as update task for the details-element type 'USB'. */
    371 class UIGDetailsUpdateTaskUSB : public UIGDetailsUpdateTask
    372 {
    373     Q_OBJECT;
    374 
    375 public:
    376 
    377     /** Constructs update task passing @a machine to the base-class. */
    378     UIGDetailsUpdateTaskUSB(const CMachine &machine)
    379         : UIGDetailsUpdateTask(machine) {}
    380 
    381 private:
    382 
    383     /** Contains update task body. */
    384     void run();
    385 };
    386 
    387 /** UIGDetailsElementInterface extension for the details-element type 'USB'. */
    388 class UIGDetailsElementUSB : public UIGDetailsElementInterface
    389 {
    390     Q_OBJECT;
    391 
    392 public:
    393 
    394     /** Constructs details-element object for passed @a pParent set.
    395       * @param fOpened brings whether the details-element should be visually opened. */
    396     UIGDetailsElementUSB(UIGDetailsSet *pParent, bool fOpened)
    397         : UIGDetailsElementInterface(pParent, DetailsElementType_USB, fOpened) {}
    398 
    399 private:
    400 
    401     /** Creates update task for this element. */
    402     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskUSB(machine()); }
     371class UIDetailsUpdateTaskUSB : public UIDetailsUpdateTask
     372{
     373    Q_OBJECT;
     374
     375public:
     376
     377    /** Constructs update task passing @a machine to the base-class. */
     378    UIDetailsUpdateTaskUSB(const CMachine &machine)
     379        : UIDetailsUpdateTask(machine) {}
     380
     381private:
     382
     383    /** Contains update task body. */
     384    void run();
     385};
     386
     387/** UIDetailsElementInterface extension for the details-element type 'USB'. */
     388class UIDetailsElementUSB : public UIDetailsElementInterface
     389{
     390    Q_OBJECT;
     391
     392public:
     393
     394    /** Constructs details-element object for passed @a pParent set.
     395      * @param fOpened brings whether the details-element should be visually opened. */
     396    UIDetailsElementUSB(UIDetailsSet *pParent, bool fOpened)
     397        : UIDetailsElementInterface(pParent, DetailsElementType_USB, fOpened) {}
     398
     399private:
     400
     401    /** Creates update task for this element. */
     402    UITask* createUpdateTask() { return new UIDetailsUpdateTaskUSB(machine()); }
    403403};
    404404
    405405
    406406/** UITask extension used as update task for the details-element type 'SF'. */
    407 class UIGDetailsUpdateTaskSF : public UIGDetailsUpdateTask
    408 {
    409     Q_OBJECT;
    410 
    411 public:
    412 
    413     /** Constructs update task passing @a machine to the base-class. */
    414     UIGDetailsUpdateTaskSF(const CMachine &machine)
    415         : UIGDetailsUpdateTask(machine) {}
    416 
    417 private:
    418 
    419     /** Contains update task body. */
    420     void run();
    421 };
    422 
    423 /** UIGDetailsElementInterface extension for the details-element type 'SF'. */
    424 class UIGDetailsElementSF : public UIGDetailsElementInterface
    425 {
    426     Q_OBJECT;
    427 
    428 public:
    429 
    430     /** Constructs details-element object for passed @a pParent set.
    431       * @param fOpened brings whether the details-element should be visually opened. */
    432     UIGDetailsElementSF(UIGDetailsSet *pParent, bool fOpened)
    433         : UIGDetailsElementInterface(pParent, DetailsElementType_SF, fOpened) {}
    434 
    435 private:
    436 
    437     /** Creates update task for this element. */
    438     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskSF(machine()); }
     407class UIDetailsUpdateTaskSF : public UIDetailsUpdateTask
     408{
     409    Q_OBJECT;
     410
     411public:
     412
     413    /** Constructs update task passing @a machine to the base-class. */
     414    UIDetailsUpdateTaskSF(const CMachine &machine)
     415        : UIDetailsUpdateTask(machine) {}
     416
     417private:
     418
     419    /** Contains update task body. */
     420    void run();
     421};
     422
     423/** UIDetailsElementInterface extension for the details-element type 'SF'. */
     424class UIDetailsElementSF : public UIDetailsElementInterface
     425{
     426    Q_OBJECT;
     427
     428public:
     429
     430    /** Constructs details-element object for passed @a pParent set.
     431      * @param fOpened brings whether the details-element should be visually opened. */
     432    UIDetailsElementSF(UIDetailsSet *pParent, bool fOpened)
     433        : UIDetailsElementInterface(pParent, DetailsElementType_SF, fOpened) {}
     434
     435private:
     436
     437    /** Creates update task for this element. */
     438    UITask* createUpdateTask() { return new UIDetailsUpdateTaskSF(machine()); }
    439439};
    440440
    441441
    442442/** UITask extension used as update task for the details-element type 'UI'. */
    443 class UIGDetailsUpdateTaskUI : public UIGDetailsUpdateTask
    444 {
    445     Q_OBJECT;
    446 
    447 public:
    448 
    449     /** Constructs update task passing @a machine to the base-class. */
    450     UIGDetailsUpdateTaskUI(const CMachine &machine)
    451         : UIGDetailsUpdateTask(machine) {}
    452 
    453 private:
    454 
    455     /** Contains update task body. */
    456     void run();
    457 };
    458 
    459 /** UIGDetailsElementInterface extension for the details-element type 'UI'. */
    460 class UIGDetailsElementUI : public UIGDetailsElementInterface
    461 {
    462     Q_OBJECT;
    463 
    464 public:
    465 
    466     /** Constructs details-element object for passed @a pParent set.
    467       * @param fOpened brings whether the details-element should be visually opened. */
    468     UIGDetailsElementUI(UIGDetailsSet *pParent, bool fOpened)
    469         : UIGDetailsElementInterface(pParent, DetailsElementType_UI, fOpened) {}
    470 
    471 private:
    472 
    473     /** Creates update task for this element. */
    474     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskUI(machine()); }
     443class UIDetailsUpdateTaskUI : public UIDetailsUpdateTask
     444{
     445    Q_OBJECT;
     446
     447public:
     448
     449    /** Constructs update task passing @a machine to the base-class. */
     450    UIDetailsUpdateTaskUI(const CMachine &machine)
     451        : UIDetailsUpdateTask(machine) {}
     452
     453private:
     454
     455    /** Contains update task body. */
     456    void run();
     457};
     458
     459/** UIDetailsElementInterface extension for the details-element type 'UI'. */
     460class UIDetailsElementUI : public UIDetailsElementInterface
     461{
     462    Q_OBJECT;
     463
     464public:
     465
     466    /** Constructs details-element object for passed @a pParent set.
     467      * @param fOpened brings whether the details-element should be visually opened. */
     468    UIDetailsElementUI(UIDetailsSet *pParent, bool fOpened)
     469        : UIDetailsElementInterface(pParent, DetailsElementType_UI, fOpened) {}
     470
     471private:
     472
     473    /** Creates update task for this element. */
     474    UITask* createUpdateTask() { return new UIDetailsUpdateTaskUI(machine()); }
    475475};
    476476
    477477
    478478/** UITask extension used as update task for the details-element type 'Description'. */
    479 class UIGDetailsUpdateTaskDescription : public UIGDetailsUpdateTask
    480 {
    481     Q_OBJECT;
    482 
    483 public:
    484 
    485     /** Constructs update task passing @a machine to the base-class. */
    486     UIGDetailsUpdateTaskDescription(const CMachine &machine)
    487         : UIGDetailsUpdateTask(machine) {}
    488 
    489 private:
    490 
    491     /** Contains update task body. */
    492     void run();
    493 };
    494 
    495 /** UIGDetailsElementInterface extension for the details-element type 'Description'. */
    496 class UIGDetailsElementDescription : public UIGDetailsElementInterface
    497 {
    498     Q_OBJECT;
    499 
    500 public:
    501 
    502     /** Constructs details-element object for passed @a pParent set.
    503       * @param fOpened brings whether the details-element should be visually opened. */
    504     UIGDetailsElementDescription(UIGDetailsSet *pParent, bool fOpened)
    505         : UIGDetailsElementInterface(pParent, DetailsElementType_Description, fOpened) {}
    506 
    507 private:
    508 
    509     /** Creates update task for this element. */
    510     UITask* createUpdateTask() { return new UIGDetailsUpdateTaskDescription(machine()); }
    511 };
    512 
    513 #endif /* !___UIGDetailsElements_h___ */
    514 
     479class UIDetailsUpdateTaskDescription : public UIDetailsUpdateTask
     480{
     481    Q_OBJECT;
     482
     483public:
     484
     485    /** Constructs update task passing @a machine to the base-class. */
     486    UIDetailsUpdateTaskDescription(const CMachine &machine)
     487        : UIDetailsUpdateTask(machine) {}
     488
     489private:
     490
     491    /** Contains update task body. */
     492    void run();
     493};
     494
     495/** UIDetailsElementInterface extension for the details-element type 'Description'. */
     496class UIDetailsElementDescription : public UIDetailsElementInterface
     497{
     498    Q_OBJECT;
     499
     500public:
     501
     502    /** Constructs details-element object for passed @a pParent set.
     503      * @param fOpened brings whether the details-element should be visually opened. */
     504    UIDetailsElementDescription(UIDetailsSet *pParent, bool fOpened)
     505        : UIDetailsElementInterface(pParent, DetailsElementType_Description, fOpened) {}
     506
     507private:
     508
     509    /** Creates update task for this element. */
     510    UITask* createUpdateTask() { return new UIDetailsUpdateTaskDescription(machine()); }
     511};
     512
     513#endif /* !___UIDetailsElements_h___ */
     514
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsGroup class implementation.
     3 * VBox Qt GUI - UIDetailsGroup class implementation.
    44 */
    55
     
    2525
    2626/* GUI includes: */
    27 # include "UIGDetailsGroup.h"
    28 # include "UIGDetailsSet.h"
    29 # include "UIGDetailsModel.h"
     27# include "UIDetailsGroup.h"
     28# include "UIDetailsSet.h"
     29# include "UIDetailsModel.h"
    3030# include "UIExtraDataManager.h"
    3131# include "VBoxGlobal.h"
    32 # include "UIVMItem.h"
     32# include "UIVirtualMachineItem.h"
    3333
    3434#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
    3535
    3636
    37 UIGDetailsGroup::UIGDetailsGroup(QGraphicsScene *pParent)
    38     : UIGDetailsItem(0)
     37UIDetailsGroup::UIDetailsGroup(QGraphicsScene *pParent)
     38    : UIDetailsItem(0)
    3939    , m_iPreviousMinimumWidthHint(0)
    4040    , m_iPreviousMinimumHeightHint(0)
     
    4848}
    4949
    50 UIGDetailsGroup::~UIGDetailsGroup()
     50UIDetailsGroup::~UIDetailsGroup()
    5151{
    5252    /* Cleanup items: */
     
    5454}
    5555
    56 void UIGDetailsGroup::buildGroup(const QList<UIVMItem*> &machineItems)
     56void UIDetailsGroup::buildGroup(const QList<UIVirtualMachineItem*> &machineItems)
    5757{
    5858    /* Remember passed machine-items: */
     
    7070}
    7171
    72 void UIGDetailsGroup::rebuildGroup()
     72void UIDetailsGroup::rebuildGroup()
    7373{
    7474    /* Cleanup build-step: */
     
    8383}
    8484
    85 void UIGDetailsGroup::stopBuildingGroup()
     85void UIDetailsGroup::stopBuildingGroup()
    8686{
    8787    /* Generate new group-id: */
     
    8989}
    9090
    91 void UIGDetailsGroup::sltBuildStep(QString strStepId, int iStepNumber)
     91void UIDetailsGroup::sltBuildStep(QString strStepId, int iStepNumber)
    9292{
    9393    /* Cleanup build-step: */
     
    103103    {
    104104        /* Should we create a new set for this step? */
    105         UIGDetailsSet *pSet = 0;
     105        UIDetailsSet *pSet = 0;
    106106        if (iStepNumber > m_items.size() - 1)
    107             pSet = new UIGDetailsSet(this);
     107            pSet = new UIDetailsSet(this);
    108108        /* Or use existing? */
    109109        else
     
    111111
    112112        /* Create next build-step: */
    113         m_pBuildStep = new UIBuildStep(this, pSet, strStepId, iStepNumber + 1);
     113        m_pBuildStep = new UIPrepareStep(this, pSet, strStepId, iStepNumber + 1);
    114114
    115115        /* Build set: */
     
    123123}
    124124
    125 QVariant UIGDetailsGroup::data(int iKey) const
     125QVariant UIDetailsGroup::data(int iKey) const
    126126{
    127127    /* Provide other members with required data: */
     
    137137}
    138138
    139 void UIGDetailsGroup::addItem(UIGDetailsItem *pItem)
     139void UIDetailsGroup::addItem(UIDetailsItem *pItem)
    140140{
    141141    switch (pItem->type())
    142142    {
    143         case UIGDetailsItemType_Set: m_items.append(pItem); break;
    144         default: AssertMsgFailed(("Invalid item type!")); break;
    145     }
    146 }
    147 
    148 void UIGDetailsGroup::removeItem(UIGDetailsItem *pItem)
     143        case UIDetailsItemType_Set: m_items.append(pItem); break;
     144        default: AssertMsgFailed(("Invalid item type!")); break;
     145    }
     146}
     147
     148void UIDetailsGroup::removeItem(UIDetailsItem *pItem)
    149149{
    150150    switch (pItem->type())
    151151    {
    152         case UIGDetailsItemType_Set: m_items.removeAt(m_items.indexOf(pItem)); break;
    153         default: AssertMsgFailed(("Invalid item type!")); break;
    154     }
    155 }
    156 
    157 QList<UIGDetailsItem*> UIGDetailsGroup::items(UIGDetailsItemType type /* = UIGDetailsItemType_Set */) const
     152        case UIDetailsItemType_Set: m_items.removeAt(m_items.indexOf(pItem)); break;
     153        default: AssertMsgFailed(("Invalid item type!")); break;
     154    }
     155}
     156
     157QList<UIDetailsItem*> UIDetailsGroup::items(UIDetailsItemType type /* = UIDetailsItemType_Set */) const
    158158{
    159159    switch (type)
    160160    {
    161         case UIGDetailsItemType_Set: return m_items;
    162         case UIGDetailsItemType_Any: return items(UIGDetailsItemType_Set);
    163         default: AssertMsgFailed(("Invalid item type!")); break;
    164     }
    165     return QList<UIGDetailsItem*>();
    166 }
    167 
    168 bool UIGDetailsGroup::hasItems(UIGDetailsItemType type /* = UIGDetailsItemType_Set */) const
     161        case UIDetailsItemType_Set: return m_items;
     162        case UIDetailsItemType_Any: return items(UIDetailsItemType_Set);
     163        default: AssertMsgFailed(("Invalid item type!")); break;
     164    }
     165    return QList<UIDetailsItem*>();
     166}
     167
     168bool UIDetailsGroup::hasItems(UIDetailsItemType type /* = UIDetailsItemType_Set */) const
    169169{
    170170    switch (type)
    171171    {
    172         case UIGDetailsItemType_Set: return !m_items.isEmpty();
    173         case UIGDetailsItemType_Any: return hasItems(UIGDetailsItemType_Set);
     172        case UIDetailsItemType_Set: return !m_items.isEmpty();
     173        case UIDetailsItemType_Any: return hasItems(UIDetailsItemType_Set);
    174174        default: AssertMsgFailed(("Invalid item type!")); break;
    175175    }
     
    177177}
    178178
    179 void UIGDetailsGroup::clearItems(UIGDetailsItemType type /* = UIGDetailsItemType_Set */)
     179void UIDetailsGroup::clearItems(UIDetailsItemType type /* = UIDetailsItemType_Set */)
    180180{
    181181    switch (type)
    182182    {
    183         case UIGDetailsItemType_Set: while (!m_items.isEmpty()) { delete m_items.last(); } break;
    184         case UIGDetailsItemType_Any: clearItems(UIGDetailsItemType_Set); break;
    185         default: AssertMsgFailed(("Invalid item type!")); break;
    186     }
    187 }
    188 
    189 void UIGDetailsGroup::prepareConnections()
     183        case UIDetailsItemType_Set: while (!m_items.isEmpty()) { delete m_items.last(); } break;
     184        case UIDetailsItemType_Any: clearItems(UIDetailsItemType_Set); break;
     185        default: AssertMsgFailed(("Invalid item type!")); break;
     186    }
     187}
     188
     189void UIDetailsGroup::prepareConnections()
    190190{
    191191    /* Prepare group-item connections: */
     
    196196}
    197197
    198 void UIGDetailsGroup::updateGeometry()
     198void UIDetailsGroup::updateGeometry()
    199199{
    200200    /* Call to base class: */
    201     UIGDetailsItem::updateGeometry();
     201    UIDetailsItem::updateGeometry();
    202202
    203203    /* Group-item should notify details-view if minimum-width-hint was changed: */
     
    219219}
    220220
    221 int UIGDetailsGroup::minimumWidthHint() const
     221int UIDetailsGroup::minimumWidthHint() const
    222222{
    223223    /* Prepare variables: */
     
    227227    /* For each the set we have: */
    228228    bool fHasItems = false;
    229     foreach (UIGDetailsItem *pItem, items())
     229    foreach (UIDetailsItem *pItem, items())
    230230    {
    231231        /* Ignore which are with no details: */
    232         if (UIGDetailsSet *pSetItem = pItem->toSet())
     232        if (UIDetailsSet *pSetItem = pItem->toSet())
    233233            if (!pSetItem->hasDetails())
    234234                continue;
     
    247247}
    248248
    249 int UIGDetailsGroup::minimumHeightHint() const
     249int UIDetailsGroup::minimumHeightHint() const
    250250{
    251251    /* Prepare variables: */
     
    256256    /* For each the set we have: */
    257257    bool fHasItems = false;
    258     foreach (UIGDetailsItem *pItem, items())
     258    foreach (UIDetailsItem *pItem, items())
    259259    {
    260260        /* Ignore which are with no details: */
    261         if (UIGDetailsSet *pSetItem = pItem->toSet())
     261        if (UIDetailsSet *pSetItem = pItem->toSet())
    262262            if (!pSetItem->hasDetails())
    263263                continue;
     
    279279}
    280280
    281 void UIGDetailsGroup::updateLayout()
     281void UIDetailsGroup::updateLayout()
    282282{
    283283    /* Prepare variables: */
     
    288288
    289289    /* Layout all the sets: */
    290     foreach (UIGDetailsItem *pItem, items())
     290    foreach (UIDetailsItem *pItem, items())
    291291    {
    292292        /* Ignore sets with no details: */
    293         if (UIGDetailsSet *pSetItem = pItem->toSet())
     293        if (UIDetailsSet *pSetItem = pItem->toSet())
    294294            if (!pSetItem->hasDetails())
    295295                continue;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsGroup class declaration.
     3 * VBox Qt GUI - UIDetailsGroup class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGDetailsGroup_h__
    19 #define __UIGDetailsGroup_h__
     18#ifndef __UIDetailsGroup_h__
     19#define __UIDetailsGroup_h__
    2020
    2121/* GUI includes: */
    22 #include "UIGDetailsItem.h"
     22#include "UIDetailsItem.h"
    2323
    2424/* Forward declarations: */
    25 class UIVMItem;
     25class UIVirtualMachineItem;
    2626class QGraphicsScene;
    2727
    2828/* Details group
    2929 * for graphics details model/view architecture: */
    30 class UIGDetailsGroup : public UIGDetailsItem
     30class UIDetailsGroup : public UIDetailsItem
    3131{
    3232    Q_OBJECT;
     
    4141
    4242    /* Graphics-item type: */
    43     enum { Type = UIGDetailsItemType_Group };
     43    enum { Type = UIDetailsItemType_Group };
    4444    int type() const { return Type; }
    4545
    4646    /* Constructor/destructor: */
    47     UIGDetailsGroup(QGraphicsScene *pParent);
    48     ~UIGDetailsGroup();
     47    UIDetailsGroup(QGraphicsScene *pParent);
     48    ~UIDetailsGroup();
    4949
    5050    /* API: Build stuff: */
    51     void buildGroup(const QList<UIVMItem*> &machineItems);
     51    void buildGroup(const QList<UIVirtualMachineItem*> &machineItems);
    5252    void rebuildGroup();
    5353    void stopBuildingGroup();
     
    7575
    7676    /* Hidden API: Children stuff: */
    77     void addItem(UIGDetailsItem *pItem);
    78     void removeItem(UIGDetailsItem *pItem);
    79     QList<UIGDetailsItem*> items(UIGDetailsItemType type = UIGDetailsItemType_Set) const;
    80     bool hasItems(UIGDetailsItemType type = UIGDetailsItemType_Set) const;
    81     void clearItems(UIGDetailsItemType type = UIGDetailsItemType_Set);
     77    void addItem(UIDetailsItem *pItem);
     78    void removeItem(UIDetailsItem *pItem);
     79    QList<UIDetailsItem*> items(UIDetailsItemType type = UIDetailsItemType_Set) const;
     80    bool hasItems(UIDetailsItemType type = UIDetailsItemType_Set) const;
     81    void clearItems(UIDetailsItemType type = UIDetailsItemType_Set);
    8282
    8383    /* Helpers: Prepare stuff: */
     
    9393    int m_iPreviousMinimumWidthHint;
    9494    int m_iPreviousMinimumHeightHint;
    95     QList<UIGDetailsItem*> m_items;
    96     QList<UIVMItem*> m_machineItems;
    97     UIBuildStep *m_pBuildStep;
     95    QList<UIDetailsItem*> m_items;
     96    QList<UIVirtualMachineItem*> m_machineItems;
     97    UIPrepareStep *m_pBuildStep;
    9898    QString m_strGroupId;
    9999
    100100    /* Friends: */
    101     friend class UIGDetailsModel;
     101    friend class UIDetailsModel;
    102102};
    103103
    104 #endif /* __UIGDetailsGroup_h__ */
     104#endif /* __UIDetailsGroup_h__ */
    105105
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsItem.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsItem class definition.
     3 * VBox Qt GUI - UIDetailsItem class definition.
    44 */
    55
     
    2929/* GUI includes: */
    3030# include "UIGraphicsTextPane.h"
    31 # include "UIGDetailsGroup.h"
    32 # include "UIGDetailsSet.h"
    33 # include "UIGDetailsElement.h"
    34 # include "UIGDetailsModel.h"
    35 # include "UIGDetailsView.h"
    36 # include "UIGDetails.h"
     31# include "UIDetailsGroup.h"
     32# include "UIDetailsSet.h"
     33# include "UIDetailsElement.h"
     34# include "UIDetailsModel.h"
     35# include "UIDetailsView.h"
     36# include "UIDetails.h"
    3737
    3838#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    4040
    4141/** QAccessibleObject extension used as an accessibility interface for Details-view items. */
    42 class UIAccessibilityInterfaceForUIGDetailsItem : public QAccessibleObject
     42class UIAccessibilityInterfaceForUIDetailsItem : public QAccessibleObject
    4343{
    4444public:
     
    4848    {
    4949        /* Creating Details-view accessibility interface: */
    50         if (pObject && strClassname == QLatin1String("UIGDetailsItem"))
    51             return new UIAccessibilityInterfaceForUIGDetailsItem(pObject);
     50        if (pObject && strClassname == QLatin1String("UIDetailsItem"))
     51            return new UIAccessibilityInterfaceForUIDetailsItem(pObject);
    5252
    5353        /* Null by default: */
     
    5656
    5757    /** Constructs an accessibility interface passing @a pObject to the base-class. */
    58     UIAccessibilityInterfaceForUIGDetailsItem(QObject *pObject)
     58    UIAccessibilityInterfaceForUIDetailsItem(QObject *pObject)
    5959        : QAccessibleObject(pObject)
    6060    {}
     
    7070        {
    7171            /* For a set: */
    72             case UIGDetailsItemType_Set:
     72            case UIDetailsItemType_Set:
    7373            {
    7474                /* Always return parent view: */
     
    7676            }
    7777            /* For an element: */
    78             case UIGDetailsItemType_Element:
     78            case UIDetailsItemType_Element:
    7979            {
    8080                /* What amount of children root has? */
     
    105105        switch (item()->type())
    106106        {
    107             case UIGDetailsItemType_Set:     return item()->items().size();
    108             case UIGDetailsItemType_Element: return item()->toElement()->text().size();
     107            case UIDetailsItemType_Set:     return item()->items().size();
     108            case UIDetailsItemType_Element: return item()->toElement()->text().size();
    109109            default: break;
    110110        }
     
    125125        switch (item()->type())
    126126        {
    127             case UIGDetailsItemType_Set:     return QAccessible::queryAccessibleInterface(item()->items().at(iIndex));
    128             case UIGDetailsItemType_Element: return QAccessible::queryAccessibleInterface(&item()->toElement()->text()[iIndex]);
     127            case UIDetailsItemType_Set:     return QAccessible::queryAccessibleInterface(item()->items().at(iIndex));
     128            case UIDetailsItemType_Element: return QAccessible::queryAccessibleInterface(&item()->toElement()->text()[iIndex]);
    129129            default: break;
    130130        }
     
    189189
    190190    /** Returns corresponding Details-view item. */
    191     UIGDetailsItem *item() const { return qobject_cast<UIGDetailsItem*>(object()); }
     191    UIDetailsItem *item() const { return qobject_cast<UIDetailsItem*>(object()); }
    192192};
    193193
    194194
    195 UIGDetailsItem::UIGDetailsItem(UIGDetailsItem *pParent)
     195UIDetailsItem::UIDetailsItem(UIDetailsItem *pParent)
    196196    : QIWithRetranslateUI4<QIGraphicsWidget>(pParent)
    197197    , m_pParent(pParent)
    198198{
    199199    /* Install Details-view item accessibility interface factory: */
    200     QAccessible::installFactory(UIAccessibilityInterfaceForUIGDetailsItem::pFactory);
     200    QAccessible::installFactory(UIAccessibilityInterfaceForUIDetailsItem::pFactory);
    201201
    202202    /* Basic item setup: */
     
    218218}
    219219
    220 UIGDetailsGroup* UIGDetailsItem::toGroup()
    221 {
    222     UIGDetailsGroup *pItem = qgraphicsitem_cast<UIGDetailsGroup*>(this);
    223     AssertMsg(pItem, ("Trying to cast invalid item type to UIGDetailsGroup!"));
     220UIDetailsGroup* UIDetailsItem::toGroup()
     221{
     222    UIDetailsGroup *pItem = qgraphicsitem_cast<UIDetailsGroup*>(this);
     223    AssertMsg(pItem, ("Trying to cast invalid item type to UIDetailsGroup!"));
    224224    return pItem;
    225225}
    226226
    227 UIGDetailsSet* UIGDetailsItem::toSet()
    228 {
    229     UIGDetailsSet *pItem = qgraphicsitem_cast<UIGDetailsSet*>(this);
    230     AssertMsg(pItem, ("Trying to cast invalid item type to UIGDetailsSet!"));
     227UIDetailsSet* UIDetailsItem::toSet()
     228{
     229    UIDetailsSet *pItem = qgraphicsitem_cast<UIDetailsSet*>(this);
     230    AssertMsg(pItem, ("Trying to cast invalid item type to UIDetailsSet!"));
    231231    return pItem;
    232232}
    233233
    234 UIGDetailsElement* UIGDetailsItem::toElement()
    235 {
    236     UIGDetailsElement *pItem = qgraphicsitem_cast<UIGDetailsElement*>(this);
    237     AssertMsg(pItem, ("Trying to cast invalid item type to UIGDetailsElement!"));
     234UIDetailsElement* UIDetailsItem::toElement()
     235{
     236    UIDetailsElement *pItem = qgraphicsitem_cast<UIDetailsElement*>(this);
     237    AssertMsg(pItem, ("Trying to cast invalid item type to UIDetailsElement!"));
    238238    return pItem;
    239239}
    240240
    241 UIGDetailsModel* UIGDetailsItem::model() const
    242 {
    243     UIGDetailsModel *pModel = qobject_cast<UIGDetailsModel*>(QIGraphicsWidget::scene()->parent());
     241UIDetailsModel* UIDetailsItem::model() const
     242{
     243    UIDetailsModel *pModel = qobject_cast<UIDetailsModel*>(QIGraphicsWidget::scene()->parent());
    244244    AssertMsg(pModel, ("Incorrect graphics scene parent set!"));
    245245    return pModel;
    246246}
    247247
    248 UIGDetailsItem* UIGDetailsItem::parentItem() const
     248UIDetailsItem* UIDetailsItem::parentItem() const
    249249{
    250250    return m_pParent;
    251251}
    252252
    253 void UIGDetailsItem::updateGeometry()
     253void UIDetailsItem::updateGeometry()
    254254{
    255255    /* Call to base-class: */
     
    261261}
    262262
    263 QSizeF UIGDetailsItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const
     263QSizeF UIDetailsItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const
    264264{
    265265    /* If Qt::MinimumSize or Qt::PreferredSize requested: */
     
    271271}
    272272
    273 void UIGDetailsItem::sltBuildStep(QString, int)
     273void UIDetailsItem::sltBuildStep(QString, int)
    274274{
    275275    AssertMsgFailed(("This item doesn't support building!"));
     
    277277
    278278/* static */
    279 void UIGDetailsItem::configurePainterShape(QPainter *pPainter,
     279void UIDetailsItem::configurePainterShape(QPainter *pPainter,
    280280                                           const QStyleOptionGraphicsItem *pOption,
    281281                                           int iRadius)
     
    293293
    294294/* static */
    295 void UIGDetailsItem::paintFrameRect(QPainter *pPainter, const QRect &rect, int iRadius)
     295void UIDetailsItem::paintFrameRect(QPainter *pPainter, const QRect &rect, int iRadius)
    296296{
    297297    pPainter->save();
     
    307307
    308308/* static */
    309 void UIGDetailsItem::paintPixmap(QPainter *pPainter, const QRect &rect, const QPixmap &pixmap)
     309void UIDetailsItem::paintPixmap(QPainter *pPainter, const QRect &rect, const QPixmap &pixmap)
    310310{
    311311    pPainter->drawPixmap(rect, pixmap);
     
    313313
    314314/* static */
    315 void UIGDetailsItem::paintText(QPainter *pPainter, QPoint point,
     315void UIDetailsItem::paintText(QPainter *pPainter, QPoint point,
    316316                               const QFont &font, QPaintDevice *pPaintDevice,
    317317                               const QString &strText, const QColor &color)
     
    329329}
    330330
    331 UIBuildStep::UIBuildStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber)
     331UIPrepareStep::UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber)
    332332    : QObject(pParent)
    333333    , m_strStepId(strStepId)
     
    339339}
    340340
    341 void UIBuildStep::sltStepDone()
     341void UIPrepareStep::sltStepDone()
    342342{
    343343    emit sigStepDone(m_strStepId, m_iStepNumber);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsItem.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsItem class declaration.
     3 * VBox Qt GUI - UIDetailsItem class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGDetailsItem_h__
    19 #define __UIGDetailsItem_h__
     18#ifndef __UIDetailsItem_h__
     19#define __UIDetailsItem_h__
    2020
    2121/* GUI includes: */
     
    2424
    2525/* Forward declaration: */
    26 class UIGDetailsModel;
     26class UIDetailsModel;
    2727class QGraphicsSceneHoverEvent;
    2828class QGraphicsSceneMouseEvent;
    29 class UIGDetailsGroup;
    30 class UIGDetailsSet;
    31 class UIGDetailsElement;
     29class UIDetailsGroup;
     30class UIDetailsSet;
     31class UIDetailsElement;
    3232
    33 /* UIGDetailsItem types: */
    34 enum UIGDetailsItemType
     33/* UIDetailsItem types: */
     34enum UIDetailsItemType
    3535{
    36     UIGDetailsItemType_Any     = QGraphicsItem::UserType,
    37     UIGDetailsItemType_Group   = QGraphicsItem::UserType + 1,
    38     UIGDetailsItemType_Set     = QGraphicsItem::UserType + 2,
    39     UIGDetailsItemType_Element = QGraphicsItem::UserType + 3,
    40     UIGDetailsItemType_Preview = QGraphicsItem::UserType + 10
     36    UIDetailsItemType_Any     = QGraphicsItem::UserType,
     37    UIDetailsItemType_Group   = QGraphicsItem::UserType + 1,
     38    UIDetailsItemType_Set     = QGraphicsItem::UserType + 2,
     39    UIDetailsItemType_Element = QGraphicsItem::UserType + 3,
     40    UIDetailsItemType_Preview = QGraphicsItem::UserType + 10
    4141};
    4242
    4343/* Details item interface
    4444 * for graphics details model/view architecture: */
    45 class UIGDetailsItem : public QIWithRetranslateUI4<QIGraphicsWidget>
     45class UIDetailsItem : public QIWithRetranslateUI4<QIGraphicsWidget>
    4646{
    4747    Q_OBJECT;
     
    5656
    5757    /* Constructor: */
    58     UIGDetailsItem(UIGDetailsItem *pParent);
     58    UIDetailsItem(UIDetailsItem *pParent);
    5959
    6060    /* API: Cast stuff: */
    61     UIGDetailsGroup* toGroup();
    62     UIGDetailsSet* toSet();
    63     UIGDetailsElement* toElement();
     61    UIDetailsGroup* toGroup();
     62    UIDetailsSet* toSet();
     63    UIDetailsElement* toElement();
    6464
    6565    /* API: Model stuff: */
    66     UIGDetailsModel* model() const;
     66    UIDetailsModel* model() const;
    6767
    6868    /* API: Parent stuff: */
    69     UIGDetailsItem* parentItem() const;
     69    UIDetailsItem* parentItem() const;
    7070
    7171    /** Returns the description of the item. */
     
    7373
    7474    /* API: Children stuff: */
    75     virtual void addItem(UIGDetailsItem *pItem) = 0;
    76     virtual void removeItem(UIGDetailsItem *pItem) = 0;
    77     virtual QList<UIGDetailsItem*> items(UIGDetailsItemType type = UIGDetailsItemType_Any) const = 0;
    78     virtual bool hasItems(UIGDetailsItemType type = UIGDetailsItemType_Any) const = 0;
    79     virtual void clearItems(UIGDetailsItemType type = UIGDetailsItemType_Any) = 0;
     75    virtual void addItem(UIDetailsItem *pItem) = 0;
     76    virtual void removeItem(UIDetailsItem *pItem) = 0;
     77    virtual QList<UIDetailsItem*> items(UIDetailsItemType type = UIDetailsItemType_Any) const = 0;
     78    virtual bool hasItems(UIDetailsItemType type = UIDetailsItemType_Any) const = 0;
     79    virtual void clearItems(UIDetailsItemType type = UIDetailsItemType_Any) = 0;
    8080
    8181    /* API: Layout stuff: */
     
    107107
    108108    /* Variables: */
    109     UIGDetailsItem *m_pParent;
     109    UIDetailsItem *m_pParent;
    110110};
    111111
    112112/* Allows to build item content synchronously: */
    113 class UIBuildStep : public QObject
     113class UIPrepareStep : public QObject
    114114{
    115115    Q_OBJECT;
     
    123123
    124124    /* Constructor: */
    125     UIBuildStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber);
     125    UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber);
    126126
    127127private slots:
     
    137137};
    138138
    139 #endif /* __UIGDetailsItem_h__ */
     139#endif /* __UIDetailsItem_h__ */
    140140
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsModel class implementation.
     3 * VBox Qt GUI - UIDetailsModel class implementation.
    44 */
    55
     
    2828
    2929/* GUI includes: */
    30 # include "UIGDetails.h"
    31 # include "UIGDetailsModel.h"
    32 # include "UIGDetailsGroup.h"
    33 # include "UIGDetailsElement.h"
     30# include "UIDetails.h"
     31# include "UIDetailsModel.h"
     32# include "UIDetailsGroup.h"
     33# include "UIDetailsElement.h"
    3434# include "UIExtraDataManager.h"
    3535# include "VBoxGlobal.h"
     
    3939
    4040
    41 UIGDetailsModel::UIGDetailsModel(UIGDetails *pParent)
     41UIDetailsModel::UIDetailsModel(UIDetails *pParent)
    4242    : QObject(pParent)
    4343    , m_pDetails(pParent)
     
    5959}
    6060
    61 UIGDetailsModel::~UIGDetailsModel()
     61UIDetailsModel::~UIDetailsModel()
    6262{
    6363    /* Save settings: */
     
    7171 }
    7272
    73 QGraphicsScene* UIGDetailsModel::scene() const
     73QGraphicsScene* UIDetailsModel::scene() const
    7474{
    7575    return m_pScene;
    7676}
    7777
    78 QGraphicsView* UIGDetailsModel::paintDevice() const
     78QGraphicsView* UIDetailsModel::paintDevice() const
    7979{
    8080    if (!m_pScene || m_pScene->views().isEmpty())
     
    8383}
    8484
    85 QGraphicsItem* UIGDetailsModel::itemAt(const QPointF &position) const
     85QGraphicsItem* UIDetailsModel::itemAt(const QPointF &position) const
    8686{
    8787    return scene()->itemAt(position, QTransform());
    8888}
    8989
    90 UIGDetailsItem *UIGDetailsModel::root() const
     90UIDetailsItem *UIDetailsModel::root() const
    9191{
    9292    return m_pRoot;
    9393}
    9494
    95 void UIGDetailsModel::updateLayout()
     95void UIDetailsModel::updateLayout()
    9696{
    9797    /* Prepare variables: */
     
    109109}
    110110
    111 void UIGDetailsModel::setItems(const QList<UIVMItem*> &items)
     111void UIDetailsModel::setItems(const QList<UIVirtualMachineItem*> &items)
    112112{
    113113    m_pRoot->buildGroup(items);
    114114}
    115115
    116 void UIGDetailsModel::sltHandleViewResize()
     116void UIDetailsModel::sltHandleViewResize()
    117117{
    118118    /* Relayout: */
     
    120120}
    121121
    122 void UIGDetailsModel::sltToggleElements(DetailsElementType type, bool fToggled)
     122void UIDetailsModel::sltToggleElements(DetailsElementType type, bool fToggled)
    123123{
    124124    /* Make sure it is not started yet: */
     
    127127
    128128    /* Prepare/configure animation callback: */
    129     m_pAnimationCallback = new UIGDetailsElementAnimationCallback(this, type, fToggled);
     129    m_pAnimationCallback = new UIDetailsElementAnimationCallback(this, type, fToggled);
    130130    connect(m_pAnimationCallback, SIGNAL(sigAllAnimationFinished(DetailsElementType, bool)),
    131131            this, SLOT(sltToggleAnimationFinished(DetailsElementType, bool)), Qt::QueuedConnection);
    132132    /* For each the set of the group: */
    133     foreach (UIGDetailsItem *pSetItem, m_pRoot->items())
     133    foreach (UIDetailsItem *pSetItem, m_pRoot->items())
    134134    {
    135135        /* For each the element of the set: */
    136         foreach (UIGDetailsItem *pElementItem, pSetItem->items())
     136        foreach (UIDetailsItem *pElementItem, pSetItem->items())
    137137        {
    138138            /* Get each element: */
    139             UIGDetailsElement *pElement = pElementItem->toElement();
     139            UIDetailsElement *pElement = pElementItem->toElement();
    140140            /* Check if this element is of required type: */
    141141            if (pElement->elementType() == type)
     
    158158}
    159159
    160 void UIGDetailsModel::sltToggleAnimationFinished(DetailsElementType type, bool fToggled)
     160void UIDetailsModel::sltToggleAnimationFinished(DetailsElementType type, bool fToggled)
    161161{
    162162    /* Cleanup animation callback: */
     
    165165
    166166    /* Mark animation finished: */
    167     foreach (UIGDetailsItem *pSetItem, m_pRoot->items())
    168     {
    169         foreach (UIGDetailsItem *pElementItem, pSetItem->items())
     167    foreach (UIDetailsItem *pSetItem, m_pRoot->items())
     168    {
     169        foreach (UIDetailsItem *pElementItem, pSetItem->items())
    170170        {
    171             UIGDetailsElement *pElement = pElementItem->toElement();
     171            UIDetailsElement *pElement = pElementItem->toElement();
    172172            if (pElement->elementType() == type)
    173173                pElement->markAnimationFinished();
     
    182182}
    183183
    184 void UIGDetailsModel::sltElementTypeToggled()
     184void UIDetailsModel::sltElementTypeToggled()
    185185{
    186186    /* Which item was toggled? */
     
    198198}
    199199
    200 void UIGDetailsModel::sltHandleSlidingStarted()
     200void UIDetailsModel::sltHandleSlidingStarted()
    201201{
    202202    m_pRoot->stopBuildingGroup();
    203203}
    204204
    205 void UIGDetailsModel::sltHandleToggleStarted()
     205void UIDetailsModel::sltHandleToggleStarted()
    206206{
    207207    m_pRoot->stopBuildingGroup();
    208208}
    209209
    210 void UIGDetailsModel::sltHandleToggleFinished()
     210void UIDetailsModel::sltHandleToggleFinished()
    211211{
    212212    m_pRoot->rebuildGroup();
    213213}
    214214
    215 QVariant UIGDetailsModel::data(int iKey) const
     215QVariant UIDetailsModel::data(int iKey) const
    216216{
    217217    switch (iKey)
     
    223223}
    224224
    225 void UIGDetailsModel::prepareScene()
     225void UIDetailsModel::prepareScene()
    226226{
    227227    m_pScene = new QGraphicsScene(this);
     
    229229}
    230230
    231 void UIGDetailsModel::prepareRoot()
    232 {
    233     m_pRoot = new UIGDetailsGroup(scene());
    234 }
    235 
    236 void UIGDetailsModel::loadSettings()
     231void UIDetailsModel::prepareRoot()
     232{
     233    m_pRoot = new UIDetailsGroup(scene());
     234}
     235
     236void UIDetailsModel::loadSettings()
    237237{
    238238    /* Load settings: */
     
    255255}
    256256
    257 void UIGDetailsModel::saveSettings()
     257void UIDetailsModel::saveSettings()
    258258{
    259259    /* Save settings: */
     
    261261}
    262262
    263 void UIGDetailsModel::cleanupRoot()
     263void UIDetailsModel::cleanupRoot()
    264264{
    265265    delete m_pRoot;
     
    267267}
    268268
    269 void UIGDetailsModel::cleanupScene()
     269void UIDetailsModel::cleanupScene()
    270270{
    271271    delete m_pScene;
     
    273273}
    274274
    275 bool UIGDetailsModel::eventFilter(QObject *pObject, QEvent *pEvent)
     275bool UIDetailsModel::eventFilter(QObject *pObject, QEvent *pEvent)
    276276{
    277277    /* Ignore if no scene object: */
     
    287287}
    288288
    289 bool UIGDetailsModel::processContextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent)
     289bool UIDetailsModel::processContextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent)
    290290{
    291291    /* Pass preview context menu instead: */
    292292    if (QGraphicsItem *pItem = itemAt(pEvent->scenePos()))
    293         if (pItem->type() == UIGDetailsItemType_Preview)
     293        if (pItem->type() == UIDetailsItemType_Preview)
    294294            return false;
    295295
     
    312312}
    313313
    314 UIGDetailsElementAnimationCallback::UIGDetailsElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled)
     314UIDetailsElementAnimationCallback::UIDetailsElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled)
    315315    : QObject(pParent)
    316316    , m_type(type)
     
    319319}
    320320
    321 void UIGDetailsElementAnimationCallback::addNotifier(UIGDetailsItem *pItem)
     321void UIDetailsElementAnimationCallback::addNotifier(UIDetailsItem *pItem)
    322322{
    323323    /* Connect notifier: */
     
    327327}
    328328
    329 void UIGDetailsElementAnimationCallback::sltAnimationFinished()
     329void UIDetailsElementAnimationCallback::sltAnimationFinished()
    330330{
    331331    /* Determine notifier: */
    332     UIGDetailsItem *pItem = qobject_cast<UIGDetailsItem*>(sender());
     332    UIDetailsItem *pItem = qobject_cast<UIDetailsItem*>(sender());
    333333    /* Disconnect notifier: */
    334334    disconnect(pItem, SIGNAL(sigToggleElementFinished()), this, SLOT(sltAnimationFinished()));
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsModel class declaration.
     3 * VBox Qt GUI - UIDetailsModel class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGDetailsModel_h__
    19 #define __UIGDetailsModel_h__
     18#ifndef __UIDetailsModel_h__
     19#define __UIDetailsModel_h__
    2020
    2121/* Qt includes: */
     
    3636class QGraphicsSceneContextMenuEvent;
    3737class QGraphicsView;
    38 class UIVMItem;
    39 class UIGDetailsElementAnimationCallback;
    40 class UIGDetailsGroup;
    41 class UIGDetailsItem;
    42 class UIGDetails;
     38class UIVirtualMachineItem;
     39class UIDetailsElementAnimationCallback;
     40class UIDetailsGroup;
     41class UIDetailsItem;
     42class UIDetails;
    4343
    4444/* Graphics details-model: */
    45 class UIGDetailsModel : public QObject
     45class UIDetailsModel : public QObject
    4646{
    4747    Q_OBJECT;
     
    6060    /** Constructs a details-model passing @a pParent to the base-class.
    6161      * @param  pParent  Brings the details container to embed into. */
    62     UIGDetailsModel(UIGDetails *pParent);
     62    UIDetailsModel(UIDetails *pParent);
    6363    /** Destructs a details-model. */
    64     ~UIGDetailsModel();
     64    ~UIDetailsModel();
    6565
    6666    /* API: Scene stuff: */
     
    7070
    7171    /** Returns the details reference. */
    72     UIGDetails *details() const { return m_pDetails; }
     72    UIDetails *details() const { return m_pDetails; }
    7373
    7474    /** Returns the root item instance. */
    75     UIGDetailsItem *root() const;
     75    UIDetailsItem *root() const;
    7676
    7777    /* API: Layout stuff: */
     
    7979
    8080    /* API: Current-item(s) stuff: */
    81     void setItems(const QList<UIVMItem*> &items);
     81    void setItems(const QList<UIVirtualMachineItem*> &items);
    8282
    8383    /** Returns the details settings. */
     
    128128
    129129    /** Holds the details reference. */
    130     UIGDetails *m_pDetails;
     130    UIDetails *m_pDetails;
    131131
    132132    /* Variables: */
    133133    QGraphicsScene *m_pScene;
    134     UIGDetailsGroup *m_pRoot;
    135     UIGDetailsElementAnimationCallback *m_pAnimationCallback;
     134    UIDetailsGroup *m_pRoot;
     135    UIDetailsElementAnimationCallback *m_pAnimationCallback;
    136136    /** Holds the details settings. */
    137137    QMap<DetailsElementType, bool> m_settings;
     
    139139
    140140/* Details-element animation callback: */
    141 class UIGDetailsElementAnimationCallback : public QObject
     141class UIDetailsElementAnimationCallback : public QObject
    142142{
    143143    Q_OBJECT;
     
    151151
    152152    /* Constructor: */
    153     UIGDetailsElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled);
     153    UIDetailsElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled);
    154154
    155155    /* API: Notifiers stuff: */
    156     void addNotifier(UIGDetailsItem *pItem);
     156    void addNotifier(UIDetailsItem *pItem);
    157157
    158158private slots:
     
    164164
    165165    /* Variables: */
    166     QList<UIGDetailsItem*> m_notifiers;
     166    QList<UIDetailsItem*> m_notifiers;
    167167    DetailsElementType m_type;
    168168    bool m_fToggled;
    169169};
    170170
    171 #endif /* __UIGDetailsModel_h__ */
     171#endif /* __UIDetailsModel_h__ */
    172172
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsSet class implementation.
     3 * VBox Qt GUI - UIDetailsSet class implementation.
    44 */
    55
     
    2424
    2525/* GUI includes: */
    26 # include "UIGDetailsSet.h"
    27 # include "UIGDetailsModel.h"
    28 # include "UIGDetailsElements.h"
    29 # include "UIVMItem.h"
     26# include "UIDetailsSet.h"
     27# include "UIDetailsModel.h"
     28# include "UIDetailsElements.h"
     29# include "UIVirtualMachineItem.h"
    3030# include "UIVirtualBoxEventHandler.h"
    3131# include "VBoxGlobal.h"
     
    3838
    3939
    40 UIGDetailsSet::UIGDetailsSet(UIGDetailsItem *pParent)
    41     : UIGDetailsItem(pParent)
     40UIDetailsSet::UIDetailsSet(UIDetailsItem *pParent)
     41    : UIDetailsItem(pParent)
    4242    , m_pMachineItem(0)
    4343    , m_fHasDetails(false)
     
    5757}
    5858
    59 UIGDetailsSet::~UIGDetailsSet()
     59UIDetailsSet::~UIDetailsSet()
    6060{
    6161    /* Cleanup items: */
     
    6666}
    6767
    68 void UIGDetailsSet::buildSet(UIVMItem *pMachineItem, bool fFullSet, const QMap<DetailsElementType, bool> &settings)
     68void UIDetailsSet::buildSet(UIVirtualMachineItem *pMachineItem, bool fFullSet, const QMap<DetailsElementType, bool> &settings)
    6969{
    7070    /* Remember passed arguments: */
     
    113113}
    114114
    115 void UIGDetailsSet::sltBuildStep(QString strStepId, int iStepNumber)
     115void UIDetailsSet::sltBuildStep(QString strStepId, int iStepNumber)
    116116{
    117117    /* Cleanup build-step: */
     
    134134
    135135        /* Check if element is present already: */
    136         UIGDetailsElement *pElement = element(elementType);
     136        UIDetailsElement *pElement = element(elementType);
    137137        if (pElement && fOpen)
    138138            pElement->open(false);
     
    173173        {
    174174            /* Create next build-step: */
    175             m_pBuildStep = new UIBuildStep(this, pElement, strStepId, iStepNumber + 1);
     175            m_pBuildStep = new UIPrepareStep(this, pElement, strStepId, iStepNumber + 1);
    176176
    177177            /* Build element: */
     
    191191        model()->updateLayout();
    192192        /* Repaint all the items: */
    193         foreach (UIGDetailsItem *pItem, items())
     193        foreach (UIDetailsItem *pItem, items())
    194194            pItem->update();
    195195        /* Notify listener about build done: */
     
    198198}
    199199
    200 void UIGDetailsSet::sltMachineStateChange(QString strId)
     200void UIDetailsSet::sltMachineStateChange(QString strId)
    201201{
    202202    /* Is this our VM changed? */
     
    208208}
    209209
    210 void UIGDetailsSet::sltMachineAttributesChange(QString strId)
     210void UIDetailsSet::sltMachineAttributesChange(QString strId)
    211211{
    212212    /* Is this our VM changed? */
     
    218218}
    219219
    220 void UIGDetailsSet::sltUpdateAppearance()
     220void UIDetailsSet::sltUpdateAppearance()
    221221{
    222222    /* Update appearance: */
     
    224224}
    225225
    226 QString UIGDetailsSet::description() const
     226QString UIDetailsSet::description() const
    227227{
    228228    return tr("Contains the details of virtual machine '%1'").arg(m_pMachineItem->name());
    229229}
    230230
    231 QVariant UIGDetailsSet::data(int iKey) const
     231QVariant UIDetailsSet::data(int iKey) const
    232232{
    233233    /* Provide other members with required data: */
     
    243243}
    244244
    245 void UIGDetailsSet::addItem(UIGDetailsItem *pItem)
     245void UIDetailsSet::addItem(UIDetailsItem *pItem)
    246246{
    247247    switch (pItem->type())
    248248    {
    249         case UIGDetailsItemType_Element:
    250         {
    251             UIGDetailsElement *pElement = pItem->toElement();
     249        case UIDetailsItemType_Element:
     250        {
     251            UIDetailsElement *pElement = pItem->toElement();
    252252            DetailsElementType type = pElement->elementType();
    253253            AssertMsg(!m_elements.contains(type), ("Element already added!"));
     
    263263}
    264264
    265 void UIGDetailsSet::removeItem(UIGDetailsItem *pItem)
     265void UIDetailsSet::removeItem(UIDetailsItem *pItem)
    266266{
    267267    switch (pItem->type())
    268268    {
    269         case UIGDetailsItemType_Element:
    270         {
    271             UIGDetailsElement *pElement = pItem->toElement();
     269        case UIDetailsItemType_Element:
     270        {
     271            UIDetailsElement *pElement = pItem->toElement();
    272272            DetailsElementType type = pElement->elementType();
    273273            AssertMsg(m_elements.contains(type), ("Element do not present (type = %d)!", (int)type));
     
    283283}
    284284
    285 QList<UIGDetailsItem*> UIGDetailsSet::items(UIGDetailsItemType type /* = UIGDetailsItemType_Element */) const
     285QList<UIDetailsItem*> UIDetailsSet::items(UIDetailsItemType type /* = UIDetailsItemType_Element */) const
    286286{
    287287    switch (type)
    288288    {
    289         case UIGDetailsItemType_Element: return m_elements.values();
    290         case UIGDetailsItemType_Any: return items(UIGDetailsItemType_Element);
     289        case UIDetailsItemType_Element: return m_elements.values();
     290        case UIDetailsItemType_Any: return items(UIDetailsItemType_Element);
    291291        default: AssertMsgFailed(("Invalid item type!")); break;
    292292    }
    293     return QList<UIGDetailsItem*>();
    294 }
    295 
    296 bool UIGDetailsSet::hasItems(UIGDetailsItemType type /* = UIGDetailsItemType_Element */) const
     293    return QList<UIDetailsItem*>();
     294}
     295
     296bool UIDetailsSet::hasItems(UIDetailsItemType type /* = UIDetailsItemType_Element */) const
    297297{
    298298    switch (type)
    299299    {
    300         case UIGDetailsItemType_Element: return !m_elements.isEmpty();
    301         case UIGDetailsItemType_Any: return hasItems(UIGDetailsItemType_Element);
     300        case UIDetailsItemType_Element: return !m_elements.isEmpty();
     301        case UIDetailsItemType_Any: return hasItems(UIDetailsItemType_Element);
    302302        default: AssertMsgFailed(("Invalid item type!")); break;
    303303    }
     
    305305}
    306306
    307 void UIGDetailsSet::clearItems(UIGDetailsItemType type /* = UIGDetailsItemType_Element */)
     307void UIDetailsSet::clearItems(UIDetailsItemType type /* = UIDetailsItemType_Element */)
    308308{
    309309    switch (type)
    310310    {
    311         case UIGDetailsItemType_Element:
     311        case UIDetailsItemType_Element:
    312312        {
    313313            foreach (int iKey, m_elements.keys())
     
    316316            break;
    317317        }
    318         case UIGDetailsItemType_Any:
    319         {
    320             clearItems(UIGDetailsItemType_Element);
     318        case UIDetailsItemType_Any:
     319        {
     320            clearItems(UIDetailsItemType_Element);
    321321            break;
    322322        }
     
    329329}
    330330
    331 UIGDetailsElement* UIGDetailsSet::element(DetailsElementType elementType) const
    332 {
    333     UIGDetailsItem *pItem = m_elements.value(elementType, 0);
     331UIDetailsElement* UIDetailsSet::element(DetailsElementType elementType) const
     332{
     333    UIDetailsItem *pItem = m_elements.value(elementType, 0);
    334334    if (pItem)
    335335        return pItem->toElement();
     
    337337}
    338338
    339 void UIGDetailsSet::prepareSet()
     339void UIDetailsSet::prepareSet()
    340340{
    341341    /* Setup size-policy: */
     
    343343}
    344344
    345 void UIGDetailsSet::prepareConnections()
     345void UIDetailsSet::prepareConnections()
    346346{
    347347    /* Global-events connections: */
     
    359359}
    360360
    361 int UIGDetailsSet::minimumWidthHint() const
     361int UIDetailsSet::minimumWidthHint() const
    362362{
    363363    /* Zero if has no details: */
     
    371371
    372372    /* Take into account all the elements: */
    373     foreach (UIGDetailsItem *pItem, items())
     373    foreach (UIDetailsItem *pItem, items())
    374374    {
    375375        /* Skip hidden: */
     
    378378
    379379        /* For each particular element: */
    380         UIGDetailsElement *pElement = pItem->toElement();
     380        UIDetailsElement *pElement = pItem->toElement();
    381381        switch (pElement->elementType())
    382382        {
     
    398398            case DetailsElementType_Preview:
    399399            {
    400                 UIGDetailsItem *pGeneralItem = element(DetailsElementType_General);
    401                 UIGDetailsItem *pSystemItem = element(DetailsElementType_System);
     400                UIDetailsItem *pGeneralItem = element(DetailsElementType_General);
     401                UIDetailsItem *pSystemItem = element(DetailsElementType_System);
    402402                int iGeneralElementWidth = pGeneralItem ? pGeneralItem->minimumWidthHint() : 0;
    403403                int iSystemElementWidth = pSystemItem ? pSystemItem->minimumWidthHint() : 0;
     
    417417}
    418418
    419 int UIGDetailsSet::minimumHeightHint() const
     419int UIDetailsSet::minimumHeightHint() const
    420420{
    421421    /* Zero if has no details: */
     
    429429
    430430    /* Take into account all the elements: */
    431     foreach (UIGDetailsItem *pItem, items())
     431    foreach (UIDetailsItem *pItem, items())
    432432    {
    433433        /* Skip hidden: */
     
    436436
    437437        /* For each particular element: */
    438         UIGDetailsElement *pElement = pItem->toElement();
     438        UIDetailsElement *pElement = pItem->toElement();
    439439        switch (pElement->elementType())
    440440        {
     
    473473}
    474474
    475 void UIGDetailsSet::updateLayout()
     475void UIDetailsSet::updateLayout()
    476476{
    477477    /* Prepare variables: */
     
    482482
    483483    /* Layout all the elements: */
    484     foreach (UIGDetailsItem *pItem, items())
     484    foreach (UIDetailsItem *pItem, items())
    485485    {
    486486        /* Skip hidden: */
     
    489489
    490490        /* For each particular element: */
    491         UIGDetailsElement *pElement = pItem->toElement();
     491        UIDetailsElement *pElement = pItem->toElement();
    492492        switch (pElement->elementType())
    493493        {
     
    510510                if (pElement->elementType() == DetailsElementType_General ||
    511511                    pElement->elementType() == DetailsElementType_System)
    512                     if (UIGDetailsElement *pPreviewElement = element(DetailsElementType_Preview))
     512                    if (UIDetailsElement *pPreviewElement = element(DetailsElementType_Preview))
    513513                        if (pPreviewElement->isVisible())
    514514                            iWidth -= (iSpacing + pPreviewElement->minimumWidthHint());
     
    553553}
    554554
    555 void UIGDetailsSet::rebuildSet()
     555void UIDetailsSet::rebuildSet()
    556556{
    557557    /* Make sure we have details: */
     
    573573}
    574574
    575 UIGDetailsElement* UIGDetailsSet::createElement(DetailsElementType elementType, bool fOpen)
     575UIDetailsElement* UIDetailsSet::createElement(DetailsElementType elementType, bool fOpen)
    576576{
    577577    /* Element factory: */
    578578    switch (elementType)
    579579    {
    580         case DetailsElementType_General:     return new UIGDetailsElementGeneral(this, fOpen);
    581         case DetailsElementType_System:      return new UIGDetailsElementSystem(this, fOpen);
    582         case DetailsElementType_Preview:     return new UIGDetailsElementPreview(this, fOpen);
    583         case DetailsElementType_Display:     return new UIGDetailsElementDisplay(this, fOpen);
    584         case DetailsElementType_Storage:     return new UIGDetailsElementStorage(this, fOpen);
    585         case DetailsElementType_Audio:       return new UIGDetailsElementAudio(this, fOpen);
    586         case DetailsElementType_Network:     return new UIGDetailsElementNetwork(this, fOpen);
    587         case DetailsElementType_Serial:      return new UIGDetailsElementSerial(this, fOpen);
    588         case DetailsElementType_USB:         return new UIGDetailsElementUSB(this, fOpen);
    589         case DetailsElementType_SF:          return new UIGDetailsElementSF(this, fOpen);
    590         case DetailsElementType_UI:          return new UIGDetailsElementUI(this, fOpen);
    591         case DetailsElementType_Description: return new UIGDetailsElementDescription(this, fOpen);
     580        case DetailsElementType_General:     return new UIDetailsElementGeneral(this, fOpen);
     581        case DetailsElementType_System:      return new UIDetailsElementSystem(this, fOpen);
     582        case DetailsElementType_Preview:     return new UIDetailsElementPreview(this, fOpen);
     583        case DetailsElementType_Display:     return new UIDetailsElementDisplay(this, fOpen);
     584        case DetailsElementType_Storage:     return new UIDetailsElementStorage(this, fOpen);
     585        case DetailsElementType_Audio:       return new UIDetailsElementAudio(this, fOpen);
     586        case DetailsElementType_Network:     return new UIDetailsElementNetwork(this, fOpen);
     587        case DetailsElementType_Serial:      return new UIDetailsElementSerial(this, fOpen);
     588        case DetailsElementType_USB:         return new UIDetailsElementUSB(this, fOpen);
     589        case DetailsElementType_SF:          return new UIDetailsElementSF(this, fOpen);
     590        case DetailsElementType_UI:          return new UIDetailsElementUI(this, fOpen);
     591        case DetailsElementType_Description: return new UIDetailsElementDescription(this, fOpen);
    592592        case DetailsElementType_Invalid:     AssertFailed(); break; /* Shut up, MSC! */
    593593    }
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsSet class declaration.
     3 * VBox Qt GUI - UIDetailsSet class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGDetailsSet_h__
    19 #define __UIGDetailsSet_h__
     18#ifndef __UIDetailsSet_h__
     19#define __UIDetailsSet_h__
    2020
    2121/* GUI includes: */
    22 #include "UIGDetailsItem.h"
     22#include "UIDetailsItem.h"
    2323#include "UIExtraDataDefs.h"
    2424#include "UISettingsDefs.h"
     
    2929
    3030/* Forward declarations: */
    31 class UIVMItem;
     31class UIVirtualMachineItem;
    3232
    3333/* Using declarations: */
     
    3636/* Details set
    3737 * for graphics details model/view architecture: */
    38 class UIGDetailsSet : public UIGDetailsItem
     38class UIDetailsSet : public UIDetailsItem
    3939{
    4040    Q_OBJECT;
     
    4343
    4444    /* Graphics-item type: */
    45     enum { Type = UIGDetailsItemType_Set };
     45    enum { Type = UIDetailsItemType_Set };
    4646    int type() const { return Type; }
    4747
    4848    /* Constructor/destructor: */
    49     UIGDetailsSet(UIGDetailsItem *pParent);
    50     ~UIGDetailsSet();
     49    UIDetailsSet(UIDetailsItem *pParent);
     50    ~UIDetailsSet();
    5151
    5252    /* API: Build stuff: */
    53     void buildSet(UIVMItem *pMachineItem, bool fFullSet, const QMap<DetailsElementType, bool> &settings);
     53    void buildSet(UIVirtualMachineItem *pMachineItem, bool fFullSet, const QMap<DetailsElementType, bool> &settings);
    5454
    5555    /* API: Machine stuff: */
     
    8989
    9090    /* Hidden API: Children stuff: */
    91     void addItem(UIGDetailsItem *pItem);
    92     void removeItem(UIGDetailsItem *pItem);
    93     QList<UIGDetailsItem*> items(UIGDetailsItemType type = UIGDetailsItemType_Element) const;
    94     bool hasItems(UIGDetailsItemType type = UIGDetailsItemType_Element) const;
    95     void clearItems(UIGDetailsItemType type = UIGDetailsItemType_Element);
    96     UIGDetailsElement* element(DetailsElementType elementType) const;
     91    void addItem(UIDetailsItem *pItem);
     92    void removeItem(UIDetailsItem *pItem);
     93    QList<UIDetailsItem*> items(UIDetailsItemType type = UIDetailsItemType_Element) const;
     94    bool hasItems(UIDetailsItemType type = UIDetailsItemType_Element) const;
     95    void clearItems(UIDetailsItemType type = UIDetailsItemType_Element);
     96    UIDetailsElement* element(DetailsElementType elementType) const;
    9797
    9898    /* Helpers: Prepare stuff: */
     
    107107    /* Helpers: Build stuff: */
    108108    void rebuildSet();
    109     UIGDetailsElement* createElement(DetailsElementType elementType, bool fOpen);
     109    UIDetailsElement* createElement(DetailsElementType elementType, bool fOpen);
    110110
    111111    /** Machine-item this set built for. */
    112     UIVMItem *m_pMachineItem;
     112    UIVirtualMachineItem *m_pMachineItem;
    113113
    114114    /* Main variables: */
    115115    CMachine m_machine;
    116     QMap<int, UIGDetailsItem*> m_elements;
     116    QMap<int, UIDetailsItem*> m_elements;
    117117    bool m_fHasDetails;
    118118
     
    122122    /* Prepare variables: */
    123123    bool m_fFullSet;
    124     UIBuildStep *m_pBuildStep;
     124    UIPrepareStep *m_pBuildStep;
    125125    int m_iLastStepNumber;
    126126    QString m_strSetId;
     
    128128};
    129129
    130 #endif /* __UIGDetailsSet_h__ */
     130#endif /* __UIDetailsSet_h__ */
    131131
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsView.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsView class implementation.
     3 * VBox Qt GUI - UIDetailsView class implementation.
    44 */
    55
     
    2626
    2727/* GUI includes: */
    28 # include "UIGDetails.h"
    29 # include "UIGDetailsModel.h"
    30 # include "UIGDetailsView.h"
    31 # include "UIGDetailsItem.h"
     28# include "UIDetails.h"
     29# include "UIDetailsModel.h"
     30# include "UIDetailsView.h"
     31# include "UIDetailsItem.h"
    3232
    3333/* Other VBox includes: */
     
    3838
    3939/** QAccessibleWidget extension used as an accessibility interface for Details-view. */
    40 class UIAccessibilityInterfaceForUIGDetailsView : public QAccessibleWidget
     40class UIAccessibilityInterfaceForUIDetailsView : public QAccessibleWidget
    4141{
    4242public:
     
    4646    {
    4747        /* Creating Details-view accessibility interface: */
    48         if (pObject && strClassname == QLatin1String("UIGDetailsView"))
    49             return new UIAccessibilityInterfaceForUIGDetailsView(qobject_cast<QWidget*>(pObject));
     48        if (pObject && strClassname == QLatin1String("UIDetailsView"))
     49            return new UIAccessibilityInterfaceForUIDetailsView(qobject_cast<QWidget*>(pObject));
    5050
    5151        /* Null by default: */
     
    5454
    5555    /** Constructs an accessibility interface passing @a pWidget to the base-class. */
    56     UIAccessibilityInterfaceForUIGDetailsView(QWidget *pWidget)
     56    UIAccessibilityInterfaceForUIDetailsView(QWidget *pWidget)
    5757        : QAccessibleWidget(pWidget, QAccessible::List)
    5858    {}
     
    108108
    109109    /** Returns corresponding Details-view. */
    110     UIGDetailsView *view() const { return qobject_cast<UIGDetailsView*>(widget()); }
     110    UIDetailsView *view() const { return qobject_cast<UIDetailsView*>(widget()); }
    111111};
    112112
    113113
    114 UIGDetailsView::UIGDetailsView(UIGDetails *pParent)
     114UIDetailsView::UIDetailsView(UIDetails *pParent)
    115115    : QIWithRetranslateUI<QIGraphicsView>(pParent)
    116116    , m_pDetails(pParent)
     
    119119{
    120120    /* Install Details-view accessibility interface factory: */
    121     QAccessible::installFactory(UIAccessibilityInterfaceForUIGDetailsView::pFactory);
     121    QAccessible::installFactory(UIAccessibilityInterfaceForUIDetailsView::pFactory);
    122122
    123123    /* Prepare palette: */
     
    139139}
    140140
    141 void UIGDetailsView::sltMinimumWidthHintChanged(int iMinimumWidthHint)
     141void UIDetailsView::sltMinimumWidthHintChanged(int iMinimumWidthHint)
    142142{
    143143    /* Is there something changed? */
     
    157157}
    158158
    159 void UIGDetailsView::sltMinimumHeightHintChanged(int iMinimumHeightHint)
     159void UIDetailsView::sltMinimumHeightHintChanged(int iMinimumHeightHint)
    160160{
    161161    /* Is there something changed? */
     
    172172}
    173173
    174 void UIGDetailsView::retranslateUi()
     174void UIDetailsView::retranslateUi()
    175175{
    176176    /* Translate this: */
     
    178178}
    179179
    180 void UIGDetailsView::preparePalette()
     180void UIDetailsView::preparePalette()
    181181{
    182182    /* Setup palette: */
     
    186186}
    187187
    188 void UIGDetailsView::resizeEvent(QResizeEvent *pEvent)
     188void UIDetailsView::resizeEvent(QResizeEvent *pEvent)
    189189{
    190190    /* Call to base-class: */
     
    194194}
    195195
    196 void UIGDetailsView::updateSceneRect()
     196void UIDetailsView::updateSceneRect()
    197197{
    198198    setSceneRect(0, 0, m_iMinimumWidthHint, m_iMinimumHeightHint);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsView.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGDetailsView class declaration.
     3 * VBox Qt GUI - UIDetailsView class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGDetailsView_h__
    19 #define __UIGDetailsView_h__
     18#ifndef __UIDetailsView_h__
     19#define __UIDetailsView_h__
    2020
    2121/* GUI includes: */
     
    2424
    2525/* Forward declarations: */
    26 class UIGDetails;
     26class UIDetails;
    2727
    2828/* Graphics details-view: */
    29 class UIGDetailsView : public QIWithRetranslateUI<QIGraphicsView>
     29class UIDetailsView : public QIWithRetranslateUI<QIGraphicsView>
    3030{
    3131    Q_OBJECT;
     
    4040    /** Constructs a details-view passing @a pParent to the base-class.
    4141      * @param  pParent  Brings the details container to embed into. */
    42     UIGDetailsView(UIGDetails *pParent);
     42    UIDetailsView(UIDetails *pParent);
    4343
    4444    /** Returns the details reference. */
    45     UIGDetails *details() const { return m_pDetails; }
     45    UIDetails *details() const { return m_pDetails; }
    4646
    4747private slots:
     
    6666
    6767    /** Holds the details reference. */
    68     UIGDetails *m_pDetails;
     68    UIDetails *m_pDetails;
    6969
    7070    /* Variables: */
     
    7373};
    7474
    75 #endif /* __UIGDetailsView_h__ */
     75#endif /* __UIDetailsView_h__ */
    7676
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIMachinePreview.cpp

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGMachinePreview class implementation.
     3 * VBox Qt GUI - UIMachinePreview class implementation.
    44 */
    55
     
    2828
    2929/* GUI includes: */
    30 # include "UIGMachinePreview.h"
     30# include "UIMachinePreview.h"
    3131# include "UIVirtualBoxEventHandler.h"
    3232# include "UIExtraDataManager.h"
     
    4949#endif /* VBOX_WITH_XPCOM */
    5050
    51 UIGMachinePreview::UIGMachinePreview(QIGraphicsWidget *pParent)
     51UIMachinePreview::UIMachinePreview(QIGraphicsWidget *pParent)
    5252    : QIWithRetranslateUI4<QIGraphicsWidget>(pParent)
    5353    , m_pUpdateTimer(new QTimer(this))
     
    120120}
    121121
    122 UIGMachinePreview::~UIGMachinePreview()
     122UIMachinePreview::~UIMachinePreview()
    123123{
    124124    /* Close any open session: */
     
    147147}
    148148
    149 void UIGMachinePreview::setMachine(const CMachine& machine)
     149void UIMachinePreview::setMachine(const CMachine& machine)
    150150{
    151151    /* Pause: */
     
    165165}
    166166
    167 CMachine UIGMachinePreview::machine() const
     167CMachine UIMachinePreview::machine() const
    168168{
    169169    return m_machine;
    170170}
    171171
    172 void UIGMachinePreview::sltMachineStateChange(QString strId)
     172void UIMachinePreview::sltMachineStateChange(QString strId)
    173173{
    174174    /* Make sure its the event for our machine: */
     
    180180}
    181181
    182 void UIGMachinePreview::sltRecreatePreview()
     182void UIMachinePreview::sltRecreatePreview()
    183183{
    184184    /* Skip invisible preview: */
     
    331331}
    332332
    333 void UIGMachinePreview::resizeEvent(QGraphicsSceneResizeEvent *pEvent)
     333void UIMachinePreview::resizeEvent(QGraphicsSceneResizeEvent *pEvent)
    334334{
    335335    recalculatePreviewRectangle();
     
    338338}
    339339
    340 void UIGMachinePreview::showEvent(QShowEvent *pEvent)
     340void UIMachinePreview::showEvent(QShowEvent *pEvent)
    341341{
    342342    restart();
     
    344344}
    345345
    346 void UIGMachinePreview::hideEvent(QHideEvent *pEvent)
     346void UIMachinePreview::hideEvent(QHideEvent *pEvent)
    347347{
    348348    stop();
     
    350350}
    351351
    352 void UIGMachinePreview::contextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent)
     352void UIMachinePreview::contextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent)
    353353{
    354354    QAction *pReturn = m_pUpdateTimerMenu->exec(pEvent->screenPos(), 0);
     
    361361}
    362362
    363 void UIGMachinePreview::retranslateUi()
     363void UIMachinePreview::retranslateUi()
    364364{
    365365    m_actions.value(PreviewUpdateIntervalType_Disabled)->setText(tr("Update disabled"));
     
    371371}
    372372
    373 QSizeF UIGMachinePreview::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const
     373QSizeF UIMachinePreview::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const
    374374{
    375375    if (which == Qt::MinimumSize)
     
    388388}
    389389
    390 void UIGMachinePreview::paint(QPainter *pPainter, const QStyleOptionGraphicsItem*, QWidget*)
     390void UIMachinePreview::paint(QPainter *pPainter, const QStyleOptionGraphicsItem*, QWidget*)
    391391{
    392392    /* Where should the content go: */
     
    444444}
    445445
    446 void UIGMachinePreview::setUpdateInterval(PreviewUpdateIntervalType interval, bool fSave)
     446void UIMachinePreview::setUpdateInterval(PreviewUpdateIntervalType interval, bool fSave)
    447447{
    448448    switch (interval)
     
    474474}
    475475
    476 void UIGMachinePreview::recalculatePreviewRectangle()
     476void UIMachinePreview::recalculatePreviewRectangle()
    477477{
    478478    /* Contents rectangle: */
     
    482482}
    483483
    484 void UIGMachinePreview::restart()
     484void UIMachinePreview::restart()
    485485{
    486486    /* Fetch the latest machine-state: */
     
    508508}
    509509
    510 void UIGMachinePreview::stop()
     510void UIMachinePreview::stop()
    511511{
    512512    /* Stop the timer: */
     
    515515
    516516/* static */
    517 UIGMachinePreview::AspectRatioPreset UIGMachinePreview::bestAspectRatioPreset(const double dAspectRatio,
     517UIMachinePreview::AspectRatioPreset UIMachinePreview::bestAspectRatioPreset(const double dAspectRatio,
    518518                                                                              const QMap<AspectRatioPreset, double> &ratios)
    519519{
     
    543543
    544544/* static */
    545 QSize UIGMachinePreview::imageAspectRatioSize(const QSize &hostSize, const QSize &guestSize)
     545QSize UIMachinePreview::imageAspectRatioSize(const QSize &hostSize, const QSize &guestSize)
    546546{
    547547    /* Make sure host-size and guest-size are valid: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIMachinePreview.h

    r73385 r73424  
    11/* $Id$ */
    22/** @file
    3  * VBox Qt GUI - UIGMachinePreview class declaration.
     3 * VBox Qt GUI - UIMachinePreview class declaration.
    44 */
    55
     
    1616 */
    1717
    18 #ifndef __UIGMachinePreview_h__
    19 #define __UIGMachinePreview_h__
     18#ifndef __UIMachinePreview_h__
     19#define __UIMachinePreview_h__
    2020
    2121/* Qt includes: */
     
    2424/* GUI includes: */
    2525#include "QIWithRetranslateUI.h"
    26 #include "UIGDetailsItem.h"
     26#include "UIDetailsItem.h"
    2727#include "UIExtraDataDefs.h"
    2828
     
    4040
    4141/* Preview window class: */
    42 class UIGMachinePreview : public QIWithRetranslateUI4<QIGraphicsWidget>
     42class UIMachinePreview : public QIWithRetranslateUI4<QIGraphicsWidget>
    4343{
    4444    Q_OBJECT;
     
    5252
    5353    /* Graphics-item type: */
    54     enum { Type = UIGDetailsItemType_Preview };
     54    enum { Type = UIDetailsItemType_Preview };
    5555    int type() const { return Type; }
    5656
    5757    /* Constructor/destructor: */
    58     UIGMachinePreview(QIGraphicsWidget *pParent);
    59     ~UIGMachinePreview();
     58    UIMachinePreview(QIGraphicsWidget *pParent);
     59    ~UIMachinePreview();
    6060
    6161    /* API: Machine stuff: */
     
    125125};
    126126
    127 #endif /* !__UIGMachinePreview_h__ */
     127#endif /* !__UIMachinePreview_h__ */
    128128
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