Changeset 73424 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 1, 2018 2:07:18 PM (6 years ago)
- 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 178 178 $(if $(VBOX_GUI_WITH_KEYS_RESET_HANDLER),VBOX_GUI_WITH_KEYS_RESET_HANDLER) \ 179 179 $(if $(VBOX_GUI_WITH_CUSTOMIZATIONS1),VBOX_GUI_WITH_CUSTOMIZATIONS1) \ 180 $(if $(VBOX_GUI_WITH_NEW_MANAGER),VBOX_GUI_WITH_NEW_MANAGER) \ 180 181 $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE) \ 181 182 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) … … 373 374 ./src/wizards/importappliance \ 374 375 ./src/wizards/firstrun 376 377 ifdef VBOX_GUI_WITH_NEW_MANAGER 378 VBOX_GUI_INC_DIRS += \ 379 ./src/manager \ 380 ./src/manager/chooser \ 381 ./src/manager/details 382 endif 375 383 376 384 ifdef VBOX_GUI_WITH_NETWORK_MANAGER … … 736 744 src/wizards/importappliance/UIWizardImportAppPageBasic2.h \ 737 745 src/wizards/importappliance/UIWizardImportAppPageExpert.h 746 747 ifdef 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 772 endif 738 773 739 774 ifndef VBOX_GUI_WITH_SHARED_LIBRARY … … 1171 1206 src/wizards/importappliance/UIWizardImportApp.cpp 1172 1207 1208 ifdef VBOX_GUI_WITH_NEW_MANAGER 1209 VirtualBox_QT_MOCSRCS = \ 1210 src/manager/UIWelcomePane.cpp 1211 endif 1212 1173 1213 ifndef VBOX_GUI_WITH_SHARED_LIBRARY 1174 1214 VirtualBox_QT_MOCSRCS += \ … … 1380 1420 src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp \ 1381 1421 src/wizards/importappliance/UIWizardImportAppPageExpert.cpp 1422 1423 ifdef 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 1448 endif 1382 1449 1383 1450 VirtualBox_SOURCES.darwin += \ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIStarter.cpp
r72362 r73424 25 25 #include "UIStarter.h" 26 26 #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 28 32 #endif 29 33 #if !defined(VBOX_GUI_WITH_SHARED_LIBRARY) || defined(VBOX_RUNTIME_UI) … … 122 126 } 123 127 128 # ifdef VBOX_GUI_WITH_NEW_MANAGER 129 /* Create/show manager-window: */ 130 UIVirtualBoxManager::create(); 131 # else 124 132 /* Create/show selector-window: */ 125 133 UISelectorWindow::create(); 134 # endif 126 135 127 136 # ifdef VBOX_BLEEDING_EDGE … … 162 171 { 163 172 #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 164 178 /* Recreate/show selector-window: */ 165 179 UISelectorWindow::destroy(); 166 180 UISelectorWindow::create(); 181 # endif 167 182 #endif /* !VBOX_GUI_WITH_SHARED_LIBRARY || !VBOX_RUNTIME_UI */ 168 183 } … … 171 186 { 172 187 #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 173 193 /* Destroy Selector UI: */ 174 194 if (gpSelectorWindow) 175 195 UISelectorWindow::destroy(); 196 # endif 176 197 #endif /* !VBOX_GUI_WITH_SHARED_LIBRARY || !VBOX_RUNTIME_UI */ 177 198 … … 186 207 { 187 208 #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 188 216 /* Create/show selector-window: */ 189 217 UISelectorWindow::create(); … … 191 219 /* Ask the Selector UI to open URLs asynchronously: */ 192 220 QMetaObject::invokeMethod(gpSelectorWindow, "sltOpenUrls", Qt::QueuedConnection); 221 # endif 193 222 #endif /* !VBOX_GUI_WITH_SHARED_LIBRARY || !VBOX_RUNTIME_UI */ 194 223 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UITool sPaneGlobal class implementation.3 * VBox Qt GUI - UIToolPaneGlobal class implementation. 4 4 */ 5 5 … … 26 26 /* GUI includes */ 27 27 # include "UIActionPoolSelector.h" 28 # include "UI DesktopPane.h"28 # include "UIWelcomePane.h" 29 29 # include "UIHostNetworkManager.h" 30 30 # include "UIIconPool.h" 31 31 # include "UIMediumManager.h" 32 # include "UITool sPaneGlobal.h"32 # include "UIToolPaneGlobal.h" 33 33 34 34 /* Other VBox includes: */ … … 38 38 39 39 40 UITool sPaneGlobal::UIToolsPaneGlobal(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)40 UIToolPaneGlobal::UIToolPaneGlobal(UIActionPool *pActionPool, QWidget *pParent /* = 0 */) 41 41 : QIWithRetranslateUI<QWidget>(pParent) 42 42 , m_pActionPool(pActionPool) … … 50 50 } 51 51 52 UITool sPaneGlobal::~UIToolsPaneGlobal()52 UIToolPaneGlobal::~UIToolPaneGlobal() 53 53 { 54 54 /* Cleanup: */ … … 56 56 } 57 57 58 ToolTypeGlobal UITool sPaneGlobal::currentTool() const58 ToolTypeGlobal UIToolPaneGlobal::currentTool() const 59 59 { 60 60 return m_pLayout->currentWidget()->property("ToolType").value<ToolTypeGlobal>(); 61 61 } 62 62 63 bool UITool sPaneGlobal::isToolOpened(ToolTypeGlobal enmType) const63 bool UIToolPaneGlobal::isToolOpened(ToolTypeGlobal enmType) const 64 64 { 65 65 /* Search through the stacked widgets: */ … … 70 70 } 71 71 72 void UITool sPaneGlobal::openTool(ToolTypeGlobal enmType)72 void UIToolPaneGlobal::openTool(ToolTypeGlobal enmType) 73 73 { 74 74 /* Search through the stacked widgets: */ … … 93 93 { 94 94 /* Create Desktop pane: */ 95 m_pPaneDesktop = new UI DesktopPane;95 m_pPaneDesktop = new UIWelcomePane; 96 96 AssertPtrReturnVoid(m_pPaneDesktop); 97 97 { … … 141 141 } 142 142 143 void UITool sPaneGlobal::closeTool(ToolTypeGlobal enmType)143 void UIToolPaneGlobal::closeTool(ToolTypeGlobal enmType) 144 144 { 145 145 /* Search through the stacked widgets: */ … … 167 167 } 168 168 169 void UITool sPaneGlobal::setDetailsError(const QString &strError)169 void UIToolPaneGlobal::setDetailsError(const QString &strError) 170 170 { 171 171 /* Update desktop pane: */ … … 174 174 } 175 175 176 void UITool sPaneGlobal::retranslateUi()176 void UIToolPaneGlobal::retranslateUi() 177 177 { 178 178 /* Translate Global Tools welcome screen: */ … … 215 215 } 216 216 217 void UITool sPaneGlobal::prepare()217 void UIToolPaneGlobal::prepare() 218 218 { 219 219 /* Create stacked-layout: */ … … 227 227 } 228 228 229 void UITool sPaneGlobal::cleanup()229 void UIToolPaneGlobal::cleanup() 230 230 { 231 231 /* Remove all widgets prematurelly: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneGlobal.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UITool sPaneGlobal class declaration.3 * VBox Qt GUI - UIToolPaneGlobal class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef ___UITool sPaneGlobal_h___19 #define ___UITool sPaneGlobal_h___18 #ifndef ___UIToolPaneGlobal_h___ 19 #define ___UIToolPaneGlobal_h___ 20 20 21 21 /* Qt includes: */ … … 31 31 class QVBoxLayout; 32 32 class UIActionPool; 33 class UI DesktopPane;33 class UIWelcomePane; 34 34 class UIHostNetworkManagerWidget; 35 35 class UIMediumManagerWidget; 36 class UIV MItem;36 class UIVirtualMachineItem; 37 37 class CMachine; 38 38 39 39 40 40 /** QWidget subclass representing container for tool panes. */ 41 class UITool sPaneGlobal : public QIWithRetranslateUI<QWidget>41 class UIToolPaneGlobal : public QIWithRetranslateUI<QWidget> 42 42 { 43 43 Q_OBJECT; … … 46 46 47 47 /** Constructs tools pane passing @a pParent to the base-class. */ 48 UITool sPaneGlobal(UIActionPool *pActionPool, QWidget *pParent = 0);48 UIToolPaneGlobal(UIActionPool *pActionPool, QWidget *pParent = 0); 49 49 /** Destructs tools pane. */ 50 virtual ~UITool sPaneGlobal() /* override */;50 virtual ~UIToolPaneGlobal() /* override */; 51 51 52 52 /** Returns type of tool currently opened. */ … … 82 82 QStackedLayout *m_pLayout; 83 83 /** Holds the Desktop pane instance. */ 84 UI DesktopPane *m_pPaneDesktop;84 UIWelcomePane *m_pPaneDesktop; 85 85 /** Holds the Virtual Media Manager instance. */ 86 86 UIMediumManagerWidget *m_pPaneMedia; … … 89 89 }; 90 90 91 #endif /* !___UITool sPaneGlobal_h___ */91 #endif /* !___UIToolPaneGlobal_h___ */ 92 92 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UITool sPaneMachine class implementation.3 * VBox Qt GUI - UIToolPaneMachine class implementation. 4 4 */ 5 5 … … 26 26 /* GUI includes */ 27 27 # include "UIActionPoolSelector.h" 28 # include "UI DesktopPane.h"29 # include "UI GDetails.h"28 # include "UIWelcomePane.h" 29 # include "UIDetails.h" 30 30 # include "UIIconPool.h" 31 31 # include "UISnapshotPane.h" 32 # include "UITool sPaneMachine.h"33 # include "UIV MItem.h"32 # include "UIToolPaneMachine.h" 33 # include "UIVirtualMachineItem.h" 34 34 # include "UIVMLogViewerWidget.h" 35 35 … … 40 40 41 41 42 UITool sPaneMachine::UIToolsPaneMachine(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)42 UIToolPaneMachine::UIToolPaneMachine(UIActionPool *pActionPool, QWidget *pParent /* = 0 */) 43 43 : QIWithRetranslateUI<QWidget>(pParent) 44 44 , m_pActionPool(pActionPool) … … 54 54 } 55 55 56 UITool sPaneMachine::~UIToolsPaneMachine()56 UIToolPaneMachine::~UIToolPaneMachine() 57 57 { 58 58 /* Cleanup: */ … … 60 60 } 61 61 62 ToolTypeMachine UITool sPaneMachine::currentTool() const62 ToolTypeMachine UIToolPaneMachine::currentTool() const 63 63 { 64 64 return m_pLayout->currentWidget()->property("ToolType").value<ToolTypeMachine>(); 65 65 } 66 66 67 bool UITool sPaneMachine::isToolOpened(ToolTypeMachine enmType) const67 bool UIToolPaneMachine::isToolOpened(ToolTypeMachine enmType) const 68 68 { 69 69 /* Search through the stacked widgets: */ … … 74 74 } 75 75 76 void UITool sPaneMachine::openTool(ToolTypeMachine enmType)76 void UIToolPaneMachine::openTool(ToolTypeMachine enmType) 77 77 { 78 78 /* Search through the stacked widgets: */ … … 97 97 { 98 98 /* Create Desktop pane: */ 99 m_pPaneDesktop = new UI DesktopPane(m_pActionPool->action(UIActionIndexST_M_Group_S_Refresh));99 m_pPaneDesktop = new UIWelcomePane(m_pActionPool->action(UIActionIndexST_M_Group_S_Refresh)); 100 100 AssertPtrReturnVoid(m_pPaneDesktop); 101 101 { … … 112 112 { 113 113 /* Create Details pane: */ 114 m_pPaneDetails = new UI GDetails;114 m_pPaneDetails = new UIDetails; 115 115 AssertPtrReturnVoid(m_pPaneDetails); 116 116 { 117 117 /* Configure pane: */ 118 118 m_pPaneDetails->setProperty("ToolType", QVariant::fromValue(ToolTypeMachine_Details)); 119 connect(this, &UITool sPaneMachine::sigSlidingStarted, m_pPaneDetails, &UIGDetails::sigSlidingStarted);120 connect(this, &UITool sPaneMachine::sigToggleStarted, m_pPaneDetails, &UIGDetails::sigToggleStarted);121 connect(this, &UITool sPaneMachine::sigToggleFinished, m_pPaneDetails, &UIGDetails::sigToggleFinished);122 connect(m_pPaneDetails, &UI GDetails::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); 123 123 124 124 /* Add into layout: */ … … 164 164 } 165 165 166 void UITool sPaneMachine::closeTool(ToolTypeMachine enmType)166 void UIToolPaneMachine::closeTool(ToolTypeMachine enmType) 167 167 { 168 168 /* Search through the stacked widgets: */ … … 191 191 } 192 192 193 void UITool sPaneMachine::setDetailsError(const QString &strError)193 void UIToolPaneMachine::setDetailsError(const QString &strError) 194 194 { 195 195 /* Update desktop pane: */ … … 198 198 } 199 199 200 void UITool sPaneMachine::setCurrentItem(UIVMItem *pItem)200 void UIToolPaneMachine::setCurrentItem(UIVirtualMachineItem *pItem) 201 201 { 202 202 if (m_pItem == pItem) … … 217 217 } 218 218 219 void UITool sPaneMachine::setItems(const QList<UIVMItem*> &items)219 void UIToolPaneMachine::setItems(const QList<UIVirtualMachineItem*> &items) 220 220 { 221 221 /* Update details pane: */ … … 224 224 } 225 225 226 void UITool sPaneMachine::setMachine(const CMachine &comMachine)226 void UIToolPaneMachine::setMachine(const CMachine &comMachine) 227 227 { 228 228 /* Update snapshots pane is it is open: */ … … 240 240 } 241 241 242 void UITool sPaneMachine::retranslateUi()242 void UIToolPaneMachine::retranslateUi() 243 243 { 244 244 /* Translate Machine Tools welcome screen: */ … … 303 303 } 304 304 305 void UITool sPaneMachine::prepare()305 void UIToolPaneMachine::prepare() 306 306 { 307 307 /* Create stacked-layout: */ … … 315 315 } 316 316 317 void UITool sPaneMachine::cleanup()317 void UIToolPaneMachine::cleanup() 318 318 { 319 319 /* Remove all widgets prematurelly: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UITool sPaneMachine class declaration.3 * VBox Qt GUI - UIToolPaneMachine class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef ___UITool sPaneMachine_h___19 #define ___UITool sPaneMachine_h___18 #ifndef ___UIToolPaneMachine_h___ 19 #define ___UIToolPaneMachine_h___ 20 20 21 21 /* Qt includes: */ … … 31 31 class QVBoxLayout; 32 32 class UIActionPool; 33 class UI DesktopPane;34 class UI GDetails;33 class UIWelcomePane; 34 class UIDetails; 35 35 class UIVMLogViewerWidget; 36 36 class UISnapshotPane; 37 class UIV MItem;37 class UIVirtualMachineItem; 38 38 class CMachine; 39 39 40 40 41 41 /** QWidget subclass representing container for tool panes. */ 42 class UITool sPaneMachine : public QIWithRetranslateUI<QWidget>42 class UIToolPaneMachine : public QIWithRetranslateUI<QWidget> 43 43 { 44 44 Q_OBJECT; … … 46 46 signals: 47 47 48 /** Redirects signal from UI SelectorWindow to UIGDetails. */48 /** Redirects signal from UIVirtualBoxManager to UIDetails. */ 49 49 void sigSlidingStarted(); 50 /** Redirects signal from UI SelectorWindow to UIGDetails. */50 /** Redirects signal from UIVirtualBoxManager to UIDetails. */ 51 51 void sigToggleStarted(); 52 /** Redirects signal from UI SelectorWindow to UIGDetails. */52 /** Redirects signal from UIVirtualBoxManager to UIDetails. */ 53 53 void sigToggleFinished(); 54 /** Redirects signal from UI GDetails to UISelectorWindow. */54 /** Redirects signal from UIDetails to UIVirtualBoxManager. */ 55 55 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QString &strId); 56 56 … … 58 58 59 59 /** Constructs tools pane passing @a pParent to the base-class. */ 60 UITool sPaneMachine(UIActionPool *pActionPool, QWidget *pParent = 0);60 UIToolPaneMachine(UIActionPool *pActionPool, QWidget *pParent = 0); 61 61 /** Destructs tools pane. */ 62 virtual ~UITool sPaneMachine() /* override */;62 virtual ~UIToolPaneMachine() /* override */; 63 63 64 64 /** Returns type of tool currently opened. */ … … 75 75 76 76 /** Defines current machine @a pItem. */ 77 void setCurrentItem(UIV MItem *pItem);77 void setCurrentItem(UIVirtualMachineItem *pItem); 78 78 79 79 /** Defines the machine @a items. */ 80 void setItems(const QList<UIV MItem*> &items);80 void setItems(const QList<UIVirtualMachineItem*> &items); 81 81 82 82 /** Defines the @a comMachine object. */ … … 101 101 102 102 /** Holds current machine item reference. */ 103 UIV MItem *m_pItem;103 UIVirtualMachineItem *m_pItem; 104 104 105 105 /** Holds the stacked-layout instance. */ 106 106 QStackedLayout *m_pLayout; 107 107 /** Holds the Desktop pane instance. */ 108 UI DesktopPane *m_pPaneDesktop;108 UIWelcomePane *m_pPaneDesktop; 109 109 /** Holds the Details pane instance. */ 110 UI GDetails *m_pPaneDetails;110 UIDetails *m_pPaneDetails; 111 111 /** Holds the Snapshots pane instance. */ 112 112 UISnapshotPane *m_pPaneSnapshots; … … 115 115 }; 116 116 117 #endif /* !___UITool sPaneMachine_h___ */117 #endif /* !___UIToolPaneMachine_h___ */ 118 118 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolbarTools.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UITool sToolbarclass implementation.3 * VBox Qt GUI - UIToolbarTools class implementation. 4 4 */ 5 5 … … 32 32 # include "UITabBar.h" 33 33 # include "UIToolBar.h" 34 # include "UITool sToolbar.h"34 # include "UIToolbarTools.h" 35 35 36 36 /* Other VBox includes: */ … … 40 40 41 41 42 UITool sToolbar::UIToolsToolbar(UIActionPool *pActionPool, QWidget *pParent /* = 0 */)42 UIToolbarTools::UIToolbarTools(UIActionPool *pActionPool, QWidget *pParent /* = 0 */) 43 43 : QWidget(pParent) 44 44 , m_pActionPool(pActionPool) … … 52 52 } 53 53 54 void UITool sToolbar::setTabBars(UITabBar *pTabBarMachine, UITabBar *pTabBarGlobal)54 void UIToolbarTools::setTabBars(UITabBar *pTabBarMachine, UITabBar *pTabBarGlobal) 55 55 { 56 56 /* Remember the new tab-bars: */ … … 60 60 /* Configure tab-bar connections: */ 61 61 connect(m_pTabBarMachine, &UITabBar::sigTabRequestForClosing, 62 this, &UITool sToolbar::sltHandleCloseToolMachine);62 this, &UIToolbarTools::sltHandleCloseToolMachine); 63 63 connect(m_pTabBarMachine, &UITabBar::sigCurrentTabChanged, 64 this, &UITool sToolbar::sltHandleToolChosenMachine);64 this, &UIToolbarTools::sltHandleToolChosenMachine); 65 65 connect(m_pTabBarGlobal, &UITabBar::sigTabRequestForClosing, 66 this, &UITool sToolbar::sltHandleCloseToolGlobal);66 this, &UIToolbarTools::sltHandleCloseToolGlobal); 67 67 connect(m_pTabBarGlobal, &UITabBar::sigCurrentTabChanged, 68 this, &UITool sToolbar::sltHandleToolChosenGlobal);68 this, &UIToolbarTools::sltHandleToolChosenGlobal); 69 69 70 70 /* Let the tab-bars know our opinion: */ … … 72 72 } 73 73 74 void UITool sToolbar::setToolButtonStyle(Qt::ToolButtonStyle enmStyle)74 void UIToolbarTools::setToolButtonStyle(Qt::ToolButtonStyle enmStyle) 75 75 { 76 76 m_pToolBar->setToolButtonStyle(enmStyle); 77 77 } 78 78 79 QList<ToolTypeMachine> UITool sToolbar::tabOrderMachine() const79 QList<ToolTypeMachine> UIToolbarTools::tabOrderMachine() const 80 80 { 81 81 QList<ToolTypeMachine> list; … … 85 85 } 86 86 87 QList<ToolTypeGlobal> UITool sToolbar::tabOrderGlobal() const87 QList<ToolTypeGlobal> UIToolbarTools::tabOrderGlobal() const 88 88 { 89 89 QList<ToolTypeGlobal> list; … … 93 93 } 94 94 95 void UITool sToolbar::sltHandleOpenToolMachine()95 void UIToolbarTools::sltHandleOpenToolMachine() 96 96 { 97 97 /* Acquire sender action: */ … … 116 116 } 117 117 118 void UITool sToolbar::sltHandleOpenToolGlobal()118 void UIToolbarTools::sltHandleOpenToolGlobal() 119 119 { 120 120 /* Acquire sender action: */ … … 139 139 } 140 140 141 void UITool sToolbar::sltHandleCloseToolMachine(const QUuid &uuid)141 void UIToolbarTools::sltHandleCloseToolMachine(const QUuid &uuid) 142 142 { 143 143 /* If the ID is registered: */ … … 153 153 } 154 154 155 void UITool sToolbar::sltHandleCloseToolGlobal(const QUuid &uuid)155 void UIToolbarTools::sltHandleCloseToolGlobal(const QUuid &uuid) 156 156 { 157 157 /* If the ID is registered: */ … … 167 167 } 168 168 169 void UITool sToolbar::sltHandleToolChosenMachine(const QUuid &uuid)169 void UIToolbarTools::sltHandleToolChosenMachine(const QUuid &uuid) 170 170 { 171 171 /* If the ID is registered => Notify listeners: */ … … 174 174 } 175 175 176 void UITool sToolbar::sltHandleToolChosenGlobal(const QUuid &uuid)176 void UIToolbarTools::sltHandleToolChosenGlobal(const QUuid &uuid) 177 177 { 178 178 /* If the ID is registered => Notify listeners: */ … … 181 181 } 182 182 183 void UITool sToolbar::sltHandleActionToggle()183 void UIToolbarTools::sltHandleActionToggle() 184 184 { 185 185 /* Handle known actions: */ … … 190 190 } 191 191 192 void UITool sToolbar::prepare()192 void UIToolbarTools::prepare() 193 193 { 194 194 /* Prepare menu: */ … … 201 201 } 202 202 203 void UITool sToolbar::prepareMenu()203 void UIToolbarTools::prepareMenu() 204 204 { 205 205 /* Configure 'Machine' menu: */ … … 210 210 pMenuMachine->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Details)); 211 211 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Details), &UIAction::triggered, 212 this, &UITool sToolbar::sltHandleOpenToolMachine);212 this, &UIToolbarTools::sltHandleOpenToolMachine); 213 213 m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Details) 214 214 ->setProperty("ToolTypeMachine", QVariant::fromValue(ToolTypeMachine_Details)); … … 217 217 pMenuMachine->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots)); 218 218 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots), &UIAction::triggered, 219 this, &UITool sToolbar::sltHandleOpenToolMachine);219 this, &UIToolbarTools::sltHandleOpenToolMachine); 220 220 m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_Snapshots) 221 221 ->setProperty("ToolTypeMachine", QVariant::fromValue(ToolTypeMachine_Snapshots)); … … 224 224 pMenuMachine->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_LogViewer)); 225 225 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_LogViewer), &UIAction::triggered, 226 this, &UITool sToolbar::sltHandleOpenToolMachine);226 this, &UIToolbarTools::sltHandleOpenToolMachine); 227 227 m_pActionPool->action(UIActionIndexST_M_Tools_M_Machine_S_LogViewer) 228 228 ->setProperty("ToolTypeMachine", QVariant::fromValue(ToolTypeMachine_LogViewer)); … … 232 232 m_pActionPool->action(UIActionIndexST_M_Tools_T_Machine)->setMenu(pMenuMachine); 233 233 connect(m_pActionPool->action(UIActionIndexST_M_Tools_T_Machine), &UIAction::toggled, 234 this, &UITool sToolbar::sltHandleActionToggle);234 this, &UIToolbarTools::sltHandleActionToggle); 235 235 236 236 /* Configure 'Global' menu: */ … … 241 241 pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager)); 242 242 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager), &UIAction::triggered, 243 this, &UITool sToolbar::sltHandleOpenToolGlobal);243 this, &UIToolbarTools::sltHandleOpenToolGlobal); 244 244 m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager) 245 245 ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_VirtualMedia)); … … 248 248 pMenuGlobal->addAction(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager)); 249 249 connect(m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager), &UIAction::triggered, 250 this, &UITool sToolbar::sltHandleOpenToolGlobal);250 this, &UIToolbarTools::sltHandleOpenToolGlobal); 251 251 m_pActionPool->action(UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager) 252 252 ->setProperty("ToolTypeGlobal", QVariant::fromValue(ToolTypeGlobal_HostNetwork)); … … 256 256 m_pActionPool->action(UIActionIndexST_M_Tools_T_Global)->setMenu(pMenuGlobal); 257 257 connect(m_pActionPool->action(UIActionIndexST_M_Tools_T_Global), &UIAction::toggled, 258 this, &UITool sToolbar::sltHandleActionToggle);258 this, &UIToolbarTools::sltHandleActionToggle); 259 259 260 260 /* By default 'Machine' toggle action is toggled: */ … … 262 262 } 263 263 264 void UITool sToolbar::prepareWidgets()264 void UIToolbarTools::prepareWidgets() 265 265 { 266 266 /* Create main layout: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolbarTools.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UITool sToolbarclass declaration.3 * VBox Qt GUI - UIToolbarTools class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef ___UITool sToolbar_h___19 #define ___UITool sToolbar_h___18 #ifndef ___UIToolbarTools_h___ 19 #define ___UIToolbarTools_h___ 20 20 21 21 /* Qt includes: */ … … 25 25 26 26 /* GUI includes: */ 27 #include "UITool sPaneGlobal.h"28 #include "UITool sPaneMachine.h"27 #include "UIToolPaneGlobal.h" 28 #include "UIToolPaneMachine.h" 29 29 30 30 /* Forward declarations: */ … … 39 39 40 40 /** Tools toolbar imlementation for Selector UI. */ 41 class UITool sToolbar: public QWidget41 class UIToolbarTools : public QWidget 42 42 { 43 43 Q_OBJECT; … … 64 64 /** Constructs Tools toolbar passing @a pParent to the base-class. 65 65 * @param pActionPool Brings the action-pool to take corresponding actions from. */ 66 UITool sToolbar(UIActionPool *pActionPool, QWidget *pParent = 0);66 UIToolbarTools(UIActionPool *pActionPool, QWidget *pParent = 0); 67 67 68 68 /** Defines the tab-bars to control. */ … … 125 125 }; 126 126 127 #endif /* !___UITool sToolbar_h___ */127 #endif /* !___UIToolbarTools_h___ */ 128 128 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI SelectorWindowclass implementation.3 * VBox Qt GUI - UIVirtualBoxManager class implementation. 4 4 */ 5 5 … … 35 35 # include "UIErrorString.h" 36 36 # include "UIExtraDataManager.h" 37 # include "UI GChooser.h"37 # include "UIChooser.h" 38 38 # include "UIHostNetworkManager.h" 39 39 # include "UIMedium.h" … … 41 41 # include "UIMessageCenter.h" 42 42 # include "UIModalWindowManager.h" 43 # include "UI SelectorWindow.h"43 # include "UIVirtualBoxManager.h" 44 44 # include "UISettingsDialogSpecific.h" 45 45 # include "UISlidingWidget.h" … … 47 47 # include "UIToolBar.h" 48 48 # include "UIVMLogViewerDialog.h" 49 # include "UIV MItem.h"50 # include "UITool sPaneMachine.h"51 # include "UITool sToolbar.h"49 # include "UIVirtualMachineItem.h" 50 # include "UIToolPaneMachine.h" 51 # include "UIToolbarTools.h" 52 52 # ifdef VBOX_GUI_WITH_NETWORK_MANAGER 53 53 # include "UIUpdateManager.h" … … 87 87 88 88 /* static */ 89 UI SelectorWindow* UISelectorWindow::m_spInstance = 0;89 UIVirtualBoxManager* UIVirtualBoxManager::m_spInstance = 0; 90 90 91 91 /* static */ 92 void UI SelectorWindow::create()92 void UIVirtualBoxManager::create() 93 93 { 94 94 /* Return if selector-window is already created: */ … … 97 97 98 98 /* Create selector-window: */ 99 new UI SelectorWindow;99 new UIVirtualBoxManager; 100 100 /* Prepare selector-window: */ 101 101 m_spInstance->prepare(); … … 107 107 108 108 /* static */ 109 void UI SelectorWindow::destroy()109 void UIVirtualBoxManager::destroy() 110 110 { 111 111 /* Make sure selector-window is created: */ … … 120 120 } 121 121 122 UI SelectorWindow::UISelectorWindow()122 UIVirtualBoxManager::UIVirtualBoxManager() 123 123 : m_fPolished(false) 124 124 , m_fWarningAboutInaccessibleMediaShown(false) … … 143 143 } 144 144 145 UI SelectorWindow::~UISelectorWindow()145 UIVirtualBoxManager::~UIVirtualBoxManager() 146 146 { 147 147 m_spInstance = 0; 148 148 } 149 149 150 bool UI SelectorWindow::shouldBeMaximized() const150 bool UIVirtualBoxManager::shouldBeMaximized() const 151 151 { 152 152 return gEDataManager->selectorWindowShouldBeMaximized(); 153 153 } 154 154 155 void UI SelectorWindow::sltHandlePolishEvent()155 void UIVirtualBoxManager::sltHandlePolishEvent() 156 156 { 157 157 /* Get current item: */ 158 UIV MItem *pItem = currentItem();158 UIVirtualMachineItem *pItem = currentItem(); 159 159 160 160 /* Make sure there is accessible VM item chosen: */ … … 178 178 179 179 #ifdef VBOX_WS_X11 180 void UI SelectorWindow::sltHandleHostScreenAvailableAreaChange()180 void UIVirtualBoxManager::sltHandleHostScreenAvailableAreaChange() 181 181 { 182 182 /* Prevent handling if fake screen detected: */ … … 190 190 #endif /* VBOX_WS_X11 */ 191 191 192 void UI SelectorWindow::sltShowSelectorWindowContextMenu(const QPoint &position)192 void UIVirtualBoxManager::sltShowSelectorWindowContextMenu(const QPoint &position) 193 193 { 194 194 /* Populate toolbar/statusbar acctions: */ … … 260 260 } 261 261 262 void UI SelectorWindow::sltHandleChooserPaneIndexChange(bool fUpdateDetails /* = true */,263 bool fUpdateSnapshots /* = true */,264 bool fUpdateLogViewer /* = true*/)262 void UIVirtualBoxManager::sltHandleChooserPaneIndexChange(bool fUpdateDetails /* = true */, 263 bool fUpdateSnapshots /* = true */, 264 bool fUpdateLogViewer /* = true */) 265 265 { 266 266 /* Get current item: */ 267 UIV MItem *pItem = currentItem();267 UIVirtualMachineItem *pItem = currentItem(); 268 268 269 269 /* Update action visibility: */ … … 324 324 } 325 325 326 void UI SelectorWindow::sltHandleMediumEnumerationFinish()326 void UIVirtualBoxManager::sltHandleMediumEnumerationFinish() 327 327 { 328 328 /* We try to warn about inaccessible mediums only once … … 357 357 } 358 358 359 void UI SelectorWindow::sltOpenUrls(QList<QUrl> list /* = QList<QUrl>() */)359 void UIVirtualBoxManager::sltOpenUrls(QList<QUrl> list /* = QList<QUrl>() */) 360 360 { 361 361 /* Make sure any pending D&D events are consumed. */ … … 416 416 } 417 417 418 void UI SelectorWindow::sltHandleGroupSavingProgressChange()418 void UIVirtualBoxManager::sltHandleGroupSavingProgressChange() 419 419 { 420 420 updateActionsAppearance(); … … 422 422 423 423 #ifdef VBOX_WS_MAC 424 void UI SelectorWindow::sltActionHovered(UIAction *pAction)424 void UIVirtualBoxManager::sltActionHovered(UIAction *pAction) 425 425 { 426 426 /* Show the action message for a ten seconds: */ … … 429 429 #endif /* VBOX_WS_MAC */ 430 430 431 void UI SelectorWindow::sltHandleStateChange(QString)431 void UIVirtualBoxManager::sltHandleStateChange(QString) 432 432 { 433 433 /* Get current item: */ 434 UIV MItem *pItem = currentItem();434 UIVirtualMachineItem *pItem = currentItem(); 435 435 436 436 /* Make sure current item present: */ … … 442 442 } 443 443 444 void UI SelectorWindow::sltOpenVirtualMediumManagerWindow()444 void UIVirtualBoxManager::sltOpenVirtualMediumManagerWindow() 445 445 { 446 446 /* First check if instance of widget opened embedded: */ … … 456 456 UIMediumManagerFactory().prepare(m_pManagerVirtualMedia, this); 457 457 connect(m_pManagerVirtualMedia, &QIManagerDialog::sigClose, 458 this, &UI SelectorWindow::sltCloseVirtualMediumManagerWindow);458 this, &UIVirtualBoxManager::sltCloseVirtualMediumManagerWindow); 459 459 } 460 460 … … 465 465 } 466 466 467 void UI SelectorWindow::sltCloseVirtualMediumManagerWindow()467 void UIVirtualBoxManager::sltCloseVirtualMediumManagerWindow() 468 468 { 469 469 /* Destroy instance if still exists: */ … … 472 472 } 473 473 474 void UI SelectorWindow::sltOpenHostNetworkManagerWindow()474 void UIVirtualBoxManager::sltOpenHostNetworkManagerWindow() 475 475 { 476 476 /* First check if instance of widget opened embedded: */ … … 486 486 UIHostNetworkManagerFactory().prepare(m_pManagerHostNetwork, this); 487 487 connect(m_pManagerHostNetwork, &QIManagerDialog::sigClose, 488 this, &UI SelectorWindow::sltCloseHostNetworkManagerWindow);488 this, &UIVirtualBoxManager::sltCloseHostNetworkManagerWindow); 489 489 } 490 490 … … 495 495 } 496 496 497 void UI SelectorWindow::sltCloseHostNetworkManagerWindow()497 void UIVirtualBoxManager::sltCloseHostNetworkManagerWindow() 498 498 { 499 499 /* Destroy instance if still exists: */ … … 502 502 } 503 503 504 void UI SelectorWindow::sltOpenImportApplianceWizard(const QString &strFileName /* = QString() */)504 void UIVirtualBoxManager::sltOpenImportApplianceWizard(const QString &strFileName /* = QString() */) 505 505 { 506 506 /* Show Import Appliance wizard: */ … … 528 528 } 529 529 530 void UI SelectorWindow::sltOpenExportApplianceWizard()530 void UIVirtualBoxManager::sltOpenExportApplianceWizard() 531 531 { 532 532 /* Get selected items: */ 533 QList<UIV MItem*> items = currentItems();533 QList<UIVirtualMachineItem*> items = currentItems(); 534 534 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 535 535 … … 556 556 557 557 #ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI 558 void UI SelectorWindow::sltOpenExtraDataManagerWindow()558 void UIVirtualBoxManager::sltOpenExtraDataManagerWindow() 559 559 { 560 560 gEDataManager->openWindow(this); … … 562 562 #endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */ 563 563 564 void UI SelectorWindow::sltOpenPreferencesDialog()564 void UIVirtualBoxManager::sltOpenPreferencesDialog() 565 565 { 566 566 /* Check that we do NOT handling that already: */ … … 582 582 } 583 583 584 void UI SelectorWindow::sltPerformExit()584 void UIVirtualBoxManager::sltPerformExit() 585 585 { 586 586 close(); 587 587 } 588 588 589 void UI SelectorWindow::sltOpenAddMachineDialog(const QString &strFileName /* = QString() */)589 void UIVirtualBoxManager::sltOpenAddMachineDialog(const QString &strFileName /* = QString() */) 590 590 { 591 591 /* Initialize variables: */ … … 633 633 } 634 634 635 void UI SelectorWindow::sltOpenMachineSettingsDialog(const QString &strCategoryRef /* = QString() */,635 void UIVirtualBoxManager::sltOpenMachineSettingsDialog(const QString &strCategoryRef /* = QString() */, 636 636 const QString &strControlRef /* = QString() */, 637 637 const QString &strID /* = QString() */) … … 681 681 } 682 682 683 void UI SelectorWindow::sltOpenCloneMachineWizard()683 void UIVirtualBoxManager::sltOpenCloneMachineWizard() 684 684 { 685 685 /* Get current item: */ 686 UIV MItem *pItem = currentItem();686 UIVirtualMachineItem *pItem = currentItem(); 687 687 AssertMsgReturnVoid(pItem, ("Current item should be selected!\n")); 688 688 … … 706 706 } 707 707 708 void UI SelectorWindow::sltPerformMoveMachine()709 { 710 UIV MItem *pItem = currentItem();708 void UIVirtualBoxManager::sltPerformMoveMachine() 709 { 710 UIVirtualMachineItem *pItem = currentItem(); 711 711 AssertMsgReturnVoid(pItem, ("Current item should be selected!\n")); 712 712 … … 744 744 } 745 745 746 void UI SelectorWindow::sltPerformStartOrShowMachine()746 void UIVirtualBoxManager::sltPerformStartOrShowMachine() 747 747 { 748 748 /* Start selected VMs in corresponding mode: */ 749 QList<UIV MItem*> items = currentItems();749 QList<UIVirtualMachineItem*> items = currentItems(); 750 750 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 751 751 performStartOrShowVirtualMachines(items, VBoxGlobal::LaunchMode_Invalid); 752 752 } 753 753 754 void UI SelectorWindow::sltPerformStartMachineNormal()754 void UIVirtualBoxManager::sltPerformStartMachineNormal() 755 755 { 756 756 /* Start selected VMs in corresponding mode: */ 757 QList<UIV MItem*> items = currentItems();757 QList<UIVirtualMachineItem*> items = currentItems(); 758 758 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 759 759 performStartOrShowVirtualMachines(items, VBoxGlobal::LaunchMode_Default); 760 760 } 761 761 762 void UI SelectorWindow::sltPerformStartMachineHeadless()762 void UIVirtualBoxManager::sltPerformStartMachineHeadless() 763 763 { 764 764 /* Start selected VMs in corresponding mode: */ 765 QList<UIV MItem*> items = currentItems();765 QList<UIVirtualMachineItem*> items = currentItems(); 766 766 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 767 767 performStartOrShowVirtualMachines(items, VBoxGlobal::LaunchMode_Headless); 768 768 } 769 769 770 void UI SelectorWindow::sltPerformStartMachineDetachable()770 void UIVirtualBoxManager::sltPerformStartMachineDetachable() 771 771 { 772 772 /* Start selected VMs in corresponding mode: */ 773 QList<UIV MItem*> items = currentItems();773 QList<UIVirtualMachineItem*> items = currentItems(); 774 774 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 775 775 performStartOrShowVirtualMachines(items, VBoxGlobal::LaunchMode_Separate); 776 776 } 777 777 778 void UI SelectorWindow::sltPerformDiscardMachineState()778 void UIVirtualBoxManager::sltPerformDiscardMachineState() 779 779 { 780 780 /* Get selected items: */ 781 QList<UIV MItem*> items = currentItems();781 QList<UIVirtualMachineItem*> items = currentItems(); 782 782 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 783 783 784 784 /* Prepare the list of the machines to be discarded: */ 785 785 QStringList machineNames; 786 QList<UIV MItem*> itemsToDiscard;787 foreach (UIV MItem *pItem, items)788 if (isActionEnabled(UIActionIndexST_M_Group_S_Discard, QList<UIV MItem*>() << pItem))786 QList<UIVirtualMachineItem*> itemsToDiscard; 787 foreach (UIVirtualMachineItem *pItem, items) 788 if (isActionEnabled(UIActionIndexST_M_Group_S_Discard, QList<UIVirtualMachineItem*>() << pItem)) 789 789 { 790 790 machineNames << pItem->name(); … … 798 798 799 799 /* For every confirmed item: */ 800 foreach (UIV MItem *pItem, itemsToDiscard)800 foreach (UIVirtualMachineItem *pItem, itemsToDiscard) 801 801 { 802 802 /* Open a session to modify VM: */ … … 816 816 } 817 817 818 void UI SelectorWindow::sltPerformPauseOrResumeMachine(bool fPause)818 void UIVirtualBoxManager::sltPerformPauseOrResumeMachine(bool fPause) 819 819 { 820 820 /* Get selected items: */ 821 QList<UIV MItem*> items = currentItems();821 QList<UIVirtualMachineItem*> items = currentItems(); 822 822 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 823 823 824 824 /* For every selected item: */ 825 foreach (UIV MItem *pItem, items)825 foreach (UIVirtualMachineItem *pItem, items) 826 826 { 827 827 /* Get item state: */ … … 829 829 830 830 /* Check if current item could be paused/resumed: */ 831 if (!isActionEnabled(UIActionIndexST_M_Group_T_Pause, QList<UIV MItem*>() << pItem))831 if (!isActionEnabled(UIActionIndexST_M_Group_T_Pause, QList<UIVirtualMachineItem*>() << pItem)) 832 832 continue; 833 833 … … 871 871 } 872 872 873 void UI SelectorWindow::sltPerformResetMachine()873 void UIVirtualBoxManager::sltPerformResetMachine() 874 874 { 875 875 /* Get selected items: */ 876 QList<UIV MItem*> items = currentItems();876 QList<UIVirtualMachineItem*> items = currentItems(); 877 877 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 878 878 879 879 /* Prepare the list of the machines to be reseted: */ 880 880 QStringList machineNames; 881 QList<UIV MItem*> itemsToReset;882 foreach (UIV MItem *pItem, items)883 if (isActionEnabled(UIActionIndexST_M_Group_S_Reset, QList<UIV MItem*>() << pItem))881 QList<UIVirtualMachineItem*> itemsToReset; 882 foreach (UIVirtualMachineItem *pItem, items) 883 if (isActionEnabled(UIActionIndexST_M_Group_S_Reset, QList<UIVirtualMachineItem*>() << pItem)) 884 884 { 885 885 machineNames << pItem->name(); … … 893 893 894 894 /* For each selected item: */ 895 foreach (UIV MItem *pItem, itemsToReset)895 foreach (UIVirtualMachineItem *pItem, itemsToReset) 896 896 { 897 897 /* Open a session to modify VM state: */ … … 910 910 } 911 911 912 void UI SelectorWindow::sltPerformDetachMachineUI()912 void UIVirtualBoxManager::sltPerformDetachMachineUI() 913 913 { 914 914 /* Get selected items: */ 915 QList<UIV MItem*> items = currentItems();915 QList<UIVirtualMachineItem*> items = currentItems(); 916 916 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 917 917 918 918 /* For each selected item: */ 919 foreach (UIV MItem *pItem, items)919 foreach (UIVirtualMachineItem *pItem, items) 920 920 { 921 921 /* Check if current item could be detached: */ 922 if (!isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Detach, QList<UIV MItem*>() << pItem))922 if (!isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Detach, QList<UIVirtualMachineItem*>() << pItem)) 923 923 continue; 924 924 … … 928 928 } 929 929 930 void UI SelectorWindow::sltPerformSaveMachineState()930 void UIVirtualBoxManager::sltPerformSaveMachineState() 931 931 { 932 932 /* Get selected items: */ 933 QList<UIV MItem*> items = currentItems();933 QList<UIVirtualMachineItem*> items = currentItems(); 934 934 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 935 935 936 936 /* For each selected item: */ 937 foreach (UIV MItem *pItem, items)937 foreach (UIVirtualMachineItem *pItem, items) 938 938 { 939 939 /* Check if current item could be saved: */ 940 if (!isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_SaveState, QList<UIV MItem*>() << pItem))940 if (!isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_SaveState, QList<UIVirtualMachineItem*>() << pItem)) 941 941 continue; 942 942 … … 975 975 } 976 976 977 void UI SelectorWindow::sltPerformShutdownMachine()977 void UIVirtualBoxManager::sltPerformShutdownMachine() 978 978 { 979 979 /* Get selected items: */ 980 QList<UIV MItem*> items = currentItems();980 QList<UIVirtualMachineItem*> items = currentItems(); 981 981 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 982 982 983 983 /* Prepare the list of the machines to be shutdowned: */ 984 984 QStringList machineNames; 985 QList<UIV MItem*> itemsToShutdown;986 foreach (UIV MItem *pItem, items)987 if (isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Shutdown, QList<UIV MItem*>() << pItem))985 QList<UIVirtualMachineItem*> itemsToShutdown; 986 foreach (UIVirtualMachineItem *pItem, items) 987 if (isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_Shutdown, QList<UIVirtualMachineItem*>() << pItem)) 988 988 { 989 989 machineNames << pItem->name(); … … 997 997 998 998 /* For each selected item: */ 999 foreach (UIV MItem *pItem, itemsToShutdown)999 foreach (UIVirtualMachineItem *pItem, itemsToShutdown) 1000 1000 { 1001 1001 /* Open a session to modify VM state: */ … … 1016 1016 } 1017 1017 1018 void UI SelectorWindow::sltPerformPowerOffMachine()1018 void UIVirtualBoxManager::sltPerformPowerOffMachine() 1019 1019 { 1020 1020 /* Get selected items: */ 1021 QList<UIV MItem*> items = currentItems();1021 QList<UIVirtualMachineItem*> items = currentItems(); 1022 1022 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1023 1023 1024 1024 /* Prepare the list of the machines to be powered off: */ 1025 1025 QStringList machineNames; 1026 QList<UIV MItem*> itemsToPowerOff;1027 foreach (UIV MItem *pItem, items)1028 if (isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_PowerOff, QList<UIV MItem*>() << pItem))1026 QList<UIVirtualMachineItem*> itemsToPowerOff; 1027 foreach (UIVirtualMachineItem *pItem, items) 1028 if (isActionEnabled(UIActionIndexST_M_Machine_M_Close_S_PowerOff, QList<UIVirtualMachineItem*>() << pItem)) 1029 1029 { 1030 1030 machineNames << pItem->name(); … … 1038 1038 1039 1039 /* For each selected item: */ 1040 foreach (UIV MItem *pItem, itemsToPowerOff)1040 foreach (UIVirtualMachineItem *pItem, itemsToPowerOff) 1041 1041 { 1042 1042 /* Open a session to modify VM state: */ … … 1065 1065 } 1066 1066 1067 void UI SelectorWindow::sltOpenMachineLogDialog()1067 void UIVirtualBoxManager::sltOpenMachineLogDialog() 1068 1068 { 1069 1069 /* Get selected items: */ 1070 QList<UIV MItem*> items = currentItems();1070 QList<UIVirtualMachineItem*> items = currentItems(); 1071 1071 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1072 1072 … … 1079 1079 1080 1080 /* For each selected item: */ 1081 foreach (UIV MItem *pItem, items)1081 foreach (UIVirtualMachineItem *pItem, items) 1082 1082 { 1083 1083 /* Check if log could be show for the current item: */ 1084 if (!isActionEnabled(UIActionIndexST_M_Group_S_ShowLogDialog, QList<UIV MItem*>() << pItem))1084 if (!isActionEnabled(UIActionIndexST_M_Group_S_ShowLogDialog, QList<UIVirtualMachineItem*>() << pItem)) 1085 1085 continue; 1086 1086 … … 1095 1095 m_logViewers[pItem->machine().GetHardwareUUID()] = pLogViewerDialog; 1096 1096 connect(pLogViewerDialog, &QIManagerDialog::sigClose, 1097 this, &UI SelectorWindow::sltCloseLogViewerWindow);1097 this, &UIVirtualBoxManager::sltCloseLogViewerWindow); 1098 1098 } 1099 1099 } … … 1112 1112 } 1113 1113 1114 void UI SelectorWindow::sltCloseLogViewerWindow()1114 void UIVirtualBoxManager::sltCloseLogViewerWindow() 1115 1115 { 1116 1116 QMap<QString, QIManagerDialog*>::iterator sendersIterator = m_logViewers.begin(); … … 1134 1134 } 1135 1135 1136 void UI SelectorWindow::sltShowMachineInFileManager()1136 void UIVirtualBoxManager::sltShowMachineInFileManager() 1137 1137 { 1138 1138 /* Get selected items: */ 1139 QList<UIV MItem*> items = currentItems();1139 QList<UIVirtualMachineItem*> items = currentItems(); 1140 1140 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1141 1141 1142 1142 /* For each selected item: */ 1143 foreach (UIV MItem *pItem, items)1143 foreach (UIVirtualMachineItem *pItem, items) 1144 1144 { 1145 1145 /* Check if that item could be shown in file-browser: */ 1146 if (!isActionEnabled(UIActionIndexST_M_Group_S_ShowInFileManager, QList<UIV MItem*>() << pItem))1146 if (!isActionEnabled(UIActionIndexST_M_Group_S_ShowInFileManager, QList<UIVirtualMachineItem*>() << pItem)) 1147 1147 continue; 1148 1148 … … 1152 1152 } 1153 1153 1154 void UI SelectorWindow::sltPerformCreateMachineShortcut()1154 void UIVirtualBoxManager::sltPerformCreateMachineShortcut() 1155 1155 { 1156 1156 /* Get selected items: */ 1157 QList<UIV MItem*> items = currentItems();1157 QList<UIVirtualMachineItem*> items = currentItems(); 1158 1158 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1159 1159 1160 1160 /* For each selected item: */ 1161 foreach (UIV MItem *pItem, items)1161 foreach (UIVirtualMachineItem *pItem, items) 1162 1162 { 1163 1163 /* Check if shortcuts could be created for this item: */ 1164 if (!isActionEnabled(UIActionIndexST_M_Group_S_CreateShortcut, QList<UIV MItem*>() << pItem))1164 if (!isActionEnabled(UIActionIndexST_M_Group_S_CreateShortcut, QList<UIVirtualMachineItem*>() << pItem)) 1165 1165 continue; 1166 1166 … … 1173 1173 } 1174 1174 1175 void UI SelectorWindow::sltGroupCloseMenuAboutToShow()1175 void UIVirtualBoxManager::sltGroupCloseMenuAboutToShow() 1176 1176 { 1177 1177 /* Get selected items: */ 1178 QList<UIV MItem*> items = currentItems();1178 QList<UIVirtualMachineItem*> items = currentItems(); 1179 1179 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1180 1180 … … 1182 1182 } 1183 1183 1184 void UI SelectorWindow::sltMachineCloseMenuAboutToShow()1184 void UIVirtualBoxManager::sltMachineCloseMenuAboutToShow() 1185 1185 { 1186 1186 /* Get selected items: */ 1187 QList<UIV MItem*> items = currentItems();1187 QList<UIVirtualMachineItem*> items = currentItems(); 1188 1188 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1189 1189 … … 1191 1191 } 1192 1192 1193 void UI SelectorWindow::sltHandleToolsTypeSwitch()1193 void UIVirtualBoxManager::sltHandleToolsTypeSwitch() 1194 1194 { 1195 1195 /* If Machine tool button is checked => go backward: */ … … 1210 1210 } 1211 1211 1212 void UI SelectorWindow::sltHandleShowTabBarMachine()1212 void UIVirtualBoxManager::sltHandleShowTabBarMachine() 1213 1213 { 1214 1214 m_pActionTabBarGlobal->setVisible(false); … … 1216 1216 } 1217 1217 1218 void UI SelectorWindow::sltHandleShowTabBarGlobal()1218 void UIVirtualBoxManager::sltHandleShowTabBarGlobal() 1219 1219 { 1220 1220 m_pActionTabBarMachine->setVisible(false); … … 1222 1222 } 1223 1223 1224 void UI SelectorWindow::sltHandleToolOpenedMachine(ToolTypeMachine enmType)1224 void UIVirtualBoxManager::sltHandleToolOpenedMachine(ToolTypeMachine enmType) 1225 1225 { 1226 1226 /* First, make sure corresponding tool set opened: */ … … 1238 1238 if (enmType == ToolTypeMachine_Snapshots || enmType == ToolTypeMachine_LogViewer) 1239 1239 { 1240 UIV MItem *pItem = currentItem();1240 UIVirtualMachineItem *pItem = currentItem(); 1241 1241 m_pPaneToolsMachine->setMachine(pItem ? pItem->machine() : CMachine()); 1242 1242 } 1243 1243 } 1244 1244 1245 void UI SelectorWindow::sltHandleToolOpenedGlobal(ToolTypeGlobal enmType)1245 void UIVirtualBoxManager::sltHandleToolOpenedGlobal(ToolTypeGlobal enmType) 1246 1246 { 1247 1247 /* First, make sure corresponding tool set opened: */ … … 1254 1254 } 1255 1255 1256 void UI SelectorWindow::sltHandleToolClosedMachine(ToolTypeMachine enmType)1256 void UIVirtualBoxManager::sltHandleToolClosedMachine(ToolTypeMachine enmType) 1257 1257 { 1258 1258 /* Close corresponding tool: */ … … 1260 1260 } 1261 1261 1262 void UI SelectorWindow::sltHandleToolClosedGlobal(ToolTypeGlobal enmType)1262 void UIVirtualBoxManager::sltHandleToolClosedGlobal(ToolTypeGlobal enmType) 1263 1263 { 1264 1264 /* Close corresponding tool: */ … … 1266 1266 } 1267 1267 1268 UIV MItem* UISelectorWindow::currentItem() const1268 UIVirtualMachineItem* UIVirtualBoxManager::currentItem() const 1269 1269 { 1270 1270 return m_pPaneChooser->currentItem(); 1271 1271 } 1272 1272 1273 QList<UIV MItem*> UISelectorWindow::currentItems() const1273 QList<UIVirtualMachineItem*> UIVirtualBoxManager::currentItems() const 1274 1274 { 1275 1275 return m_pPaneChooser->currentItems(); 1276 1276 } 1277 1277 1278 void UI SelectorWindow::retranslateUi()1278 void UIVirtualBoxManager::retranslateUi() 1279 1279 { 1280 1280 /* Set window title: */ … … 1303 1303 } 1304 1304 1305 bool UI SelectorWindow::event(QEvent *pEvent)1305 bool UIVirtualBoxManager::event(QEvent *pEvent) 1306 1306 { 1307 1307 /* Which event do we have? */ … … 1374 1374 } 1375 1375 1376 void UI SelectorWindow::showEvent(QShowEvent *pEvent)1376 void UIVirtualBoxManager::showEvent(QShowEvent *pEvent) 1377 1377 { 1378 1378 /* Call to base-class: */ … … 1389 1389 } 1390 1390 1391 void UI SelectorWindow::polishEvent(QShowEvent*)1391 void UIVirtualBoxManager::polishEvent(QShowEvent*) 1392 1392 { 1393 1393 /* Make sure user warned about inaccessible medium(s) … … 1400 1400 1401 1401 #ifdef VBOX_WS_MAC 1402 bool UI SelectorWindow::eventFilter(QObject *pObject, QEvent *pEvent)1402 bool UIVirtualBoxManager::eventFilter(QObject *pObject, QEvent *pEvent) 1403 1403 { 1404 1404 /* Ignore for non-active window except for FileOpen event which should be always processed: */ … … 1429 1429 #endif /* VBOX_WS_MAC */ 1430 1430 1431 void UI SelectorWindow::closeEvent(QCloseEvent *pEvent)1431 void UIVirtualBoxManager::closeEvent(QCloseEvent *pEvent) 1432 1432 { 1433 1433 /* Call to base-class: */ … … 1438 1438 } 1439 1439 1440 void UI SelectorWindow::prepare()1440 void UIVirtualBoxManager::prepare() 1441 1441 { 1442 1442 #ifdef VBOX_WS_X11 … … 1487 1487 } 1488 1488 1489 void UI SelectorWindow::prepareIcon()1489 void UIVirtualBoxManager::prepareIcon() 1490 1490 { 1491 1491 /* Prepare application icon. … … 1501 1501 } 1502 1502 1503 void UI SelectorWindow::prepareMenuBar()1503 void UIVirtualBoxManager::prepareMenuBar() 1504 1504 { 1505 1505 #ifndef VBOX_WS_MAC … … 1549 1549 } 1550 1550 1551 void UI SelectorWindow::prepareMenuFile(QMenu *pMenu)1551 void UIVirtualBoxManager::prepareMenuFile(QMenu *pMenu) 1552 1552 { 1553 1553 /* Do not touch if filled already: */ … … 1645 1645 } 1646 1646 1647 void UI SelectorWindow::prepareMenuGroup(QMenu *pMenu)1647 void UIVirtualBoxManager::prepareMenuGroup(QMenu *pMenu) 1648 1648 { 1649 1649 /* Do not touch if filled already: */ … … 1710 1710 } 1711 1711 1712 void UI SelectorWindow::prepareMenuMachine(QMenu *pMenu)1712 void UIVirtualBoxManager::prepareMenuMachine(QMenu *pMenu) 1713 1713 { 1714 1714 /* Do not touch if filled already: */ … … 1783 1783 } 1784 1784 1785 void UI SelectorWindow::prepareMenuGroupStartOrShow(QMenu *pMenu)1785 void UIVirtualBoxManager::prepareMenuGroupStartOrShow(QMenu *pMenu) 1786 1786 { 1787 1787 /* Do not touch if filled already: */ … … 1812 1812 } 1813 1813 1814 void UI SelectorWindow::prepareMenuMachineStartOrShow(QMenu *pMenu)1814 void UIVirtualBoxManager::prepareMenuMachineStartOrShow(QMenu *pMenu) 1815 1815 { 1816 1816 /* Do not touch if filled already: */ … … 1841 1841 } 1842 1842 1843 void UI SelectorWindow::prepareMenuGroupClose(QMenu *pMenu)1843 void UIVirtualBoxManager::prepareMenuGroupClose(QMenu *pMenu) 1844 1844 { 1845 1845 /* Do not touch if filled already: */ … … 1873 1873 } 1874 1874 1875 void UI SelectorWindow::prepareMenuMachineClose(QMenu *pMenu)1875 void UIVirtualBoxManager::prepareMenuMachineClose(QMenu *pMenu) 1876 1876 { 1877 1877 /* Do not touch if filled already: */ … … 1905 1905 } 1906 1906 1907 void UI SelectorWindow::prepareStatusBar()1907 void UIVirtualBoxManager::prepareStatusBar() 1908 1908 { 1909 1909 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER … … 1924 1924 } 1925 1925 1926 void UI SelectorWindow::prepareToolbar()1926 void UIVirtualBoxManager::prepareToolbar() 1927 1927 { 1928 1928 /* Create Main toolbar: */ … … 1983 1983 1984 1984 /* Create Tools toolbar: */ 1985 m_pToolbarTools = new UITool sToolbar(actionPool());1985 m_pToolbarTools = new UIToolbarTools(actionPool()); 1986 1986 if (m_pToolbarTools) 1987 1987 { 1988 1988 /* Configure toolbar: */ 1989 1989 m_pToolbarTools->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding); 1990 connect(m_pToolbarTools, &UITool sToolbar::sigShowTabBarMachine,1991 this, &UI SelectorWindow::sltHandleShowTabBarMachine);1992 connect(m_pToolbarTools, &UITool sToolbar::sigShowTabBarGlobal,1993 this, &UI SelectorWindow::sltHandleShowTabBarGlobal);1990 connect(m_pToolbarTools, &UIToolbarTools::sigShowTabBarMachine, 1991 this, &UIVirtualBoxManager::sltHandleShowTabBarMachine); 1992 connect(m_pToolbarTools, &UIToolbarTools::sigShowTabBarGlobal, 1993 this, &UIVirtualBoxManager::sltHandleShowTabBarGlobal); 1994 1994 m_pToolbarTools->setTabBars(m_pTabBarMachine, m_pTabBarGlobal); 1995 1995 … … 2021 2021 } 2022 2022 2023 void UI SelectorWindow::prepareWidgets()2023 void UIVirtualBoxManager::prepareWidgets() 2024 2024 { 2025 2025 /* Create central-widget: */ … … 2060 2060 2061 2061 /* Create Chooser-pane: */ 2062 m_pPaneChooser = new UI GChooser(this);2062 m_pPaneChooser = new UIChooser(this); 2063 2063 AssertPtrReturnVoid(m_pPaneChooser); 2064 2064 { … … 2068 2068 2069 2069 /* Create Machine Tools-pane: */ 2070 m_pPaneToolsMachine = new UITool sPaneMachine(actionPool());2070 m_pPaneToolsMachine = new UIToolPaneMachine(actionPool()); 2071 2071 AssertPtrReturnVoid(m_pPaneToolsMachine); 2072 2072 { … … 2084 2084 2085 2085 /* Create Global Tools-pane: */ 2086 m_pPaneToolsGlobal = new UITool sPaneGlobal(actionPool());2086 m_pPaneToolsGlobal = new UIToolPaneGlobal(actionPool()); 2087 2087 AssertPtrReturnVoid(m_pPaneToolsGlobal); 2088 2088 … … 2100 2100 } 2101 2101 2102 void UI SelectorWindow::prepareConnections()2102 void UIVirtualBoxManager::prepareConnections() 2103 2103 { 2104 2104 #ifdef VBOX_WS_X11 … … 2173 2173 /* 'Tools' actions connections: */ 2174 2174 connect(actionPool()->action(UIActionIndexST_M_Tools_T_Machine), &UIAction::toggled, 2175 this, &UI SelectorWindow::sltHandleToolsTypeSwitch);2175 this, &UIVirtualBoxManager::sltHandleToolsTypeSwitch); 2176 2176 connect(actionPool()->action(UIActionIndexST_M_Tools_T_Global), &UIAction::toggled, 2177 this, &UI SelectorWindow::sltHandleToolsTypeSwitch);2177 this, &UIVirtualBoxManager::sltHandleToolsTypeSwitch); 2178 2178 2179 2179 /* Status-bar connections: */ … … 2195 2195 ::darwinRegisterForUnifiedToolbarContextMenuEvents(this); 2196 2196 #endif /* VBOX_WS_MAC */ 2197 connect(m_pToolbarTools, &UITool sToolbar::sigToolOpenedMachine, this, &UISelectorWindow::sltHandleToolOpenedMachine);2198 connect(m_pToolbarTools, &UITool sToolbar::sigToolOpenedGlobal, this, &UISelectorWindow::sltHandleToolOpenedGlobal);2199 connect(m_pToolbarTools, &UITool sToolbar::sigToolClosedMachine, this, &UISelectorWindow::sltHandleToolClosedMachine);2200 connect(m_pToolbarTools, &UITool sToolbar::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); 2201 2201 2202 2202 /* VM desktop connections: */ … … 2209 2209 } 2210 2210 2211 void UI SelectorWindow::loadSettings()2211 void UIVirtualBoxManager::loadSettings() 2212 2212 { 2213 2213 /* Restore window geometry: */ … … 2217 2217 2218 2218 /* Restore geometry: */ 2219 LogRel2(("GUI: UI SelectorWindow: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n",2219 LogRel2(("GUI: UIVirtualBoxManager: Restoring geometry to: Origin=%dx%d, Size=%dx%d\n", 2220 2220 m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height())); 2221 2221 restoreGeometry(); … … 2277 2277 } 2278 2278 2279 void UI SelectorWindow::saveSettings()2279 void UIVirtualBoxManager::saveSettings() 2280 2280 { 2281 2281 /* Save toolbar Machine/Global tools orders: */ … … 2304 2304 gEDataManager->setSelectorWindowGeometry(m_geometry, isMaximized()); 2305 2305 #endif /* !VBOX_WS_MAC */ 2306 LogRel2(("GUI: UI SelectorWindow: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",2306 LogRel2(("GUI: UIVirtualBoxManager: Geometry saved as: Origin=%dx%d, Size=%dx%d\n", 2307 2307 m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height())); 2308 2308 } 2309 2309 } 2310 2310 2311 void UI SelectorWindow::cleanupConnections()2311 void UIVirtualBoxManager::cleanupConnections() 2312 2312 { 2313 2313 #ifdef VBOX_WS_MAC … … 2317 2317 } 2318 2318 2319 void UI SelectorWindow::cleanupMenuBar()2319 void UIVirtualBoxManager::cleanupMenuBar() 2320 2320 { 2321 2321 #ifdef VBOX_WS_MAC … … 2328 2328 } 2329 2329 2330 void UI SelectorWindow::cleanup()2330 void UIVirtualBoxManager::cleanup() 2331 2331 { 2332 2332 /* Close the sub-dialogs first: */ … … 2342 2342 } 2343 2343 2344 void UI SelectorWindow::performStartOrShowVirtualMachines(const QList<UIVMItem*> &items, VBoxGlobal::LaunchMode enmLaunchMode)2344 void UIVirtualBoxManager::performStartOrShowVirtualMachines(const QList<UIVirtualMachineItem*> &items, VBoxGlobal::LaunchMode enmLaunchMode) 2345 2345 { 2346 2346 /* Do nothing while group saving is in progress: */ … … 2350 2350 /* Compose the list of startable items: */ 2351 2351 QStringList startableMachineNames; 2352 QList<UIV MItem*> startableItems;2353 foreach (UIV MItem *pItem, items)2354 if (isAtLeastOneItemCanBeStarted(QList<UIV MItem*>() << pItem))2352 QList<UIVirtualMachineItem*> startableItems; 2353 foreach (UIVirtualMachineItem *pItem, items) 2354 if (isAtLeastOneItemCanBeStarted(QList<UIVirtualMachineItem*>() << pItem)) 2355 2355 { 2356 2356 startableItems << pItem; … … 2366 2366 2367 2367 /* For every item => check if it could be launched: */ 2368 foreach (UIV MItem *pItem, items)2369 if ( isAtLeastOneItemCanBeShown(QList<UIV MItem*>() << pItem)2370 || ( isAtLeastOneItemCanBeStarted(QList<UIV MItem*>() << pItem)2368 foreach (UIVirtualMachineItem *pItem, items) 2369 if ( isAtLeastOneItemCanBeShown(QList<UIVirtualMachineItem*>() << pItem) 2370 || ( isAtLeastOneItemCanBeStarted(QList<UIVirtualMachineItem*>() << pItem) 2371 2371 && fStartConfirmed)) 2372 2372 { … … 2374 2374 VBoxGlobal::LaunchMode enmItemLaunchMode = enmLaunchMode; 2375 2375 if (enmItemLaunchMode == VBoxGlobal::LaunchMode_Invalid) 2376 enmItemLaunchMode = UIV MItem::isItemRunningHeadless(pItem) ? VBoxGlobal::LaunchMode_Separate :2376 enmItemLaunchMode = UIVirtualMachineItem::isItemRunningHeadless(pItem) ? VBoxGlobal::LaunchMode_Separate : 2377 2377 qApp->keyboardModifiers() == Qt::ShiftModifier ? VBoxGlobal::LaunchMode_Headless : 2378 2378 VBoxGlobal::LaunchMode_Default; … … 2384 2384 } 2385 2385 2386 void UI SelectorWindow::updateActionsVisibility()2386 void UIVirtualBoxManager::updateActionsVisibility() 2387 2387 { 2388 2388 /* Determine whether Machine or Group menu should be shown at all: */ … … 2413 2413 } 2414 2414 2415 void UI SelectorWindow::updateActionsAppearance()2415 void UIVirtualBoxManager::updateActionsAppearance() 2416 2416 { 2417 2417 /* Get current items: */ 2418 QList<UIV MItem*> items = currentItems();2418 QList<UIVirtualMachineItem*> items = currentItems(); 2419 2419 2420 2420 /* Enable/disable group actions: */ … … 2472 2472 2473 2473 /* Get current item: */ 2474 UIV MItem *pItem = currentItem();2474 UIVirtualMachineItem *pItem = currentItem(); 2475 2475 2476 2476 /* Start/Show action is deremined by 1st item: */ 2477 2477 if (pItem && pItem->accessible()) 2478 2478 { 2479 actionPool()->action(UIActionIndexST_M_Group_M_StartOrShow)->toActionPolymorphicMenu()->setState(UIV MItem::isItemPoweredOff(pItem) ? 0 : 1);2480 actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)->toActionPolymorphicMenu()->setState(UIV MItem::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); 2481 2481 QToolButton *pButton = qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow))); 2482 2482 if (pButton) 2483 pButton->setPopupMode(UIV MItem::isItemPoweredOff(pItem) ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup);2483 pButton->setPopupMode(UIVirtualMachineItem::isItemPoweredOff(pItem) ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup); 2484 2484 } 2485 2485 else … … 2489 2489 QToolButton *pButton = qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow))); 2490 2490 if (pButton) 2491 pButton->setPopupMode(UIV MItem::isItemPoweredOff(pItem) ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup);2491 pButton->setPopupMode(UIVirtualMachineItem::isItemPoweredOff(pItem) ? QToolButton::MenuButtonPopup : QToolButton::DelayedPopup); 2492 2492 } 2493 2493 2494 2494 /* Pause/Resume action is deremined by 1st started item: */ 2495 UIV MItem *pFirstStartedAction = 0;2496 foreach (UIV MItem *pSelectedItem, items)2497 if (UIV MItem::isItemStarted(pSelectedItem))2495 UIVirtualMachineItem *pFirstStartedAction = 0; 2496 foreach (UIVirtualMachineItem *pSelectedItem, items) 2497 if (UIVirtualMachineItem::isItemStarted(pSelectedItem)) 2498 2498 { 2499 2499 pFirstStartedAction = pSelectedItem; … … 2502 2502 /* Update the group Pause/Resume action appearance: */ 2503 2503 actionPool()->action(UIActionIndexST_M_Group_T_Pause)->blockSignals(true); 2504 actionPool()->action(UIActionIndexST_M_Group_T_Pause)->setChecked(pFirstStartedAction && UIV MItem::isItemPaused(pFirstStartedAction));2504 actionPool()->action(UIActionIndexST_M_Group_T_Pause)->setChecked(pFirstStartedAction && UIVirtualMachineItem::isItemPaused(pFirstStartedAction)); 2505 2505 actionPool()->action(UIActionIndexST_M_Group_T_Pause)->retranslateUi(); 2506 2506 actionPool()->action(UIActionIndexST_M_Group_T_Pause)->blockSignals(false); 2507 2507 /* Update the machine Pause/Resume action appearance: */ 2508 2508 actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->blockSignals(true); 2509 actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->setChecked(pFirstStartedAction && UIV MItem::isItemPaused(pFirstStartedAction));2509 actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->setChecked(pFirstStartedAction && UIVirtualMachineItem::isItemPaused(pFirstStartedAction)); 2510 2510 actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->retranslateUi(); 2511 2511 actionPool()->action(UIActionIndexST_M_Machine_T_Pause)->blockSignals(false); … … 2518 2518 } 2519 2519 2520 bool UI SelectorWindow::isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items)2520 bool UIVirtualBoxManager::isActionEnabled(int iActionIndex, const QList<UIVirtualMachineItem*> &items) 2521 2521 { 2522 2522 /* No actions enabled for empty item list: */ … … 2525 2525 2526 2526 /* Get first item: */ 2527 UIV MItem *pItem = items.first();2527 UIVirtualMachineItem *pItem = items.first(); 2528 2528 2529 2529 /* For known action types: */ … … 2552 2552 return !m_pPaneChooser->isGroupSavingInProgress() && 2553 2553 items.size() == 1 && 2554 UIV MItem::isItemEditable(pItem);2554 UIVirtualMachineItem::isItemEditable(pItem); 2555 2555 } 2556 2556 case UIActionIndexST_M_Machine_S_Remove: … … 2659 2659 2660 2660 /* static */ 2661 bool UI SelectorWindow::isItemsPoweredOff(const QList<UIVMItem*> &items)2662 { 2663 foreach (UIV MItem *pItem, items)2664 if (!UIV MItem::isItemPoweredOff(pItem))2661 bool UIVirtualBoxManager::isItemsPoweredOff(const QList<UIVirtualMachineItem*> &items) 2662 { 2663 foreach (UIVirtualMachineItem *pItem, items) 2664 if (!UIVirtualMachineItem::isItemPoweredOff(pItem)) 2665 2665 return false; 2666 2666 return true; … … 2668 2668 2669 2669 /* static */ 2670 bool UI SelectorWindow::isAtLeastOneItemAbleToShutdown(const QList<UIVMItem*> &items)2670 bool UIVirtualBoxManager::isAtLeastOneItemAbleToShutdown(const QList<UIVirtualMachineItem*> &items) 2671 2671 { 2672 2672 /* Enumerate all the passed items: */ 2673 foreach (UIV MItem *pItem, items)2673 foreach (UIVirtualMachineItem *pItem, items) 2674 2674 { 2675 2675 /* Skip non-running machines: */ 2676 if (!UIV MItem::isItemRunning(pItem))2676 if (!UIVirtualMachineItem::isItemRunning(pItem)) 2677 2677 continue; 2678 2678 /* Skip session failures: */ … … 2701 2701 2702 2702 /* static */ 2703 bool UI SelectorWindow::isAtLeastOneItemSupportsShortcuts(const QList<UIVMItem*> &items)2704 { 2705 foreach (UIV MItem *pItem, items)2703 bool UIVirtualBoxManager::isAtLeastOneItemSupportsShortcuts(const QList<UIVirtualMachineItem*> &items) 2704 { 2705 foreach (UIVirtualMachineItem *pItem, items) 2706 2706 if (pItem->accessible() 2707 2707 #ifdef VBOX_WS_MAC … … 2715 2715 2716 2716 /* static */ 2717 bool UI SelectorWindow::isAtLeastOneItemAccessible(const QList<UIVMItem*> &items)2718 { 2719 foreach (UIV MItem *pItem, items)2717 bool UIVirtualBoxManager::isAtLeastOneItemAccessible(const QList<UIVirtualMachineItem*> &items) 2718 { 2719 foreach (UIVirtualMachineItem *pItem, items) 2720 2720 if (pItem->accessible()) 2721 2721 return true; … … 2724 2724 2725 2725 /* static */ 2726 bool UI SelectorWindow::isAtLeastOneItemInaccessible(const QList<UIVMItem*> &items)2727 { 2728 foreach (UIV MItem *pItem, items)2726 bool UIVirtualBoxManager::isAtLeastOneItemInaccessible(const QList<UIVirtualMachineItem*> &items) 2727 { 2728 foreach (UIVirtualMachineItem *pItem, items) 2729 2729 if (!pItem->accessible()) 2730 2730 return true; … … 2733 2733 2734 2734 /* static */ 2735 bool UI SelectorWindow::isAtLeastOneItemRemovable(const QList<UIVMItem*> &items)2736 { 2737 foreach (UIV MItem *pItem, items)2738 if (!pItem->accessible() || UIV MItem::isItemEditable(pItem))2735 bool UIVirtualBoxManager::isAtLeastOneItemRemovable(const QList<UIVirtualMachineItem*> &items) 2736 { 2737 foreach (UIVirtualMachineItem *pItem, items) 2738 if (!pItem->accessible() || UIVirtualMachineItem::isItemEditable(pItem)) 2739 2739 return true; 2740 2740 return false; … … 2742 2742 2743 2743 /* static */ 2744 bool UI SelectorWindow::isAtLeastOneItemCanBeStarted(const QList<UIVMItem*> &items)2745 { 2746 foreach (UIV MItem *pItem, items)2747 { 2748 if (UIV MItem::isItemPoweredOff(pItem) && UIVMItem::isItemEditable(pItem))2744 bool UIVirtualBoxManager::isAtLeastOneItemCanBeStarted(const QList<UIVirtualMachineItem*> &items) 2745 { 2746 foreach (UIVirtualMachineItem *pItem, items) 2747 { 2748 if (UIVirtualMachineItem::isItemPoweredOff(pItem) && UIVirtualMachineItem::isItemEditable(pItem)) 2749 2749 return true; 2750 2750 } … … 2753 2753 2754 2754 /* static */ 2755 bool UI SelectorWindow::isAtLeastOneItemCanBeShown(const QList<UIVMItem*> &items)2756 { 2757 foreach (UIV MItem *pItem, items)2758 { 2759 if (UIV MItem::isItemStarted(pItem) && (pItem->canSwitchTo() || UIVMItem::isItemRunningHeadless(pItem)))2755 bool UIVirtualBoxManager::isAtLeastOneItemCanBeShown(const QList<UIVirtualMachineItem*> &items) 2756 { 2757 foreach (UIVirtualMachineItem *pItem, items) 2758 { 2759 if (UIVirtualMachineItem::isItemStarted(pItem) && (pItem->canSwitchTo() || UIVirtualMachineItem::isItemRunningHeadless(pItem))) 2760 2760 return true; 2761 2761 } … … 2764 2764 2765 2765 /* static */ 2766 bool UI SelectorWindow::isAtLeastOneItemCanBeStartedOrShown(const QList<UIVMItem*> &items)2767 { 2768 foreach (UIV MItem *pItem, items)2769 { 2770 if ((UIV MItem::isItemPoweredOff(pItem) && UIVMItem::isItemEditable(pItem)) ||2771 (UIV MItem::isItemStarted(pItem) && (pItem->canSwitchTo() || UIVMItem::isItemRunningHeadless(pItem))))2766 bool 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)))) 2772 2772 return true; 2773 2773 } … … 2776 2776 2777 2777 /* static */ 2778 bool UI SelectorWindow::isAtLeastOneItemDiscardable(const QList<UIVMItem*> &items)2779 { 2780 foreach (UIV MItem *pItem, items)2781 if (UIV MItem::isItemSaved(pItem) && UIVMItem::isItemEditable(pItem))2778 bool UIVirtualBoxManager::isAtLeastOneItemDiscardable(const QList<UIVirtualMachineItem*> &items) 2779 { 2780 foreach (UIVirtualMachineItem *pItem, items) 2781 if (UIVirtualMachineItem::isItemSaved(pItem) && UIVirtualMachineItem::isItemEditable(pItem)) 2782 2782 return true; 2783 2783 return false; … … 2785 2785 2786 2786 /* static */ 2787 bool UI SelectorWindow::isAtLeastOneItemStarted(const QList<UIVMItem*> &items)2788 { 2789 foreach (UIV MItem *pItem, items)2790 if (UIV MItem::isItemStarted(pItem))2787 bool UIVirtualBoxManager::isAtLeastOneItemStarted(const QList<UIVirtualMachineItem*> &items) 2788 { 2789 foreach (UIVirtualMachineItem *pItem, items) 2790 if (UIVirtualMachineItem::isItemStarted(pItem)) 2791 2791 return true; 2792 2792 return false; … … 2794 2794 2795 2795 /* static */ 2796 bool UI SelectorWindow::isAtLeastOneItemRunning(const QList<UIVMItem*> &items)2797 { 2798 foreach (UIV MItem *pItem, items)2799 if (UIV MItem::isItemRunning(pItem))2796 bool UIVirtualBoxManager::isAtLeastOneItemRunning(const QList<UIVirtualMachineItem*> &items) 2797 { 2798 foreach (UIVirtualMachineItem *pItem, items) 2799 if (UIVirtualMachineItem::isItemRunning(pItem)) 2800 2800 return true; 2801 2801 return false; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI SelectorWindowclass declaration.3 * VBox Qt GUI - UIVirtualBoxManager class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef ___UI SelectorWindow_h___19 #define ___UI SelectorWindow_h___18 #ifndef ___UIVirtualBoxManager_h___ 19 #define ___UIVirtualBoxManager_h___ 20 20 21 21 /* Qt includes: */ … … 25 25 #include "QIMainWindow.h" 26 26 #include "QIWithRetranslateUI.h" 27 #include "UITool sPaneGlobal.h"28 #include "UITool sPaneMachine.h"27 #include "UIToolPaneGlobal.h" 28 #include "UIToolPaneMachine.h" 29 29 #include "VBoxGlobal.h" 30 30 … … 35 35 class UIAction; 36 36 class UIActionPool; 37 class UI GChooser;37 class UIChooser; 38 38 class UISlidingWidget; 39 39 class UITabBar; 40 40 class UIToolBar; 41 class UITool sToolbar;42 class UIV MItem;41 class UIToolbarTools; 42 class UIVirtualMachineItem; 43 43 44 44 /* Type definitions: */ … … 47 47 /** Singleton QIMainWindow extension 48 48 * used as VirtualBox Manager (selector-window) instance. */ 49 class UI SelectorWindow: public QIWithRetranslateUI<QIMainWindow>49 class UIVirtualBoxManager : public QIWithRetranslateUI<QIMainWindow> 50 50 { 51 51 Q_OBJECT; … … 63 63 static void destroy(); 64 64 /** Static instance provider. */ 65 static UI SelectorWindow*instance() { return m_spInstance; }65 static UIVirtualBoxManager *instance() { return m_spInstance; } 66 66 67 67 /** Returns the action-pool instance. */ … … 71 71 72 72 /** Constructs selector-window. */ 73 UI SelectorWindow();73 UIVirtualBoxManager(); 74 74 /** Destructs selector-window. */ 75 ~UI SelectorWindow();75 ~UIVirtualBoxManager(); 76 76 77 77 /** Returns whether the window should be maximized when geometry being restored. */ … … 222 222 223 223 /** Returns current-item. */ 224 UIV MItem* currentItem() const;224 UIVirtualMachineItem* currentItem() const; 225 225 /** Returns a list of current-items. */ 226 QList<UIV MItem*> currentItems() const;226 QList<UIVirtualMachineItem*> currentItems() const; 227 227 228 228 /** @name Event handling stuff. … … 291 291 * @{ */ 292 292 /** Launches or shows virtual machines represented by passed @a items in corresponding @a enmLaunchMode (for launch). */ 293 void performStartOrShowVirtualMachines(const QList<UIV MItem*> &items, VBoxGlobal::LaunchMode enmLaunchMode);293 void performStartOrShowVirtualMachines(const QList<UIVirtualMachineItem*> &items, VBoxGlobal::LaunchMode enmLaunchMode); 294 294 /** @} */ 295 295 … … 303 303 /** Returns whether the action with @a iActionIndex is enabled. 304 304 * @param items used to calculate verdict about should the action be enabled. */ 305 bool isActionEnabled(int iActionIndex, const QList<UIV MItem*> &items);305 bool isActionEnabled(int iActionIndex, const QList<UIVirtualMachineItem*> &items); 306 306 307 307 /** Returns whether all passed @a items are powered off. */ 308 static bool isItemsPoweredOff(const QList<UIV MItem*> &items);308 static bool isItemsPoweredOff(const QList<UIVirtualMachineItem*> &items); 309 309 /** Returns whether at least one of passed @a items is able to shutdown. */ 310 static bool isAtLeastOneItemAbleToShutdown(const QList<UIV MItem*> &items);310 static bool isAtLeastOneItemAbleToShutdown(const QList<UIVirtualMachineItem*> &items); 311 311 /** Returns whether at least one of passed @a items supports shortcut creation. */ 312 static bool isAtLeastOneItemSupportsShortcuts(const QList<UIV MItem*> &items);312 static bool isAtLeastOneItemSupportsShortcuts(const QList<UIVirtualMachineItem*> &items); 313 313 /** Returns whether at least one of passed @a items is accessible. */ 314 static bool isAtLeastOneItemAccessible(const QList<UIV MItem*> &items);314 static bool isAtLeastOneItemAccessible(const QList<UIVirtualMachineItem*> &items); 315 315 /** Returns whether at least one of passed @a items is inaccessible. */ 316 static bool isAtLeastOneItemInaccessible(const QList<UIV MItem*> &items);316 static bool isAtLeastOneItemInaccessible(const QList<UIVirtualMachineItem*> &items); 317 317 /** Returns whether at least one of passed @a items is removable. */ 318 static bool isAtLeastOneItemRemovable(const QList<UIV MItem*> &items);318 static bool isAtLeastOneItemRemovable(const QList<UIVirtualMachineItem*> &items); 319 319 /** Returns whether at least one of passed @a items can be started. */ 320 static bool isAtLeastOneItemCanBeStarted(const QList<UIV MItem*> &items);320 static bool isAtLeastOneItemCanBeStarted(const QList<UIVirtualMachineItem*> &items); 321 321 /** Returns whether at least one of passed @a items can be shown. */ 322 static bool isAtLeastOneItemCanBeShown(const QList<UIV MItem*> &items);322 static bool isAtLeastOneItemCanBeShown(const QList<UIVirtualMachineItem*> &items); 323 323 /** Returns whether at least one of passed @a items can be started or shown. */ 324 static bool isAtLeastOneItemCanBeStartedOrShown(const QList<UIV MItem*> &items);324 static bool isAtLeastOneItemCanBeStartedOrShown(const QList<UIVirtualMachineItem*> &items); 325 325 /** Returns whether at least one of passed @a items can be discarded. */ 326 static bool isAtLeastOneItemDiscardable(const QList<UIV MItem*> &items);326 static bool isAtLeastOneItemDiscardable(const QList<UIVirtualMachineItem*> &items); 327 327 /** Returns whether at least one of passed @a items is started. */ 328 static bool isAtLeastOneItemStarted(const QList<UIV MItem*> &items);328 static bool isAtLeastOneItemStarted(const QList<UIVirtualMachineItem*> &items); 329 329 /** Returns whether at least one of passed @a items is running. */ 330 static bool isAtLeastOneItemRunning(const QList<UIV MItem*> &items);330 static bool isAtLeastOneItemRunning(const QList<UIVirtualMachineItem*> &items); 331 331 /** @} */ 332 332 333 333 /** Holds the static instance. */ 334 static UI SelectorWindow*m_spInstance;334 static UIVirtualBoxManager *m_spInstance; 335 335 336 336 /** Holds whether the dialog is polished. */ … … 361 361 362 362 /** Holds the Tools-toolbar instance. */ 363 UITool sToolbar*m_pToolbarTools;363 UIToolbarTools *m_pToolbarTools; 364 364 365 365 /** Holds the Machine Tools order. */ … … 369 369 370 370 /** Holds the Chooser-pane instance. */ 371 UI GChooser *m_pPaneChooser;371 UIChooser *m_pPaneChooser; 372 372 /** Holds the Machine Tools-pane instance. */ 373 UITool sPaneMachine *m_pPaneToolsMachine;373 UIToolPaneMachine *m_pPaneToolsMachine; 374 374 /** Holds the Global Tools-pane instance. */ 375 UITool sPaneGlobal *m_pPaneToolsGlobal;375 UIToolPaneGlobal *m_pPaneToolsGlobal; 376 376 377 377 /** Holds the list of Group menu actions. */ … … 393 393 }; 394 394 395 #define gp SelectorWindow UISelectorWindow::instance()396 397 #endif /* !___UI SelectorWindow_h___ */398 395 #define gpManager UIVirtualBoxManager::instance() 396 397 #endif /* !___UIVirtualBoxManager_h___ */ 398 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIV MItem class implementation.3 * VBox Qt GUI - UIVirtualMachineItem class implementation. 4 4 */ 5 5 … … 26 26 27 27 /* GUI includes: */ 28 # include "UIV MItem.h"28 # include "UIVirtualMachineItem.h" 29 29 # include "VBoxGlobal.h" 30 30 # include "UIConverter.h" … … 141 141 #endif 142 142 143 UIV MItem::UIVMItem(const CMachine &aMachine)143 UIVirtualMachineItem::UIVirtualMachineItem(const CMachine &aMachine) 144 144 : m_machine(aMachine) 145 145 { … … 147 147 } 148 148 149 UIV MItem::~UIVMItem()149 UIVirtualMachineItem::~UIVirtualMachineItem() 150 150 { 151 151 } … … 154 154 //////////////////////////////////////////////////////////////////////////////// 155 155 156 QPixmap UIV MItem::osPixmap(QSize *pLogicalSize /* = 0 */) const156 QPixmap UIVirtualMachineItem::osPixmap(QSize *pLogicalSize /* = 0 */) const 157 157 { 158 158 if (pLogicalSize) … … 161 161 } 162 162 163 QString UIV MItem::machineStateName() const163 QString UIVirtualMachineItem::machineStateName() const 164 164 { 165 165 return m_fAccessible ? gpConverter->toString(m_machineState) : … … 167 167 } 168 168 169 QIcon UIV MItem::machineStateIcon() const169 QIcon UIVirtualMachineItem::machineStateIcon() const 170 170 { 171 171 return m_fAccessible ? gpConverter->toIcon(m_machineState) : … … 173 173 } 174 174 175 QString UIV MItem::sessionStateName() const175 QString UIVirtualMachineItem::sessionStateName() const 176 176 { 177 177 return m_fAccessible ? gpConverter->toString(m_sessionState) : … … 179 179 } 180 180 181 QString UIV MItem::toolTipText() const181 QString UIVirtualMachineItem::toolTipText() const 182 182 { 183 183 QString dateTime = (m_lastStateChange.date() == QDate::currentDate()) ? … … 215 215 } 216 216 217 const QStringList& UIV MItem::groups()217 const QStringList& UIVirtualMachineItem::groups() 218 218 { 219 219 return m_groups; 220 220 } 221 221 222 bool UIV MItem::recache()222 bool UIVirtualMachineItem::recache() 223 223 { 224 224 bool needsResort = true; … … 313 313 } 314 314 315 void UIV MItem::recachePixmap()315 void UIVirtualMachineItem::recachePixmap() 316 316 { 317 317 /* If machine is accessible: */ … … 336 336 * foreground, and @a false otherwise. 337 337 */ 338 bool UIV MItem::canSwitchTo() const338 bool UIVirtualMachineItem::canSwitchTo() const 339 339 { 340 340 return const_cast <CMachine &>(m_machine).CanShowConsoleWindow(); … … 351 351 * @return true if successfully switched and false otherwise. 352 352 */ 353 bool UIV MItem::switchTo()353 bool UIVirtualMachineItem::switchTo() 354 354 { 355 355 #ifdef VBOX_WS_MAC … … 464 464 465 465 /* static */ 466 bool UIV MItem::isItemEditable(UIVMItem *pItem)466 bool UIVirtualMachineItem::isItemEditable(UIVirtualMachineItem *pItem) 467 467 { 468 468 return pItem && … … 472 472 473 473 /* static */ 474 bool UIV MItem::isItemSaved(UIVMItem *pItem)474 bool UIVirtualMachineItem::isItemSaved(UIVirtualMachineItem *pItem) 475 475 { 476 476 return pItem && … … 480 480 481 481 /* static */ 482 bool UIV MItem::isItemPoweredOff(UIVMItem *pItem)482 bool UIVirtualMachineItem::isItemPoweredOff(UIVirtualMachineItem *pItem) 483 483 { 484 484 return pItem && … … 491 491 492 492 /* static */ 493 bool UIV MItem::isItemStarted(UIVMItem *pItem)493 bool UIVirtualMachineItem::isItemStarted(UIVirtualMachineItem *pItem) 494 494 { 495 495 return isItemRunning(pItem) || isItemPaused(pItem); … … 497 497 498 498 /* static */ 499 bool UIV MItem::isItemRunning(UIVMItem *pItem)499 bool UIVirtualMachineItem::isItemRunning(UIVirtualMachineItem *pItem) 500 500 { 501 501 return pItem && … … 507 507 508 508 /* static */ 509 bool UIV MItem::isItemRunningHeadless(UIVMItem *pItem)509 bool UIVirtualMachineItem::isItemRunningHeadless(UIVirtualMachineItem *pItem) 510 510 { 511 511 if (isItemRunning(pItem)) … … 527 527 528 528 /* static */ 529 bool UIV MItem::isItemPaused(UIVMItem *pItem)529 bool UIVirtualMachineItem::isItemPaused(UIVirtualMachineItem *pItem) 530 530 { 531 531 return pItem && … … 536 536 537 537 /* static */ 538 bool UIV MItem::isItemStuck(UIVMItem *pItem)538 bool UIVirtualMachineItem::isItemStuck(UIVirtualMachineItem *pItem) 539 539 { 540 540 return pItem && … … 543 543 } 544 544 545 QString UIV MItemMimeData::m_type = "application/org.virtualbox.gui.vmselector.uivmitem";546 547 UIV MItemMimeData::UIVMItemMimeData(UIVMItem *pItem)545 QString UIVirtualMachineItemMimeData::m_type = "application/org.virtualbox.gui.vmselector.UIVirtualMachineItem"; 546 547 UIVirtualMachineItemMimeData::UIVirtualMachineItemMimeData(UIVirtualMachineItem *pItem) 548 548 : m_pItem(pItem) 549 549 { 550 550 } 551 551 552 UIV MItem *UIVMItemMimeData::item() const552 UIVirtualMachineItem *UIVirtualMachineItemMimeData::item() const 553 553 { 554 554 return m_pItem; 555 555 } 556 556 557 QStringList UIV MItemMimeData::formats() const557 QStringList UIVirtualMachineItemMimeData::formats() const 558 558 { 559 559 QStringList types; … … 563 563 564 564 /* static */ 565 QString UIV MItemMimeData::type()565 QString UIVirtualMachineItemMimeData::type() 566 566 { 567 567 return m_type; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualMachineItem.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIV MItem class declarations.3 * VBox Qt GUI - UIVirtualMachineItem class declarations. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UIV MItem_h__19 #define __UIV MItem_h__18 #ifndef __UIVirtualMachineItem_h__ 19 #define __UIVirtualMachineItem_h__ 20 20 21 21 /* Qt includes: */ … … 35 35 using namespace UISettingsDefs; 36 36 37 class UIV MItem37 class UIVirtualMachineItem 38 38 { 39 39 public: 40 40 41 UIV MItem(const CMachine &aMachine);42 virtual ~UIV MItem();41 UIVirtualMachineItem(const CMachine &aMachine); 42 virtual ~UIVirtualMachineItem(); 43 43 44 44 CMachine machine() const { return m_machine; } … … 78 78 ConfigurationAccessLevel configurationAccessLevel() const { return m_configurationAccessLevel; } 79 79 80 static bool isItemEditable(UIV MItem *pItem);81 static bool isItemSaved(UIV MItem *pItem);82 static bool isItemPoweredOff(UIV MItem *pItem);83 static bool isItemStarted(UIV MItem *pItem);84 static bool isItemRunning(UIV MItem *pItem);85 static bool isItemRunningHeadless(UIV MItem *pItem);86 static bool isItemPaused(UIV MItem *pItem);87 static bool isItemStuck(UIV MItem *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); 88 88 89 89 private: … … 119 119 120 120 /* Make the pointer of this class public to the QVariant framework */ 121 Q_DECLARE_METATYPE(UIV MItem *);121 Q_DECLARE_METATYPE(UIVirtualMachineItem *); 122 122 123 class UIV MItemMimeData: public QMimeData123 class UIVirtualMachineItemMimeData: public QMimeData 124 124 { 125 125 Q_OBJECT; … … 127 127 public: 128 128 129 UIV MItemMimeData(UIVMItem *pItem);129 UIVirtualMachineItemMimeData(UIVirtualMachineItem *pItem); 130 130 131 UIV MItem *item() const;131 UIVirtualMachineItem *item() const; 132 132 QStringList formats() const; 133 133 … … 137 137 138 138 /* Private member vars */ 139 UIV MItem *m_pItem;139 UIVirtualMachineItem *m_pItem; 140 140 141 141 static QString m_type; 142 142 }; 143 143 144 #endif /* __UIV MItem_h__ */144 #endif /* __UIVirtualMachineItem_h__ */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIWelcomePane.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI DesktopPane class implementation.3 * VBox Qt GUI - UIWelcomePane class implementation. 4 4 */ 5 5 … … 36 36 /* GUI includes */ 37 37 # include "QIWithRetranslateUI.h" 38 # include "UI DesktopPane.h"38 # include "UIWelcomePane.h" 39 39 # include "VBoxUtils.h" 40 40 … … 60 60 61 61 /** QScrollArea extension to wrap a tools pane. */ 62 class UI ToolScrollArea: public QScrollArea62 class UIScrollAreaTools : public QScrollArea 63 63 { 64 64 Q_OBJECT; … … 67 67 68 68 /** Constructs scroll-area passing @a pParent to the base-class. */ 69 UI ToolScrollArea(QWidget *pParent = 0);69 UIScrollAreaTools(QWidget *pParent = 0); 70 70 71 71 protected: … … 83 83 * hints calculation which is very stupid taking into account 84 84 * QLayout "eats it raw" and tries to be dynamical on it's basis. */ 85 class UI Label : public QLabel85 class UIWrappableLabel : public QLabel 86 86 { 87 87 Q_OBJECT; … … 90 90 91 91 /** Constructs scroll-area passing @a pParent to the base-class. */ 92 UI Label(QWidget *pParent = 0);92 UIWrappableLabel(QWidget *pParent = 0); 93 93 94 94 protected: … … 108 108 109 109 110 /** Our own skinnable implementation of tool widget for UI DesktopPane. */111 class UI ToolWidget: public QWidget110 /** Our own skinnable implementation of tool widget for UIWelcomePane. */ 111 class UIWidgetTool : public QWidget 112 112 { 113 113 Q_OBJECT; … … 116 116 117 117 /** Constructs tool widget on the basis of passed @a pAction and @a strDescription. */ 118 UI ToolWidget(QAction *pAction, const QString &strDescription);118 UIWidgetTool(QAction *pAction, const QString &strDescription); 119 119 120 120 protected: … … 157 157 * 2. Error pane reflecting information about currently chosen 158 158 * inaccessible VM and allowing to operate over it. */ 159 class UI DesktopPanePrivate : public QIWithRetranslateUI<QStackedWidget>159 class UIWelcomePanePrivate : public QIWithRetranslateUI<QStackedWidget> 160 160 { 161 161 Q_OBJECT; … … 165 165 /** Constructs private desktop pane passing @a pParent to the base-class. 166 166 * @param pRefreshAction Brings the refresh action reference. */ 167 UI DesktopPanePrivate(QWidget *pParent, QAction *pRefreshAction);167 UIWelcomePanePrivate(QWidget *pParent, QAction *pRefreshAction); 168 168 169 169 /** Assigns @a strError and switches to error pane. */ … … 212 212 213 213 /** Holds the tools pane scroll-area instance. */ 214 UI ToolScrollArea*m_pScrollArea;214 UIScrollAreaTools *m_pScrollArea; 215 215 /** Holds the tools pane instance. */ 216 216 QWidget *m_pToolsPane; … … 228 228 229 229 /********************************************************************************************************************************* 230 * Class UI ToolScrollAreaimplementation. *230 * Class UIScrollAreaTools implementation. * 231 231 *********************************************************************************************************************************/ 232 232 233 UI ToolScrollArea::UIToolScrollArea(QWidget *pParent /* = 0 */)233 UIScrollAreaTools::UIScrollAreaTools(QWidget *pParent /* = 0 */) 234 234 : QScrollArea(pParent) 235 235 { 236 236 } 237 237 238 QSize UI ToolScrollArea::minimumSizeHint() const238 QSize UIScrollAreaTools::minimumSizeHint() const 239 239 { 240 240 // WORKAROUND: … … 250 250 251 251 /********************************************************************************************************************************* 252 * Class UI Label implementation. *252 * Class UIWrappableLabel implementation. * 253 253 *********************************************************************************************************************************/ 254 254 255 UI Label::UILabel(QWidget *pParent /* = 0 */)255 UIWrappableLabel::UIWrappableLabel(QWidget *pParent /* = 0 */) 256 256 : QLabel(pParent) 257 257 { 258 258 } 259 259 260 void UI Label::resizeEvent(QResizeEvent *pEvent)260 void UIWrappableLabel::resizeEvent(QResizeEvent *pEvent) 261 261 { 262 262 /* Call to base-class: */ … … 270 270 } 271 271 272 bool UI Label::hasHeightForWidth() const272 bool UIWrappableLabel::hasHeightForWidth() const 273 273 { 274 274 // WORKAROUND: … … 280 280 } 281 281 282 QSize UI Label::minimumSizeHint() const /* override */282 QSize UIWrappableLabel::minimumSizeHint() const /* override */ 283 283 { 284 284 // WORKAROUND: … … 290 290 } 291 291 292 QSize UI Label::sizeHint() const /* override */292 QSize UIWrappableLabel::sizeHint() const /* override */ 293 293 { 294 294 // WORKAROUND: … … 299 299 300 300 /********************************************************************************************************************************* 301 * Class UI ToolWidgetimplementation. *301 * Class UIWidgetTool implementation. * 302 302 *********************************************************************************************************************************/ 303 303 304 UI ToolWidget::UIToolWidget(QAction *pAction, const QString &strDescription)304 UIWidgetTool::UIWidgetTool(QAction *pAction, const QString &strDescription) 305 305 : m_pAction(pAction) 306 306 , m_strDescription(strDescription) … … 315 315 } 316 316 317 bool UI ToolWidget::event(QEvent *pEvent)317 bool UIWidgetTool::event(QEvent *pEvent) 318 318 { 319 319 /* Handle known event types: */ … … 356 356 } 357 357 358 void UI ToolWidget::paintEvent(QPaintEvent * /* pEvent */)358 void UIWidgetTool::paintEvent(QPaintEvent * /* pEvent */) 359 359 { 360 360 /* Prepare painter: */ … … 457 457 } 458 458 459 void UI ToolWidget::prepare()459 void UIWidgetTool::prepare() 460 460 { 461 461 /* Configure self: */ … … 493 493 494 494 /* Create description label: */ 495 m_pLabelDescription = new UI Label;495 m_pLabelDescription = new UIWrappableLabel; 496 496 AssertPtrReturnVoid(m_pLabelDescription); 497 497 { … … 524 524 } 525 525 526 void UI ToolWidget::updatePixmap()526 void UIWidgetTool::updatePixmap() 527 527 { 528 528 const int iMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize) * 1.375; … … 532 532 533 533 /********************************************************************************************************************************* 534 * Class UI DesktopPanePrivate implementation. *534 * Class UIWelcomePanePrivate implementation. * 535 535 *********************************************************************************************************************************/ 536 536 537 UI DesktopPanePrivate::UIDesktopPanePrivate(QWidget *pParent, QAction *pRefreshAction)537 UIWelcomePanePrivate::UIWelcomePanePrivate(QWidget *pParent, QAction *pRefreshAction) 538 538 : QIWithRetranslateUI<QStackedWidget>(pParent) 539 539 , m_pErrBox(0), m_pErrLabel(0), m_pErrText(0) … … 545 545 } 546 546 547 void UI DesktopPanePrivate::setError(const QString &strError)547 void UIWelcomePanePrivate::setError(const QString &strError) 548 548 { 549 549 /* Prepare error pane if necessary: */ … … 557 557 } 558 558 559 void UI DesktopPanePrivate::setToolsPaneText(const QString &strText)559 void UIWelcomePanePrivate::setToolsPaneText(const QString &strText) 560 560 { 561 561 /* Prepare tools pane if necessary: */ … … 569 569 } 570 570 571 void UI DesktopPanePrivate::setToolsPaneIcon(const QIcon &icon)571 void UIWelcomePanePrivate::setToolsPaneIcon(const QIcon &icon) 572 572 { 573 573 /* Prepare tools pane if necessary: */ … … 583 583 } 584 584 585 void UI DesktopPanePrivate::addToolDescription(QAction *pAction, const QString &strDescription)585 void UIWelcomePanePrivate::addToolDescription(QAction *pAction, const QString &strDescription) 586 586 { 587 587 /* Prepare tools pane if necessary: */ … … 589 589 590 590 /* Add tool widget on the basis of passed description: */ 591 UI ToolWidget *pWidget = new UIToolWidget(pAction, strDescription);591 UIWidgetTool *pWidget = new UIWidgetTool(pAction, strDescription); 592 592 AssertPtrReturnVoid(pWidget); 593 593 { … … 600 600 } 601 601 602 void UI DesktopPanePrivate::removeToolDescriptions()602 void UIWelcomePanePrivate::removeToolDescriptions() 603 603 { 604 604 /* Clear the layout: */ … … 614 614 } 615 615 616 bool UI DesktopPanePrivate::event(QEvent *pEvent)616 bool UIWelcomePanePrivate::event(QEvent *pEvent) 617 617 { 618 618 /* Handle know event types: */ … … 634 634 } 635 635 636 void UI DesktopPanePrivate::retranslateUi()636 void UIWelcomePanePrivate::retranslateUi() 637 637 { 638 638 /* Translate error-label text: */ … … 652 652 } 653 653 654 void UI DesktopPanePrivate::prepareErrorPane()654 void UIWelcomePanePrivate::prepareErrorPane() 655 655 { 656 656 if (m_pErrBox) … … 709 709 } 710 710 711 void UI DesktopPanePrivate::prepareToolsPane()711 void UIWelcomePanePrivate::prepareToolsPane() 712 712 { 713 713 /* Do nothing if already exists: */ … … 716 716 717 717 /* Create scroll-area: */ 718 m_pScrollArea = new UI ToolScrollArea;718 m_pScrollArea = new UIScrollAreaTools; 719 719 AssertPtrReturnVoid(m_pScrollArea); 720 720 { … … 740 740 741 741 /* Create welcome text label: */ 742 m_pLabelToolsPaneText = new UI Label;742 m_pLabelToolsPaneText = new UIWrappableLabel; 743 743 AssertPtrReturnVoid(m_pLabelToolsPaneText); 744 744 { … … 790 790 } 791 791 792 void UI DesktopPanePrivate::updatePixmap()792 void UIWelcomePanePrivate::updatePixmap() 793 793 { 794 794 /* Assign corresponding icon: */ … … 801 801 802 802 /********************************************************************************************************************************* 803 * Class UI DesktopPane implementation. *803 * Class UIWelcomePane implementation. * 804 804 *********************************************************************************************************************************/ 805 805 806 UI DesktopPane::UIDesktopPane(QAction *pRefreshAction /* = 0 */, QWidget *pParent /* = 0 */)806 UIWelcomePane::UIWelcomePane(QAction *pRefreshAction /* = 0 */, QWidget *pParent /* = 0 */) 807 807 : QWidget(pParent) 808 808 { … … 812 812 813 813 /* Create desktop pane: */ 814 m_pDesktopPrivate = new UI DesktopPanePrivate(this, pRefreshAction);814 m_pDesktopPrivate = new UIWelcomePanePrivate(this, pRefreshAction); 815 815 816 816 /* Add it to the layout: */ … … 818 818 } 819 819 820 void UI DesktopPane::updateDetailsError(const QString &strError)820 void UIWelcomePane::updateDetailsError(const QString &strError) 821 821 { 822 822 m_pDesktopPrivate->setError(strError); 823 823 } 824 824 825 void UI DesktopPane::setToolsPaneText(const QString &strText)825 void UIWelcomePane::setToolsPaneText(const QString &strText) 826 826 { 827 827 m_pDesktopPrivate->setToolsPaneText(strText); 828 828 } 829 829 830 void UI DesktopPane::setToolsPaneIcon(const QIcon &icon)830 void UIWelcomePane::setToolsPaneIcon(const QIcon &icon) 831 831 { 832 832 m_pDesktopPrivate->setToolsPaneIcon(icon); 833 833 } 834 834 835 void UI DesktopPane::addToolDescription(QAction *pAction, const QString &strDescription)835 void UIWelcomePane::addToolDescription(QAction *pAction, const QString &strDescription) 836 836 { 837 837 m_pDesktopPrivate->addToolDescription(pAction, strDescription); 838 838 } 839 839 840 void UI DesktopPane::removeToolDescriptions()840 void UIWelcomePane::removeToolDescriptions() 841 841 { 842 842 m_pDesktopPrivate->removeToolDescriptions(); 843 843 } 844 844 845 #include "UI DesktopPane.moc"846 845 #include "UIWelcomePane.moc" 846 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIWelcomePane.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI DesktopPane class declaration.3 * VBox Qt GUI - UIWelcomePane class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef ___UI DesktopPane_h___19 #define ___UI DesktopPane_h___18 #ifndef ___UIWelcomePane_h___ 19 #define ___UIWelcomePane_h___ 20 20 21 21 /* Qt includes: */ … … 26 26 class QIcon; 27 27 class QString; 28 class UI DesktopPanePrivate;28 class UIWelcomePanePrivate; 29 29 30 30 … … 33 33 * 2. Error details pane reflecting information about currently chosen 34 34 * inaccessible VM and allowing to operate over it. */ 35 class UI DesktopPane : public QWidget35 class UIWelcomePane : public QWidget 36 36 { 37 37 Q_OBJECT; … … 41 41 /** Constructs desktop pane passing @a pParent to the base-class. 42 42 * @param pRefreshAction Brings the refresh action reference. */ 43 UI DesktopPane(QAction *pRefreshAction = 0, QWidget *pParent = 0);43 UIWelcomePane(QAction *pRefreshAction = 0, QWidget *pParent = 0); 44 44 45 45 /** Updates @a strError details and switches to error details pane. */ … … 60 60 61 61 /** Holds the private desktop pane instance. */ 62 UI DesktopPanePrivate *m_pDesktopPrivate;62 UIWelcomePanePrivate *m_pDesktopPrivate; 63 63 }; 64 64 65 #endif /* !___UI DesktopPane_h___ */65 #endif /* !___UIWelcomePane_h___ */ 66 66 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooser class implementation.3 * VBox Qt GUI - UIChooser class implementation. 4 4 */ 5 5 … … 26 26 27 27 /* GUI includes: */ 28 # include "UI GChooser.h"29 # include "UI GChooserModel.h"30 # include "UI GChooserView.h"31 # include "UI SelectorWindow.h"28 # include "UIChooser.h" 29 # include "UIChooserModel.h" 30 # include "UIChooserView.h" 31 # include "UIVirtualBoxManager.h" 32 32 # include "VBoxGlobal.h" 33 33 … … 35 35 36 36 37 UI GChooser::UIGChooser(UISelectorWindow*pParent)37 UIChooser::UIChooser(UIVirtualBoxManager *pParent) 38 38 : QWidget(pParent) 39 39 , m_pSelectorWindow(pParent) … … 61 61 } 62 62 63 UI GChooser::~UIGChooser()63 UIChooser::~UIChooser() 64 64 { 65 65 /* Save: */ … … 67 67 } 68 68 69 UIActionPool* UI GChooser::actionPool() const69 UIActionPool* UIChooser::actionPool() const 70 70 { 71 71 return selector()->actionPool(); 72 72 } 73 73 74 UIV MItem* UIGChooser::currentItem() const74 UIVirtualMachineItem* UIChooser::currentItem() const 75 75 { 76 76 return m_pChooserModel->currentMachineItem(); 77 77 } 78 78 79 QList<UIV MItem*> UIGChooser::currentItems() const79 QList<UIVirtualMachineItem*> UIChooser::currentItems() const 80 80 { 81 81 return m_pChooserModel->currentMachineItems(); 82 82 } 83 83 84 bool UI GChooser::isSingleGroupSelected() const84 bool UIChooser::isSingleGroupSelected() const 85 85 { 86 86 return m_pChooserModel->isSingleGroupSelected(); 87 87 } 88 88 89 bool UI GChooser::isAllItemsOfOneGroupSelected() const89 bool UIChooser::isAllItemsOfOneGroupSelected() const 90 90 { 91 91 return m_pChooserModel->isAllItemsOfOneGroupSelected(); 92 92 } 93 93 94 bool UI GChooser::isGroupSavingInProgress() const94 bool UIChooser::isGroupSavingInProgress() const 95 95 { 96 96 return m_pChooserModel->isGroupSavingInProgress(); 97 97 } 98 98 99 void UI GChooser::preparePalette()99 void UIChooser::preparePalette() 100 100 { 101 101 /* Setup palette: */ … … 106 106 } 107 107 108 void UI GChooser::prepareLayout()108 void UIChooser::prepareLayout() 109 109 { 110 110 /* Setup main-layout: */ … … 115 115 } 116 116 117 void UI GChooser::prepareModel()117 void UIChooser::prepareModel() 118 118 { 119 119 /* Setup chooser-model: */ 120 m_pChooserModel = new UI GChooserModel(this);120 m_pChooserModel = new UIChooserModel(this); 121 121 } 122 122 123 void UI GChooser::prepareView()123 void UIChooser::prepareView() 124 124 { 125 125 /* Setup chooser-view: */ 126 m_pChooserView = new UI GChooserView(this);126 m_pChooserView = new UIChooserView(this); 127 127 m_pChooserView->setScene(m_pChooserModel->scene()); 128 128 m_pChooserView->show(); … … 131 131 } 132 132 133 void UI GChooser::prepareConnections()133 void UIChooser::prepareConnections() 134 134 { 135 135 /* Setup chooser-model connections: */ … … 138 138 connect(m_pChooserModel, SIGNAL(sigRootItemMinimumHeightHintChanged(int)), 139 139 m_pChooserView, SLOT(sltMinimumHeightHintChanged(int))); 140 connect(m_pChooserModel, SIGNAL(sigFocusChanged(UI GChooserItem*)),141 m_pChooserView, SLOT(sltFocusChanged(UI GChooserItem*)));140 connect(m_pChooserModel, SIGNAL(sigFocusChanged(UIChooserItem*)), 141 m_pChooserView, SLOT(sltFocusChanged(UIChooserItem*))); 142 142 143 143 /* Setup chooser-view connections: */ … … 146 146 } 147 147 148 void UI GChooser::load()148 void UIChooser::load() 149 149 { 150 150 /* Prepare model: */ … … 152 152 } 153 153 154 void UI GChooser::save()154 void UIChooser::save() 155 155 { 156 156 /* Cleanup model: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooser class declaration.3 * VBox Qt GUI - UIChooser class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GChooser_h__19 #define __UI GChooser_h__18 #ifndef __UIChooser_h__ 19 #define __UIChooser_h__ 20 20 21 21 /* Qt includes: */ … … 23 23 24 24 /* GUI includes: */ 25 #include "UI GChooserItem.h"25 #include "UIChooserItem.h" 26 26 27 27 /* Forward declartions: */ 28 class UIV MItem;28 class UIVirtualMachineItem; 29 29 class QVBoxLayout; 30 class UI SelectorWindow;30 class UIVirtualBoxManager; 31 31 class UIActionPool; 32 class UI GChooserModel;33 class UI GChooserView;32 class UIChooserModel; 33 class UIChooserView; 34 34 class QStatusBar; 35 35 36 36 /* Graphics selector widget: */ 37 class UI GChooser : public QWidget37 class UIChooser : public QWidget 38 38 { 39 39 Q_OBJECT; … … 57 57 58 58 /* Constructor/destructor: */ 59 UI GChooser(UISelectorWindow*pParent);60 ~UI GChooser();59 UIChooser(UIVirtualBoxManager *pParent); 60 ~UIChooser(); 61 61 62 62 /** Returns the selector-window reference. */ 63 UI SelectorWindow* selector() const { return m_pSelectorWindow; }63 UIVirtualBoxManager* selector() const { return m_pSelectorWindow; } 64 64 /** Returns the action-pool reference. */ 65 65 UIActionPool* actionPool() const; 66 66 67 67 /** Return the Chooser-model instance. */ 68 UI GChooserModel *model() const { return m_pChooserModel; }68 UIChooserModel *model() const { return m_pChooserModel; } 69 69 /** Return the Chooser-view instance. */ 70 UI GChooserView *view() const { return m_pChooserView; }70 UIChooserView *view() const { return m_pChooserView; } 71 71 72 72 /* API: Current-item stuff: */ 73 UIV MItem* currentItem() const;74 QList<UIV MItem*> currentItems() const;73 UIVirtualMachineItem* currentItem() const; 74 QList<UIVirtualMachineItem*> currentItems() const; 75 75 bool isSingleGroupSelected() const; 76 76 bool isAllItemsOfOneGroupSelected() const; … … 93 93 94 94 /** Holds the selector-window reference. */ 95 UI SelectorWindow* m_pSelectorWindow;95 UIVirtualBoxManager* m_pSelectorWindow; 96 96 97 97 /* Variables: */ 98 98 QVBoxLayout *m_pMainLayout; 99 UI GChooserModel *m_pChooserModel;100 UI GChooserView *m_pChooserView;99 UIChooserModel *m_pChooserModel; 100 UIChooserView *m_pChooserView; 101 101 }; 102 102 103 #endif /* __UI GChooser_h__ */103 #endif /* __UIChooser_h__ */ 104 104 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerKeyboard.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserHandlerKeyboard class implementation.3 * VBox Qt GUI - UIChooserHandlerKeyboard class implementation. 4 4 */ 5 5 … … 24 24 25 25 /* GUI incluedes: */ 26 # include "UI GChooserHandlerKeyboard.h"27 # include "UI GChooserModel.h"28 # include "UI GChooserItemGroup.h"26 # include "UIChooserHandlerKeyboard.h" 27 # include "UIChooserModel.h" 28 # include "UIChooserItemGroup.h" 29 29 30 30 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 31 31 32 32 33 UI GChooserHandlerKeyboard::UIGChooserHandlerKeyboard(UIGChooserModel *pParent)33 UIChooserHandlerKeyboard::UIChooserHandlerKeyboard(UIChooserModel *pParent) 34 34 : QObject(pParent) 35 35 , m_pModel(pParent) … … 42 42 } 43 43 44 bool UI GChooserHandlerKeyboard::handle(QKeyEvent *pEvent, UIKeyboardEventType type) const44 bool UIChooserHandlerKeyboard::handle(QKeyEvent *pEvent, UIKeyboardEventType type) const 45 45 { 46 46 /* Process passed event: */ … … 54 54 } 55 55 56 UI GChooserModel* UIGChooserHandlerKeyboard::model() const56 UIChooserModel* UIChooserHandlerKeyboard::model() const 57 57 { 58 58 return m_pModel; 59 59 } 60 60 61 bool UI GChooserHandlerKeyboard::handleKeyPress(QKeyEvent *pEvent) const61 bool UIChooserHandlerKeyboard::handleKeyPress(QKeyEvent *pEvent) const 62 62 { 63 63 /* Which key it was? */ … … 97 97 int iPosition = model()->navigationList().indexOf(model()->focusItem()); 98 98 /* Determine 'previous' item: */ 99 UI GChooserItem *pPreviousItem = 0;99 UIChooserItem *pPreviousItem = 0; 100 100 if (iPosition > 0) 101 101 { … … 110 110 pPreviousItem->makeSureItsVisible(); 111 111 /* Calculate positions: */ 112 UI GChooserItem *pFirstItem = model()->currentItem();112 UIChooserItem *pFirstItem = model()->currentItem(); 113 113 int iFirstPosition = model()->navigationList().indexOf(pFirstItem); 114 114 int iPreviousPosition = model()->navigationList().indexOf(pPreviousItem); 115 115 /* Populate list of items from 'first' to 'previous': */ 116 QList<UI GChooserItem*> items;116 QList<UIChooserItem*> items; 117 117 if (iFirstPosition <= iPreviousPosition) 118 118 for (int i = iFirstPosition; i <= iPreviousPosition; ++i) … … 140 140 int iPosition = model()->navigationList().indexOf(model()->focusItem()); 141 141 /* Determine 'previous' item: */ 142 UI GChooserItem *pPreviousItem = 0;142 UIChooserItem *pPreviousItem = 0; 143 143 if (iPosition > 0) 144 144 { … … 194 194 int iPosition = model()->navigationList().indexOf(model()->focusItem()); 195 195 /* Determine 'next' item: */ 196 UI GChooserItem *pNextItem = 0;196 UIChooserItem *pNextItem = 0; 197 197 if (iPosition < model()->navigationList().size() - 1) 198 198 { … … 207 207 pNextItem->makeSureItsVisible(); 208 208 /* Calculate positions: */ 209 UI GChooserItem *pFirstItem = model()->currentItem();209 UIChooserItem *pFirstItem = model()->currentItem(); 210 210 int iFirstPosition = model()->navigationList().indexOf(pFirstItem); 211 211 int iNextPosition = model()->navigationList().indexOf(pNextItem); 212 212 /* Populate list of items from 'first' to 'next': */ 213 QList<UI GChooserItem*> items;213 QList<UIChooserItem*> items; 214 214 if (iFirstPosition <= iNextPosition) 215 215 for (int i = iFirstPosition; i <= iNextPosition; ++i) … … 237 237 int iPosition = model()->navigationList().indexOf(model()->focusItem()); 238 238 /* Determine 'next' item: */ 239 UI GChooserItem *pNextItem = 0;239 UIChooserItem *pNextItem = 0; 240 240 if (iPosition < model()->navigationList().size() - 1) 241 241 { … … 262 262 { 263 263 /* If there is a focus item: */ 264 if (UI GChooserItem *pFocusItem = model()->focusItem())264 if (UIChooserItem *pFocusItem = model()->focusItem()) 265 265 { 266 266 /* Of the known type: */ 267 267 switch (pFocusItem->type()) 268 268 { 269 case UI GChooserItemType_Group:270 case UI GChooserItemType_Machine:269 case UIChooserItemType_Group: 270 case UIChooserItemType_Machine: 271 271 { 272 272 /* Unindent root if its NOT main: */ … … 286 286 { 287 287 /* If there is focus item: */ 288 if (UI GChooserItem *pFocusItem = model()->focusItem())288 if (UIChooserItem *pFocusItem = model()->focusItem()) 289 289 { 290 290 /* Of the group type: */ 291 if (pFocusItem->type() == UI GChooserItemType_Group)291 if (pFocusItem->type() == UIChooserItemType_Group) 292 292 { 293 293 /* Indent root with this item: */ … … 302 302 { 303 303 /* If this item is of group type: */ 304 if (model()->focusItem()->type() == UI GChooserItemType_Group)304 if (model()->focusItem()->type() == UIChooserItemType_Group) 305 305 { 306 306 /* Start embedded editing focus item: */ … … 331 331 } 332 332 /* If there is a focus item: */ 333 else if (UI GChooserItem *pFocusItem = model()->focusItem())333 else if (UIChooserItem *pFocusItem = model()->focusItem()) 334 334 { 335 335 /* Of the group type: */ 336 if (pFocusItem->type() == UI GChooserItemType_Group)336 if (pFocusItem->type() == UIChooserItemType_Group) 337 337 { 338 338 /* Toggle that group: */ 339 UI GChooserItemGroup *pGroupItem = pFocusItem->toGroupItem();339 UIChooserItemGroup *pGroupItem = pFocusItem->toGroupItem(); 340 340 if (pGroupItem->isClosed()) 341 341 pGroupItem->open(); … … 362 362 } 363 363 364 bool UI GChooserHandlerKeyboard::handleKeyRelease(QKeyEvent*) const364 bool UIChooserHandlerKeyboard::handleKeyRelease(QKeyEvent*) const 365 365 { 366 366 /* Pass all events: */ … … 368 368 } 369 369 370 void UI GChooserHandlerKeyboard::shift(UIItemShiftDirection direction, UIItemShiftSize size) const370 void UIChooserHandlerKeyboard::shift(UIItemShiftDirection direction, UIItemShiftSize size) const 371 371 { 372 372 /* Get focus-item and his parent: */ 373 UI GChooserItem *pFocusItem = model()->focusItem();374 UI GChooserItem *pParentItem = pFocusItem->parentItem();373 UIChooserItem *pFocusItem = model()->focusItem(); 374 UIChooserItem *pParentItem = pFocusItem->parentItem(); 375 375 /* Get the list of focus-item neighbours: */ 376 UI GChooserItemType type = (UIGChooserItemType)pFocusItem->type();377 QList<UI GChooserItem*> items = pParentItem->items(type);376 UIChooserItemType type = (UIChooserItemType)pFocusItem->type(); 377 QList<UIChooserItem*> items = pParentItem->items(type); 378 378 /* Get focus-item position: */ 379 379 int iFocusPosition = items.indexOf(pFocusItem); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerKeyboard.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserHandlerKeyboard class declaration.3 * VBox Qt GUI - UIChooserHandlerKeyboard class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GChooserHandlerKeyboard_h__19 #define __UI GChooserHandlerKeyboard_h__18 #ifndef __UIChooserHandlerKeyboard_h__ 19 #define __UIChooserHandlerKeyboard_h__ 20 20 21 21 /* Qt includes: */ … … 24 24 25 25 /* Forward declarations: */ 26 class UI GChooserModel;26 class UIChooserModel; 27 27 class QKeyEvent; 28 28 … … 49 49 50 50 /* Keyboard handler for graphics selector: */ 51 class UI GChooserHandlerKeyboard : public QObject51 class UIChooserHandlerKeyboard : public QObject 52 52 { 53 53 Q_OBJECT; … … 56 56 57 57 /* Constructor: */ 58 UI GChooserHandlerKeyboard(UIGChooserModel *pParent);58 UIChooserHandlerKeyboard(UIChooserModel *pParent); 59 59 60 60 /* API: Model keyboard-event handler delegate: */ … … 64 64 65 65 /* API: Model wrapper: */ 66 UI GChooserModel* model() const;66 UIChooserModel* model() const; 67 67 68 68 /* Helpers: Model keyboard-event handler delegates: */ … … 74 74 75 75 /* Variables: */ 76 UI GChooserModel *m_pModel;76 UIChooserModel *m_pModel; 77 77 QMap<int, UIItemShiftSize> m_shiftMap; 78 78 }; 79 79 80 #endif /* __UI GChooserHandlerKeyboard_h__ */80 #endif /* __UIChooserHandlerKeyboard_h__ */ 81 81 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerMouse.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserHandlerMouse class implementation.3 * VBox Qt GUI - UIChooserHandlerMouse class implementation. 4 4 */ 5 5 … … 24 24 25 25 /* GUI incluedes: */ 26 # include "UI GChooserHandlerMouse.h"27 # include "UI GChooserModel.h"28 # include "UI GChooserItemGroup.h"29 # include "UI GChooserItemMachine.h"26 # include "UIChooserHandlerMouse.h" 27 # include "UIChooserModel.h" 28 # include "UIChooserItemGroup.h" 29 # include "UIChooserItemMachine.h" 30 30 31 31 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 32 32 33 33 34 UI GChooserHandlerMouse::UIGChooserHandlerMouse(UIGChooserModel *pParent)34 UIChooserHandlerMouse::UIChooserHandlerMouse(UIChooserModel *pParent) 35 35 : QObject(pParent) 36 36 , m_pModel(pParent) … … 38 38 } 39 39 40 bool UI GChooserHandlerMouse::handle(QGraphicsSceneMouseEvent *pEvent, UIMouseEventType type) const40 bool UIChooserHandlerMouse::handle(QGraphicsSceneMouseEvent *pEvent, UIMouseEventType type) const 41 41 { 42 42 /* Process passed event: */ … … 51 51 } 52 52 53 UI GChooserModel* UIGChooserHandlerMouse::model() const53 UIChooserModel* UIChooserHandlerMouse::model() const 54 54 { 55 55 return m_pModel; 56 56 } 57 57 58 bool UI GChooserHandlerMouse::handleMousePress(QGraphicsSceneMouseEvent *pEvent) const58 bool UIChooserHandlerMouse::handleMousePress(QGraphicsSceneMouseEvent *pEvent) const 59 59 { 60 60 /* Get item under mouse cursor: */ … … 69 69 { 70 70 /* Which item we just clicked? */ 71 UI GChooserItem *pClickedItem = 0;71 UIChooserItem *pClickedItem = 0; 72 72 /* Was that a group item? */ 73 if (UI GChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIGChooserItemGroup*>(pItemUnderMouse))73 if (UIChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIChooserItemGroup*>(pItemUnderMouse)) 74 74 pClickedItem = pGroupItem; 75 75 /* Or a machine one? */ 76 else if (UI GChooserItemMachine *pMachineItem = qgraphicsitem_cast<UIGChooserItemMachine*>(pItemUnderMouse))76 else if (UIChooserItemMachine *pMachineItem = qgraphicsitem_cast<UIChooserItemMachine*>(pItemUnderMouse)) 77 77 pClickedItem = pMachineItem; 78 78 /* If we had clicked one of required item types: */ … … 83 83 { 84 84 /* Calculate positions: */ 85 UI GChooserItem *pFirstItem = model()->currentItem();85 UIChooserItem *pFirstItem = model()->currentItem(); 86 86 int iFirstPosition = model()->navigationList().indexOf(pFirstItem); 87 87 int iClickedPosition = model()->navigationList().indexOf(pClickedItem); 88 88 /* Populate list of items from 'first' to 'clicked': */ 89 QList<UI GChooserItem*> items;89 QList<UIChooserItem*> items; 90 90 if (iFirstPosition <= iClickedPosition) 91 91 for (int i = iFirstPosition; i <= iClickedPosition; ++i) … … 124 124 { 125 125 /* Which item we just clicked? */ 126 UI GChooserItem *pClickedItem = 0;126 UIChooserItem *pClickedItem = 0; 127 127 /* Was that a group item? */ 128 if (UI GChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIGChooserItemGroup*>(pItemUnderMouse))128 if (UIChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIChooserItemGroup*>(pItemUnderMouse)) 129 129 pClickedItem = pGroupItem; 130 130 /* Or a machine one? */ 131 else if (UI GChooserItemMachine *pMachineItem = qgraphicsitem_cast<UIGChooserItemMachine*>(pItemUnderMouse))131 else if (UIChooserItemMachine *pMachineItem = qgraphicsitem_cast<UIChooserItemMachine*>(pItemUnderMouse)) 132 132 pClickedItem = pMachineItem; 133 133 /* If we had clicked one of required item types: */ … … 148 148 } 149 149 150 bool UI GChooserHandlerMouse::handleMouseRelease(QGraphicsSceneMouseEvent*) const150 bool UIChooserHandlerMouse::handleMouseRelease(QGraphicsSceneMouseEvent*) const 151 151 { 152 152 /* Pass all events: */ … … 154 154 } 155 155 156 bool UI GChooserHandlerMouse::handleMouseDoubleClick(QGraphicsSceneMouseEvent *pEvent) const156 bool UIChooserHandlerMouse::handleMouseDoubleClick(QGraphicsSceneMouseEvent *pEvent) const 157 157 { 158 158 /* Get item under mouse cursor: */ … … 167 167 { 168 168 /* Was that a group item? */ 169 if (UI GChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIGChooserItemGroup*>(pItemUnderMouse))169 if (UIChooserItemGroup *pGroupItem = qgraphicsitem_cast<UIChooserItemGroup*>(pItemUnderMouse)) 170 170 { 171 171 /* Prepare variables: */ … … 209 209 } 210 210 /* Or a machine one? */ 211 else if (pItemUnderMouse->type() == UI GChooserItemType_Machine)211 else if (pItemUnderMouse->type() == UIChooserItemType_Machine) 212 212 { 213 213 /* Activate machine item: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerMouse.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserHandlerMouse class declaration.3 * VBox Qt GUI - UIChooserHandlerMouse class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GChooserHandlerMouse_h__19 #define __UI GChooserHandlerMouse_h__18 #ifndef __UIChooserHandlerMouse_h__ 19 #define __UIChooserHandlerMouse_h__ 20 20 21 21 /* Qt includes: */ … … 23 23 24 24 /* Forward declarations: */ 25 class UI GChooserModel;25 class UIChooserModel; 26 26 class QGraphicsSceneMouseEvent; 27 class UI GChooserItem;27 class UIChooserItem; 28 28 29 29 /* Mouse event type: */ … … 36 36 37 37 /* Mouse handler for graphics selector: */ 38 class UI GChooserHandlerMouse : public QObject38 class UIChooserHandlerMouse : public QObject 39 39 { 40 40 Q_OBJECT; … … 43 43 44 44 /* Constructor: */ 45 UI GChooserHandlerMouse(UIGChooserModel *pParent);45 UIChooserHandlerMouse(UIChooserModel *pParent); 46 46 47 47 /* API: Model mouse-event handler delegate: */ … … 51 51 52 52 /* API: Model wrapper: */ 53 UI GChooserModel* model() const;53 UIChooserModel* model() const; 54 54 55 55 /* Helpers: Model mouse-event handler delegates: */ … … 59 59 60 60 /* Variables: */ 61 UI GChooserModel *m_pModel;61 UIChooserModel *m_pModel; 62 62 }; 63 63 64 #endif /* __UI GChooserHandlerMouse_h__ */64 #endif /* __UIChooserHandlerMouse_h__ */ 65 65 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserItem class definition.3 * VBox Qt GUI - UIChooserItem class definition. 4 4 */ 5 5 … … 34 34 35 35 /* GUI includes: */ 36 # include "UI GChooser.h"37 # include "UI GChooserItem.h"38 # include "UI GChooserView.h"39 # include "UI GChooserModel.h"40 # include "UI GChooserItemGroup.h"41 # include "UI GChooserItemMachine.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" 42 42 43 43 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 45 45 46 46 /** QAccessibleObject extension used as an accessibility interface for Chooser-view items. */ 47 class UIAccessibilityInterfaceForUI GChooserItem : public QAccessibleObject47 class UIAccessibilityInterfaceForUIChooserItem : public QAccessibleObject 48 48 { 49 49 public: … … 53 53 { 54 54 /* Creating Chooser-view accessibility interface: */ 55 if (pObject && strClassname == QLatin1String("UI GChooserItem"))56 return new UIAccessibilityInterfaceForUI GChooserItem(pObject);55 if (pObject && strClassname == QLatin1String("UIChooserItem")) 56 return new UIAccessibilityInterfaceForUIChooserItem(pObject); 57 57 58 58 /* Null by default: */ … … 61 61 62 62 /** Constructs an accessibility interface passing @a pObject to the base-class. */ 63 UIAccessibilityInterfaceForUI GChooserItem(QObject *pObject)63 UIAccessibilityInterfaceForUIChooserItem(QObject *pObject) 64 64 : QAccessibleObject(pObject) 65 65 {} … … 82 82 83 83 /* Return the number of group children: */ 84 if (item()->type() == UI GChooserItemType_Group)84 if (item()->type() == UIChooserItemType_Group) 85 85 return item()->items().size(); 86 86 … … 149 149 150 150 /* Return the role of group: */ 151 if (item()->type() == UI GChooserItemType_Group)151 if (item()->type() == UIChooserItemType_Group) 152 152 return QAccessible::List; 153 153 … … 176 176 177 177 /* Compose the state of group: */ 178 if (item()->type() == UI GChooserItemType_Group)178 if (item()->type() == UIChooserItemType_Group) 179 179 { 180 180 state.expandable = true; … … 190 190 191 191 /** Returns corresponding Chooser-view item. */ 192 UI GChooserItem *item() const { return qobject_cast<UIGChooserItem*>(object()); }192 UIChooserItem *item() const { return qobject_cast<UIChooserItem*>(object()); } 193 193 }; 194 194 195 195 196 UI GChooserItem::UIGChooserItem(UIGChooserItem *pParent, bool fTemporary)196 UIChooserItem::UIChooserItem(UIChooserItem *pParent, bool fTemporary) 197 197 : m_fRoot(!pParent) 198 198 , m_fTemporary(fTemporary) … … 212 212 { 213 213 /* Install Chooser-view item accessibility interface factory: */ 214 QAccessible::installFactory(UIAccessibilityInterfaceForUI GChooserItem::pFactory);214 QAccessible::installFactory(UIAccessibilityInterfaceForUIChooserItem::pFactory); 215 215 216 216 /* Basic item setup: */ … … 258 258 } 259 259 260 UI GChooserItemGroup* UIGChooserItem::toGroupItem()261 { 262 UI GChooserItemGroup *pItem = qgraphicsitem_cast<UIGChooserItemGroup*>(this);263 AssertMsg(pItem, ("Trying to cast invalid item type to UI GChooserItemGroup!"));260 UIChooserItemGroup* UIChooserItem::toGroupItem() 261 { 262 UIChooserItemGroup *pItem = qgraphicsitem_cast<UIChooserItemGroup*>(this); 263 AssertMsg(pItem, ("Trying to cast invalid item type to UIChooserItemGroup!")); 264 264 return pItem; 265 265 } 266 266 267 UI GChooserItemMachine* UIGChooserItem::toMachineItem()268 { 269 UI GChooserItemMachine *pItem = qgraphicsitem_cast<UIGChooserItemMachine*>(this);270 AssertMsg(pItem, ("Trying to cast invalid item type to UI GChooserItemMachine!"));267 UIChooserItemMachine* UIChooserItem::toMachineItem() 268 { 269 UIChooserItemMachine *pItem = qgraphicsitem_cast<UIChooserItemMachine*>(this); 270 AssertMsg(pItem, ("Trying to cast invalid item type to UIChooserItemMachine!")); 271 271 return pItem; 272 272 } 273 273 274 UI GChooserModel* UIGChooserItem::model() const275 { 276 UI GChooserModel *pModel = qobject_cast<UIGChooserModel*>(QIGraphicsWidget::scene()->parent());274 UIChooserModel* UIChooserItem::model() const 275 { 276 UIChooserModel *pModel = qobject_cast<UIChooserModel*>(QIGraphicsWidget::scene()->parent()); 277 277 AssertMsg(pModel, ("Incorrect graphics scene parent set!")); 278 278 return pModel; 279 279 } 280 280 281 UIActionPool* UI GChooserItem::actionPool() const281 UIActionPool* UIChooserItem::actionPool() const 282 282 { 283 283 return model()->actionPool(); 284 284 } 285 285 286 UI GChooserItem* UIGChooserItem::parentItem() const286 UIChooserItem* UIChooserItem::parentItem() const 287 287 { 288 288 return m_pParent; 289 289 } 290 290 291 void UI GChooserItem::show()291 void UIChooserItem::show() 292 292 { 293 293 /* Call to base-class: */ … … 295 295 } 296 296 297 void UI GChooserItem::hide()297 void UIChooserItem::hide() 298 298 { 299 299 /* Call to base-class: */ … … 301 301 } 302 302 303 void UI GChooserItem::setRoot(bool fRoot)303 void UIChooserItem::setRoot(bool fRoot) 304 304 { 305 305 m_fRoot = fRoot; … … 307 307 } 308 308 309 bool UI GChooserItem::isRoot() const309 bool UIChooserItem::isRoot() const 310 310 { 311 311 return m_fRoot; 312 312 } 313 313 314 bool UI GChooserItem::isHovered() const314 bool UIChooserItem::isHovered() const 315 315 { 316 316 return m_fHovered; 317 317 } 318 318 319 void UI GChooserItem::setHovered(bool fHovered)319 void UIChooserItem::setHovered(bool fHovered) 320 320 { 321 321 m_fHovered = fHovered; … … 326 326 } 327 327 328 void UI GChooserItem::updateGeometry()328 void UIChooserItem::updateGeometry() 329 329 { 330 330 /* Call to base-class: */ … … 357 357 } 358 358 359 void UI GChooserItem::makeSureItsVisible()359 void UIChooserItem::makeSureItsVisible() 360 360 { 361 361 /* If item is not visible: */ … … 363 363 { 364 364 /* Get parrent item, assert if can't: */ 365 if (UI GChooserItemGroup *pParentItem = parentItem()->toGroupItem())365 if (UIChooserItemGroup *pParentItem = parentItem()->toGroupItem()) 366 366 { 367 367 /* We should make parent visible: */ … … 374 374 } 375 375 376 void UI GChooserItem::setDragTokenPlace(DragToken where)376 void UIChooserItem::setDragTokenPlace(DragToken where) 377 377 { 378 378 /* Something changed? */ … … 384 384 } 385 385 386 DragToken UI GChooserItem::dragTokenPlace() const386 DragToken UIChooserItem::dragTokenPlace() const 387 387 { 388 388 return m_dragTokenPlace; … … 390 390 391 391 392 bool UI GChooserItem::isTemporary() const392 bool UIChooserItem::isTemporary() const 393 393 { 394 394 return m_fTemporary; 395 395 } 396 396 397 void UI GChooserItem::hoverMoveEvent(QGraphicsSceneHoverEvent*)397 void UIChooserItem::hoverMoveEvent(QGraphicsSceneHoverEvent*) 398 398 { 399 399 if (!m_fHovered) … … 405 405 } 406 406 407 void UI GChooserItem::hoverLeaveEvent(QGraphicsSceneHoverEvent*)407 void UIChooserItem::hoverLeaveEvent(QGraphicsSceneHoverEvent*) 408 408 { 409 409 if (m_fHovered) … … 415 415 } 416 416 417 void UI GChooserItem::mousePressEvent(QGraphicsSceneMouseEvent *pEvent)417 void UIChooserItem::mousePressEvent(QGraphicsSceneMouseEvent *pEvent) 418 418 { 419 419 /* By default, non-moveable and non-selectable items … … 426 426 } 427 427 428 void UI GChooserItem::mouseMoveEvent(QGraphicsSceneMouseEvent *pEvent)428 void UIChooserItem::mouseMoveEvent(QGraphicsSceneMouseEvent *pEvent) 429 429 { 430 430 /* Make sure item is really dragged: */ … … 442 442 } 443 443 444 void UI GChooserItem::dragMoveEvent(QGraphicsSceneDragDropEvent *pEvent)444 void UIChooserItem::dragMoveEvent(QGraphicsSceneDragDropEvent *pEvent) 445 445 { 446 446 /* Make sure we are non-root: */ … … 449 449 /* Allow drag tokens only for the same item type as current: */ 450 450 bool fAllowDragToken = false; 451 if ((type() == UI GChooserItemType_Group &&452 pEvent->mimeData()->hasFormat(UI GChooserItemGroup::className())) ||453 (type() == UI GChooserItemType_Machine &&454 pEvent->mimeData()->hasFormat(UI GChooserItemMachine::className())))451 if ((type() == UIChooserItemType_Group && 452 pEvent->mimeData()->hasFormat(UIChooserItemGroup::className())) || 453 (type() == UIChooserItemType_Machine && 454 pEvent->mimeData()->hasFormat(UIChooserItemMachine::className()))) 455 455 fAllowDragToken = true; 456 456 /* Do we need a drag-token? */ … … 470 470 } 471 471 472 void UI GChooserItem::dragLeaveEvent(QGraphicsSceneDragDropEvent*)472 void UIChooserItem::dragLeaveEvent(QGraphicsSceneDragDropEvent*) 473 473 { 474 474 resetDragToken(); 475 475 } 476 476 477 void UI GChooserItem::dropEvent(QGraphicsSceneDragDropEvent *pEvent)477 void UIChooserItem::dropEvent(QGraphicsSceneDragDropEvent *pEvent) 478 478 { 479 479 /* Do we have token active? */ … … 495 495 } 496 496 497 void UI GChooserItem::handleRootStatusChange()497 void UIChooserItem::handleRootStatusChange() 498 498 { 499 499 /* Reset minimum size hints for non-root items: */ … … 506 506 507 507 /* static */ 508 void UI GChooserItem::configurePainterShape(QPainter *pPainter,508 void UIChooserItem::configurePainterShape(QPainter *pPainter, 509 509 const QStyleOptionGraphicsItem *pOption, 510 510 int iRadius) … … 521 521 522 522 /* static */ 523 void UI GChooserItem::paintFrameRect(QPainter *pPainter, const QRect &rect, bool fIsSelected, int iRadius)523 void UIChooserItem::paintFrameRect(QPainter *pPainter, const QRect &rect, bool fIsSelected, int iRadius) 524 524 { 525 525 pPainter->save(); … … 535 535 536 536 /* static */ 537 void UI GChooserItem::paintPixmap(QPainter *pPainter, const QPoint &point, const QPixmap &pixmap)537 void UIChooserItem::paintPixmap(QPainter *pPainter, const QPoint &point, const QPixmap &pixmap) 538 538 { 539 539 pPainter->drawPixmap(point, pixmap); … … 541 541 542 542 /* static */ 543 void UI GChooserItem::paintText(QPainter *pPainter, QPoint point,543 void UIChooserItem::paintText(QPainter *pPainter, QPoint point, 544 544 const QFont &font, QPaintDevice *pPaintDevice, 545 545 const QString &strText) … … 557 557 558 558 /* static */ 559 QSize UI GChooserItem::textSize(const QFont &font, QPaintDevice *pPaintDevice, const QString &strText)559 QSize UIChooserItem::textSize(const QFont &font, QPaintDevice *pPaintDevice, const QString &strText) 560 560 { 561 561 /* Make sure text is not empty: */ … … 569 569 570 570 /* static */ 571 int UI GChooserItem::textWidth(const QFont &font, QPaintDevice *pPaintDevice, int iCount)571 int UIChooserItem::textWidth(const QFont &font, QPaintDevice *pPaintDevice, int iCount) 572 572 { 573 573 /* Return text width: */ … … 579 579 580 580 /* static */ 581 QString UI GChooserItem::compressText(const QFont &font, QPaintDevice *pPaintDevice, QString strText, int iWidth)581 QString UIChooserItem::compressText(const QFont &font, QPaintDevice *pPaintDevice, QString strText, int iWidth) 582 582 { 583 583 /* Check if passed text is empty: */ … … 598 598 } 599 599 600 UI GChooserItemMimeData::UIGChooserItemMimeData(UIGChooserItem *pItem)600 UIChooserItemMimeData::UIChooserItemMimeData(UIChooserItem *pItem) 601 601 : m_pItem(pItem) 602 602 { 603 603 } 604 604 605 bool UI GChooserItemMimeData::hasFormat(const QString &strMimeType) const605 bool UIChooserItemMimeData::hasFormat(const QString &strMimeType) const 606 606 { 607 607 if (strMimeType == QString(m_pItem->metaObject()->className())) … … 610 610 } 611 611 612 UI GChooserItem* UIGChooserItemMimeData::item() const612 UIChooserItem* UIChooserItemMimeData::item() const 613 613 { 614 614 return m_pItem; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItem.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserItem class declaration.3 * VBox Qt GUI - UIChooserItem class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GChooserItem_h__19 #define __UI GChooserItem_h__18 #ifndef __UIChooserItem_h__ 19 #define __UIChooserItem_h__ 20 20 21 21 /* Qt includes: */ … … 31 31 /* Forward declaration: */ 32 32 class UIActionPool; 33 class UI GChooserModel;34 class UI GChooserItemGroup;35 class UI GChooserItemMachine;33 class UIChooserModel; 34 class UIChooserItemGroup; 35 class UIChooserItemMachine; 36 36 class QGraphicsSceneHoverEvent; 37 37 class QGraphicsSceneMouseEvent; … … 40 40 class QPropertyAnimation; 41 41 42 /* UI GChooserItem types: */43 enum UI GChooserItemType44 { 45 UI GChooserItemType_Any = QGraphicsItem::UserType,46 UI GChooserItemType_Group = QGraphicsItem::UserType + 1,47 UI GChooserItemType_Machine = QGraphicsItem::UserType + 242 /* UIChooserItem types: */ 43 enum UIChooserItemType 44 { 45 UIChooserItemType_Any = QGraphicsItem::UserType, 46 UIChooserItemType_Group = QGraphicsItem::UserType + 1, 47 UIChooserItemType_Machine = QGraphicsItem::UserType + 2 48 48 }; 49 49 50 50 /* Item search flags: */ 51 enum UI GChooserItemSearchFlag52 { 53 UI GChooserItemSearchFlag_Machine = RT_BIT(0),54 UI GChooserItemSearchFlag_Group = RT_BIT(1),55 UI GChooserItemSearchFlag_ExactName = RT_BIT(2)51 enum UIChooserItemSearchFlag 52 { 53 UIChooserItemSearchFlag_Machine = RT_BIT(0), 54 UIChooserItemSearchFlag_Group = RT_BIT(1), 55 UIChooserItemSearchFlag_ExactName = RT_BIT(2) 56 56 }; 57 57 … … 61 61 /* Graphics item interface 62 62 * for graphics selector model/view architecture: */ 63 class UI GChooserItem : public QIWithRetranslateUI4<QIGraphicsWidget>63 class UIChooserItem : public QIWithRetranslateUI4<QIGraphicsWidget> 64 64 { 65 65 Q_OBJECT; … … 79 79 80 80 /* Constructor: */ 81 UI GChooserItem(UIGChooserItem *pParent, bool fTemporary);81 UIChooserItem(UIChooserItem *pParent, bool fTemporary); 82 82 83 83 /* API: Cast stuff: */ 84 UI GChooserItemGroup* toGroupItem();85 UI GChooserItemMachine* toMachineItem();84 UIChooserItemGroup* toGroupItem(); 85 UIChooserItemMachine* toMachineItem(); 86 86 87 87 /* API: Model stuff: */ 88 UI GChooserModel* model() const;88 UIChooserModel* model() const; 89 89 90 90 /** Returns the action-pool reference. */ … … 92 92 93 93 /* API: Parent stuff: */ 94 UI GChooserItem* parentItem() const;94 UIChooserItem* parentItem() const; 95 95 96 96 /* API: Basic stuff: */ … … 109 109 110 110 /* API: Children stuff: */ 111 virtual void addItem(UI GChooserItem *pItem, int iPosition) = 0;112 virtual void removeItem(UI GChooserItem *pItem) = 0;113 virtual void setItems(const QList<UI GChooserItem*> &items, UIGChooserItemType type) = 0;114 virtual QList<UI GChooserItem*> items(UIGChooserItemType type = UIGChooserItemType_Any) const = 0;115 virtual bool hasItems(UI GChooserItemType type = UIGChooserItemType_Any) const = 0;116 virtual void clearItems(UI GChooserItemType 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; 117 117 virtual void updateAll(const QString &strId) = 0; 118 118 virtual void removeAll(const QString &strId) = 0; 119 virtual UI GChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags) = 0;120 virtual UI GChooserItemMachine* firstMachineItem() = 0;119 virtual UIChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags) = 0; 120 virtual UIChooserItemMachine* firstMachineItem() = 0; 121 121 virtual void sortItems() = 0; 122 122 … … 133 133 virtual QPixmap toPixmap() = 0; 134 134 virtual bool isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where = DragToken_Off) const = 0; 135 virtual void processDrop(QGraphicsSceneDragDropEvent *pEvent, UI GChooserItem *pFromWho = 0, DragToken where = DragToken_Off) = 0;135 virtual void processDrop(QGraphicsSceneDragDropEvent *pEvent, UIChooserItem *pFromWho = 0, DragToken where = DragToken_Off) = 0; 136 136 virtual void resetDragToken() = 0; 137 137 void setDragTokenPlace(DragToken where); … … 195 195 bool m_fRoot; 196 196 bool m_fTemporary; 197 UI GChooserItem *m_pParent;197 UIChooserItem *m_pParent; 198 198 QRectF m_previousGeometry; 199 199 int m_iPreviousMinimumWidthHint; … … 214 214 215 215 /* Mime-data for graphics item interface: */ 216 class UI GChooserItemMimeData : public QMimeData216 class UIChooserItemMimeData : public QMimeData 217 217 { 218 218 Q_OBJECT; … … 221 221 222 222 /* Constructor: */ 223 UI GChooserItemMimeData(UIGChooserItem *pItem);223 UIChooserItemMimeData(UIChooserItem *pItem); 224 224 225 225 /* API: Format checker: */ … … 227 227 228 228 /* API: Item getter: */ 229 UI GChooserItem* item() const;229 UIChooserItem* item() const; 230 230 231 231 private: 232 232 233 233 /* Variables: */ 234 UI GChooserItem *m_pItem;235 }; 236 237 #endif /* __UI GChooserItem_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 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserItemGroup class implementation.3 * VBox Qt GUI - UIChooserItemGroup class implementation. 4 4 */ 5 5 … … 30 30 31 31 /* GUI includes: */ 32 # include "UI GChooserItemGroup.h"33 # include "UI GChooserItemMachine.h"34 # include "UI GChooserModel.h"35 # include "UI GChooserView.h"32 # include "UIChooserItemGroup.h" 33 # include "UIChooserItemMachine.h" 34 # include "UIChooserModel.h" 35 # include "UIChooserView.h" 36 36 # include "UIGraphicsRotatorButton.h" 37 37 # include "UIIconPool.h" 38 # include "UI SelectorWindow.h"38 # include "UIVirtualBoxManager.h" 39 39 40 40 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 44 44 45 45 /* static */ 46 QString UI GChooserItemGroup::className() { return "UIGChooserItemGroup"; }47 48 UI GChooserItemGroup::UIGChooserItemGroup(QGraphicsScene *pScene)49 : UI GChooserItem(0, false /* temporary? */)46 QString UIChooserItemGroup::className() { return "UIChooserItemGroup"; } 47 48 UIChooserItemGroup::UIChooserItemGroup(QGraphicsScene *pScene) 49 : UIChooserItem(0, false /* temporary? */) 50 50 , m_fClosed(false) 51 51 , m_fMainRoot(true) … … 68 68 } 69 69 70 UI GChooserItemGroup::UIGChooserItemGroup(QGraphicsScene *pScene,71 UI GChooserItemGroup *pCopyFrom,70 UIChooserItemGroup::UIChooserItemGroup(QGraphicsScene *pScene, 71 UIChooserItemGroup *pCopyFrom, 72 72 bool fMainRoot) 73 : UI GChooserItem(0, true /* temporary? */)73 : UIChooserItem(0, true /* temporary? */) 74 74 , m_fClosed(pCopyFrom->isClosed()) 75 75 , m_fMainRoot(fMainRoot) … … 95 95 } 96 96 97 UI GChooserItemGroup::UIGChooserItemGroup(UIGChooserItem *pParent,97 UIChooserItemGroup::UIChooserItemGroup(UIChooserItem *pParent, 98 98 const QString &strName, 99 99 bool fOpened /* = false */, 100 100 int iPosition /* = -1 */) 101 : UI GChooserItem(pParent, pParent->isTemporary())101 : UIChooserItem(pParent, pParent->isTemporary()) 102 102 , m_fClosed(!fOpened) 103 103 , m_fMainRoot(false) … … 113 113 connect(this, SIGNAL(sigToggleStarted()), model(), SIGNAL(sigToggleStarted())); 114 114 connect(this, SIGNAL(sigToggleFinished()), model(), SIGNAL(sigToggleFinished()), Qt::QueuedConnection); 115 connect(gp SelectorWindow, &UISelectorWindow::sigWindowRemapped,116 this, &UI GChooserItemGroup::sltHandleWindowRemapped);115 connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped, 116 this, &UIChooserItemGroup::sltHandleWindowRemapped); 117 117 118 118 /* Translate finally: */ … … 132 132 } 133 133 134 UI GChooserItemGroup::UIGChooserItemGroup(UIGChooserItem *pParent,135 UI GChooserItemGroup *pCopyFrom,134 UIChooserItemGroup::UIChooserItemGroup(UIChooserItem *pParent, 135 UIChooserItemGroup *pCopyFrom, 136 136 int iPosition /* = -1 */) 137 : UI GChooserItem(pParent, pParent->isTemporary())137 : UIChooserItem(pParent, pParent->isTemporary()) 138 138 , m_fClosed(pCopyFrom->isClosed()) 139 139 , m_fMainRoot(false) … … 149 149 connect(this, SIGNAL(sigToggleStarted()), model(), SIGNAL(sigToggleStarted())); 150 150 connect(this, SIGNAL(sigToggleFinished()), model(), SIGNAL(sigToggleFinished())); 151 connect(gp SelectorWindow, &UISelectorWindow::sigWindowRemapped,152 this, &UI GChooserItemGroup::sltHandleWindowRemapped);151 connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped, 152 this, &UIChooserItemGroup::sltHandleWindowRemapped); 153 153 154 154 /* Copy content to 'this': */ … … 165 165 } 166 166 167 UI GChooserItemGroup::~UIGChooserItemGroup()167 UIChooserItemGroup::~UIChooserItemGroup() 168 168 { 169 169 /* Delete all the items: */ … … 194 194 } 195 195 196 QString UI GChooserItemGroup::name() const196 QString UIChooserItemGroup::name() const 197 197 { 198 198 return m_strName; 199 199 } 200 200 201 QString UI GChooserItemGroup::description() const201 QString UIChooserItemGroup::description() const 202 202 { 203 203 return m_strDescription; 204 204 } 205 205 206 QString UI GChooserItemGroup::fullName() const206 QString UIChooserItemGroup::fullName() const 207 207 { 208 208 /* Return "/" for main root-item: */ … … 218 218 } 219 219 220 QString UI GChooserItemGroup::definition() const220 QString UIChooserItemGroup::definition() const 221 221 { 222 222 return QString("g=%1").arg(name()); 223 223 } 224 224 225 void UI GChooserItemGroup::setName(const QString &strName)225 void UIChooserItemGroup::setName(const QString &strName) 226 226 { 227 227 /* Something changed? */ … … 237 237 } 238 238 239 bool UI GChooserItemGroup::isClosed() const239 bool UIChooserItemGroup::isClosed() const 240 240 { 241 241 return m_fClosed && !isRoot(); 242 242 } 243 243 244 bool UI GChooserItemGroup::isOpened() const244 bool UIChooserItemGroup::isOpened() const 245 245 { 246 246 return !m_fClosed || isRoot(); 247 247 } 248 248 249 void UI GChooserItemGroup::close(bool fAnimated /* = true */)249 void UIChooserItemGroup::close(bool fAnimated /* = true */) 250 250 { 251 251 AssertMsg(!isRoot(), ("Can't close root-item!")); … … 253 253 } 254 254 255 void UI GChooserItemGroup::open(bool fAnimated /* = true */)255 void UIChooserItemGroup::open(bool fAnimated /* = true */) 256 256 { 257 257 AssertMsg(!isRoot(), ("Can't open root-item!")); … … 259 259 } 260 260 261 bool UI GChooserItemGroup::isContainsMachine(const QString &strId) const261 bool UIChooserItemGroup::isContainsMachine(const QString &strId) const 262 262 { 263 263 /* Check each machine-item: */ 264 foreach (UI GChooserItem *pItem, m_machineItems)264 foreach (UIChooserItem *pItem, m_machineItems) 265 265 if (pItem->toMachineItem()->id() == strId) 266 266 return true; … … 269 269 } 270 270 271 bool UI GChooserItemGroup::isContainsLockedMachine()271 bool UIChooserItemGroup::isContainsLockedMachine() 272 272 { 273 273 /* Check each machine-item: */ 274 foreach (UI GChooserItem *pItem, items(UIGChooserItemType_Machine))274 foreach (UIChooserItem *pItem, items(UIChooserItemType_Machine)) 275 275 if (pItem->toMachineItem()->isLockedMachine()) 276 276 return true; 277 277 /* Check each group-item: */ 278 foreach (UI GChooserItem *pItem, items(UIGChooserItemType_Group))278 foreach (UIChooserItem *pItem, items(UIChooserItemType_Group)) 279 279 if (pItem->toGroupItem()->isContainsLockedMachine()) 280 280 return true; … … 283 283 } 284 284 285 void UI GChooserItemGroup::sltHandleWindowRemapped()285 void UIChooserItemGroup::sltHandleWindowRemapped() 286 286 { 287 287 /* Update pixmaps: */ … … 289 289 } 290 290 291 void UI GChooserItemGroup::sltNameEditingFinished()291 void UIChooserItemGroup::sltNameEditingFinished() 292 292 { 293 293 /* Not for root: */ … … 300 300 /* Enumerate all the group names: */ 301 301 QStringList groupNames; 302 foreach (UI GChooserItem *pItem, parentItem()->items(UIGChooserItemType_Group))302 foreach (UIChooserItem *pItem, parentItem()->items(UIChooserItemType_Group)) 303 303 groupNames << pItem->name(); 304 304 /* If proposed name is empty or not unique, reject it: */ … … 316 316 } 317 317 318 void UI GChooserItemGroup::sltGroupToggleStart()318 void UIChooserItemGroup::sltGroupToggleStart() 319 319 { 320 320 /* Not for root: */ … … 349 349 } 350 350 351 void UI GChooserItemGroup::sltGroupToggleFinish(bool fToggled)351 void UIChooserItemGroup::sltGroupToggleFinish(bool fToggled) 352 352 { 353 353 /* Not for root: */ … … 371 371 } 372 372 373 void UI GChooserItemGroup::sltIndentRoot()373 void UIChooserItemGroup::sltIndentRoot() 374 374 { 375 375 /* Unhover before indenting: */ … … 380 380 } 381 381 382 void UI GChooserItemGroup::sltUnindentRoot()382 void UIChooserItemGroup::sltUnindentRoot() 383 383 { 384 384 /* Unhover before unindenting: */ … … 389 389 } 390 390 391 QVariant UI GChooserItemGroup::data(int iKey) const391 QVariant UIChooserItemGroup::data(int iKey) const 392 392 { 393 393 /* Provide other members with required data: */ … … 407 407 } 408 408 409 void UI GChooserItemGroup::prepare()409 void UIChooserItemGroup::prepare() 410 410 { 411 411 /* Buttons: */ … … 440 440 441 441 /* Setup name-editor: */ 442 m_pNameEditorWidget = new UI GroupRenameEditor(name(), this);442 m_pNameEditorWidget = new UIEditorGroupRename(name(), this); 443 443 m_pNameEditorWidget->setFont(m_nameFont); 444 444 connect(m_pNameEditorWidget, SIGNAL(sigEditingFinished()), this, SLOT(sltNameEditingFinished())); … … 465 465 466 466 /* static */ 467 void UI GChooserItemGroup::copyContent(UIGChooserItemGroup *pFrom, UIGChooserItemGroup *pTo)467 void UIChooserItemGroup::copyContent(UIChooserItemGroup *pFrom, UIChooserItemGroup *pTo) 468 468 { 469 469 /* Copy group-items: */ 470 foreach (UI GChooserItem *pGroupItem, pFrom->items(UIGChooserItemType_Group))471 new UI GChooserItemGroup(pTo, pGroupItem->toGroupItem());470 foreach (UIChooserItem *pGroupItem, pFrom->items(UIChooserItemType_Group)) 471 new UIChooserItemGroup(pTo, pGroupItem->toGroupItem()); 472 472 /* Copy machine-items: */ 473 foreach (UI GChooserItem *pMachineItem, pFrom->items(UIGChooserItemType_Machine))474 new UI GChooserItemMachine(pTo, pMachineItem->toMachineItem());475 } 476 477 void UI GChooserItemGroup::handleRootStatusChange()473 foreach (UIChooserItem *pMachineItem, pFrom->items(UIChooserItemType_Machine)) 474 new UIChooserItemMachine(pTo, pMachineItem->toMachineItem()); 475 } 476 477 void UIChooserItemGroup::handleRootStatusChange() 478 478 { 479 479 /* Call to base-class: */ 480 UI GChooserItem::handleRootStatusChange();480 UIChooserItem::handleRootStatusChange(); 481 481 482 482 /* Update linked values: */ … … 485 485 } 486 486 487 void UI GChooserItemGroup::updateVisibleName()487 void UIChooserItemGroup::updateVisibleName() 488 488 { 489 489 /* Not for main root: */ … … 552 552 } 553 553 554 void UI GChooserItemGroup::updatePixmaps()554 void UIChooserItemGroup::updatePixmaps() 555 555 { 556 556 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize); 557 m_groupsPixmap = UIIconPool::iconSet(":/group_abstract_16px.png").pixmap(gp SelectorWindow->windowHandle(),557 m_groupsPixmap = UIIconPool::iconSet(":/group_abstract_16px.png").pixmap(gpManager->windowHandle(), 558 558 QSize(iIconMetric, iIconMetric)); 559 m_machinesPixmap = UIIconPool::iconSet(":/machine_abstract_16px.png").pixmap(gp SelectorWindow->windowHandle(),559 m_machinesPixmap = UIIconPool::iconSet(":/machine_abstract_16px.png").pixmap(gpManager->windowHandle(), 560 560 QSize(iIconMetric, iIconMetric)); 561 561 m_pixmapSizeGroups = m_groupsPixmap.size() / m_groupsPixmap.devicePixelRatio(); … … 563 563 } 564 564 565 void UI GChooserItemGroup::updateItemCountInfo()565 void UIChooserItemGroup::updateItemCountInfo() 566 566 { 567 567 /* Not for main root: */ … … 605 605 } 606 606 607 void UI GChooserItemGroup::updateMinimumHeaderSize()607 void UIChooserItemGroup::updateMinimumHeaderSize() 608 608 { 609 609 /* Not for main root: */ … … 678 678 } 679 679 680 void UI GChooserItemGroup::updateToolTip()680 void UIChooserItemGroup::updateToolTip() 681 681 { 682 682 /* Not for main root: */ … … 698 698 699 699 /* Should we add group info? */ 700 if (!items(UI GChooserItemType_Group).isEmpty())700 if (!items(UIChooserItemType_Group).isEmpty()) 701 701 { 702 702 /* Template: */ 703 QString strGroupCount = tr("%n group(s)", "Group item tool-tip / Group info", items(UI GChooserItemType_Group).size());703 QString strGroupCount = tr("%n group(s)", "Group item tool-tip / Group info", items(UIChooserItemType_Group).size()); 704 704 705 705 /* Append value: */ … … 709 709 710 710 /* Should we add machine info? */ 711 if (!items(UI GChooserItemType_Machine).isEmpty())711 if (!items(UIChooserItemType_Machine).isEmpty()) 712 712 { 713 713 /* Check if 'this' group contains started VMs: */ 714 714 int iCountOfStartedMachineItems = 0; 715 foreach (UI GChooserItem *pItem, items(UIGChooserItemType_Machine))716 if (UIV MItem::isItemStarted(pItem->toMachineItem()))715 foreach (UIChooserItem *pItem, items(UIChooserItemType_Machine)) 716 if (UIVirtualMachineItem::isItemStarted(pItem->toMachineItem())) 717 717 ++iCountOfStartedMachineItems; 718 718 /* Template: */ 719 QString strMachineCount = tr("%n machine(s)", "Group item tool-tip / Machine info", items(UI GChooserItemType_Machine).size());719 QString strMachineCount = tr("%n machine(s)", "Group item tool-tip / Machine info", items(UIChooserItemType_Machine).size()); 720 720 QString strStartedMachineCount = tr("(%n running)", "Group item tool-tip / Running machine info", iCountOfStartedMachineItems); 721 721 … … 731 731 } 732 732 733 void UI GChooserItemGroup::updateToggleButtonToolTip()733 void UIChooserItemGroup::updateToggleButtonToolTip() 734 734 { 735 735 /* Is toggle-button created? */ … … 741 741 } 742 742 743 void UI GChooserItemGroup::retranslateUi()743 void UIChooserItemGroup::retranslateUi() 744 744 { 745 745 /* Update description: */ … … 757 757 } 758 758 759 void UI GChooserItemGroup::show()759 void UIChooserItemGroup::show() 760 760 { 761 761 /* Call to base-class: */ 762 UI GChooserItem::show();762 UIChooserItem::show(); 763 763 /* Show children: */ 764 764 if (!isClosed()) 765 foreach (UI GChooserItem *pItem, items())765 foreach (UIChooserItem *pItem, items()) 766 766 pItem->show(); 767 767 } 768 768 769 void UI GChooserItemGroup::hide()769 void UIChooserItemGroup::hide() 770 770 { 771 771 /* Call to base-class: */ 772 UI GChooserItem::hide();772 UIChooserItem::hide(); 773 773 /* Hide children: */ 774 foreach (UI GChooserItem *pItem, items())774 foreach (UIChooserItem *pItem, items()) 775 775 pItem->hide(); 776 776 } 777 777 778 void UI GChooserItemGroup::startEditing()778 void UIChooserItemGroup::startEditing() 779 779 { 780 780 /* Not for root: */ … … 792 792 } 793 793 794 void UI GChooserItemGroup::addItem(UIGChooserItem *pItem, int iPosition)794 void UIChooserItemGroup::addItem(UIChooserItem *pItem, int iPosition) 795 795 { 796 796 /* Check item type: */ 797 797 switch (pItem->type()) 798 798 { 799 case UI GChooserItemType_Group:799 case UIChooserItemType_Group: 800 800 { 801 801 AssertMsg(!m_groupItems.contains(pItem), ("Group-item already added!")); … … 807 807 break; 808 808 } 809 case UI GChooserItemType_Machine:809 case UIChooserItemType_Machine: 810 810 { 811 811 AssertMsg(!m_machineItems.contains(pItem), ("Machine-item already added!")); … … 830 830 } 831 831 832 void UI GChooserItemGroup::removeItem(UIGChooserItem *pItem)832 void UIChooserItemGroup::removeItem(UIChooserItem *pItem) 833 833 { 834 834 /* Check item type: */ 835 835 switch (pItem->type()) 836 836 { 837 case UI GChooserItemType_Group:837 case UIChooserItemType_Group: 838 838 { 839 839 AssertMsg(m_groupItems.contains(pItem), ("Group-item was not found!")); … … 842 842 break; 843 843 } 844 case UI GChooserItemType_Machine:844 case UIChooserItemType_Machine: 845 845 { 846 846 AssertMsg(m_machineItems.contains(pItem), ("Machine-item was not found!")); … … 862 862 } 863 863 864 void UI GChooserItemGroup::setItems(const QList<UIGChooserItem*> &items, UIGChooserItemType type)864 void UIChooserItemGroup::setItems(const QList<UIChooserItem*> &items, UIChooserItemType type) 865 865 { 866 866 /* Check item type: */ 867 867 switch (type) 868 868 { 869 case UI GChooserItemType_Group: m_groupItems = items; break;870 case UI GChooserItemType_Machine: m_machineItems = items; break;869 case UIChooserItemType_Group: m_groupItems = items; break; 870 case UIChooserItemType_Machine: m_machineItems = items; break; 871 871 default: AssertMsgFailed(("Invalid item type!")); break; 872 872 } … … 878 878 } 879 879 880 QList<UI GChooserItem*> UIGChooserItemGroup::items(UIGChooserItemType type /* = UIGChooserItemType_Any */) const880 QList<UIChooserItem*> UIChooserItemGroup::items(UIChooserItemType type /* = UIChooserItemType_Any */) const 881 881 { 882 882 switch (type) 883 883 { 884 case UI GChooserItemType_Any: return items(UIGChooserItemType_Group) + items(UIGChooserItemType_Machine);885 case UI GChooserItemType_Group: return m_groupItems;886 case UI GChooserItemType_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; 887 887 default: break; 888 888 } 889 return QList<UI GChooserItem*>();890 } 891 892 bool UI GChooserItemGroup::hasItems(UIGChooserItemType type /* = UIGChooserItemType_Any */) const889 return QList<UIChooserItem*>(); 890 } 891 892 bool UIChooserItemGroup::hasItems(UIChooserItemType type /* = UIChooserItemType_Any */) const 893 893 { 894 894 switch (type) 895 895 { 896 case UI GChooserItemType_Any:897 return hasItems(UI GChooserItemType_Group) || hasItems(UIGChooserItemType_Machine);898 case UI GChooserItemType_Group:896 case UIChooserItemType_Any: 897 return hasItems(UIChooserItemType_Group) || hasItems(UIChooserItemType_Machine); 898 case UIChooserItemType_Group: 899 899 return !m_groupItems.isEmpty(); 900 case UI GChooserItemType_Machine:900 case UIChooserItemType_Machine: 901 901 return !m_machineItems.isEmpty(); 902 902 } … … 904 904 } 905 905 906 void UI GChooserItemGroup::clearItems(UIGChooserItemType type /* = UIGChooserItemType_Any */)906 void UIChooserItemGroup::clearItems(UIChooserItemType type /* = UIChooserItemType_Any */) 907 907 { 908 908 switch (type) 909 909 { 910 case UI GChooserItemType_Any:911 { 912 clearItems(UI GChooserItemType_Group);913 clearItems(UI GChooserItemType_Machine);910 case UIChooserItemType_Any: 911 { 912 clearItems(UIChooserItemType_Group); 913 clearItems(UIChooserItemType_Machine); 914 914 break; 915 915 } 916 case UI GChooserItemType_Group:916 case UIChooserItemType_Group: 917 917 { 918 918 while (!m_groupItems.isEmpty()) { delete m_groupItems.last(); } … … 920 920 break; 921 921 } 922 case UI GChooserItemType_Machine:922 case UIChooserItemType_Machine: 923 923 { 924 924 while (!m_machineItems.isEmpty()) { delete m_machineItems.last(); } … … 934 934 } 935 935 936 void UI GChooserItemGroup::updateAll(const QString &strId)936 void UIChooserItemGroup::updateAll(const QString &strId) 937 937 { 938 938 /* Update all the required items recursively: */ 939 foreach (UI GChooserItem *pItem, items())939 foreach (UIChooserItem *pItem, items()) 940 940 pItem->updateAll(strId); 941 941 } 942 942 943 void UI GChooserItemGroup::removeAll(const QString &strId)943 void UIChooserItemGroup::removeAll(const QString &strId) 944 944 { 945 945 /* Remove all the required items recursively: */ 946 foreach (UI GChooserItem *pItem, items())946 foreach (UIChooserItem *pItem, items()) 947 947 pItem->removeAll(strId); 948 948 } 949 949 950 UI GChooserItem* UIGChooserItemGroup::searchForItem(const QString &strSearchTag, int iItemSearchFlags)950 UIChooserItem* UIChooserItemGroup::searchForItem(const QString &strSearchTag, int iItemSearchFlags) 951 951 { 952 952 /* Are we searching among group-items? */ 953 if (iItemSearchFlags & UI GChooserItemSearchFlag_Group)953 if (iItemSearchFlags & UIChooserItemSearchFlag_Group) 954 954 { 955 955 /* Are we searching by the exact name? */ 956 if (iItemSearchFlags & UI GChooserItemSearchFlag_ExactName)956 if (iItemSearchFlags & UIChooserItemSearchFlag_ExactName) 957 957 { 958 958 /* Exact name matches? */ … … 970 970 971 971 /* Search among all the children, but machines first: */ 972 foreach (UI GChooserItem *pItem, items(UIGChooserItemType_Machine))973 if (UI GChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iItemSearchFlags))972 foreach (UIChooserItem *pItem, items(UIChooserItemType_Machine)) 973 if (UIChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iItemSearchFlags)) 974 974 return pFoundItem; 975 foreach (UI GChooserItem *pItem, items(UIGChooserItemType_Group))976 if (UI GChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iItemSearchFlags))975 foreach (UIChooserItem *pItem, items(UIChooserItemType_Group)) 976 if (UIChooserItem *pFoundItem = pItem->searchForItem(strSearchTag, iItemSearchFlags)) 977 977 return pFoundItem; 978 978 … … 981 981 } 982 982 983 UI GChooserItemMachine* UIGChooserItemGroup::firstMachineItem()983 UIChooserItemMachine* UIChooserItemGroup::firstMachineItem() 984 984 { 985 985 /* If this group-item have at least one machine-item: */ 986 if (hasItems(UI GChooserItemType_Machine))986 if (hasItems(UIChooserItemType_Machine)) 987 987 /* Return the first machine-item: */ 988 return items(UI GChooserItemType_Machine).first()->firstMachineItem();988 return items(UIChooserItemType_Machine).first()->firstMachineItem(); 989 989 /* If this group-item have at least one group-item: */ 990 else if (hasItems(UI GChooserItemType_Group))990 else if (hasItems(UIChooserItemType_Group)) 991 991 /* Return the first machine-item of the first group-item: */ 992 return items(UI GChooserItemType_Group).first()->firstMachineItem();992 return items(UIChooserItemType_Group).first()->firstMachineItem(); 993 993 /* Found nothing? */ 994 994 return 0; 995 995 } 996 996 997 void UI GChooserItemGroup::sortItems()997 void UIChooserItemGroup::sortItems() 998 998 { 999 999 /* Sort group-items: */ 1000 QMap<QString, UI GChooserItem*> sorter;1001 foreach (UI GChooserItem *pItem, items(UIGChooserItemType_Group))1000 QMap<QString, UIChooserItem*> sorter; 1001 foreach (UIChooserItem *pItem, items(UIChooserItemType_Group)) 1002 1002 sorter.insert(pItem->name().toLower(), pItem); 1003 setItems(sorter.values(), UI GChooserItemType_Group);1003 setItems(sorter.values(), UIChooserItemType_Group); 1004 1004 1005 1005 /* Sort machine-items: */ 1006 1006 sorter.clear(); 1007 foreach (UI GChooserItem *pItem, items(UIGChooserItemType_Machine))1007 foreach (UIChooserItem *pItem, items(UIChooserItemType_Machine)) 1008 1008 sorter.insert(pItem->name().toLower(), pItem); 1009 setItems(sorter.values(), UI GChooserItemType_Machine);1009 setItems(sorter.values(), UIChooserItemType_Machine); 1010 1010 1011 1011 /* Update model: */ … … 1014 1014 } 1015 1015 1016 void UI GChooserItemGroup::updateLayout()1016 void UIChooserItemGroup::updateLayout() 1017 1017 { 1018 1018 /* Prepare variables: */ … … 1116 1116 { 1117 1117 /* Hide all the items: */ 1118 foreach (UI GChooserItem *pItem, items())1118 foreach (UIChooserItem *pItem, items()) 1119 1119 pItem->hide(); 1120 1120 } … … 1130 1130 1131 1131 /* Layout all the items: */ 1132 foreach (UI GChooserItem *pItem, items())1132 foreach (UIChooserItem *pItem, items()) 1133 1133 { 1134 1134 /* Show if hidden: */ … … 1148 1148 } 1149 1149 1150 int UI GChooserItemGroup::minimumWidthHint(bool fOpenedGroup) const1150 int UIChooserItemGroup::minimumWidthHint(bool fOpenedGroup) const 1151 1151 { 1152 1152 /* Calculating proposed width: */ … … 1164 1164 /* We have to take every child width into account: */ 1165 1165 int iMaximumChildWidth = 0; 1166 foreach (UI GChooserItem *pItem, items())1166 foreach (UIChooserItem *pItem, items()) 1167 1167 iMaximumChildWidth = qMax(iMaximumChildWidth, pItem->minimumWidthHint()); 1168 1168 iProposedWidth += iMaximumChildWidth; … … 1186 1186 /* We have to take every child width into account: */ 1187 1187 int iMaximumChildWidth = 0; 1188 foreach (UI GChooserItem *pItem, items())1188 foreach (UIChooserItem *pItem, items()) 1189 1189 iMaximumChildWidth = qMax(iMaximumChildWidth, pItem->minimumWidthHint()); 1190 1190 iProposedWidth = qMax(iProposedWidth, iMaximumChildWidth); … … 1199 1199 } 1200 1200 1201 int UI GChooserItemGroup::minimumHeightHint(bool fOpenedGroup) const1201 int UIChooserItemGroup::minimumHeightHint(bool fOpenedGroup) const 1202 1202 { 1203 1203 /* Prepare variables: */ … … 1219 1219 iProposedHeight += 2 * iRootIndent; 1220 1220 /* And every existing: */ 1221 foreach (UI GChooserItem *pItem, items())1221 foreach (UIChooserItem *pItem, items()) 1222 1222 { 1223 1223 /* Child height: */ … … 1250 1250 iProposedHeight += iVerticalMargin; 1251 1251 /* Every existing: */ 1252 foreach (UI GChooserItem *pItem, items())1252 foreach (UIChooserItem *pItem, items()) 1253 1253 { 1254 1254 /* Child height: */ … … 1272 1272 } 1273 1273 1274 int UI GChooserItemGroup::minimumWidthHint() const1274 int UIChooserItemGroup::minimumWidthHint() const 1275 1275 { 1276 1276 return minimumWidthHint(isOpened()); 1277 1277 } 1278 1278 1279 int UI GChooserItemGroup::minimumHeightHint() const1279 int UIChooserItemGroup::minimumHeightHint() const 1280 1280 { 1281 1281 return minimumHeightHint(isOpened()); 1282 1282 } 1283 1283 1284 QSizeF UI GChooserItemGroup::minimumSizeHint(bool fOpenedGroup) const1284 QSizeF UIChooserItemGroup::minimumSizeHint(bool fOpenedGroup) const 1285 1285 { 1286 1286 return QSizeF(minimumWidthHint(fOpenedGroup), minimumHeightHint(fOpenedGroup)); 1287 1287 } 1288 1288 1289 QSizeF UI GChooserItemGroup::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const1289 QSizeF UIChooserItemGroup::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const 1290 1290 { 1291 1291 /* If Qt::MinimumSize requested: */ … … 1293 1293 return minimumSizeHint(isOpened()); 1294 1294 /* Else call to base-class: */ 1295 return UI GChooserItem::sizeHint(which, constraint);1296 } 1297 1298 QPixmap UI GChooserItemGroup::toPixmap()1295 return UIChooserItem::sizeHint(which, constraint); 1296 } 1297 1298 QPixmap UIChooserItemGroup::toPixmap() 1299 1299 { 1300 1300 /* Ask item to paint itself into pixmap: */ … … 1310 1310 } 1311 1311 1312 bool UI GChooserItemGroup::isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const1312 bool UIChooserItemGroup::isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const 1313 1313 { 1314 1314 /* No drops while saving groups: */ … … 1321 1321 return parentItem()->isDropAllowed(pEvent); 1322 1322 /* Else we should check mime format: */ 1323 if (pMimeData->hasFormat(UI GChooserItemGroup::className()))1323 if (pMimeData->hasFormat(UIChooserItemGroup::className())) 1324 1324 { 1325 1325 /* Get passed group-item: */ 1326 const UI GChooserItemMimeData *pCastedMimeData = qobject_cast<const UIGChooserItemMimeData*>(pMimeData);1327 AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UI GChooserItemMimeData!"));1328 UI GChooserItem *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(); 1329 1329 /* Make sure passed group is mutable within this group: */ 1330 1330 if (pItem->toGroupItem()->isContainsLockedMachine() && 1331 !items(UI GChooserItemType_Group).contains(pItem))1331 !items(UIChooserItemType_Group).contains(pItem)) 1332 1332 return false; 1333 1333 /* Make sure passed group is not 'this': */ … … 1335 1335 return false; 1336 1336 /* Make sure passed group is not among our parents: */ 1337 const UI GChooserItem *pTestedWidget = this;1338 while (UI GChooserItem *pParentOfTestedWidget = pTestedWidget->parentItem())1337 const UIChooserItem *pTestedWidget = this; 1338 while (UIChooserItem *pParentOfTestedWidget = pTestedWidget->parentItem()) 1339 1339 { 1340 1340 if (pItem == pParentOfTestedWidget) … … 1344 1344 return true; 1345 1345 } 1346 else if (pMimeData->hasFormat(UI GChooserItemMachine::className()))1346 else if (pMimeData->hasFormat(UIChooserItemMachine::className())) 1347 1347 { 1348 1348 /* Get passed machine-item: */ 1349 const UI GChooserItemMimeData *pCastedMimeData = qobject_cast<const UIGChooserItemMimeData*>(pMimeData);1350 AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UI GChooserItemMimeData!"));1351 UI GChooserItem *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(); 1352 1352 /* Make sure passed machine is mutable within this group: */ 1353 1353 if (pItem->toMachineItem()->isLockedMachine() && 1354 !items(UI GChooserItemType_Machine).contains(pItem))1354 !items(UIChooserItemType_Machine).contains(pItem)) 1355 1355 return false; 1356 1356 switch (pEvent->proposedAction()) … … 1373 1373 } 1374 1374 1375 void UI GChooserItemGroup::processDrop(QGraphicsSceneDragDropEvent *pEvent, UIGChooserItem *pFromWho, DragToken where)1375 void UIChooserItemGroup::processDrop(QGraphicsSceneDragDropEvent *pEvent, UIChooserItem *pFromWho, DragToken where) 1376 1376 { 1377 1377 /* Get mime: */ 1378 1378 const QMimeData *pMime = pEvent->mimeData(); 1379 1379 /* Check mime format: */ 1380 if (pMime->hasFormat(UI GChooserItemGroup::className()))1380 if (pMime->hasFormat(UIChooserItemGroup::className())) 1381 1381 { 1382 1382 switch (pEvent->proposedAction()) … … 1386 1386 { 1387 1387 /* Remember scene: */ 1388 UI GChooserModel *pModel = model();1388 UIChooserModel *pModel = model(); 1389 1389 1390 1390 /* Get passed group-item: */ 1391 const UI GChooserItemMimeData *pCastedMime = qobject_cast<const UIGChooserItemMimeData*>(pMime);1392 AssertMsg(pCastedMime, ("Can't cast passed mime-data to UI GChooserItemMimeData!"));1393 UI GChooserItem *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(); 1394 1394 1395 1395 /* Check if we have position information: */ … … 1408 1408 1409 1409 /* Copy passed item into this group: */ 1410 UI GChooserItem *pNewGroupItem = new UIGChooserItemGroup(this, pItem->toGroupItem(), iPosition);1410 UIChooserItem *pNewGroupItem = new UIChooserItemGroup(this, pItem->toGroupItem(), iPosition); 1411 1411 if (isClosed()) 1412 1412 open(false); … … 1431 1431 } 1432 1432 } 1433 else if (pMime->hasFormat(UI GChooserItemMachine::className()))1433 else if (pMime->hasFormat(UIChooserItemMachine::className())) 1434 1434 { 1435 1435 switch (pEvent->proposedAction()) … … 1439 1439 { 1440 1440 /* Remember scene: */ 1441 UI GChooserModel *pModel = model();1441 UIChooserModel *pModel = model(); 1442 1442 1443 1443 /* Get passed item: */ 1444 const UI GChooserItemMimeData *pCastedMime = qobject_cast<const UIGChooserItemMimeData*>(pMime);1445 AssertMsg(pCastedMime, ("Can't cast passed mime-data to UI GChooserItemMimeData!"));1446 UI GChooserItem *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(); 1447 1447 1448 1448 /* Check if we have position information: */ … … 1461 1461 1462 1462 /* Copy passed machine-item into this group: */ 1463 UI GChooserItem *pNewMachineItem = new UIGChooserItemMachine(this, pItem->toMachineItem(), iPosition);1463 UIChooserItem *pNewMachineItem = new UIChooserItemMachine(this, pItem->toMachineItem(), iPosition); 1464 1464 if (isClosed()) 1465 1465 open(false); … … 1486 1486 } 1487 1487 1488 void UI GChooserItemGroup::resetDragToken()1488 void UIChooserItemGroup::resetDragToken() 1489 1489 { 1490 1490 /* Reset drag token for this item: */ … … 1495 1495 } 1496 1496 /* Reset drag tokens for all the items: */ 1497 foreach (UI GChooserItem *pItem, items())1497 foreach (UIChooserItem *pItem, items()) 1498 1498 pItem->resetDragToken(); 1499 1499 } 1500 1500 1501 QMimeData* UI GChooserItemGroup::createMimeData()1502 { 1503 return new UI GChooserItemMimeData(this);1504 } 1505 1506 void UI GChooserItemGroup::showEvent(QShowEvent *pEvent)1501 QMimeData* UIChooserItemGroup::createMimeData() 1502 { 1503 return new UIChooserItemMimeData(this); 1504 } 1505 1506 void UIChooserItemGroup::showEvent(QShowEvent *pEvent) 1507 1507 { 1508 1508 /* Call to base-class: */ 1509 UI GChooserItem::showEvent(pEvent);1509 UIChooserItem::showEvent(pEvent); 1510 1510 1511 1511 /* Update pixmaps: */ … … 1513 1513 } 1514 1514 1515 void UI GChooserItemGroup::resizeEvent(QGraphicsSceneResizeEvent *pEvent)1515 void UIChooserItemGroup::resizeEvent(QGraphicsSceneResizeEvent *pEvent) 1516 1516 { 1517 1517 /* Call to base-class: */ 1518 UI GChooserItem::resizeEvent(pEvent);1518 UIChooserItem::resizeEvent(pEvent); 1519 1519 1520 1520 /* What is the new geometry? */ … … 1529 1529 } 1530 1530 1531 void UI GChooserItemGroup::hoverMoveEvent(QGraphicsSceneHoverEvent *pEvent)1531 void UIChooserItemGroup::hoverMoveEvent(QGraphicsSceneHoverEvent *pEvent) 1532 1532 { 1533 1533 /* Skip if hovered: */ … … 1545 1545 1546 1546 /* Call to base-class: */ 1547 UI GChooserItem::hoverMoveEvent(pEvent);1547 UIChooserItem::hoverMoveEvent(pEvent); 1548 1548 1549 1549 /* Update linked values: */ … … 1551 1551 } 1552 1552 1553 void UI GChooserItemGroup::hoverLeaveEvent(QGraphicsSceneHoverEvent *pEvent)1553 void UIChooserItemGroup::hoverLeaveEvent(QGraphicsSceneHoverEvent *pEvent) 1554 1554 { 1555 1555 /* Skip if not hovered: */ … … 1558 1558 1559 1559 /* Call to base-class: */ 1560 UI GChooserItem::hoverLeaveEvent(pEvent);1560 UIChooserItem::hoverLeaveEvent(pEvent); 1561 1561 1562 1562 /* Update linked values: */ … … 1564 1564 } 1565 1565 1566 void UI GChooserItemGroup::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget* /* pWidget = 0 */)1566 void UIChooserItemGroup::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget* /* pWidget = 0 */) 1567 1567 { 1568 1568 /* Setup: */ … … 1576 1576 } 1577 1577 1578 void UI GChooserItemGroup::paintBackground(QPainter *pPainter, const QRect &rect)1578 void UIChooserItemGroup::paintBackground(QPainter *pPainter, const QRect &rect) 1579 1579 { 1580 1580 /* Save painter: */ … … 1705 1705 } 1706 1706 1707 void UI GChooserItemGroup::paintHeader(QPainter *pPainter, const QRect &rect)1707 void UIChooserItemGroup::paintHeader(QPainter *pPainter, const QRect &rect) 1708 1708 { 1709 1709 /* Not for main root: */ … … 1838 1838 } 1839 1839 1840 void UI GChooserItemGroup::updateAnimationParameters()1840 void UIChooserItemGroup::updateAnimationParameters() 1841 1841 { 1842 1842 /* Only for item with button: */ … … 1851 1851 } 1852 1852 1853 void UI GChooserItemGroup::setAdditionalHeight(int iAdditionalHeight)1853 void UIChooserItemGroup::setAdditionalHeight(int iAdditionalHeight) 1854 1854 { 1855 1855 m_iAdditionalHeight = iAdditionalHeight; … … 1858 1858 } 1859 1859 1860 int UI GChooserItemGroup::additionalHeight() const1860 int UIChooserItemGroup::additionalHeight() const 1861 1861 { 1862 1862 return m_iAdditionalHeight; 1863 1863 } 1864 1864 1865 UI GroupRenameEditor::UIGroupRenameEditor(const QString &strName, UIGChooserItem *pParent)1865 UIEditorGroupRename::UIEditorGroupRename(const QString &strName, UIChooserItem *pParent) 1866 1866 : m_pParent(pParent) 1867 1867 , m_pLineEdit(0) … … 1881 1881 } 1882 1882 1883 QString UI GroupRenameEditor::text() const1883 QString UIEditorGroupRename::text() const 1884 1884 { 1885 1885 return m_pLineEdit->text(); 1886 1886 } 1887 1887 1888 void UI GroupRenameEditor::setText(const QString &strText)1888 void UIEditorGroupRename::setText(const QString &strText) 1889 1889 { 1890 1890 m_pLineEdit->setText(strText); 1891 1891 } 1892 1892 1893 void UI GroupRenameEditor::setFont(const QFont &font)1893 void UIEditorGroupRename::setFont(const QFont &font) 1894 1894 { 1895 1895 QWidget::setFont(font); … … 1897 1897 } 1898 1898 1899 void UI GroupRenameEditor::setFocus()1899 void UIEditorGroupRename::setFocus() 1900 1900 { 1901 1901 m_pLineEdit->setFocus(); 1902 1902 } 1903 1903 1904 bool UI GroupRenameEditor::eventFilter(QObject *pWatched, QEvent *pEvent)1904 bool UIEditorGroupRename::eventFilter(QObject *pWatched, QEvent *pEvent) 1905 1905 { 1906 1906 /* Process only events sent to line-edit: */ … … 1932 1932 } 1933 1933 1934 void UI GroupRenameEditor::handleContextMenuEvent(QContextMenuEvent *pContextMenuEvent)1934 void UIEditorGroupRename::handleContextMenuEvent(QContextMenuEvent *pContextMenuEvent) 1935 1935 { 1936 1936 /* Prepare variables: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemGroup.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserItemGroup class declaration.3 * VBox Qt GUI - UIChooserItemGroup class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GChooserItemGroup_h__19 #define __UI GChooserItemGroup_h__18 #ifndef __UIChooserItemGroup_h__ 19 #define __UIChooserItemGroup_h__ 20 20 21 21 /* Qt includes: */ … … 24 24 25 25 /* GUI includes: */ 26 #include "UI GChooserItem.h"26 #include "UIChooserItem.h" 27 27 28 28 /* Forward declarations: */ … … 32 32 class UIGraphicsButton; 33 33 class UIGraphicsRotatorButton; 34 class UI GroupRenameEditor;34 class UIEditorGroupRename; 35 35 36 36 /* Graphics group-item 37 37 * for graphics selector model/view architecture: */ 38 class UI GChooserItemGroup : public UIGChooserItem38 class UIChooserItemGroup : public UIChooserItem 39 39 { 40 40 Q_OBJECT; … … 53 53 54 54 /* Graphics-item type: */ 55 enum { Type = UI GChooserItemType_Group };55 enum { Type = UIChooserItemType_Group }; 56 56 int type() const { return Type; } 57 57 58 58 /* Constructor (main-root-item): */ 59 UI GChooserItemGroup(QGraphicsScene *pScene);59 UIChooserItemGroup(QGraphicsScene *pScene); 60 60 /* Constructor (temporary main-root-item/root-item copy): */ 61 UI GChooserItemGroup(QGraphicsScene *pScene, UIGChooserItemGroup *pCopyFrom, bool fMainRoot);61 UIChooserItemGroup(QGraphicsScene *pScene, UIChooserItemGroup *pCopyFrom, bool fMainRoot); 62 62 /* Constructor (new non-root-item): */ 63 UI GChooserItemGroup(UIGChooserItem *pParent, const QString &strName, bool fOpened = false, int iPosition = -1);63 UIChooserItemGroup(UIChooserItem *pParent, const QString &strName, bool fOpened = false, int iPosition = -1); 64 64 /* Constructor (new non-root-item copy): */ 65 UI GChooserItemGroup(UIGChooserItem *pParent, UIGChooserItemGroup *pCopyFrom, int iPosition = -1);65 UIChooserItemGroup(UIChooserItem *pParent, UIChooserItemGroup *pCopyFrom, int iPosition = -1); 66 66 /* Destructor: */ 67 ~UI GChooserItemGroup();67 ~UIChooserItemGroup(); 68 68 69 69 /* API: Basic stuff: */ … … 116 116 /* Helpers: Prepare stuff: */ 117 117 void prepare(); 118 static void copyContent(UI GChooserItemGroup *pFrom, UIGChooserItemGroup *pTo);118 static void copyContent(UIChooserItemGroup *pFrom, UIChooserItemGroup *pTo); 119 119 120 120 /* Helpers: Update stuff: */ … … 137 137 138 138 /* Helpers: Children stuff: */ 139 void addItem(UI GChooserItem *pItem, int iPosition);140 void removeItem(UI GChooserItem *pItem);141 void setItems(const QList<UI GChooserItem*> &items, UIGChooserItemType type);142 QList<UI GChooserItem*> items(UIGChooserItemType type = UIGChooserItemType_Any) const;143 bool hasItems(UI GChooserItemType type = UIGChooserItemType_Any) const;144 void clearItems(UI GChooserItemType 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); 145 145 void updateAll(const QString &strId); 146 146 void removeAll(const QString &strId); 147 UI GChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags);148 UI GChooserItemMachine* firstMachineItem();147 UIChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags); 148 UIChooserItemMachine* firstMachineItem(); 149 149 void sortItems(); 150 150 … … 168 168 QPixmap toPixmap(); 169 169 bool isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const; 170 void processDrop(QGraphicsSceneDragDropEvent *pEvent, UI GChooserItem *pFromWho, DragToken where);170 void processDrop(QGraphicsSceneDragDropEvent *pEvent, UIChooserItem *pFromWho, DragToken where); 171 171 void resetDragToken(); 172 172 QMimeData* createMimeData(); … … 200 200 UIGraphicsButton *m_pEnterButton; 201 201 UIGraphicsButton *m_pExitButton; 202 UI GroupRenameEditor*m_pNameEditorWidget;202 UIEditorGroupRename *m_pNameEditorWidget; 203 203 QGraphicsProxyWidget *m_pNameEditor; 204 QList<UI GChooserItem*> m_groupItems;205 QList<UI GChooserItem*> m_machineItems;204 QList<UIChooserItem*> m_groupItems; 205 QList<UIChooserItem*> m_machineItems; 206 206 int m_iAdditionalHeight; 207 207 int m_iCornerRadius; … … 229 229 }; 230 230 231 class UI GroupRenameEditor: public QWidget231 class UIEditorGroupRename : public QWidget 232 232 { 233 233 Q_OBJECT; … … 241 241 242 242 /* Constructor: */ 243 UI GroupRenameEditor(const QString &strName, UIGChooserItem *pParent);243 UIEditorGroupRename(const QString &strName, UIChooserItem *pParent); 244 244 245 245 /* API: Text stuff: */ … … 264 264 265 265 /* Variables: */ 266 UI GChooserItem *m_pParent;266 UIChooserItem *m_pParent; 267 267 QLineEdit *m_pLineEdit; 268 268 QMenu *m_pTemporaryMenu; 269 269 }; 270 270 271 #endif /* __UI GChooserItemGroup_h__ */272 271 #endif /* __UIChooserItemGroup_h__ */ 272 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserItemMachine class implementation.3 * VBox Qt GUI - UIChooserItemMachine class implementation. 4 4 */ 5 5 … … 27 27 /* GUI includes: */ 28 28 # include "VBoxGlobal.h" 29 # include "UI GChooserItemGroup.h"30 # include "UI GChooserItemMachine.h"31 # include "UI GChooserModel.h"29 # include "UIChooserItemGroup.h" 30 # include "UIChooserItemMachine.h" 31 # include "UIChooserModel.h" 32 32 # include "UIGraphicsToolBar.h" 33 33 # include "UIActionPoolSelector.h" … … 35 35 # include "UIIconPool.h" 36 36 # include "UIImageTools.h" 37 # include "UI SelectorWindow.h"37 # include "UIVirtualBoxManager.h" 38 38 39 39 /* COM includes: */ … … 45 45 46 46 /* static */ 47 QString UI GChooserItemMachine::className() { return "UIGChooserItemMachine"; }48 49 UI GChooserItemMachine::UIGChooserItemMachine(UIGChooserItem *pParent,47 QString UIChooserItemMachine::className() { return "UIChooserItemMachine"; } 48 49 UIChooserItemMachine::UIChooserItemMachine(UIChooserItem *pParent, 50 50 const CMachine &machine, 51 51 int iPosition /* = -1 */) 52 : UI GChooserItem(pParent, pParent->isTemporary())53 , UIV MItem(machine)52 : UIChooserItem(pParent, pParent->isTemporary()) 53 , UIVirtualMachineItem(machine) 54 54 { 55 55 /* Prepare: */ … … 62 62 63 63 /* Configure connections: */ 64 connect(gp SelectorWindow, &UISelectorWindow::sigWindowRemapped,65 this, &UI GChooserItemMachine::sltHandleWindowRemapped);64 connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped, 65 this, &UIChooserItemMachine::sltHandleWindowRemapped); 66 66 67 67 /* Init: */ … … 74 74 } 75 75 76 UI GChooserItemMachine::UIGChooserItemMachine(UIGChooserItem *pParent,77 UI GChooserItemMachine *pCopyFrom,76 UIChooserItemMachine::UIChooserItemMachine(UIChooserItem *pParent, 77 UIChooserItemMachine *pCopyFrom, 78 78 int iPosition /* = -1 */) 79 : UI GChooserItem(pParent, pParent->isTemporary())80 , UIV MItem(pCopyFrom->machine())79 : UIChooserItem(pParent, pParent->isTemporary()) 80 , UIVirtualMachineItem(pCopyFrom->machine()) 81 81 { 82 82 /* Prepare: */ … … 89 89 90 90 /* Configure connections: */ 91 connect(gp SelectorWindow, &UISelectorWindow::sigWindowRemapped,92 this, &UI GChooserItemMachine::sltHandleWindowRemapped);91 connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped, 92 this, &UIChooserItemMachine::sltHandleWindowRemapped); 93 93 94 94 /* Init: */ … … 101 101 } 102 102 103 UI GChooserItemMachine::~UIGChooserItemMachine()103 UIChooserItemMachine::~UIChooserItemMachine() 104 104 { 105 105 /* If that item is focused: */ … … 127 127 } 128 128 129 QString UI GChooserItemMachine::name() const130 { 131 return UIV MItem::name();132 } 133 134 QString UI GChooserItemMachine::description() const129 QString UIChooserItemMachine::name() const 130 { 131 return UIVirtualMachineItem::name(); 132 } 133 134 QString UIChooserItemMachine::description() const 135 135 { 136 136 return m_strDescription; 137 137 } 138 138 139 QString UI GChooserItemMachine::fullName() const139 QString UIChooserItemMachine::fullName() const 140 140 { 141 141 /* Get full parent name, append with '/' if not yet appended: */ … … 148 148 } 149 149 150 QString UI GChooserItemMachine::definition() const150 QString UIChooserItemMachine::definition() const 151 151 { 152 152 return QString("m=%1").arg(name()); 153 153 } 154 154 155 bool UI GChooserItemMachine::isLockedMachine() const155 bool UIChooserItemMachine::isLockedMachine() const 156 156 { 157 157 KMachineState state = machineState(); … … 163 163 164 164 /* static */ 165 void UI GChooserItemMachine::enumerateMachineItems(const QList<UIGChooserItem*> &il,166 QList<UI GChooserItemMachine*> &ol,165 void UIChooserItemMachine::enumerateMachineItems(const QList<UIChooserItem*> &il, 166 QList<UIChooserItemMachine*> &ol, 167 167 int iEnumerationFlags /* = 0 */) 168 168 { 169 169 /* Enumerate all the passed items: */ 170 foreach (UI GChooserItem *pItem, il)170 foreach (UIChooserItem *pItem, il) 171 171 { 172 172 /* If that is machine-item: */ 173 if (pItem->type() == UI GChooserItemType_Machine)173 if (pItem->type() == UIChooserItemType_Machine) 174 174 { 175 175 /* Get the iterated machine-item: */ 176 UI GChooserItemMachine *pMachineItem = pItem->toMachineItem();176 UIChooserItemMachine *pMachineItem = pItem->toMachineItem(); 177 177 /* Skip if exactly this item is already enumerated: */ 178 178 if (ol.contains(pMachineItem)) 179 179 continue; 180 180 /* Skip if item with same ID is already enumerated but we need unique: */ 181 if ((iEnumerationFlags & UI GChooserItemMachineEnumerationFlag_Unique) &&181 if ((iEnumerationFlags & UIChooserItemMachineEnumerationFlag_Unique) && 182 182 contains(ol, pMachineItem)) 183 183 continue; 184 184 /* Skip if this item is accessible and we no need it: */ 185 if ((iEnumerationFlags & UI GChooserItemMachineEnumerationFlag_Inaccessible) &&185 if ((iEnumerationFlags & UIChooserItemMachineEnumerationFlag_Inaccessible) && 186 186 pMachineItem->accessible()) 187 187 continue; … … 190 190 } 191 191 /* If that is group-item: */ 192 else if (pItem->type() == UI GChooserItemType_Group)192 else if (pItem->type() == UIChooserItemType_Group) 193 193 { 194 194 /* Enumerate all the machine-items recursively: */ 195 enumerateMachineItems(pItem->items(UI GChooserItemType_Machine), ol, iEnumerationFlags);195 enumerateMachineItems(pItem->items(UIChooserItemType_Machine), ol, iEnumerationFlags); 196 196 /* Enumerate all the group-items recursively: */ 197 enumerateMachineItems(pItem->items(UI GChooserItemType_Group), ol, iEnumerationFlags);197 enumerateMachineItems(pItem->items(UIChooserItemType_Group), ol, iEnumerationFlags); 198 198 } 199 199 } 200 200 } 201 201 202 void UI GChooserItemMachine::sltHandleWindowRemapped()202 void UIChooserItemMachine::sltHandleWindowRemapped() 203 203 { 204 204 /* Recache and update pixmaps: */ … … 207 207 } 208 208 209 QVariant UI GChooserItemMachine::data(int iKey) const209 QVariant UIChooserItemMachine::data(int iKey) const 210 210 { 211 211 /* Provide other members with required data: */ … … 233 233 } 234 234 235 void UI GChooserItemMachine::updatePixmaps()235 void UIChooserItemMachine::updatePixmaps() 236 236 { 237 237 /* Update pixmap: */ … … 242 242 } 243 243 244 void UI GChooserItemMachine::updatePixmap()244 void UIChooserItemMachine::updatePixmap() 245 245 { 246 246 /* Get new pixmap and pixmap-size: */ … … 261 261 } 262 262 263 void UI GChooserItemMachine::updateStatePixmap()263 void UIChooserItemMachine::updateStatePixmap() 264 264 { 265 265 /* Determine the icon metric: */ … … 270 270 AssertReturnVoid(!stateIcon.isNull()); 271 271 const QSize statePixmapSize = QSize(iIconMetric, iIconMetric); 272 const QPixmap statePixmap = stateIcon.pixmap(gp SelectorWindow->windowHandle(), statePixmapSize);272 const QPixmap statePixmap = stateIcon.pixmap(gpManager->windowHandle(), statePixmapSize); 273 273 /* Update linked values: */ 274 274 if (m_statePixmapSize != statePixmapSize) … … 284 284 } 285 285 286 void UI GChooserItemMachine::updateName()286 void UIChooserItemMachine::updateName() 287 287 { 288 288 /* Get new name: */ … … 299 299 } 300 300 301 void UI GChooserItemMachine::updateSnapshotName()301 void UIChooserItemMachine::updateSnapshotName() 302 302 { 303 303 /* Get new snapshot-name: */ … … 314 314 } 315 315 316 void UI GChooserItemMachine::updateFirstRowMaximumWidth()316 void UIChooserItemMachine::updateFirstRowMaximumWidth() 317 317 { 318 318 /* Prepare variables: */ … … 343 343 } 344 344 345 void UI GChooserItemMachine::updateMinimumNameWidth()345 void UIChooserItemMachine::updateMinimumNameWidth() 346 346 { 347 347 /* Calculate new minimum name width: */ … … 359 359 } 360 360 361 void UI GChooserItemMachine::updateMinimumSnapshotNameWidth()361 void UIChooserItemMachine::updateMinimumSnapshotNameWidth() 362 362 { 363 363 /* Calculate new minimum snapshot-name width: */ … … 383 383 } 384 384 385 void UI GChooserItemMachine::updateMaximumNameWidth()385 void UIChooserItemMachine::updateMaximumNameWidth() 386 386 { 387 387 /* Calculate new maximum name width: */ … … 405 405 } 406 406 407 void UI GChooserItemMachine::updateMaximumSnapshotNameWidth()407 void UIChooserItemMachine::updateMaximumSnapshotNameWidth() 408 408 { 409 409 /* Prepare variables: */ … … 423 423 } 424 424 425 void UI GChooserItemMachine::updateVisibleName()425 void UIChooserItemMachine::updateVisibleName() 426 426 { 427 427 /* Prepare variables: */ … … 446 446 } 447 447 448 void UI GChooserItemMachine::updateVisibleSnapshotName()448 void UIChooserItemMachine::updateVisibleSnapshotName() 449 449 { 450 450 /* Prepare variables: */ … … 471 471 } 472 472 473 void UI GChooserItemMachine::updateStateText()473 void UIChooserItemMachine::updateStateText() 474 474 { 475 475 /* Get new state-text and state-text size: */ … … 490 490 } 491 491 492 void UI GChooserItemMachine::retranslateUi()492 void UIChooserItemMachine::retranslateUi() 493 493 { 494 494 /* Update description: */ … … 502 502 } 503 503 504 void UI GChooserItemMachine::startEditing()504 void UIChooserItemMachine::startEditing() 505 505 { 506 506 AssertMsgFailed(("Machine graphics item do NOT support editing yet!")); 507 507 } 508 508 509 void UI GChooserItemMachine::updateToolTip()509 void UIChooserItemMachine::updateToolTip() 510 510 { 511 511 setToolTip(toolTipText()); 512 512 } 513 513 514 void UI GChooserItemMachine::addItem(UIGChooserItem*, int)514 void UIChooserItemMachine::addItem(UIChooserItem*, int) 515 515 { 516 516 AssertMsgFailed(("Machine graphics item do NOT support children!")); 517 517 } 518 518 519 void UI GChooserItemMachine::removeItem(UIGChooserItem*)519 void UIChooserItemMachine::removeItem(UIChooserItem*) 520 520 { 521 521 AssertMsgFailed(("Machine graphics item do NOT support children!")); 522 522 } 523 523 524 void UI GChooserItemMachine::setItems(const QList<UIGChooserItem*>&, UIGChooserItemType)524 void UIChooserItemMachine::setItems(const QList<UIChooserItem*>&, UIChooserItemType) 525 525 { 526 526 AssertMsgFailed(("Machine graphics item do NOT support children!")); 527 527 } 528 528 529 QList<UI GChooserItem*> UIGChooserItemMachine::items(UIGChooserItemType) const529 QList<UIChooserItem*> UIChooserItemMachine::items(UIChooserItemType) const 530 530 { 531 531 AssertMsgFailed(("Machine graphics item do NOT support children!")); 532 return QList<UI GChooserItem*>();533 } 534 535 bool UI GChooserItemMachine::hasItems(UIGChooserItemType) const532 return QList<UIChooserItem*>(); 533 } 534 535 bool UIChooserItemMachine::hasItems(UIChooserItemType) const 536 536 { 537 537 AssertMsgFailed(("Machine graphics item do NOT support children!")); … … 539 539 } 540 540 541 void UI GChooserItemMachine::clearItems(UIGChooserItemType)541 void UIChooserItemMachine::clearItems(UIChooserItemType) 542 542 { 543 543 AssertMsgFailed(("Machine graphics item do NOT support children!")); 544 544 } 545 545 546 void UI GChooserItemMachine::updateAll(const QString &strId)546 void UIChooserItemMachine::updateAll(const QString &strId) 547 547 { 548 548 /* Skip other ids: */ … … 563 563 } 564 564 565 void UI GChooserItemMachine::removeAll(const QString &strId)565 void UIChooserItemMachine::removeAll(const QString &strId) 566 566 { 567 567 /* Skip wrong id: */ … … 580 580 } 581 581 582 UI GChooserItem* UIGChooserItemMachine::searchForItem(const QString &strSearchTag, int iItemSearchFlags)582 UIChooserItem* UIChooserItemMachine::searchForItem(const QString &strSearchTag, int iItemSearchFlags) 583 583 { 584 584 /* Ignoring if we are not searching for the machine-item? */ 585 if (!(iItemSearchFlags & UI GChooserItemSearchFlag_Machine))585 if (!(iItemSearchFlags & UIChooserItemSearchFlag_Machine)) 586 586 return 0; 587 587 588 588 /* Are we searching by the exact name? */ 589 if (iItemSearchFlags & UI GChooserItemSearchFlag_ExactName)589 if (iItemSearchFlags & UIChooserItemSearchFlag_ExactName) 590 590 { 591 591 /* Exact name doesn't match? */ … … 605 605 } 606 606 607 UI GChooserItemMachine* UIGChooserItemMachine::firstMachineItem()607 UIChooserItemMachine* UIChooserItemMachine::firstMachineItem() 608 608 { 609 609 return this; 610 610 } 611 611 612 void UI GChooserItemMachine::sortItems()612 void UIChooserItemMachine::sortItems() 613 613 { 614 614 AssertMsgFailed(("Machine graphics item do NOT support children!")); 615 615 } 616 616 617 void UI GChooserItemMachine::updateLayout()617 void UIChooserItemMachine::updateLayout() 618 618 { 619 619 /* Update tool-bar: */ … … 644 644 } 645 645 646 int UI GChooserItemMachine::minimumWidthHint() const646 int UIChooserItemMachine::minimumWidthHint() const 647 647 { 648 648 /* Prepare variables: */ … … 677 677 } 678 678 679 int UI GChooserItemMachine::minimumHeightHint() const679 int UIChooserItemMachine::minimumHeightHint() const 680 680 { 681 681 /* Prepare variables: */ … … 706 706 } 707 707 708 QSizeF UI GChooserItemMachine::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const708 QSizeF UIChooserItemMachine::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const 709 709 { 710 710 /* If Qt::MinimumSize requested: */ … … 712 712 return QSizeF(minimumWidthHint(), minimumHeightHint()); 713 713 /* Else call to base-class: */ 714 return UI GChooserItem::sizeHint(which, constraint);715 } 716 717 QPixmap UI GChooserItemMachine::toPixmap()714 return UIChooserItem::sizeHint(which, constraint); 715 } 716 717 QPixmap UIChooserItemMachine::toPixmap() 718 718 { 719 719 /* Ask item to paint itself into pixmap: */ … … 727 727 } 728 728 729 bool UI GChooserItemMachine::isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const729 bool UIChooserItemMachine::isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const 730 730 { 731 731 /* No drops while saving groups: */ … … 744 744 return false; 745 745 /* Else we should try to cast mime to known classes: */ 746 if (pMimeData->hasFormat(UI GChooserItemMachine::className()))746 if (pMimeData->hasFormat(UIChooserItemMachine::className())) 747 747 { 748 748 /* Make sure passed item id is not ours: */ 749 const UI GChooserItemMimeData *pCastedMimeData = qobject_cast<const UIGChooserItemMimeData*>(pMimeData);750 AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UI GChooserItemMimeData!"));751 UI GChooserItem *pItem = pCastedMimeData->item();752 UI GChooserItemMachine *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(); 753 753 /* Make sure passed machine is mutable: */ 754 754 if (pMachineItem->isLockedMachine()) … … 760 760 } 761 761 762 void UI GChooserItemMachine::processDrop(QGraphicsSceneDragDropEvent *pEvent, UIGChooserItem *pFromWho, DragToken where)762 void UIChooserItemMachine::processDrop(QGraphicsSceneDragDropEvent *pEvent, UIChooserItem *pFromWho, DragToken where) 763 763 { 764 764 /* Get mime: */ … … 768 768 Q_UNUSED(pFromWho); 769 769 Q_UNUSED(where); 770 if (pMime->hasFormat(UI GChooserItemMachine::className()))770 if (pMime->hasFormat(UIChooserItemMachine::className())) 771 771 { 772 772 switch (pEvent->proposedAction()) … … 776 776 { 777 777 /* Remember scene: */ 778 UI GChooserModel *pModel = model();778 UIChooserModel *pModel = model(); 779 779 780 780 /* Get passed item: */ 781 const UI GChooserItemMimeData *pCastedMime = qobject_cast<const UIGChooserItemMimeData*>(pMime);782 AssertMsg(pCastedMime, ("Can't cast passed mime-data to UI GChooserItemMimeData!"));783 UI GChooserItem *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(); 784 784 785 785 /* Group passed item with current item into the new group: */ 786 UI GChooserItemGroup *pNewGroupItem = new UIGChooserItemGroup(parentItem(),787 UI GChooserModel::uniqueGroupName(parentItem()),786 UIChooserItemGroup *pNewGroupItem = new UIChooserItemGroup(parentItem(), 787 UIChooserModel::uniqueGroupName(parentItem()), 788 788 true); 789 new UI GChooserItemMachine(pNewGroupItem, this);790 new UI GChooserItemMachine(pNewGroupItem, pItem->toMachineItem());789 new UIChooserItemMachine(pNewGroupItem, this); 790 new UIChooserItemMachine(pNewGroupItem, pItem->toMachineItem()); 791 791 792 792 /* If proposed action is 'move': */ … … 813 813 } 814 814 815 void UI GChooserItemMachine::resetDragToken()815 void UIChooserItemMachine::resetDragToken() 816 816 { 817 817 /* Reset drag token for this item: */ … … 823 823 } 824 824 825 QMimeData* UI GChooserItemMachine::createMimeData()826 { 827 return new UI GChooserItemMimeData(this);828 } 829 830 void UI GChooserItemMachine::showEvent(QShowEvent *pEvent)825 QMimeData* UIChooserItemMachine::createMimeData() 826 { 827 return new UIChooserItemMimeData(this); 828 } 829 830 void UIChooserItemMachine::showEvent(QShowEvent *pEvent) 831 831 { 832 832 /* Call to base-class: */ 833 UI GChooserItem::showEvent(pEvent);833 UIChooserItem::showEvent(pEvent); 834 834 835 835 /* Recache and update pixmaps: */ … … 838 838 } 839 839 840 void UI GChooserItemMachine::resizeEvent(QGraphicsSceneResizeEvent *pEvent)840 void UIChooserItemMachine::resizeEvent(QGraphicsSceneResizeEvent *pEvent) 841 841 { 842 842 /* Call to base-class: */ 843 UI GChooserItem::resizeEvent(pEvent);843 UIChooserItem::resizeEvent(pEvent); 844 844 845 845 /* What is the new geometry? */ … … 854 854 } 855 855 856 void UI GChooserItemMachine::mousePressEvent(QGraphicsSceneMouseEvent *pEvent)856 void UIChooserItemMachine::mousePressEvent(QGraphicsSceneMouseEvent *pEvent) 857 857 { 858 858 /* Call to base-class: */ 859 UI GChooserItem::mousePressEvent(pEvent);859 UIChooserItem::mousePressEvent(pEvent); 860 860 /* No drag for inaccessible: */ 861 861 if (!accessible()) … … 863 863 } 864 864 865 void UI GChooserItemMachine::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget* /* pWidget = 0 */)865 void UIChooserItemMachine::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget* /* pWidget = 0 */) 866 866 { 867 867 /* Setup: */ … … 875 875 } 876 876 877 void UI GChooserItemMachine::paintDecorations(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)877 void UIChooserItemMachine::paintDecorations(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption) 878 878 { 879 879 /* Prepare variables: */ … … 887 887 } 888 888 889 void UI GChooserItemMachine::paintBackground(QPainter *pPainter, const QRect &rect)889 void UIChooserItemMachine::paintBackground(QPainter *pPainter, const QRect &rect) 890 890 { 891 891 /* Save painter: */ … … 947 947 } 948 948 949 void UI GChooserItemMachine::paintFrameRectangle(QPainter *pPainter, const QRect &rect)949 void UIChooserItemMachine::paintFrameRectangle(QPainter *pPainter, const QRect &rect) 950 950 { 951 951 /* Only chosen and/or hovered item should have a frame: */ … … 964 964 } 965 965 966 void UI GChooserItemMachine::paintMachineInfo(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)966 void UIChooserItemMachine::paintMachineInfo(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption) 967 967 { 968 968 /* Prepare variables: */ … … 1129 1129 } 1130 1130 1131 void UI GChooserItemMachine::prepare()1131 void UIChooserItemMachine::prepare() 1132 1132 { 1133 1133 /* Tool-bar/buttons: */ … … 1210 1210 1211 1211 /* static */ 1212 bool UI GChooserItemMachine::contains(const QList<UIGChooserItemMachine*> &list, UIGChooserItemMachine *pItem)1212 bool UIChooserItemMachine::contains(const QList<UIChooserItemMachine*> &list, UIChooserItemMachine *pItem) 1213 1213 { 1214 1214 /* Check if passed list contains passed machine-item id: */ 1215 foreach (UI GChooserItemMachine *pIteratedItem, list)1215 foreach (UIChooserItemMachine *pIteratedItem, list) 1216 1216 if (pIteratedItem->id() == pItem->id()) 1217 1217 return true; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserItemMachine.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserItemMachine class declaration.3 * VBox Qt GUI - UIChooserItemMachine class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GChooserItemMachine_h__19 #define __UI GChooserItemMachine_h__18 #ifndef __UIChooserItemMachine_h__ 19 #define __UIChooserItemMachine_h__ 20 20 21 21 /* GUI includes: */ 22 #include "UIV MItem.h"23 #include "UI GChooserItem.h"22 #include "UIVirtualMachineItem.h" 23 #include "UIChooserItem.h" 24 24 25 25 /* Forward declarations: */ … … 29 29 30 30 /* Machine-item enumeration flags: */ 31 enum UI GChooserItemMachineEnumerationFlag31 enum UIChooserItemMachineEnumerationFlag 32 32 { 33 UI GChooserItemMachineEnumerationFlag_Unique = RT_BIT(0),34 UI GChooserItemMachineEnumerationFlag_Inaccessible = RT_BIT(1)33 UIChooserItemMachineEnumerationFlag_Unique = RT_BIT(0), 34 UIChooserItemMachineEnumerationFlag_Inaccessible = RT_BIT(1) 35 35 }; 36 36 37 37 /* Graphics machine item 38 38 * for graphics selector model/view architecture: */ 39 class UI GChooserItemMachine : public UIGChooserItem, public UIVMItem39 class UIChooserItemMachine : public UIChooserItem, public UIVirtualMachineItem 40 40 { 41 41 Q_OBJECT; … … 47 47 48 48 /* Graphics-item type: */ 49 enum { Type = UI GChooserItemType_Machine };49 enum { Type = UIChooserItemType_Machine }; 50 50 int type() const { return Type; } 51 51 52 52 /* Constructor (new item): */ 53 UI GChooserItemMachine(UIGChooserItem *pParent, const CMachine &machine, int iPosition = -1);53 UIChooserItemMachine(UIChooserItem *pParent, const CMachine &machine, int iPosition = -1); 54 54 /* Constructor (new item copy): */ 55 UI GChooserItemMachine(UIGChooserItem *pParent, UIGChooserItemMachine *pCopyFrom, int iPosition = -1);55 UIChooserItemMachine(UIChooserItem *pParent, UIChooserItemMachine *pCopyFrom, int iPosition = -1); 56 56 /* Destructor: */ 57 ~UI GChooserItemMachine();57 ~UIChooserItemMachine(); 58 58 59 59 /* API: Basic stuff: */ … … 65 65 66 66 /* API: Machine-item enumeration stuff: */ 67 static void enumerateMachineItems(const QList<UI GChooserItem*> &il,68 QList<UI GChooserItemMachine*> &ol,67 static void enumerateMachineItems(const QList<UIChooserItem*> &il, 68 QList<UIChooserItemMachine*> &ol, 69 69 int iEnumerationFlags = 0); 70 70 … … 119 119 120 120 /* Helpers: Children stuff: */ 121 void addItem(UI GChooserItem *pItem, int iPosition);122 void removeItem(UI GChooserItem *pItem);123 void setItems(const QList<UI GChooserItem*> &items, UIGChooserItemType type);124 QList<UI GChooserItem*> items(UIGChooserItemType type) const;125 bool hasItems(UI GChooserItemType type) const;126 void clearItems(UI GChooserItemType 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); 127 127 void updateAll(const QString &strId); 128 128 void removeAll(const QString &strId); 129 UI GChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags);130 UI GChooserItemMachine* firstMachineItem();129 UIChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags); 130 UIChooserItemMachine* firstMachineItem(); 131 131 void sortItems(); 132 132 … … 140 140 QPixmap toPixmap(); 141 141 bool isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const; 142 void processDrop(QGraphicsSceneDragDropEvent *pEvent, UI GChooserItem *pFromWho, DragToken where);142 void processDrop(QGraphicsSceneDragDropEvent *pEvent, UIChooserItem *pFromWho, DragToken where); 143 143 void resetDragToken(); 144 144 QMimeData* createMimeData(); … … 164 164 165 165 /* Helper: Machine-item enumeration stuff: */ 166 static bool contains(const QList<UI GChooserItemMachine*> &list,167 UI GChooserItemMachine *pItem);166 static bool contains(const QList<UIChooserItemMachine*> &list, 167 UIChooserItemMachine *pItem); 168 168 169 169 /* Variables: */ … … 200 200 }; 201 201 202 #endif /* __UI GChooserItemMachine_h__ */203 202 #endif /* __UIChooserItemMachine_h__ */ 203 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserModel class implementation.3 * VBox Qt GUI - UIChooserModel class implementation. 4 4 */ 5 5 … … 34 34 # include "QIMessageBox.h" 35 35 # include "VBoxGlobal.h" 36 # include "UI GChooser.h"37 # include "UI GChooserModel.h"38 # include "UI GChooserItemGroup.h"39 # include "UI GChooserItemMachine.h"36 # include "UIChooser.h" 37 # include "UIChooserModel.h" 38 # include "UIChooserItemGroup.h" 39 # include "UIChooserItemMachine.h" 40 40 # include "UIExtraDataDefs.h" 41 41 # include "UIMessageCenter.h" 42 42 # include "UIExtraDataManager.h" 43 43 # include "UIActionPoolSelector.h" 44 # include "UI GChooserHandlerMouse.h"45 # include "UI GChooserHandlerKeyboard.h"44 # include "UIChooserHandlerMouse.h" 45 # include "UIChooserHandlerKeyboard.h" 46 46 # include "UIWizardNewVM.h" 47 # include "UI SelectorWindow.h"47 # include "UIVirtualBoxManager.h" 48 48 # include "UIVirtualBoxEventHandler.h" 49 49 # include "UIModalWindowManager.h" … … 63 63 64 64 65 UI GChooserModel::UIGChooserModel(UIGChooser *pParent)65 UIChooserModel::UIChooserModel(UIChooser *pParent) 66 66 : QObject(pParent) 67 67 , m_pChooser(pParent) … … 98 98 } 99 99 100 UI GChooserModel::~UIGChooserModel()100 UIChooserModel::~UIChooserModel() 101 101 { 102 102 /* Cleanup handlers: */ … … 116 116 } 117 117 118 void UI GChooserModel::prepare()118 void UIChooserModel::prepare() 119 119 { 120 120 /* Load group tree: */ … … 131 131 } 132 132 133 void UI GChooserModel::cleanup()133 void UIChooserModel::cleanup() 134 134 { 135 135 /* Save last selected item: */ … … 147 147 } 148 148 149 UIActionPool* UI GChooserModel::actionPool() const149 UIActionPool* UIChooserModel::actionPool() const 150 150 { 151 151 return chooser()->actionPool(); 152 152 } 153 153 154 QGraphicsScene* UI GChooserModel::scene() const154 QGraphicsScene* UIChooserModel::scene() const 155 155 { 156 156 return m_pScene; 157 157 } 158 158 159 QPaintDevice* UI GChooserModel::paintDevice() const159 QPaintDevice* UIChooserModel::paintDevice() const 160 160 { 161 161 if (!m_pScene || m_pScene->views().isEmpty()) … … 164 164 } 165 165 166 QGraphicsItem* UI GChooserModel::itemAt(const QPointF &position, const QTransform &deviceTransform /* = QTransform() */) const166 QGraphicsItem* UIChooserModel::itemAt(const QPointF &position, const QTransform &deviceTransform /* = QTransform() */) const 167 167 { 168 168 return scene()->itemAt(position, deviceTransform); 169 169 } 170 170 171 void UI GChooserModel::updateLayout()171 void UIChooserModel::updateLayout() 172 172 { 173 173 /* No layout updates while sliding: */ … … 190 190 } 191 191 192 const QList<UI GChooserItem*>& UIGChooserModel::navigationList() const192 const QList<UIChooserItem*>& UIChooserModel::navigationList() const 193 193 { 194 194 return m_navigationList; 195 195 } 196 196 197 void UI GChooserModel::removeFromNavigationList(UIGChooserItem *pItem)197 void UIChooserModel::removeFromNavigationList(UIChooserItem *pItem) 198 198 { 199 199 AssertMsg(pItem, ("Passed item is invalid!")); … … 201 201 } 202 202 203 void UI GChooserModel::updateNavigation()203 void UIChooserModel::updateNavigation() 204 204 { 205 205 m_navigationList.clear(); … … 207 207 } 208 208 209 UIV MItem* UIGChooserModel::currentMachineItem() const209 UIVirtualMachineItem* UIChooserModel::currentMachineItem() const 210 210 { 211 211 /* Return first machine-item of the current-item: */ … … 213 213 } 214 214 215 QList<UIV MItem*> UIGChooserModel::currentMachineItems() const215 QList<UIVirtualMachineItem*> UIChooserModel::currentMachineItems() const 216 216 { 217 217 /* Gather list of current unique machine-items: */ 218 QList<UI GChooserItemMachine*> currentMachineItemList;219 UI GChooserItemMachine::enumerateMachineItems(currentItems(), currentMachineItemList,220 UI GChooserItemMachineEnumerationFlag_Unique);218 QList<UIChooserItemMachine*> currentMachineItemList; 219 UIChooserItemMachine::enumerateMachineItems(currentItems(), currentMachineItemList, 220 UIChooserItemMachineEnumerationFlag_Unique); 221 221 222 222 /* Reintegrate machine-items into valid format: */ 223 QList<UIV MItem*> currentMachineList;224 foreach (UI GChooserItemMachine *pItem, currentMachineItemList)223 QList<UIVirtualMachineItem*> currentMachineList; 224 foreach (UIChooserItemMachine *pItem, currentMachineItemList) 225 225 currentMachineList << pItem; 226 226 return currentMachineList; 227 227 } 228 228 229 UI GChooserItem* UIGChooserModel::currentItem() const229 UIChooserItem* UIChooserModel::currentItem() const 230 230 { 231 231 /* Return first of current items, if any: */ … … 233 233 } 234 234 235 const QList<UI GChooserItem*>& UIGChooserModel::currentItems() const235 const QList<UIChooserItem*>& UIChooserModel::currentItems() const 236 236 { 237 237 return m_currentItems; 238 238 } 239 239 240 void UI GChooserModel::setCurrentItems(const QList<UIGChooserItem*> &items)240 void UIChooserModel::setCurrentItems(const QList<UIChooserItem*> &items) 241 241 { 242 242 /* Is there something seems to be changed? */ … … 245 245 246 246 /* Remember old current-item list: */ 247 QList<UI GChooserItem*> oldCurrentItems = m_currentItems;247 QList<UIChooserItem*> oldCurrentItems = m_currentItems; 248 248 249 249 /* Clear current current-item list: */ … … 251 251 252 252 /* Iterate over all the passed items: */ 253 foreach (UI GChooserItem *pItem, items)253 foreach (UIChooserItem *pItem, items) 254 254 { 255 255 /* If navigation list contains iterated-item: */ … … 268 268 269 269 /* Update all the old items (they are no longer selected): */ 270 foreach (UI GChooserItem *pItem, oldCurrentItems)270 foreach (UIChooserItem *pItem, oldCurrentItems) 271 271 pItem->update(); 272 272 273 273 /* Update all the new items (they are selected): */ 274 foreach (UI GChooserItem *pItem, m_currentItems)274 foreach (UIChooserItem *pItem, m_currentItems) 275 275 pItem->update(); 276 276 … … 279 279 } 280 280 281 void UI GChooserModel::setCurrentItem(UIGChooserItem *pItem)281 void UIChooserModel::setCurrentItem(UIChooserItem *pItem) 282 282 { 283 283 /* Call for wrapper above: */ 284 QList<UI GChooserItem*> items;284 QList<UIChooserItem*> items; 285 285 if (pItem) 286 286 items << pItem; … … 291 291 } 292 292 293 void UI GChooserModel::setCurrentItem(const QString &strDefinition)293 void UIChooserModel::setCurrentItem(const QString &strDefinition) 294 294 { 295 295 /* Ignore if empty definition passed: */ … … 298 298 299 299 /* Parse definition: */ 300 UI GChooserItem *pItem = 0;300 UIChooserItem *pItem = 0; 301 301 QString strItemType = strDefinition.section('=', 0, 0); 302 302 QString strItemDescriptor = strDefinition.section('=', 1, -1); … … 306 306 /* Search for group-item with passed descriptor (name): */ 307 307 pItem = mainRoot()->searchForItem(strItemDescriptor, 308 UI GChooserItemSearchFlag_Group |309 UI GChooserItemSearchFlag_ExactName);308 UIChooserItemSearchFlag_Group | 309 UIChooserItemSearchFlag_ExactName); 310 310 } 311 311 /* Its a machine-item definition? */ … … 318 318 /* Search for machine-item with required name: */ 319 319 pItem = mainRoot()->searchForItem(machine.GetName(), 320 UI GChooserItemSearchFlag_Machine |321 UI GChooserItemSearchFlag_ExactName);320 UIChooserItemSearchFlag_Machine | 321 UIChooserItemSearchFlag_ExactName); 322 322 } 323 323 } … … 331 331 } 332 332 333 void UI GChooserModel::unsetCurrentItem()333 void UIChooserModel::unsetCurrentItem() 334 334 { 335 335 /* Call for wrapper above: */ … … 337 337 } 338 338 339 void UI GChooserModel::addToCurrentItems(UIGChooserItem *pItem)339 void UIChooserModel::addToCurrentItems(UIChooserItem *pItem) 340 340 { 341 341 /* Call for wrapper above: */ 342 setCurrentItems(QList<UI GChooserItem*>(m_currentItems) << pItem);343 } 344 345 void UI GChooserModel::removeFromCurrentItems(UIGChooserItem *pItem)342 setCurrentItems(QList<UIChooserItem*>(m_currentItems) << pItem); 343 } 344 345 void UIChooserModel::removeFromCurrentItems(UIChooserItem *pItem) 346 346 { 347 347 /* Prepare filtered list: */ 348 QList<UI GChooserItem*> list(m_currentItems);348 QList<UIChooserItem*> list(m_currentItems); 349 349 list.removeAll(pItem); 350 350 /* Call for wrapper above: */ … … 352 352 } 353 353 354 UI GChooserItem *UIGChooserModel::findClosestUnselectedItem() const354 UIChooserItem *UIChooserModel::findClosestUnselectedItem() const 355 355 { 356 356 /* Take the focus item (if any) as a starting point 357 357 * and find the closest non-selected item. */ 358 UI GChooserItem *pItem = focusItem();358 UIChooserItem *pItem = focusItem(); 359 359 if (!pItem) 360 360 pItem = currentItem(); … … 384 384 } 385 385 386 void UI GChooserModel::makeSureSomeItemIsSelected()386 void UIChooserModel::makeSureSomeItemIsSelected() 387 387 { 388 388 /* Make sure selection item list is never empty … … 392 392 } 393 393 394 void UI GChooserModel::notifyCurrentItemChanged()394 void UIChooserModel::notifyCurrentItemChanged() 395 395 { 396 396 /* Notify listeners about selection change: */ … … 398 398 } 399 399 400 bool UI GChooserModel::isSingleGroupSelected() const400 bool UIChooserModel::isSingleGroupSelected() const 401 401 { 402 402 return currentItems().size() == 1 && 403 currentItem()->type() == UI GChooserItemType_Group;404 } 405 406 bool UI GChooserModel::isAllItemsOfOneGroupSelected() const403 currentItem()->type() == UIChooserItemType_Group; 404 } 405 406 bool UIChooserModel::isAllItemsOfOneGroupSelected() const 407 407 { 408 408 /* Make sure at least one item selected: */ … … 411 411 412 412 /* Determine the parent group of the first item: */ 413 UI GChooserItem *pFirstParent = currentItem()->parentItem();413 UIChooserItem *pFirstParent = currentItem()->parentItem(); 414 414 415 415 /* Make sure this parent is not main root-item: */ … … 418 418 419 419 /* Enumerate current-item set: */ 420 QSet<UI GChooserItem*> currentItemSet;421 foreach (UI GChooserItem *pCurrentItem, currentItems())420 QSet<UIChooserItem*> currentItemSet; 421 foreach (UIChooserItem *pCurrentItem, currentItems()) 422 422 currentItemSet << pCurrentItem; 423 423 424 424 /* Enumerate first parent children set: */ 425 QSet<UI GChooserItem*> firstParentItemSet;426 foreach (UI GChooserItem *pFirstParentItem, pFirstParent->items())425 QSet<UIChooserItem*> firstParentItemSet; 426 foreach (UIChooserItem *pFirstParentItem, pFirstParent->items()) 427 427 firstParentItemSet << pFirstParentItem; 428 428 … … 431 431 } 432 432 433 UI GChooserItem* UIGChooserModel::focusItem() const433 UIChooserItem* UIChooserModel::focusItem() const 434 434 { 435 435 return m_pFocusItem; 436 436 } 437 437 438 void UI GChooserModel::setFocusItem(UIGChooserItem *pItem)438 void UIChooserModel::setFocusItem(UIChooserItem *pItem) 439 439 { 440 440 /* Make sure real focus unset: */ … … 446 446 447 447 /* Remember old focus-item: */ 448 UI GChooserItem *pOldFocusItem = m_pFocusItem;448 UIChooserItem *pOldFocusItem = m_pFocusItem; 449 449 450 450 /* Set new focus-item: */ … … 462 462 } 463 463 464 UI GChooserItem* UIGChooserModel::mainRoot() const464 UIChooserItem* UIChooserModel::mainRoot() const 465 465 { 466 466 return m_rootStack.first(); 467 467 } 468 468 469 UI GChooserItem* UIGChooserModel::root() const469 UIChooserItem* UIChooserModel::root() const 470 470 { 471 471 return m_rootStack.last(); 472 472 } 473 473 474 void UI GChooserModel::indentRoot(UIGChooserItem *pNewRootItem)474 void UIChooserModel::indentRoot(UIChooserItem *pNewRootItem) 475 475 { 476 476 /* Do nothing if sliding already: */ … … 487 487 /* Create left root: */ 488 488 bool fLeftRootIsMain = root() == mainRoot(); 489 m_pLeftRoot = new UI GChooserItemGroup(scene(), root()->toGroupItem(), fLeftRootIsMain);489 m_pLeftRoot = new UIChooserItemGroup(scene(), root()->toGroupItem(), fLeftRootIsMain); 490 490 m_pLeftRoot->setPos(0, 0); 491 491 m_pLeftRoot->resize(root()->geometry().size()); 492 492 493 493 /* Create right root: */ 494 m_pRightRoot = new UI GChooserItemGroup(scene(), pNewRootItem->toGroupItem(), false);494 m_pRightRoot = new UIChooserItemGroup(scene(), pNewRootItem->toGroupItem(), false); 495 495 m_pRightRoot->setPos(root()->geometry().width(), 0); 496 496 m_pRightRoot->resize(root()->geometry().size()); … … 506 506 } 507 507 508 void UI GChooserModel::unindentRoot()508 void UIChooserModel::unindentRoot() 509 509 { 510 510 /* Do nothing if sliding already: */ … … 522 522 /* Create left root: */ 523 523 bool fLeftRootIsMain = m_rootStack.at(m_rootStack.size() - 2) == mainRoot(); 524 m_pLeftRoot = new UI GChooserItemGroup(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); 525 525 m_pLeftRoot->setPos(- root()->geometry().width(), 0); 526 526 m_pLeftRoot->resize(root()->geometry().size()); 527 527 528 528 /* Create right root: */ 529 m_pRightRoot = new UI GChooserItemGroup(scene(), root()->toGroupItem(), false);529 m_pRightRoot = new UIChooserItemGroup(scene(), root()->toGroupItem(), false); 530 530 m_pRightRoot->setPos(0, 0); 531 531 m_pRightRoot->resize(root()->geometry().size()); … … 540 540 } 541 541 542 bool UI GChooserModel::isSlidingInProgress() const542 bool UIChooserModel::isSlidingInProgress() const 543 543 { 544 544 return m_fSliding; 545 545 } 546 546 547 void UI GChooserModel::startEditingGroupItemName()547 void UIChooserModel::startEditingGroupItemName() 548 548 { 549 549 sltEditGroupName(); 550 550 } 551 551 552 void UI GChooserModel::cleanupGroupTree()552 void UIChooserModel::cleanupGroupTree() 553 553 { 554 554 cleanupGroupTree(mainRoot()); … … 556 556 557 557 /* static */ 558 QString UI GChooserModel::uniqueGroupName(UIGChooserItem *pRoot)558 QString UIChooserModel::uniqueGroupName(UIChooserItem *pRoot) 559 559 { 560 560 /* Enumerate all the group names: */ 561 561 QStringList groupNames; 562 foreach (UI GChooserItem *pItem, pRoot->items(UIGChooserItemType_Group))562 foreach (UIChooserItem *pItem, pRoot->items(UIChooserItemType_Group)) 563 563 groupNames << pItem->name(); 564 564 … … 587 587 } 588 588 589 void UI GChooserModel::activateMachineItem()589 void UIChooserModel::activateMachineItem() 590 590 { 591 591 actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow)->activate(QAction::Trigger); 592 592 } 593 593 594 void UI GChooserModel::setCurrentDragObject(QDrag *pDragObject)594 void UIChooserModel::setCurrentDragObject(QDrag *pDragObject) 595 595 { 596 596 /* Make sure real focus unset: */ … … 602 602 } 603 603 604 void UI GChooserModel::lookFor(const QString &strLookupSymbol)604 void UIChooserModel::lookFor(const QString &strLookupSymbol) 605 605 { 606 606 /* Restart timer to reset lookup-string: */ … … 608 608 609 609 /* Prepare item: */ 610 UI GChooserItem *pItem = 0;610 UIChooserItem *pItem = 0; 611 611 612 612 /* We are starting to look from the current position: */ … … 626 626 for (int iIndex = iFirstIndex; iIndex < navigationList().size(); ++iIndex) 627 627 { 628 UI GChooserItem *pIteratedItem = navigationList().at(iIndex);628 UIChooserItem *pIteratedItem = navigationList().at(iIndex); 629 629 if (pIteratedItem->name().startsWith(strLookupString, Qt::CaseInsensitive)) 630 630 { … … 641 641 for (int iIndex = 0; iIndex < iFirstIndex; ++iIndex) 642 642 { 643 UI GChooserItem *pIteratedItem = navigationList().at(iIndex);643 UIChooserItem *pIteratedItem = navigationList().at(iIndex); 644 644 if (pIteratedItem->name().startsWith(strLookupString, Qt::CaseInsensitive)) 645 645 { … … 662 662 } 663 663 664 bool UI GChooserModel::isLookupInProgress() const664 bool UIChooserModel::isLookupInProgress() const 665 665 { 666 666 return m_pLookupTimer->isActive(); 667 667 } 668 668 669 void UI GChooserModel::saveGroupSettings()669 void UIChooserModel::saveGroupSettings() 670 670 { 671 671 emit sigStartGroupSaving(); 672 672 } 673 673 674 bool UI GChooserModel::isGroupSavingInProgress() const675 { 676 return UI GroupDefinitionSaveThread::instance() ||677 UI GroupOrderSaveThread::instance();678 } 679 680 void UI GChooserModel::sltMachineStateChanged(QString strId, KMachineState)674 bool UIChooserModel::isGroupSavingInProgress() const 675 { 676 return UIThreadGroupDefinitionSave::instance() || 677 UIThreadGroupOrderSave::instance(); 678 } 679 680 void UIChooserModel::sltMachineStateChanged(QString strId, KMachineState) 681 681 { 682 682 /* Update machine-items with passed id: */ … … 684 684 } 685 685 686 void UI GChooserModel::sltMachineDataChanged(QString strId)686 void UIChooserModel::sltMachineDataChanged(QString strId) 687 687 { 688 688 /* Update machine-items with passed id: */ … … 690 690 } 691 691 692 void UI GChooserModel::sltMachineRegistered(QString strId, bool fRegistered)692 void UIChooserModel::sltMachineRegistered(QString strId, bool fRegistered) 693 693 { 694 694 /* New VM registered? */ … … 709 709 { 710 710 setCurrentItem(mainRoot()->searchForItem(machine.GetName(), 711 UI GChooserItemSearchFlag_Machine |712 UI GChooserItemSearchFlag_ExactName));711 UIChooserItemSearchFlag_Machine | 712 UIChooserItemSearchFlag_ExactName)); 713 713 } 714 714 } … … 734 734 } 735 735 736 void UI GChooserModel::sltSessionStateChanged(QString strId, KSessionState)736 void UIChooserModel::sltSessionStateChanged(QString strId, KSessionState) 737 737 { 738 738 /* Update machine-items with passed id: */ … … 740 740 } 741 741 742 void UI GChooserModel::sltSnapshotChanged(QString strId, QString)742 void UIChooserModel::sltSnapshotChanged(QString strId, QString) 743 743 { 744 744 /* Update machine-items with passed id: */ … … 746 746 } 747 747 748 void UI GChooserModel::sltHandleViewResized()748 void UIChooserModel::sltHandleViewResized() 749 749 { 750 750 /* Relayout: */ … … 752 752 } 753 753 754 void UI GChooserModel::sltFocusItemDestroyed()754 void UIChooserModel::sltFocusItemDestroyed() 755 755 { 756 756 AssertMsgFailed(("Focus item destroyed!")); 757 757 } 758 758 759 void UI GChooserModel::sltLeftRootSlidingProgress()759 void UIChooserModel::sltLeftRootSlidingProgress() 760 760 { 761 761 /* Update left root: */ … … 764 764 } 765 765 766 void UI GChooserModel::sltRightRootSlidingProgress()766 void UIChooserModel::sltRightRootSlidingProgress() 767 767 { 768 768 /* Update right root: */ … … 771 771 } 772 772 773 void UI GChooserModel::sltSlidingComplete()773 void UIChooserModel::sltSlidingComplete() 774 774 { 775 775 /* Delete temporary roots: */ … … 803 803 } 804 804 805 void UI GChooserModel::sltEditGroupName()805 void UIChooserModel::sltEditGroupName() 806 806 { 807 807 /* Check if action is enabled: */ … … 817 817 } 818 818 819 void UI GChooserModel::sltSortGroup()819 void UIChooserModel::sltSortGroup() 820 820 { 821 821 /* Check if action is enabled: */ … … 831 831 } 832 832 833 void UI GChooserModel::sltUngroupSelectedGroup()833 void UIChooserModel::sltUngroupSelectedGroup() 834 834 { 835 835 /* Check if action is enabled: */ … … 838 838 839 839 /* Make sure focus item is of group type! */ 840 AssertMsg(focusItem()->type() == UI GChooserItemType_Group, ("This is not group-item!"));840 AssertMsg(focusItem()->type() == UIChooserItemType_Group, ("This is not group-item!")); 841 841 842 842 /* Check if we have collisions with our siblings: */ 843 UI GChooserItem *pFocusItem = focusItem();844 UI GChooserItem *pParentItem = pFocusItem->parentItem();845 QList<UI GChooserItem*> siblings = pParentItem->items();846 QList<UI GChooserItem*> toBeRenamed;847 QList<UI GChooserItem*> toBeRemoved;848 foreach (UI GChooserItem *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()) 849 849 { 850 850 QString strItemName = pItem->name(); 851 UI GChooserItem *pCollisionSibling = 0;852 foreach (UI GChooserItem *pSibling, siblings)851 UIChooserItem *pCollisionSibling = 0; 852 foreach (UIChooserItem *pSibling, siblings) 853 853 if (pSibling != pFocusItem && pSibling->name() == strItemName) 854 854 pCollisionSibling = pSibling; 855 855 if (pCollisionSibling) 856 856 { 857 if (pItem->type() == UI GChooserItemType_Machine)857 if (pItem->type() == UIChooserItemType_Machine) 858 858 { 859 if (pCollisionSibling->type() == UI GChooserItemType_Machine)859 if (pCollisionSibling->type() == UIChooserItemType_Machine) 860 860 toBeRemoved << pItem; 861 else if (pCollisionSibling->type() == UI GChooserItemType_Group)861 else if (pCollisionSibling->type() == UIChooserItemType_Group) 862 862 { 863 863 msgCenter().cannotResolveCollisionAutomatically(strItemName, pParentItem->name()); … … 865 865 } 866 866 } 867 else if (pItem->type() == UI GChooserItemType_Group)867 else if (pItem->type() == UIChooserItemType_Group) 868 868 { 869 869 if (msgCenter().confirmAutomaticCollisionResolve(strItemName, pParentItem->name())) … … 876 876 877 877 /* Copy all the children into our parent: */ 878 foreach (UI GChooserItem *pItem, pFocusItem->items())878 foreach (UIChooserItem *pItem, pFocusItem->items()) 879 879 { 880 880 if (toBeRemoved.contains(pItem)) … … 882 882 switch (pItem->type()) 883 883 { 884 case UI GChooserItemType_Group:884 case UIChooserItemType_Group: 885 885 { 886 UI GChooserItemGroup *pGroupItem = new UIGChooserItemGroup(pParentItem, pItem->toGroupItem());886 UIChooserItemGroup *pGroupItem = new UIChooserItemGroup(pParentItem, pItem->toGroupItem()); 887 887 if (toBeRenamed.contains(pItem)) 888 888 pGroupItem->setName(uniqueGroupName(pParentItem)); 889 889 break; 890 890 } 891 case UI GChooserItemType_Machine:891 case UIChooserItemType_Machine: 892 892 { 893 new UI GChooserItemMachine(pParentItem, pItem->toMachineItem());893 new UIChooserItemMachine(pParentItem, pItem->toMachineItem()); 894 894 break; 895 895 } … … 907 907 } 908 908 909 void UI GChooserModel::sltCreateNewMachine()909 void UIChooserModel::sltCreateNewMachine() 910 910 { 911 911 /* Check if action is enabled: */ … … 914 914 915 915 /* Choose the parent: */ 916 UI GChooserItem *pGroup = 0;916 UIChooserItem *pGroup = 0; 917 917 if (isSingleGroupSelected()) 918 918 pGroup = currentItem(); … … 946 946 } 947 947 948 void UI GChooserModel::sltGroupSelectedMachines()948 void UIChooserModel::sltGroupSelectedMachines() 949 949 { 950 950 /* Check if action is enabled: */ … … 953 953 954 954 /* Create new group in the current root: */ 955 UI GChooserItemGroup *pNewGroupItem = new UIGChooserItemGroup(root(), uniqueGroupName(root()), true);955 UIChooserItemGroup *pNewGroupItem = new UIChooserItemGroup(root(), uniqueGroupName(root()), true); 956 956 /* Enumerate all the currently chosen items: */ 957 957 QStringList busyGroupNames; 958 958 QStringList busyMachineNames; 959 QList<UI GChooserItem*> selectedItems = currentItems();960 foreach (UI GChooserItem *pItem, selectedItems)959 QList<UIChooserItem*> selectedItems = currentItems(); 960 foreach (UIChooserItem *pItem, selectedItems) 961 961 { 962 962 /* For each of known types: */ 963 963 switch (pItem->type()) 964 964 { 965 case UI GChooserItemType_Group:965 case UIChooserItemType_Group: 966 966 { 967 967 /* Avoid name collisions: */ … … 971 971 busyGroupNames << pItem->name(); 972 972 /* Copy or move group-item: */ 973 new UI GChooserItemGroup(pNewGroupItem, pItem->toGroupItem());973 new UIChooserItemGroup(pNewGroupItem, pItem->toGroupItem()); 974 974 delete pItem; 975 975 break; 976 976 } 977 case UI GChooserItemType_Machine:977 case UIChooserItemType_Machine: 978 978 { 979 979 /* Avoid name collisions: */ … … 983 983 busyMachineNames << pItem->name(); 984 984 /* Copy or move machine item: */ 985 new UI GChooserItemMachine(pNewGroupItem, pItem->toMachineItem());985 new UIChooserItemMachine(pNewGroupItem, pItem->toMachineItem()); 986 986 delete pItem; 987 987 break; … … 997 997 } 998 998 999 void UI GChooserModel::sltReloadMachine(const QString &strId)999 void UIChooserModel::sltReloadMachine(const QString &strId) 1000 1000 { 1001 1001 /* Remove all the items first: */ … … 1021 1021 } 1022 1022 1023 void UI GChooserModel::sltSortParentGroup()1023 void UIChooserModel::sltSortParentGroup() 1024 1024 { 1025 1025 /* Check if action is enabled: */ … … 1035 1035 } 1036 1036 1037 void UI GChooserModel::sltPerformRefreshAction()1037 void UIChooserModel::sltPerformRefreshAction() 1038 1038 { 1039 1039 /* Check if action is enabled: */ … … 1042 1042 1043 1043 /* Gather list of current unique inaccessible machine-items: */ 1044 QList<UI GChooserItemMachine*> inaccessibleMachineItemList;1045 UI GChooserItemMachine::enumerateMachineItems(currentItems(), inaccessibleMachineItemList,1046 UI GChooserItemMachineEnumerationFlag_Unique |1047 UI GChooserItemMachineEnumerationFlag_Inaccessible);1044 QList<UIChooserItemMachine*> inaccessibleMachineItemList; 1045 UIChooserItemMachine::enumerateMachineItems(currentItems(), inaccessibleMachineItemList, 1046 UIChooserItemMachineEnumerationFlag_Unique | 1047 UIChooserItemMachineEnumerationFlag_Inaccessible); 1048 1048 1049 1049 /* For each machine-item: */ 1050 UI GChooserItem *pSelectedItem = 0;1051 foreach (UI GChooserItemMachine *pItem, inaccessibleMachineItemList)1050 UIChooserItem *pSelectedItem = 0; 1051 foreach (UIChooserItemMachine *pItem, inaccessibleMachineItemList) 1052 1052 { 1053 1053 /* Recache: */ … … 1063 1063 if (!pSelectedItem) 1064 1064 pSelectedItem = mainRoot()->searchForItem(strMachineName, 1065 UI GChooserItemSearchFlag_Machine |1066 UI GChooserItemSearchFlag_ExactName);1065 UIChooserItemSearchFlag_Machine | 1066 UIChooserItemSearchFlag_ExactName); 1067 1067 } 1068 1068 } … … 1076 1076 } 1077 1077 1078 void UI GChooserModel::sltRemoveSelectedMachine()1078 void UIChooserModel::sltRemoveSelectedMachine() 1079 1079 { 1080 1080 /* Check if action is enabled: */ … … 1083 1083 1084 1084 /* Enumerate all the selected machine-items: */ 1085 QList<UI GChooserItemMachine*> selectedMachineItemList;1086 UI GChooserItemMachine::enumerateMachineItems(currentItems(), selectedMachineItemList);1085 QList<UIChooserItemMachine*> selectedMachineItemList; 1086 UIChooserItemMachine::enumerateMachineItems(currentItems(), selectedMachineItemList); 1087 1087 /* Enumerate all the existing machine-items: */ 1088 QList<UI GChooserItemMachine*> existingMachineItemList;1089 UI GChooserItemMachine::enumerateMachineItems(mainRoot()->items(), existingMachineItemList);1088 QList<UIChooserItemMachine*> existingMachineItemList; 1089 UIChooserItemMachine::enumerateMachineItems(mainRoot()->items(), existingMachineItemList); 1090 1090 1091 1091 /* Prepare arrays: */ 1092 1092 QMap<QString, bool> verdicts; 1093 QList<UI GChooserItem*> itemsToRemove;1093 QList<UIChooserItem*> itemsToRemove; 1094 1094 QStringList machinesToUnregister; 1095 1095 1096 1096 /* For each selected machine-item: */ 1097 foreach (UI GChooserItem *pItem, selectedMachineItemList)1097 foreach (UIChooserItem *pItem, selectedMachineItemList) 1098 1098 { 1099 1099 /* Get machine-item id: */ … … 1111 1111 /* Selected copy count: */ 1112 1112 int iSelectedCopyCount = 0; 1113 foreach (UI GChooserItem *pSelectedItem, selectedMachineItemList)1113 foreach (UIChooserItem *pSelectedItem, selectedMachineItemList) 1114 1114 if (pSelectedItem->toMachineItem()->id() == strId) 1115 1115 ++iSelectedCopyCount; 1116 1116 /* Existing copy count: */ 1117 1117 int iExistingCopyCount = 0; 1118 foreach (UI GChooserItem *pExistingItem, existingMachineItemList)1118 foreach (UIChooserItem *pExistingItem, existingMachineItemList) 1119 1119 if (pExistingItem->toMachineItem()->id() == strId) 1120 1120 ++iExistingCopyCount; … … 1138 1138 } 1139 1139 1140 void UI GChooserModel::sltStartScrolling()1140 void UIChooserModel::sltStartScrolling() 1141 1141 { 1142 1142 /* Should we scroll? */ … … 1183 1183 } 1184 1184 1185 void UI GChooserModel::sltCurrentDragObjectDestroyed()1185 void UIChooserModel::sltCurrentDragObjectDestroyed() 1186 1186 { 1187 1187 root()->resetDragToken(); 1188 1188 } 1189 1189 1190 void UI GChooserModel::sltEraseLookupTimer()1190 void UIChooserModel::sltEraseLookupTimer() 1191 1191 { 1192 1192 m_pLookupTimer->stop(); … … 1194 1194 } 1195 1195 1196 void UI GChooserModel::sltGroupSavingStart()1196 void UIChooserModel::sltGroupSavingStart() 1197 1197 { 1198 1198 saveGroupDefinitions(); … … 1200 1200 } 1201 1201 1202 void UI GChooserModel::sltGroupDefinitionsSaveComplete()1202 void UIChooserModel::sltGroupDefinitionsSaveComplete() 1203 1203 { 1204 1204 makeSureGroupDefinitionsSaveIsFinished(); … … 1206 1206 } 1207 1207 1208 void UI GChooserModel::sltGroupOrdersSaveComplete()1208 void UIChooserModel::sltGroupOrdersSaveComplete() 1209 1209 { 1210 1210 makeSureGroupOrdersSaveIsFinished(); … … 1212 1212 } 1213 1213 1214 QVariant UI GChooserModel::data(int iKey) const1214 QVariant UIChooserModel::data(int iKey) const 1215 1215 { 1216 1216 switch (iKey) … … 1222 1222 } 1223 1223 1224 void UI GChooserModel::prepareScene()1224 void UIChooserModel::prepareScene() 1225 1225 { 1226 1226 m_pScene = new QGraphicsScene(this); … … 1228 1228 } 1229 1229 1230 void UI GChooserModel::prepareRoot()1231 { 1232 m_rootStack << new UI GChooserItemGroup(scene());1233 } 1234 1235 void UI GChooserModel::prepareLookup()1230 void UIChooserModel::prepareRoot() 1231 { 1232 m_rootStack << new UIChooserItemGroup(scene()); 1233 } 1234 1235 void UIChooserModel::prepareLookup() 1236 1236 { 1237 1237 m_pLookupTimer = new QTimer(this); … … 1241 1241 } 1242 1242 1243 void UI GChooserModel::prepareContextMenu()1243 void UIChooserModel::prepareContextMenu() 1244 1244 { 1245 1245 /* Context menu for group(s): */ … … 1311 1311 } 1312 1312 1313 void UI GChooserModel::prepareHandlers()1314 { 1315 m_pMouseHandler = new UI GChooserHandlerMouse(this);1316 m_pKeyboardHandler = new UI GChooserHandlerKeyboard(this);1317 } 1318 1319 void UI GChooserModel::prepareConnections()1313 void UIChooserModel::prepareHandlers() 1314 { 1315 m_pMouseHandler = new UIChooserHandlerMouse(this); 1316 m_pKeyboardHandler = new UIChooserHandlerKeyboard(this); 1317 } 1318 1319 void UIChooserModel::prepareConnections() 1320 1320 { 1321 1321 /* Setup parent connections: */ … … 1350 1350 } 1351 1351 1352 void UI GChooserModel::loadLastSelectedItem()1352 void UIChooserModel::loadLastSelectedItem() 1353 1353 { 1354 1354 /* Load last selected item (choose first if unable to load): */ … … 1358 1358 } 1359 1359 1360 void UI GChooserModel::saveLastSelectedItem()1360 void UIChooserModel::saveLastSelectedItem() 1361 1361 { 1362 1362 /* Save last selected item: */ … … 1364 1364 } 1365 1365 1366 void UI GChooserModel::cleanupHandlers()1366 void UIChooserModel::cleanupHandlers() 1367 1367 { 1368 1368 delete m_pKeyboardHandler; … … 1372 1372 } 1373 1373 1374 void UI GChooserModel::cleanupContextMenu()1374 void UIChooserModel::cleanupContextMenu() 1375 1375 { 1376 1376 delete m_pContextMenuGroup; … … 1380 1380 } 1381 1381 1382 void UI GChooserModel::cleanupLookup()1382 void UIChooserModel::cleanupLookup() 1383 1383 { 1384 1384 delete m_pLookupTimer; … … 1386 1386 } 1387 1387 1388 void UI GChooserModel::cleanupRoot()1388 void UIChooserModel::cleanupRoot() 1389 1389 { 1390 1390 delete mainRoot(); … … 1392 1392 } 1393 1393 1394 void UI GChooserModel::cleanupScene()1394 void UIChooserModel::cleanupScene() 1395 1395 { 1396 1396 delete m_pScene; … … 1398 1398 } 1399 1399 1400 bool UI GChooserModel::eventFilter(QObject *pWatched, QEvent *pEvent)1400 bool UIChooserModel::eventFilter(QObject *pWatched, QEvent *pEvent) 1401 1401 { 1402 1402 /* Process only scene events: */ … … 1439 1439 } 1440 1440 1441 QList<UI GChooserItem*> UIGChooserModel::createNavigationList(UIGChooserItem *pItem)1441 QList<UIChooserItem*> UIChooserModel::createNavigationList(UIChooserItem *pItem) 1442 1442 { 1443 1443 /* Prepare navigation list: */ 1444 QList<UI GChooserItem*> navigationItems;1444 QList<UIChooserItem*> navigationItems; 1445 1445 1446 1446 /* Iterate over all the group-items: */ 1447 foreach (UI GChooserItem *pGroupItem, pItem->items(UIGChooserItemType_Group))1447 foreach (UIChooserItem *pGroupItem, pItem->items(UIChooserItemType_Group)) 1448 1448 { 1449 1449 navigationItems << pGroupItem; … … 1452 1452 } 1453 1453 /* Iterate over all the machine-items: */ 1454 foreach (UI GChooserItem *pMachineItem, pItem->items(UIGChooserItemType_Machine))1454 foreach (UIChooserItem *pMachineItem, pItem->items(UIChooserItemType_Machine)) 1455 1455 navigationItems << pMachineItem; 1456 1456 … … 1459 1459 } 1460 1460 1461 void UI GChooserModel::clearRealFocus()1461 void UIChooserModel::clearRealFocus() 1462 1462 { 1463 1463 /* Set the real focus to null: */ … … 1465 1465 } 1466 1466 1467 void UI GChooserModel::slideRoot(bool fForward)1467 void UIChooserModel::slideRoot(bool fForward) 1468 1468 { 1469 1469 /* Animation group: */ … … 1503 1503 } 1504 1504 1505 void UI GChooserModel::cleanupGroupTree(UIGChooserItem *pParent)1505 void UIChooserModel::cleanupGroupTree(UIChooserItem *pParent) 1506 1506 { 1507 1507 /* Cleanup all the group-items recursively first: */ 1508 foreach (UI GChooserItem *pItem, pParent->items(UIGChooserItemType_Group))1508 foreach (UIChooserItem *pItem, pParent->items(UIChooserItemType_Group)) 1509 1509 cleanupGroupTree(pItem); 1510 1510 /* If parent has no items: */ … … 1520 1520 } 1521 1521 1522 void UI GChooserModel::removeItems(const QList<UIGChooserItem*> &itemsToRemove)1522 void UIChooserModel::removeItems(const QList<UIChooserItem*> &itemsToRemove) 1523 1523 { 1524 1524 /* Confirm machine-items removal: */ 1525 1525 QStringList names; 1526 foreach (UI GChooserItem *pItem, itemsToRemove)1526 foreach (UIChooserItem *pItem, itemsToRemove) 1527 1527 names << pItem->name(); 1528 1528 if (!msgCenter().confirmMachineItemRemoval(names)) … … 1530 1530 1531 1531 /* Remove all the passed items: */ 1532 foreach (UI GChooserItem *pItem, itemsToRemove)1532 foreach (UIChooserItem *pItem, itemsToRemove) 1533 1533 delete pItem; 1534 1534 … … 1544 1544 } 1545 1545 1546 void UI GChooserModel::unregisterMachines(const QStringList &ids)1546 void UIChooserModel::unregisterMachines(const QStringList &ids) 1547 1547 { 1548 1548 /* Populate machine list: */ … … 1612 1612 } 1613 1613 1614 bool UI GChooserModel::processContextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent)1614 bool UIChooserModel::processContextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent) 1615 1615 { 1616 1616 /* Whats the reason? */ … … 1625 1625 switch (pItem->type()) 1626 1626 { 1627 case UI GChooserItemType_Group:1627 case UIChooserItemType_Group: 1628 1628 { 1629 1629 /* Get group-item: */ 1630 UI GChooserItem *pGroupItem = qgraphicsitem_cast<UIGChooserItemGroup*>(pItem);1630 UIChooserItem *pGroupItem = qgraphicsitem_cast<UIChooserItemGroup*>(pItem); 1631 1631 /* Make sure thats not root: */ 1632 1632 if (pGroupItem->isRoot()) … … 1641 1641 } 1642 1642 RT_FALL_THRU(); 1643 case UI GChooserItemType_Machine:1643 case UIChooserItemType_Machine: 1644 1644 { 1645 1645 /* Machine context menu for other Group/Machine cases: */ … … 1656 1656 { 1657 1657 /* Get first selected item: */ 1658 if (UI GChooserItem *pItem = currentItem())1658 if (UIChooserItem *pItem = currentItem()) 1659 1659 { 1660 1660 /* If this item of known type? */ 1661 1661 switch (pItem->type()) 1662 1662 { 1663 case UI GChooserItemType_Group:1663 case UIChooserItemType_Group: 1664 1664 { 1665 1665 /* Is this group-item only the one selected? */ … … 1672 1672 } 1673 1673 RT_FALL_THRU(); 1674 case UI GChooserItemType_Machine:1674 case UIChooserItemType_Machine: 1675 1675 { 1676 1676 /* Machine context menu for other Group/Machine cases: */ … … 1691 1691 } 1692 1692 1693 void UI GChooserModel::popupContextMenu(UIGraphicsSelectorContextMenuType type, QPoint point)1693 void UIChooserModel::popupContextMenu(UIGraphicsSelectorContextMenuType type, QPoint point) 1694 1694 { 1695 1695 /* Which type of context-menu requested? */ … … 1711 1711 } 1712 1712 1713 bool UI GChooserModel::processDragMoveEvent(QGraphicsSceneDragDropEvent *pEvent)1713 bool UIChooserModel::processDragMoveEvent(QGraphicsSceneDragDropEvent *pEvent) 1714 1714 { 1715 1715 /* Do we scrolling already? */ … … 1735 1735 } 1736 1736 1737 bool UI GChooserModel::processDragLeaveEvent(QGraphicsSceneDragDropEvent *pEvent)1737 bool UIChooserModel::processDragLeaveEvent(QGraphicsSceneDragDropEvent *pEvent) 1738 1738 { 1739 1739 /* Event object is not required here: */ … … 1748 1748 } 1749 1749 1750 void UI GChooserModel::loadGroupTree()1750 void UIChooserModel::loadGroupTree() 1751 1751 { 1752 1752 /* Add all the approved machines we have into the group-tree: */ 1753 LogRelFlow(("UI GChooserModel: Loading VMs...\n"));1753 LogRelFlow(("UIChooserModel: Loading VMs...\n")); 1754 1754 foreach (CMachine machine, vboxGlobal().virtualBox().GetMachines()) 1755 1755 { … … 1758 1758 addMachineIntoTheTree(machine); 1759 1759 } 1760 LogRelFlow(("UI GChooserModel: VMs loaded.\n"));1761 } 1762 1763 void UI GChooserModel::addMachineIntoTheTree(const CMachine &machine, bool fMakeItVisible /* = false */)1760 LogRelFlow(("UIChooserModel: VMs loaded.\n")); 1761 } 1762 1763 void UIChooserModel::addMachineIntoTheTree(const CMachine &machine, bool fMakeItVisible /* = false */) 1764 1764 { 1765 1765 /* Make sure passed VM is not NULL: */ 1766 1766 if (machine.isNull()) 1767 LogRelFlow(("UI GChooserModel: ERROR: Passed VM is NULL!\n"));1767 LogRelFlow(("UIChooserModel: ERROR: Passed VM is NULL!\n")); 1768 1768 AssertReturnVoid(!machine.isNull()); 1769 1769 1770 1770 /* Which VM we are loading: */ 1771 LogRelFlow(("UI GChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toUtf8().constData()));1771 LogRelFlow(("UIChooserModel: Loading VM with ID={%s}...\n", machine.GetId().toUtf8().constData())); 1772 1772 /* Is that machine accessible? */ 1773 1773 if (machine.GetAccessible()) … … 1775 1775 /* VM is accessible: */ 1776 1776 QString strName = machine.GetName(); 1777 LogRelFlow(("UI GChooserModel: VM {%s} is accessible.\n", strName.toUtf8().constData()));1777 LogRelFlow(("UIChooserModel: VM {%s} is accessible.\n", strName.toUtf8().constData())); 1778 1778 /* Which groups passed machine attached to? */ 1779 1779 QVector<QString> groups = machine.GetGroups(); 1780 1780 QStringList groupList = groups.toList(); 1781 1781 QString strGroups = groupList.join(", "); 1782 LogRelFlow(("UI GChooserModel: VM {%s} has groups: {%s}.\n", strName.toUtf8().constData(),1782 LogRelFlow(("UIChooserModel: VM {%s} has groups: {%s}.\n", strName.toUtf8().constData(), 1783 1783 strGroups.toUtf8().constData())); 1784 1784 foreach (QString strGroup, groups) … … 1788 1788 strGroup.truncate(strGroup.size() - 1); 1789 1789 /* Create machine-item with found group-item as parent: */ 1790 LogRelFlow(("UI GChooserModel: 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(), 1791 1791 strGroup.toUtf8().constData())); 1792 1792 createMachineItem(machine, getGroupItem(strGroup, mainRoot(), fMakeItVisible)); … … 1799 1799 { 1800 1800 /* VM is accessible: */ 1801 LogRelFlow(("UI GChooserModel: VM {%s} is inaccessible.\n", machine.GetId().toUtf8().constData()));1801 LogRelFlow(("UIChooserModel: VM {%s} is inaccessible.\n", machine.GetId().toUtf8().constData())); 1802 1802 /* Create machine-item with main-root group-item as parent: */ 1803 1803 createMachineItem(machine, mainRoot()); … … 1805 1805 } 1806 1806 1807 UI GChooserItem* UIGChooserModel::getGroupItem(const QString &strName, UIGChooserItem *pParentItem, bool fAllGroupsOpened)1807 UIChooserItem* UIChooserModel::getGroupItem(const QString &strName, UIChooserItem *pParentItem, bool fAllGroupsOpened) 1808 1808 { 1809 1809 /* Check passed stuff: */ … … 1823 1823 AssertMsg(!strFirstSuffix.isEmpty(), ("Invalid group name!")); 1824 1824 /* Trying to get group-item among our children: */ 1825 foreach (UI GChooserItem *pGroupItem, pParentItem->items(UIGChooserItemType_Group))1825 foreach (UIChooserItem *pGroupItem, pParentItem->items(UIChooserItemType_Group)) 1826 1826 { 1827 1827 if (pGroupItem->name() == strSecondSubName) 1828 1828 { 1829 UI GChooserItem *pFoundItem = getGroupItem(strFirstSuffix, pGroupItem, fAllGroupsOpened);1830 if (UI GChooserItemGroup *pFoundGroupItem = pFoundItem->toGroupItem())1829 UIChooserItem *pFoundItem = getGroupItem(strFirstSuffix, pGroupItem, fAllGroupsOpened); 1830 if (UIChooserItemGroup *pFoundGroupItem = pFoundItem->toGroupItem()) 1831 1831 if (fAllGroupsOpened && pFoundGroupItem->isClosed()) 1832 1832 pFoundGroupItem->open(false); … … 1837 1837 1838 1838 /* Found nothing? Creating: */ 1839 UI GChooserItemGroup *pNewGroupItem =1840 new UI GChooserItemGroup(/* Parent item and desired group name: */1839 UIChooserItemGroup *pNewGroupItem = 1840 new UIChooserItemGroup(/* Parent item and desired group name: */ 1841 1841 pParentItem, strSecondSubName, 1842 1842 /* Should be new group opened when created? */ 1843 1843 fAllGroupsOpened || shouldBeGroupOpened(pParentItem, strSecondSubName), 1844 1844 /* Which position new group-item should be placed in? */ 1845 getDesiredPosition(pParentItem, UI GChooserItemType_Group, strSecondSubName));1845 getDesiredPosition(pParentItem, UIChooserItemType_Group, strSecondSubName)); 1846 1846 return strSecondSuffix.isEmpty() ? pNewGroupItem : getGroupItem(strFirstSuffix, pNewGroupItem, fAllGroupsOpened); 1847 1847 } 1848 1848 1849 bool UI GChooserModel::shouldBeGroupOpened(UIGChooserItem *pParentItem, const QString &strName)1849 bool UIChooserModel::shouldBeGroupOpened(UIChooserItem *pParentItem, const QString &strName) 1850 1850 { 1851 1851 /* Read group definitions: */ … … 1875 1875 } 1876 1876 1877 int UI GChooserModel::getDesiredPosition(UIGChooserItem *pParentItem, UIGChooserItemType type, const QString &strName)1877 int UIChooserModel::getDesiredPosition(UIChooserItem *pParentItem, UIChooserItemType type, const QString &strName) 1878 1878 { 1879 1879 /* End of list (by default)? */ … … 1887 1887 iNewItemDesiredPosition = 0; 1888 1888 /* We have to check all the existing item positions: */ 1889 QList<UI GChooserItem*> items = pParentItem->items(type);1889 QList<UIChooserItem*> items = pParentItem->items(type); 1890 1890 for (int i = items.size() - 1; i >= 0; --i) 1891 1891 { 1892 1892 /* Get current item: */ 1893 UI GChooserItem *pItem = items[i];1893 UIChooserItem *pItem = items[i]; 1894 1894 /* Which position should be current item placed by definitions? */ 1895 QString strDefinitionName = pItem->type() == UI GChooserItemType_Group ? pItem->name() :1896 pItem->type() == UI GChooserItemType_Machine ? pItem->toMachineItem()->id() :1895 QString strDefinitionName = pItem->type() == UIChooserItemType_Group ? pItem->name() : 1896 pItem->type() == UIChooserItemType_Machine ? pItem->toMachineItem()->id() : 1897 1897 QString(); 1898 1898 AssertMsg(!strDefinitionName.isEmpty(), ("Wrong definition name!")); … … 1914 1914 } 1915 1915 1916 int UI GChooserModel::positionFromDefinitions(UIGChooserItem *pParentItem, UIGChooserItemType type, const QString &strName)1916 int UIChooserModel::positionFromDefinitions(UIChooserItem *pParentItem, UIChooserItemType type, const QString &strName) 1917 1917 { 1918 1918 /* Read group definitions: */ … … 1927 1927 switch (type) 1928 1928 { 1929 case UI GChooserItemType_Group:1929 case UIChooserItemType_Group: 1930 1930 strDefinitionTemplateShort = QString("^g(\\S)*="); 1931 1931 strDefinitionTemplateFull = QString("^g(\\S)*=%1$").arg(strName); 1932 1932 break; 1933 case UI GChooserItemType_Machine:1933 case UIChooserItemType_Machine: 1934 1934 strDefinitionTemplateShort = QString("^m="); 1935 1935 strDefinitionTemplateFull = QString("^m=%1$").arg(strName); … … 1958 1958 } 1959 1959 1960 void UI GChooserModel::createMachineItem(const CMachine &machine, UIGChooserItem *pParentItem)1960 void UIChooserModel::createMachineItem(const CMachine &machine, UIChooserItem *pParentItem) 1961 1961 { 1962 1962 /* Create corresponding item: */ 1963 new UI GChooserItemMachine(/* Parent item and corresponding machine: */1963 new UIChooserItemMachine(/* Parent item and corresponding machine: */ 1964 1964 pParentItem, machine, 1965 1965 /* Which position new group-item should be placed in? */ 1966 getDesiredPosition(pParentItem, UI GChooserItemType_Machine, machine.GetId()));1967 } 1968 1969 void UI GChooserModel::saveGroupDefinitions()1966 getDesiredPosition(pParentItem, UIChooserItemType_Machine, machine.GetId())); 1967 } 1968 1969 void UIChooserModel::saveGroupDefinitions() 1970 1970 { 1971 1971 /* Make sure there is no group save activity: */ 1972 if (UI GroupDefinitionSaveThread::instance())1972 if (UIThreadGroupDefinitionSave::instance()) 1973 1973 return; 1974 1974 … … 1978 1978 1979 1979 /* Save information in other thread: */ 1980 UI GroupDefinitionSaveThread::prepare();1980 UIThreadGroupDefinitionSave::prepare(); 1981 1981 emit sigGroupSavingStateChanged(); 1982 connect(UI GroupDefinitionSaveThread::instance(), SIGNAL(sigReload(QString)),1982 connect(UIThreadGroupDefinitionSave::instance(), SIGNAL(sigReload(QString)), 1983 1983 this, SLOT(sltReloadMachine(QString))); 1984 UI GroupDefinitionSaveThread::instance()->configure(this, m_groups, groups);1985 UI GroupDefinitionSaveThread::instance()->start();1984 UIThreadGroupDefinitionSave::instance()->configure(this, m_groups, groups); 1985 UIThreadGroupDefinitionSave::instance()->start(); 1986 1986 m_groups = groups; 1987 1987 } 1988 1988 1989 void UI GChooserModel::saveGroupOrders()1989 void UIChooserModel::saveGroupOrders() 1990 1990 { 1991 1991 /* Make sure there is no group save activity: */ 1992 if (UI GroupOrderSaveThread::instance())1992 if (UIThreadGroupOrderSave::instance()) 1993 1993 return; 1994 1994 … … 1998 1998 1999 1999 /* Save information in other thread: */ 2000 UI GroupOrderSaveThread::prepare();2000 UIThreadGroupOrderSave::prepare(); 2001 2001 emit sigGroupSavingStateChanged(); 2002 UI GroupOrderSaveThread::instance()->configure(this, groups);2003 UI GroupOrderSaveThread::instance()->start();2004 } 2005 2006 void UI GChooserModel::gatherGroupDefinitions(QMap<QString, QStringList> &groups,2007 UI GChooserItem *pParentGroup)2002 UIThreadGroupOrderSave::instance()->configure(this, groups); 2003 UIThreadGroupOrderSave::instance()->start(); 2004 } 2005 2006 void UIChooserModel::gatherGroupDefinitions(QMap<QString, QStringList> &groups, 2007 UIChooserItem *pParentGroup) 2008 2008 { 2009 2009 /* Iterate over all the machine-items: */ 2010 foreach (UI GChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Machine))2011 if (UI GChooserItemMachine *pMachineItem = pItem->toMachineItem())2010 foreach (UIChooserItem *pItem, pParentGroup->items(UIChooserItemType_Machine)) 2011 if (UIChooserItemMachine *pMachineItem = pItem->toMachineItem()) 2012 2012 if (pMachineItem->accessible()) 2013 2013 groups[pMachineItem->id()] << pParentGroup->fullName(); 2014 2014 /* Iterate over all the group-items: */ 2015 foreach (UI GChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Group))2015 foreach (UIChooserItem *pItem, pParentGroup->items(UIChooserItemType_Group)) 2016 2016 gatherGroupDefinitions(groups, pItem); 2017 2017 } 2018 2018 2019 void UI GChooserModel::gatherGroupOrders(QMap<QString, QStringList> &groups,2020 UI GChooserItem *pParentItem)2019 void UIChooserModel::gatherGroupOrders(QMap<QString, QStringList> &groups, 2020 UIChooserItem *pParentItem) 2021 2021 { 2022 2022 /* Prepare extra-data key for current group: */ 2023 2023 const QString strExtraDataKey = pParentItem->fullName(); 2024 2024 /* Iterate over all the group-items: */ 2025 foreach (UI GChooserItem *pItem, pParentItem->items(UIGChooserItemType_Group))2025 foreach (UIChooserItem *pItem, pParentItem->items(UIChooserItemType_Group)) 2026 2026 { 2027 2027 QString strGroupDescriptor(pItem->toGroupItem()->isOpened() ? "go" : "gc"); … … 2030 2030 } 2031 2031 /* Iterate over all the machine-items: */ 2032 foreach (UI GChooserItem *pItem, pParentItem->items(UIGChooserItemType_Machine))2032 foreach (UIChooserItem *pItem, pParentItem->items(UIChooserItemType_Machine)) 2033 2033 groups[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id()); 2034 2034 } 2035 2035 2036 void UI GChooserModel::makeSureGroupDefinitionsSaveIsFinished()2036 void UIChooserModel::makeSureGroupDefinitionsSaveIsFinished() 2037 2037 { 2038 2038 /* Cleanup if necessary: */ 2039 if (UI GroupDefinitionSaveThread::instance())2040 UI GroupDefinitionSaveThread::cleanup();2041 } 2042 2043 void UI GChooserModel::makeSureGroupOrdersSaveIsFinished()2039 if (UIThreadGroupDefinitionSave::instance()) 2040 UIThreadGroupDefinitionSave::cleanup(); 2041 } 2042 2043 void UIChooserModel::makeSureGroupOrdersSaveIsFinished() 2044 2044 { 2045 2045 /* Cleanup if necessary: */ 2046 if (UI GroupOrderSaveThread::instance())2047 UI GroupOrderSaveThread::cleanup();2046 if (UIThreadGroupOrderSave::instance()) 2047 UIThreadGroupOrderSave::cleanup(); 2048 2048 } 2049 2049 2050 2050 /* static */ 2051 UI GroupDefinitionSaveThread* UIGroupDefinitionSaveThread::m_spInstance = 0;2051 UIThreadGroupDefinitionSave* UIThreadGroupDefinitionSave::m_spInstance = 0; 2052 2052 2053 2053 /* static */ 2054 UI GroupDefinitionSaveThread* UIGroupDefinitionSaveThread::instance()2054 UIThreadGroupDefinitionSave* UIThreadGroupDefinitionSave::instance() 2055 2055 { 2056 2056 return m_spInstance; … … 2058 2058 2059 2059 /* static */ 2060 void UI GroupDefinitionSaveThread::prepare()2060 void UIThreadGroupDefinitionSave::prepare() 2061 2061 { 2062 2062 /* Make sure instance not prepared: */ … … 2065 2065 2066 2066 /* Crate instance: */ 2067 new UI GroupDefinitionSaveThread;2067 new UIThreadGroupDefinitionSave; 2068 2068 } 2069 2069 2070 2070 /* static */ 2071 void UI GroupDefinitionSaveThread::cleanup()2071 void UIThreadGroupDefinitionSave::cleanup() 2072 2072 { 2073 2073 /* Make sure instance prepared: */ … … 2079 2079 } 2080 2080 2081 void UI GroupDefinitionSaveThread::configure(QObject *pParent,2081 void UIThreadGroupDefinitionSave::configure(QObject *pParent, 2082 2082 const QMap<QString, QStringList> &oldLists, 2083 2083 const QMap<QString, QStringList> &newLists) … … 2088 2088 } 2089 2089 2090 UI GroupDefinitionSaveThread::UIGroupDefinitionSaveThread()2090 UIThreadGroupDefinitionSave::UIThreadGroupDefinitionSave() 2091 2091 { 2092 2092 /* Assign instance: */ … … 2094 2094 } 2095 2095 2096 UI GroupDefinitionSaveThread::~UIGroupDefinitionSaveThread()2096 UIThreadGroupDefinitionSave::~UIThreadGroupDefinitionSave() 2097 2097 { 2098 2098 /* Wait: */ … … 2103 2103 } 2104 2104 2105 void UI GroupDefinitionSaveThread::run()2105 void UIThreadGroupDefinitionSave::run() 2106 2106 { 2107 2107 /* COM prepare: */ … … 2171 2171 2172 2172 /* static */ 2173 UI GroupOrderSaveThread* UIGroupOrderSaveThread::m_spInstance = 0;2173 UIThreadGroupOrderSave* UIThreadGroupOrderSave::m_spInstance = 0; 2174 2174 2175 2175 /* static */ 2176 UI GroupOrderSaveThread* UIGroupOrderSaveThread::instance()2176 UIThreadGroupOrderSave* UIThreadGroupOrderSave::instance() 2177 2177 { 2178 2178 return m_spInstance; … … 2180 2180 2181 2181 /* static */ 2182 void UI GroupOrderSaveThread::prepare()2182 void UIThreadGroupOrderSave::prepare() 2183 2183 { 2184 2184 /* Make sure instance not prepared: */ … … 2187 2187 2188 2188 /* Crate instance: */ 2189 new UI GroupOrderSaveThread;2189 new UIThreadGroupOrderSave; 2190 2190 } 2191 2191 2192 2192 /* static */ 2193 void UI GroupOrderSaveThread::cleanup()2193 void UIThreadGroupOrderSave::cleanup() 2194 2194 { 2195 2195 /* Make sure instance prepared: */ … … 2201 2201 } 2202 2202 2203 void UI GroupOrderSaveThread::configure(QObject *pParent,2203 void UIThreadGroupOrderSave::configure(QObject *pParent, 2204 2204 const QMap<QString, QStringList> &groups) 2205 2205 { … … 2208 2208 } 2209 2209 2210 UI GroupOrderSaveThread::UIGroupOrderSaveThread()2210 UIThreadGroupOrderSave::UIThreadGroupOrderSave() 2211 2211 { 2212 2212 /* Assign instance: */ … … 2214 2214 } 2215 2215 2216 UI GroupOrderSaveThread::~UIGroupOrderSaveThread()2216 UIThreadGroupOrderSave::~UIThreadGroupOrderSave() 2217 2217 { 2218 2218 /* Wait: */ … … 2223 2223 } 2224 2224 2225 void UI GroupOrderSaveThread::run()2225 void UIThreadGroupOrderSave::run() 2226 2226 { 2227 2227 /* COM prepare: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserModel class declaration.3 * VBox Qt GUI - UIChooserModel class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GChooserModel_h__19 #define __UI GChooserModel_h__18 #ifndef __UIChooserModel_h__ 19 #define __UIChooserModel_h__ 20 20 21 21 /* Qt includes: */ … … 27 27 28 28 /* GUI includes: */ 29 #include "UI GChooserItem.h"29 #include "UIChooserItem.h" 30 30 31 31 /* COM includes: */ … … 41 41 class QTimer; 42 42 class QPaintDevice; 43 class UIV MItem;44 class UI GChooser;43 class UIVirtualMachineItem; 44 class UIChooser; 45 45 class UIActionPool; 46 class UI GChooserHandlerMouse;47 class UI GChooserHandlerKeyboard;46 class UIChooserHandlerMouse; 47 class UIChooserHandlerKeyboard; 48 48 class CMachine; 49 49 … … 56 56 57 57 /* Graphics chooser-model: */ 58 class UI GChooserModel : public QObject58 class UIChooserModel : public QObject 59 59 { 60 60 Q_OBJECT; … … 66 66 67 67 /* Notifier: Focus-item stuff: */ 68 void sigFocusChanged(UI GChooserItem *pFocusItem);68 void sigFocusChanged(UIChooserItem *pFocusItem); 69 69 70 70 /* Notifiers: Root-item stuff: */ … … 84 84 85 85 /* Constructor/destructor: */ 86 UI GChooserModel(UIGChooser *pParent);87 ~UI GChooserModel();86 UIChooserModel(UIChooser *pParent); 87 ~UIChooserModel(); 88 88 89 89 /* API: Prepare/cleanup stuff: */ … … 92 92 93 93 /** Returns the chooser reference. */ 94 UI GChooser* chooser() const { return m_pChooser; }94 UIChooser* chooser() const { return m_pChooser; } 95 95 /** Returns the action-pool reference. */ 96 96 UIActionPool* actionPool() const; … … 105 105 106 106 /* API: Navigation stuff: */ 107 const QList<UI GChooserItem*>& navigationList() const;108 void removeFromNavigationList(UI GChooserItem *pItem);107 const QList<UIChooserItem*>& navigationList() const; 108 void removeFromNavigationList(UIChooserItem *pItem); 109 109 void updateNavigation(); 110 110 111 111 /* API: Current-item stuff: */ 112 UIV MItem* currentMachineItem() const;113 QList<UIV MItem*> currentMachineItems() const;114 UI GChooserItem* currentItem() const;115 const QList<UI GChooserItem*>& currentItems() const;116 void setCurrentItems(const QList<UI GChooserItem*> &items);117 void setCurrentItem(UI GChooserItem *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); 118 118 void setCurrentItem(const QString &strDefinition); 119 119 void unsetCurrentItem(); 120 void addToCurrentItems(UI GChooserItem *pItem);121 void removeFromCurrentItems(UI GChooserItem *pItem);122 UI GChooserItem *findClosestUnselectedItem() const;120 void addToCurrentItems(UIChooserItem *pItem); 121 void removeFromCurrentItems(UIChooserItem *pItem); 122 UIChooserItem *findClosestUnselectedItem() const; 123 123 void makeSureSomeItemIsSelected(); 124 124 void notifyCurrentItemChanged(); … … 127 127 128 128 /* API: Focus-item stuff: */ 129 UI GChooserItem* focusItem() const;130 void setFocusItem(UI GChooserItem *pItem);129 UIChooserItem* focusItem() const; 130 void setFocusItem(UIChooserItem *pItem); 131 131 132 132 /* API: Root-item stuff: */ 133 UI GChooserItem* mainRoot() const;134 UI GChooserItem* root() const;135 void indentRoot(UI GChooserItem *pNewRootItem);133 UIChooserItem* mainRoot() const; 134 UIChooserItem* root() const; 135 void indentRoot(UIChooserItem *pNewRootItem); 136 136 void unindentRoot(); 137 137 bool isSlidingInProgress() const; … … 140 140 void startEditingGroupItemName(); 141 141 void cleanupGroupTree(); 142 static QString uniqueGroupName(UI GChooserItem *pRoot);142 static QString uniqueGroupName(UIChooserItem *pRoot); 143 143 144 144 /* API: Machine-item stuff: */ … … 234 234 235 235 /* Helper: Navigation stuff: */ 236 QList<UI GChooserItem*> createNavigationList(UIGChooserItem *pItem);236 QList<UIChooserItem*> createNavigationList(UIChooserItem *pItem); 237 237 238 238 /* Helper: Focus-item stuff: */ … … 243 243 244 244 /* Helper: Group-item stuff: */ 245 void cleanupGroupTree(UI GChooserItem *pGroupItem);245 void cleanupGroupTree(UIChooserItem *pGroupItem); 246 246 247 247 /* Helpers: Machine-item stuff: */ 248 void removeItems(const QList<UI GChooserItem*> &itemsToRemove);248 void removeItems(const QList<UIChooserItem*> &itemsToRemove); 249 249 void unregisterMachines(const QStringList &ids); 250 250 … … 260 260 void loadGroupTree(); 261 261 void addMachineIntoTheTree(const CMachine &machine, bool fMakeItVisible = false); 262 UI GChooserItem* getGroupItem(const QString &strName, UIGChooserItem *pParentItem, bool fAllGroupsOpened);263 bool shouldBeGroupOpened(UI GChooserItem *pParentItem, const QString &strName);264 int getDesiredPosition(UI GChooserItem *pParentItem, UIGChooserItemType type, const QString &strName);265 int positionFromDefinitions(UI GChooserItem *pParentItem, UIGChooserItemType type, const QString &strName);266 void createMachineItem(const CMachine &machine, UI GChooserItem *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); 267 267 268 268 /* Helpers: Saving stuff: */ 269 269 void saveGroupDefinitions(); 270 270 void saveGroupOrders(); 271 void gatherGroupDefinitions(QMap<QString, QStringList> &groups, UI GChooserItem *pParentGroup);272 void gatherGroupOrders(QMap<QString, QStringList> &groups, UI GChooserItem *pParentItem);271 void gatherGroupDefinitions(QMap<QString, QStringList> &groups, UIChooserItem *pParentGroup); 272 void gatherGroupOrders(QMap<QString, QStringList> &groups, UIChooserItem *pParentItem); 273 273 void makeSureGroupDefinitionsSaveIsFinished(); 274 274 void makeSureGroupOrdersSaveIsFinished(); 275 275 276 276 /** Holds the chooser reference. */ 277 UI GChooser *m_pChooser;277 UIChooser *m_pChooser; 278 278 279 279 /* Variables: */ 280 280 QGraphicsScene *m_pScene; 281 281 282 QList<UI GChooserItem*> m_rootStack;282 QList<UIChooserItem*> m_rootStack; 283 283 bool m_fSliding; 284 UI GChooserItem *m_pLeftRoot;285 UI GChooserItem *m_pRightRoot;286 QPointer<UI GChooserItem> m_pAfterSlidingFocus;284 UIChooserItem *m_pLeftRoot; 285 UIChooserItem *m_pRightRoot; 286 QPointer<UIChooserItem> m_pAfterSlidingFocus; 287 287 288 288 QMap<QString, QStringList> m_groups; 289 QList<UI GChooserItem*> m_navigationList;290 QList<UI GChooserItem*> m_currentItems;291 UI GChooserHandlerMouse *m_pMouseHandler;292 UI GChooserHandlerKeyboard *m_pKeyboardHandler;289 QList<UIChooserItem*> m_navigationList; 290 QList<UIChooserItem*> m_currentItems; 291 UIChooserHandlerMouse *m_pMouseHandler; 292 UIChooserHandlerKeyboard *m_pKeyboardHandler; 293 293 QPointer<QDrag> m_pCurrentDragObject; 294 294 int m_iScrollingTokenSize; 295 295 bool m_fIsScrollingInProgress; 296 QPointer<UI GChooserItem> m_pFocusItem;296 QPointer<UIChooserItem> m_pFocusItem; 297 297 QMenu *m_pContextMenuGroup; 298 298 QMenu *m_pContextMenuMachine; … … 307 307 308 308 /* Allows to save group definitions asynchronously: */ 309 class UI GroupDefinitionSaveThread: public QThread309 class UIThreadGroupDefinitionSave : public QThread 310 310 { 311 311 Q_OBJECT; … … 322 322 323 323 /* Singleton stuff: */ 324 static UI GroupDefinitionSaveThread* instance();324 static UIThreadGroupDefinitionSave* instance(); 325 325 static void prepare(); 326 326 static void cleanup(); … … 334 334 335 335 /* Constructor/destructor: */ 336 UI GroupDefinitionSaveThread();337 ~UI GroupDefinitionSaveThread();336 UIThreadGroupDefinitionSave(); 337 ~UIThreadGroupDefinitionSave(); 338 338 339 339 /* Worker thread stuff: */ … … 341 341 342 342 /* Variables: */ 343 static UI GroupDefinitionSaveThread*m_spInstance;343 static UIThreadGroupDefinitionSave *m_spInstance; 344 344 QMap<QString, QStringList> m_oldLists; 345 345 QMap<QString, QStringList> m_newLists; … … 347 347 348 348 /* Allows to save group order asynchronously: */ 349 class UI GroupOrderSaveThread: public QThread349 class UIThreadGroupOrderSave : public QThread 350 350 { 351 351 Q_OBJECT; … … 359 359 360 360 /* Singleton stuff: */ 361 static UI GroupOrderSaveThread* instance();361 static UIThreadGroupOrderSave* instance(); 362 362 static void prepare(); 363 363 static void cleanup(); … … 369 369 370 370 /* Constructor/destructor: */ 371 UI GroupOrderSaveThread();372 ~UI GroupOrderSaveThread();371 UIThreadGroupOrderSave(); 372 ~UIThreadGroupOrderSave(); 373 373 374 374 /* Worker thread stuff: */ … … 376 376 377 377 /* Variables: */ 378 static UI GroupOrderSaveThread*m_spInstance;378 static UIThreadGroupOrderSave *m_spInstance; 379 379 QMap<QString, QStringList> m_groups; 380 380 }; 381 381 382 #endif /* __UI GChooserModel_h__ */383 382 #endif /* __UIChooserModel_h__ */ 383 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserView class implementation.3 * VBox Qt GUI - UIChooserView class implementation. 4 4 */ 5 5 … … 25 25 26 26 /* GUI includes: */ 27 # include "UI GChooser.h"28 # include "UI GChooserModel.h"29 # include "UI GChooserView.h"30 # include "UI GChooserItem.h"27 # include "UIChooser.h" 28 # include "UIChooserModel.h" 29 # include "UIChooserView.h" 30 # include "UIChooserItem.h" 31 31 32 32 /* Other VBox includes: */ … … 37 37 38 38 /** QAccessibleWidget extension used as an accessibility interface for Chooser-view. */ 39 class UIAccessibilityInterfaceForUI GChooserView : public QAccessibleWidget39 class UIAccessibilityInterfaceForUIChooserView : public QAccessibleWidget 40 40 { 41 41 public: … … 45 45 { 46 46 /* Creating Chooser-view accessibility interface: */ 47 if (pObject && strClassname == QLatin1String("UI GChooserView"))48 return new UIAccessibilityInterfaceForUI GChooserView(qobject_cast<QWidget*>(pObject));47 if (pObject && strClassname == QLatin1String("UIChooserView")) 48 return new UIAccessibilityInterfaceForUIChooserView(qobject_cast<QWidget*>(pObject)); 49 49 50 50 /* Null by default: */ … … 53 53 54 54 /** Constructs an accessibility interface passing @a pWidget to the base-class. */ 55 UIAccessibilityInterfaceForUI GChooserView(QWidget *pWidget)55 UIAccessibilityInterfaceForUIChooserView(QWidget *pWidget) 56 56 : QAccessibleWidget(pWidget, QAccessible::List) 57 57 {} … … 93 93 94 94 /** Returns corresponding Chooser-view. */ 95 UI GChooserView *view() const { return qobject_cast<UIGChooserView*>(widget()); }95 UIChooserView *view() const { return qobject_cast<UIChooserView*>(widget()); } 96 96 }; 97 97 98 98 99 UI GChooserView::UIGChooserView(UIGChooser *pParent)99 UIChooserView::UIChooserView(UIChooser *pParent) 100 100 : QIWithRetranslateUI<QIGraphicsView>(pParent) 101 101 , m_pChooser(pParent) … … 104 104 { 105 105 /* Install Chooser-view accessibility interface factory: */ 106 QAccessible::installFactory(UIAccessibilityInterfaceForUI GChooserView::pFactory);106 QAccessible::installFactory(UIAccessibilityInterfaceForUIChooserView::pFactory); 107 107 108 108 /* Setup frame: */ … … 121 121 } 122 122 123 void UI GChooserView::sltMinimumWidthHintChanged(int iMinimumWidthHint)123 void UIChooserView::sltMinimumWidthHintChanged(int iMinimumWidthHint) 124 124 { 125 125 /* Is there something changed? */ … … 137 137 } 138 138 139 void UI GChooserView::sltMinimumHeightHintChanged(int iMinimumHeightHint)139 void UIChooserView::sltMinimumHeightHintChanged(int iMinimumHeightHint) 140 140 { 141 141 /* Is there something changed? */ … … 150 150 } 151 151 152 void UI GChooserView::sltFocusChanged(UIGChooserItem *pFocusItem)152 void UIChooserView::sltFocusChanged(UIChooserItem *pFocusItem) 153 153 { 154 154 /* Make sure focus-item set: */ … … 162 162 } 163 163 164 void UI GChooserView::retranslateUi()164 void UIChooserView::retranslateUi() 165 165 { 166 166 /* Translate this: */ … … 168 168 } 169 169 170 void UI GChooserView::resizeEvent(QResizeEvent *pEvent)170 void UIChooserView::resizeEvent(QResizeEvent *pEvent) 171 171 { 172 172 /* Call to base-class: */ … … 176 176 } 177 177 178 void UI GChooserView::updateSceneRect()178 void UIChooserView::updateSceneRect() 179 179 { 180 180 setSceneRect(0, 0, m_iMinimumWidthHint, m_iMinimumHeightHint); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GChooserView class declaration.3 * VBox Qt GUI - UIChooserView class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GChooserView_h__19 #define __UI GChooserView_h__18 #ifndef __UIChooserView_h__ 19 #define __UIChooserView_h__ 20 20 21 21 /* GUI includes: */ … … 24 24 25 25 /* Forward declarations: */ 26 class UI GChooser;27 class UI GChooserItem;26 class UIChooser; 27 class UIChooserItem; 28 28 29 29 /* Graphics chooser-view: */ 30 class UI GChooserView : public QIWithRetranslateUI<QIGraphicsView>30 class UIChooserView : public QIWithRetranslateUI<QIGraphicsView> 31 31 { 32 32 Q_OBJECT; … … 41 41 /** Constructs a chooser-view passing @a pParent to the base-class. 42 42 * @param pParent Brings the chooser container to embed into. */ 43 UI GChooserView(UIGChooser *pParent);43 UIChooserView(UIChooser *pParent); 44 44 45 45 /** Returns the chooser reference. */ 46 UI GChooser *chooser() const { return m_pChooser; }46 UIChooser *chooser() const { return m_pChooser; } 47 47 48 48 private slots: … … 53 53 54 54 /* Handler: Focus-item stuff: */ 55 void sltFocusChanged(UI GChooserItem *pFocusItem);55 void sltFocusChanged(UIChooserItem *pFocusItem); 56 56 57 57 private: … … 67 67 68 68 /** Holds the chooser reference. */ 69 UI GChooser *m_pChooser;69 UIChooser *m_pChooser; 70 70 71 71 /* Variables: */ … … 74 74 }; 75 75 76 #endif /* __UI GChooserView_h__ */76 #endif /* __UIChooserView_h__ */ 77 77 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetails class implementation.3 * VBox Qt GUI - UIDetails class implementation. 4 4 */ 5 5 … … 26 26 27 27 /* GUI includes: */ 28 # include "UI GDetails.h"29 # include "UI GDetailsModel.h"30 # include "UI GDetailsView.h"28 # include "UIDetails.h" 29 # include "UIDetailsModel.h" 30 # include "UIDetailsView.h" 31 31 32 32 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 33 33 34 34 35 UI GDetails::UIGDetails(QWidget *pParent /* = 0 */)35 UIDetails::UIDetails(QWidget *pParent /* = 0 */) 36 36 : QWidget(pParent) 37 37 , m_pMainLayout(0) … … 55 55 } 56 56 57 void UI GDetails::setItems(const QList<UIVMItem*> &items)57 void UIDetails::setItems(const QList<UIVirtualMachineItem*> &items) 58 58 { 59 59 /* Propagate to details-model: */ … … 61 61 } 62 62 63 void UI GDetails::preparePalette()63 void UIDetails::preparePalette() 64 64 { 65 65 /* Setup palette: */ … … 70 70 } 71 71 72 void UI GDetails::prepareLayout()72 void UIDetails::prepareLayout() 73 73 { 74 74 /* Setup main-layout: */ … … 79 79 } 80 80 81 void UI GDetails::prepareModel()81 void UIDetails::prepareModel() 82 82 { 83 83 /* Setup details-model: */ 84 m_pDetailsModel = new UI GDetailsModel(this);84 m_pDetailsModel = new UIDetailsModel(this); 85 85 } 86 86 87 void UI GDetails::prepareView()87 void UIDetails::prepareView() 88 88 { 89 89 /* Setup details-view: */ 90 m_pDetailsView = new UI GDetailsView(this);90 m_pDetailsView = new UIDetailsView(this); 91 91 m_pDetailsView->setScene(m_pDetailsModel->scene()); 92 92 m_pDetailsView->show(); … … 95 95 } 96 96 97 void UI GDetails::prepareConnections()97 void UIDetails::prepareConnections() 98 98 { 99 99 /* Setup details-model connections: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetails class declaration.3 * VBox Qt GUI - UIDetails class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GDetails_h__19 #define __UI GDetails_h__18 #ifndef __UIDetails_h__ 19 #define __UIDetails_h__ 20 20 21 21 /* Qt includes: */ … … 24 24 /* Forward declartions: */ 25 25 class QVBoxLayout; 26 class UI GDetailsModel;27 class UI GDetailsView;28 class UIV MItem;26 class UIDetailsModel; 27 class UIDetailsView; 28 class UIVirtualMachineItem; 29 29 30 30 /* Details widget: */ 31 class UI GDetails : public QWidget31 class UIDetails : public QWidget 32 32 { 33 33 Q_OBJECT; … … 48 48 49 49 /* Constructor: */ 50 UI GDetails(QWidget *pParent = 0);50 UIDetails(QWidget *pParent = 0); 51 51 52 52 /** Return the Details-model instance. */ 53 UI GDetailsModel *model() const { return m_pDetailsModel; }53 UIDetailsModel *model() const { return m_pDetailsModel; } 54 54 /** Return the Details-view instance. */ 55 UI GDetailsView *view() const { return m_pDetailsView; }55 UIDetailsView *view() const { return m_pDetailsView; } 56 56 57 57 /* API: Current item(s) stuff: */ 58 void setItems(const QList<UIV MItem*> &items);58 void setItems(const QList<UIVirtualMachineItem*> &items); 59 59 60 60 private: … … 69 69 /* Variables: */ 70 70 QVBoxLayout *m_pMainLayout; 71 UI GDetailsModel *m_pDetailsModel;72 UI GDetailsView *m_pDetailsView;71 UIDetailsModel *m_pDetailsModel; 72 UIDetailsView *m_pDetailsView; 73 73 }; 74 74 75 #endif /* __UI GDetails_h__ */75 #endif /* __UIDetails_h__ */ 76 76 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsElement class implementation.3 * VBox Qt GUI - UIDetailsElement class implementation. 4 4 */ 5 5 … … 29 29 30 30 /* GUI includes: */ 31 # include "UI GDetailsElement.h"32 # include "UI GDetailsSet.h"33 # include "UI GDetailsModel.h"31 # include "UIDetailsElement.h" 32 # include "UIDetailsSet.h" 33 # include "UIDetailsModel.h" 34 34 # include "UIGraphicsRotatorButton.h" 35 35 # include "UIGraphicsTextPane.h" … … 37 37 # include "UIConverter.h" 38 38 # include "UIIconPool.h" 39 # include "UI SelectorWindow.h"39 # include "UIVirtualBoxManager.h" 40 40 # include "VBoxGlobal.h" 41 41 … … 43 43 44 44 45 UI GDetailsElement::UIGDetailsElement(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened)46 : UI GDetailsItem(pParent)45 UIDetailsElement::UIDetailsElement(UIDetailsSet *pParent, DetailsElementType type, bool fOpened) 46 : UIDetailsItem(pParent) 47 47 , m_pSet(pParent) 48 48 , m_type(type) … … 80 80 } 81 81 82 UI GDetailsElement::~UIGDetailsElement()82 UIDetailsElement::~UIDetailsElement() 83 83 { 84 84 /* Remove item from the parent: */ … … 87 87 } 88 88 89 void UI GDetailsElement::close(bool fAnimated /* = true */)89 void UIDetailsElement::close(bool fAnimated /* = true */) 90 90 { 91 91 m_pButton->setToggled(false, fAnimated); 92 92 } 93 93 94 void UI GDetailsElement::open(bool fAnimated /* = true */)94 void UIDetailsElement::open(bool fAnimated /* = true */) 95 95 { 96 96 m_pButton->setToggled(true, fAnimated); 97 97 } 98 98 99 void UI GDetailsElement::updateAppearance()99 void UIDetailsElement::updateAppearance() 100 100 { 101 101 /* Reset name hover state: */ … … 109 109 } 110 110 111 void UI GDetailsElement::markAnimationFinished()111 void UIDetailsElement::markAnimationFinished() 112 112 { 113 113 /* Mark animation as non-running: */ … … 120 120 } 121 121 122 UITextTable &UI GDetailsElement::text() const122 UITextTable &UIDetailsElement::text() const 123 123 { 124 124 /* Retrieve text from text-pane: */ … … 126 126 } 127 127 128 void UI GDetailsElement::setText(const UITextTable &text)128 void UIDetailsElement::setText(const UITextTable &text) 129 129 { 130 130 /* Pass text to text-pane: */ … … 132 132 } 133 133 134 void UI GDetailsElement::sltHandleWindowRemapped()134 void UIDetailsElement::sltHandleWindowRemapped() 135 135 { 136 136 /* Update icon: */ … … 138 138 } 139 139 140 void UI GDetailsElement::sltToggleButtonClicked()140 void UIDetailsElement::sltToggleButtonClicked() 141 141 { 142 142 emit sigToggleElement(m_type, closed()); 143 143 } 144 144 145 void UI GDetailsElement::sltElementToggleStart()145 void UIDetailsElement::sltElementToggleStart() 146 146 { 147 147 /* Mark animation running: */ … … 155 155 } 156 156 157 void UI GDetailsElement::sltElementToggleFinish(bool fToggled)157 void UIDetailsElement::sltElementToggleFinish(bool fToggled) 158 158 { 159 159 /* Update toggle-state: */ … … 164 164 } 165 165 166 void UI GDetailsElement::sltHandleAnchorClicked(const QString &strAnchor)166 void UIDetailsElement::sltHandleAnchorClicked(const QString &strAnchor) 167 167 { 168 168 /* Current anchor role: */ … … 193 193 } 194 194 195 void UI GDetailsElement::sltMountStorageMedium()195 void UIDetailsElement::sltMountStorageMedium() 196 196 { 197 197 /* Sender action: */ … … 206 206 } 207 207 208 void UI GDetailsElement::showEvent(QShowEvent *pEvent)208 void UIDetailsElement::showEvent(QShowEvent *pEvent) 209 209 { 210 210 /* Call to base-class: */ 211 UI GDetailsItem::showEvent(pEvent);211 UIDetailsItem::showEvent(pEvent); 212 212 213 213 /* Update icon: */ … … 215 215 } 216 216 217 void UI GDetailsElement::resizeEvent(QGraphicsSceneResizeEvent*)217 void UIDetailsElement::resizeEvent(QGraphicsSceneResizeEvent*) 218 218 { 219 219 /* Update layout: */ … … 221 221 } 222 222 223 QString UI GDetailsElement::description() const223 QString UIDetailsElement::description() const 224 224 { 225 225 return tr("%1 details", "like 'General details' or 'Storage details'").arg(m_strName); 226 226 } 227 227 228 QVariant UI GDetailsElement::data(int iKey) const228 QVariant UIDetailsElement::data(int iKey) const 229 229 { 230 230 /* Provide other members with required data: */ … … 240 240 } 241 241 242 void UI GDetailsElement::updateMinimumHeaderWidth()242 void UIDetailsElement::updateMinimumHeaderWidth() 243 243 { 244 244 /* Prepare variables: */ … … 251 251 } 252 252 253 void UI GDetailsElement::updateMinimumHeaderHeight()253 void UIDetailsElement::updateMinimumHeaderHeight() 254 254 { 255 255 /* Update minimum-header-height: */ … … 258 258 } 259 259 260 void UI GDetailsElement::updateIcon()260 void UIDetailsElement::updateIcon() 261 261 { 262 262 /* Prepare whole icon first of all: */ … … 276 276 m_pixmapSize = QSize(iIconMetric, iIconMetric); 277 277 /* Acquire the icon of corresponding size (taking top-level widget DPI into account): */ 278 m_pixmap = icon.pixmap(gp SelectorWindow->windowHandle(), m_pixmapSize);278 m_pixmap = icon.pixmap(gpManager->windowHandle(), m_pixmapSize); 279 279 } 280 280 … … 284 284 } 285 285 286 void UI GDetailsElement::setName(const QString &strName)286 void UIDetailsElement::setName(const QString &strName) 287 287 { 288 288 /* Cache name: */ … … 296 296 } 297 297 298 const CMachine& UI GDetailsElement::machine()298 const CMachine& UIDetailsElement::machine() 299 299 { 300 300 return m_pSet->machine(); 301 301 } 302 302 303 int UI GDetailsElement::minimumWidthHint() const303 int UIDetailsElement::minimumWidthHint() const 304 304 { 305 305 /* Prepare variables: */ … … 317 317 } 318 318 319 int UI GDetailsElement::minimumHeightHint(bool fClosed) const319 int UIDetailsElement::minimumHeightHint(bool fClosed) const 320 320 { 321 321 /* Prepare variables: */ … … 345 345 } 346 346 347 int UI GDetailsElement::minimumHeightHint() const347 int UIDetailsElement::minimumHeightHint() const 348 348 { 349 349 return minimumHeightHint(m_fClosed); 350 350 } 351 351 352 void UI GDetailsElement::updateLayout()352 void UIDetailsElement::updateLayout() 353 353 { 354 354 /* Prepare variables: */ … … 386 386 } 387 387 388 void UI GDetailsElement::setAdditionalHeight(int iAdditionalHeight)388 void UIDetailsElement::setAdditionalHeight(int iAdditionalHeight) 389 389 { 390 390 /* Cache new value: */ … … 396 396 } 397 397 398 void UI GDetailsElement::addItem(UIGDetailsItem*)398 void UIDetailsElement::addItem(UIDetailsItem*) 399 399 { 400 400 AssertMsgFailed(("Details element do NOT support children!")); 401 401 } 402 402 403 void UI GDetailsElement::removeItem(UIGDetailsItem*)403 void UIDetailsElement::removeItem(UIDetailsItem*) 404 404 { 405 405 AssertMsgFailed(("Details element do NOT support children!")); 406 406 } 407 407 408 QList<UI GDetailsItem*> UIGDetailsElement::items(UIGDetailsItemType) const408 QList<UIDetailsItem*> UIDetailsElement::items(UIDetailsItemType) const 409 409 { 410 410 AssertMsgFailed(("Details element do NOT support children!")); 411 return QList<UI GDetailsItem*>();412 } 413 414 bool UI GDetailsElement::hasItems(UIGDetailsItemType) const411 return QList<UIDetailsItem*>(); 412 } 413 414 bool UIDetailsElement::hasItems(UIDetailsItemType) const 415 415 { 416 416 AssertMsgFailed(("Details element do NOT support children!")); … … 418 418 } 419 419 420 void UI GDetailsElement::clearItems(UIGDetailsItemType)420 void UIDetailsElement::clearItems(UIDetailsItemType) 421 421 { 422 422 AssertMsgFailed(("Details element do NOT support children!")); 423 423 } 424 424 425 void UI GDetailsElement::prepareElement()425 void UIDetailsElement::prepareElement() 426 426 { 427 427 /* Initialization: */ … … 466 466 467 467 /* Configure connections: */ 468 connect(gp SelectorWindow, &UISelectorWindow::sigWindowRemapped,469 this, &UI GDetailsElement::sltHandleWindowRemapped);468 connect(gpManager, &UIVirtualBoxManager::sigWindowRemapped, 469 this, &UIDetailsElement::sltHandleWindowRemapped); 470 470 connect(this, SIGNAL(sigToggleElement(DetailsElementType, bool)), 471 471 model(), SLOT(sltToggleElements(DetailsElementType, bool))); … … 474 474 } 475 475 476 void UI GDetailsElement::prepareButton()476 void UIDetailsElement::prepareButton() 477 477 { 478 478 /* Setup toggle-button: */ … … 485 485 } 486 486 487 void UI GDetailsElement::prepareTextPane()487 void UIDetailsElement::prepareTextPane() 488 488 { 489 489 /* Create text-pane: */ … … 493 493 } 494 494 495 void UI GDetailsElement::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget*)495 void UIDetailsElement::paint(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption, QWidget*) 496 496 { 497 497 /* Update button visibility: */ … … 508 508 } 509 509 510 void UI GDetailsElement::paintDecorations(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)510 void UIDetailsElement::paintDecorations(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption) 511 511 { 512 512 /* Paint background: */ … … 514 514 } 515 515 516 void UI GDetailsElement::paintElementInfo(QPainter *pPainter, const QStyleOptionGraphicsItem*)516 void UIDetailsElement::paintElementInfo(QPainter *pPainter, const QStyleOptionGraphicsItem*) 517 517 { 518 518 /* Initialize some necessary variables: */ … … 561 561 } 562 562 563 void UI GDetailsElement::paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption)563 void UIDetailsElement::paintBackground(QPainter *pPainter, const QStyleOptionGraphicsItem *pOption) 564 564 { 565 565 /* Save painter: */ … … 617 617 } 618 618 619 void UI GDetailsElement::hoverMoveEvent(QGraphicsSceneHoverEvent *pEvent)619 void UIDetailsElement::hoverMoveEvent(QGraphicsSceneHoverEvent *pEvent) 620 620 { 621 621 /* Update hover state: */ … … 630 630 } 631 631 632 void UI GDetailsElement::hoverLeaveEvent(QGraphicsSceneHoverEvent *pEvent)632 void UIDetailsElement::hoverLeaveEvent(QGraphicsSceneHoverEvent *pEvent) 633 633 { 634 634 /* Update hover state: */ … … 643 643 } 644 644 645 void UI GDetailsElement::mousePressEvent(QGraphicsSceneMouseEvent *pEvent)645 void UIDetailsElement::mousePressEvent(QGraphicsSceneMouseEvent *pEvent) 646 646 { 647 647 /* Only for hovered header: */ … … 660 660 } 661 661 662 void UI GDetailsElement::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *pEvent)662 void UIDetailsElement::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *pEvent) 663 663 { 664 664 /* Only for left-button: */ … … 670 670 } 671 671 672 void UI GDetailsElement::updateButtonVisibility()672 void UIDetailsElement::updateButtonVisibility() 673 673 { 674 674 if (m_fHovered && !m_pButton->isVisible()) … … 678 678 } 679 679 680 void UI GDetailsElement::handleHoverEvent(QGraphicsSceneHoverEvent *pEvent)680 void UIDetailsElement::handleHoverEvent(QGraphicsSceneHoverEvent *pEvent) 681 681 { 682 682 /* Not for 'preview' element type: */ … … 703 703 } 704 704 705 void UI GDetailsElement::updateNameHoverLink()705 void UIDetailsElement::updateNameHoverLink() 706 706 { 707 707 if (m_fNameHovered) … … 712 712 } 713 713 714 void UI GDetailsElement::updateAnimationParameters()714 void UIDetailsElement::updateAnimationParameters() 715 715 { 716 716 /* Recalculate animation parameters: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsElement class declaration.3 * VBox Qt GUI - UIDetailsElement class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GDetailsElement_h__19 #define __UI GDetailsElement_h__18 #ifndef __UIDetailsElement_h__ 19 #define __UIDetailsElement_h__ 20 20 21 21 /* Qt includes: */ … … 23 23 24 24 /* GUI includes: */ 25 #include "UI GDetailsItem.h"25 #include "UIDetailsItem.h" 26 26 #include "UIExtraDataDefs.h" 27 27 28 28 /* Forward declarations: */ 29 class UI GDetailsSet;29 class UIDetailsSet; 30 30 class CMachine; 31 31 class UIGraphicsRotatorButton; … … 42 42 /* Details element 43 43 * for graphics details model/view architecture: */ 44 class UI GDetailsElement : public UIGDetailsItem44 class UIDetailsElement : public UIDetailsItem 45 45 { 46 46 Q_OBJECT; … … 64 64 65 65 /* Graphics-item type: */ 66 enum { Type = UI GDetailsItemType_Element };66 enum { Type = UIDetailsItemType_Element }; 67 67 int type() const { return Type; } 68 68 69 69 /* Constructor/destructor: */ 70 UI GDetailsElement(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened);71 ~UI GDetailsElement();70 UIDetailsElement(UIDetailsSet *pParent, DetailsElementType type, bool fOpened); 71 ~UIDetailsElement(); 72 72 73 73 /* API: Element type: */ … … 166 166 167 167 /* API: Children stuff: */ 168 void addItem(UI GDetailsItem *pItem);169 void removeItem(UI GDetailsItem *pItem);170 QList<UI GDetailsItem*> items(UIGDetailsItemType type) const;171 bool hasItems(UI GDetailsItemType type) const;172 void clearItems(UI GDetailsItemType 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); 173 173 174 174 /* Helpers: Prepare stuff: */ … … 198 198 199 199 /* Variables: */ 200 UI GDetailsSet *m_pSet;200 UIDetailsSet *m_pSet; 201 201 DetailsElementType m_type; 202 202 QPixmap m_pixmap; … … 232 232 233 233 /* Friends: */ 234 friend class UI GDetailsSet;234 friend class UIDetailsSet; 235 235 }; 236 236 237 #endif /* __UI GDetailsElement_h__ */238 237 #endif /* __UIDetailsElement_h__ */ 238 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElements.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsElement[Name] classes implementation.3 * VBox Qt GUI - UIDetailsElement[Name] classes implementation. 4 4 */ 5 5 … … 26 26 27 27 /* GUI includes: */ 28 # include "UI GDetailsElements.h"29 # include "UI GDetailsModel.h"30 # include "UI GMachinePreview.h"28 # include "UIDetailsElements.h" 29 # include "UIDetailsModel.h" 30 # include "UIMachinePreview.h" 31 31 # include "UIGraphicsRotatorButton.h" 32 32 # include "VBoxGlobal.h" … … 55 55 56 56 57 UI GDetailsUpdateTask::UIGDetailsUpdateTask(const CMachine &machine)57 UIDetailsUpdateTask::UIDetailsUpdateTask(const CMachine &machine) 58 58 : UITask(UITask::Type_DetailsPopulation) 59 59 { … … 62 62 } 63 63 64 UI GDetailsElementInterface::UIGDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened)65 : UI GDetailsElement(pParent, type, fOpened)64 UIDetailsElementInterface::UIDetailsElementInterface(UIDetailsSet *pParent, DetailsElementType type, bool fOpened) 65 : UIDetailsElement(pParent, type, fOpened) 66 66 , m_pTask(0) 67 67 { … … 74 74 } 75 75 76 void UI GDetailsElementInterface::retranslateUi()76 void UIDetailsElementInterface::retranslateUi() 77 77 { 78 78 /* Assign corresponding name: */ … … 80 80 } 81 81 82 void UI GDetailsElementInterface::updateAppearance()82 void UIDetailsElementInterface::updateAppearance() 83 83 { 84 84 /* Call to base-class: */ 85 UI GDetailsElement::updateAppearance();85 UIDetailsElement::updateAppearance(); 86 86 87 87 /* Prepare/start update task: */ … … 95 95 } 96 96 97 void UI GDetailsElementInterface::sltUpdateAppearanceFinished(UITask *pTask)97 void UIDetailsElementInterface::sltUpdateAppearanceFinished(UITask *pTask) 98 98 { 99 99 /* Make sure that is one of our tasks: */ … … 118 118 119 119 120 UI GDetailsElementPreview::UIGDetailsElementPreview(UIGDetailsSet *pParent, bool fOpened)121 : UI GDetailsElement(pParent, DetailsElementType_Preview, fOpened)120 UIDetailsElementPreview::UIDetailsElementPreview(UIDetailsSet *pParent, bool fOpened) 121 : UIDetailsElement(pParent, DetailsElementType_Preview, fOpened) 122 122 { 123 123 /* Create preview: */ 124 m_pPreview = new UI GMachinePreview(this);124 m_pPreview = new UIMachinePreview(this); 125 125 AssertPtr(m_pPreview); 126 126 { … … 134 134 } 135 135 136 void UI GDetailsElementPreview::sltPreviewSizeHintChanged()136 void UIDetailsElementPreview::sltPreviewSizeHintChanged() 137 137 { 138 138 /* Recursively update size-hints: */ … … 142 142 } 143 143 144 void UI GDetailsElementPreview::retranslateUi()144 void UIDetailsElementPreview::retranslateUi() 145 145 { 146 146 /* Assign corresponding name: */ … … 148 148 } 149 149 150 int UI GDetailsElementPreview::minimumWidthHint() const150 int UIDetailsElementPreview::minimumWidthHint() const 151 151 { 152 152 /* Prepare variables: */ … … 166 166 } 167 167 168 int UI GDetailsElementPreview::minimumHeightHint(bool fClosed) const168 int UIDetailsElementPreview::minimumHeightHint(bool fClosed) const 169 169 { 170 170 /* Prepare variables: */ … … 197 197 } 198 198 199 void UI GDetailsElementPreview::updateLayout()199 void UIDetailsElementPreview::updateLayout() 200 200 { 201 201 /* Call to base-class: */ 202 UI GDetailsElement::updateLayout();202 UIDetailsElement::updateLayout(); 203 203 204 204 /* Show/hide preview: */ … … 214 214 } 215 215 216 void UI GDetailsElementPreview::updateAppearance()216 void UIDetailsElementPreview::updateAppearance() 217 217 { 218 218 /* Call to base-class: */ 219 UI GDetailsElement::updateAppearance();219 UIDetailsElement::updateAppearance(); 220 220 221 221 /* Set new machine attribute directly: */ … … 226 226 227 227 228 void UI GDetailsUpdateTaskGeneral::run()228 void UIDetailsUpdateTaskGeneral::run() 229 229 { 230 230 /* Acquire corresponding machine: */ … … 240 240 { 241 241 /* Machine name: */ 242 table << UITextTableLine(QApplication::translate("UI GDetails", "Name", "details (general)"), machine.GetName());242 table << UITextTableLine(QApplication::translate("UIDetails", "Name", "details (general)"), machine.GetName()); 243 243 244 244 /* Operating system type: */ 245 table << UITextTableLine(QApplication::translate("UI GDetails", "Operating System", "details (general)"),245 table << UITextTableLine(QApplication::translate("UIDetails", "Operating System", "details (general)"), 246 246 vboxGlobal().vmGuestOSTypeDescription(machine.GetOSTypeId())); 247 247 … … 250 250 if (!strSettingsFilePath.isEmpty()) 251 251 { 252 table << UITextTableLine(QApplication::translate("UI GDetails", "Settings File Location", "details (general)"),252 table << UITextTableLine(QApplication::translate("UIDetails", "Settings File Location", "details (general)"), 253 253 QDir::toNativeSeparators(QFileInfo(strSettingsFilePath).absolutePath())); 254 254 } … … 270 270 strGroup.remove(0, 1); 271 271 } 272 table << UITextTableLine(QApplication::translate("UI GDetails", "Groups", "details (general)"), groups.join(", "));273 } 274 } 275 else 276 table << UITextTableLine(QApplication::translate("UI GDetails", "Information Inaccessible", "details"), QString());277 278 /* Save the table as property: */ 279 setProperty("table", QVariant::fromValue(table)); 280 } 281 282 283 void UI GDetailsUpdateTaskSystem::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 283 void UIDetailsUpdateTaskSystem::run() 284 284 { 285 285 /* Acquire corresponding machine: */ … … 295 295 { 296 296 /* Base memory: */ 297 table << UITextTableLine(QApplication::translate("UI GDetails", "Base Memory", "details (system)"),298 QApplication::translate("UI GDetails", "%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())); 299 299 300 300 /* CPU count: */ 301 301 int cCPU = machine.GetCPUCount(); 302 302 if (cCPU > 1) 303 table << UITextTableLine(QApplication::translate("UI GDetails", "Processors", "details (system)"),303 table << UITextTableLine(QApplication::translate("UIDetails", "Processors", "details (system)"), 304 304 QString::number(cCPU)); 305 305 … … 307 307 int iCPUExecCap = machine.GetCPUExecutionCap(); 308 308 if (iCPUExecCap < 100) 309 table << UITextTableLine(QApplication::translate("UI GDetails", "Execution Cap", "details (system)"),310 QApplication::translate("UI GDetails", "%1%", "details").arg(iCPUExecCap));309 table << UITextTableLine(QApplication::translate("UIDetails", "Execution Cap", "details (system)"), 310 QApplication::translate("UIDetails", "%1%", "details").arg(iCPUExecCap)); 311 311 312 312 /* Boot-order: */ … … 321 321 if (bootOrder.isEmpty()) 322 322 bootOrder << gpConverter->toString(KDeviceType_Null); 323 table << UITextTableLine(QApplication::translate("UI GDetails", "Boot Order", "details (system)"), bootOrder.join(", "));323 table << UITextTableLine(QApplication::translate("UIDetails", "Boot Order", "details (system)"), bootOrder.join(", ")); 324 324 325 325 /* Chipset type: */ 326 326 const KChipsetType enmChipsetType = machine.GetChipsetType(); 327 327 if (enmChipsetType == KChipsetType_ICH9) 328 table << UITextTableLine(QApplication::translate("UI GDetails", "Chipset Type", "details (system)"),328 table << UITextTableLine(QApplication::translate("UIDetails", "Chipset Type", "details (system)"), 329 329 gpConverter->toString(enmChipsetType)); 330 330 … … 337 337 case KFirmwareType_EFIDUAL: 338 338 { 339 table << UITextTableLine(QApplication::translate("UI GDetails", "EFI", "details (system)"),340 QApplication::translate("UI GDetails", "Enabled", "details (system/EFI)"));339 table << UITextTableLine(QApplication::translate("UIDetails", "EFI", "details (system)"), 340 QApplication::translate("UIDetails", "Enabled", "details (system/EFI)")); 341 341 break; 342 342 } … … 344 344 { 345 345 // For NLS purpose: 346 QApplication::translate("UI GDetails", "Disabled", "details (system/EFI)");346 QApplication::translate("UIDetails", "Disabled", "details (system/EFI)"); 347 347 break; 348 348 } … … 356 356 if (machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled)) 357 357 { 358 acceleration << QApplication::translate("UI GDetails", "VT-x/AMD-V", "details (system)");358 acceleration << QApplication::translate("UIDetails", "VT-x/AMD-V", "details (system)"); 359 359 /* Nested Paging (only when hw virt is enabled): */ 360 360 if (machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging)) 361 acceleration << QApplication::translate("UI GDetails", "Nested Paging", "details (system)");361 acceleration << QApplication::translate("UIDetails", "Nested Paging", "details (system)"); 362 362 } 363 363 } 364 364 if (machine.GetCPUProperty(KCPUPropertyType_PAE)) 365 acceleration << QApplication::translate("UI GDetails", "PAE/NX", "details (system)");365 acceleration << QApplication::translate("UIDetails", "PAE/NX", "details (system)"); 366 366 switch (machine.GetEffectiveParavirtProvider()) 367 367 { 368 case KParavirtProvider_Minimal: acceleration << QApplication::translate("UI GDetails", "Minimal Paravirtualization", "details (system)"); break;369 case KParavirtProvider_HyperV: acceleration << QApplication::translate("UI GDetails", "Hyper-V Paravirtualization", "details (system)"); break;370 case KParavirtProvider_KVM: acceleration << QApplication::translate("UI GDetails", "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; 371 371 default: break; 372 372 } 373 373 if (!acceleration.isEmpty()) 374 table << UITextTableLine(QApplication::translate("UI GDetails", "Acceleration", "details (system)"),374 table << UITextTableLine(QApplication::translate("UIDetails", "Acceleration", "details (system)"), 375 375 acceleration.join(", ")); 376 376 } 377 377 else 378 table << UITextTableLine(QApplication::translate("UI GDetails", "Information Inaccessible", "details"),378 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), 379 379 QString()); 380 380 … … 384 384 385 385 386 void UI GDetailsUpdateTaskDisplay::run()386 void UIDetailsUpdateTaskDisplay::run() 387 387 { 388 388 /* Acquire corresponding machine: */ … … 398 398 { 399 399 /* Video memory: */ 400 table << UITextTableLine(QApplication::translate("UI GDetails", "Video Memory", "details (display)"),401 QApplication::translate("UI GDetails", "%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())); 402 402 403 403 /* Screen count: */ 404 404 int cGuestScreens = machine.GetMonitorCount(); 405 405 if (cGuestScreens > 1) 406 table << UITextTableLine(QApplication::translate("UI GDetails", "Screens", "details (display)"),406 table << UITextTableLine(QApplication::translate("UIDetails", "Screens", "details (display)"), 407 407 QString::number(cGuestScreens)); 408 408 … … 418 418 /* Append information: */ 419 419 if (dValue != 1.0) 420 table << UITextTableLine(QApplication::translate("UI GDetails", "Scale-factor", "details (display)"),420 table << UITextTableLine(QApplication::translate("UIDetails", "Scale-factor", "details (display)"), 421 421 QString::number(dValue, 'f', 2)); 422 422 } … … 426 426 /* 2D acceleration: */ 427 427 if (machine.GetAccelerate2DVideoEnabled()) 428 acceleration << QApplication::translate("UI GDetails", "2D Video", "details (display)");428 acceleration << QApplication::translate("UIDetails", "2D Video", "details (display)"); 429 429 #endif /* VBOX_WITH_VIDEOHWACCEL */ 430 430 /* 3D acceleration: */ 431 431 if (machine.GetAccelerate3DEnabled()) 432 acceleration << QApplication::translate("UI GDetails", "3D", "details (display)");432 acceleration << QApplication::translate("UIDetails", "3D", "details (display)"); 433 433 if (!acceleration.isEmpty()) 434 table << UITextTableLine(QApplication::translate("UI GDetails", "Acceleration", "details (display)"),434 table << UITextTableLine(QApplication::translate("UIDetails", "Acceleration", "details (display)"), 435 435 acceleration.join(", ")); 436 436 … … 440 440 { 441 441 if (srv.GetEnabled()) 442 table << UITextTableLine(QApplication::translate("UI GDetails", "Remote Desktop Server Port", "details (display/vrde)"),442 table << UITextTableLine(QApplication::translate("UIDetails", "Remote Desktop Server Port", "details (display/vrde)"), 443 443 srv.GetVRDEProperty("TCP/Ports")); 444 444 else 445 table << UITextTableLine(QApplication::translate("UI GDetails", "Remote Desktop Server", "details (display/vrde)"),446 QApplication::translate("UI GDetails", "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)")); 447 447 } 448 448 … … 450 450 if (machine.GetVideoCaptureEnabled()) 451 451 { 452 table << UITextTableLine(QApplication::translate("UI GDetails", "Video Capture File", "details (display/video capture)"),452 table << UITextTableLine(QApplication::translate("UIDetails", "Video Capture File", "details (display/video capture)"), 453 453 machine.GetVideoCaptureFile()); 454 table << UITextTableLine(QApplication::translate("UI GDetails", "Video Capture Attributes", "details (display/video capture)"),455 QApplication::translate("UI GDetails", "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") 456 456 .arg(machine.GetVideoCaptureWidth()).arg(machine.GetVideoCaptureHeight()) 457 457 .arg(machine.GetVideoCaptureFPS()).arg(machine.GetVideoCaptureRate())); … … 459 459 else 460 460 { 461 table << UITextTableLine(QApplication::translate("UI GDetails", "Video Capture", "details (display/video capture)"),462 QApplication::translate("UI GDetails", "Disabled", "details (display/video capture)"));463 } 464 } 465 else 466 table << UITextTableLine(QApplication::translate("UI GDetails", "Information Inaccessible", "details"), QString());467 468 /* Save the table as property: */ 469 setProperty("table", QVariant::fromValue(table)); 470 } 471 472 473 void UI GDetailsUpdateTaskStorage::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 473 void UIDetailsUpdateTaskStorage::run() 474 474 { 475 475 /* Acquire corresponding machine: */ … … 514 514 KDeviceType deviceType = attachment.GetType(); 515 515 QString strDeviceType = deviceType == KDeviceType_DVD ? 516 QApplication::translate("UI GDetails", "[Optical Drive]", "details (storage)") : QString();516 QApplication::translate("UIDetails", "[Optical Drive]", "details (storage)") : QString(); 517 517 if (!strDeviceType.isNull()) 518 518 strDeviceType.append(' '); … … 541 541 } 542 542 if (!fSomeInfo) 543 table << UITextTableLine(QApplication::translate("UI GDetails", "Not Attached", "details (storage)"), QString());544 } 545 else 546 table << UITextTableLine(QApplication::translate("UI GDetails", "Information Inaccessible", "details"), QString());547 548 /* Save the table as property: */ 549 setProperty("table", QVariant::fromValue(table)); 550 } 551 552 553 void UI GDetailsUpdateTaskAudio::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 553 void UIDetailsUpdateTaskAudio::run() 554 554 { 555 555 /* Acquire corresponding machine: */ … … 568 568 { 569 569 /* Driver: */ 570 table << UITextTableLine(QApplication::translate("UI GDetails", "Host Driver", "details (audio)"),570 table << UITextTableLine(QApplication::translate("UIDetails", "Host Driver", "details (audio)"), 571 571 gpConverter->toString(audio.GetAudioDriver())); 572 572 573 573 /* Controller: */ 574 table << UITextTableLine(QApplication::translate("UI GDetails", "Controller", "details (audio)"),574 table << UITextTableLine(QApplication::translate("UIDetails", "Controller", "details (audio)"), 575 575 gpConverter->toString(audio.GetAudioController())); 576 576 577 577 #ifdef VBOX_WITH_AUDIO_INOUT_INFO 578 578 /* Output: */ 579 table << UITextTableLine(QApplication::translate("UI GDetails", "Audio Output", "details (audio)"),579 table << UITextTableLine(QApplication::translate("UIDetails", "Audio Output", "details (audio)"), 580 580 audio.GetEnabledOut() ? 581 QApplication::translate("UI GDetails", "Enabled", "details (audio/output)") :582 QApplication::translate("UI GDetails", "Disabled", "details (audio/output)"));581 QApplication::translate("UIDetails", "Enabled", "details (audio/output)") : 582 QApplication::translate("UIDetails", "Disabled", "details (audio/output)")); 583 583 584 584 /* Input: */ 585 table << UITextTableLine(QApplication::translate("UI GDetails", "Audio Input", "details (audio)"),585 table << UITextTableLine(QApplication::translate("UIDetails", "Audio Input", "details (audio)"), 586 586 audio.GetEnabledIn() ? 587 QApplication::translate("UI GDetails", "Enabled", "details (audio/input)") :588 QApplication::translate("UI GDetails", "Disabled", "details (audio/input)"));587 QApplication::translate("UIDetails", "Enabled", "details (audio/input)") : 588 QApplication::translate("UIDetails", "Disabled", "details (audio/input)")); 589 589 #endif /* VBOX_WITH_AUDIO_INOUT_INFO */ 590 590 } 591 591 else 592 table << UITextTableLine(QApplication::translate("UI GDetails", "Disabled", "details (audio)"),592 table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (audio)"), 593 593 QString()); 594 594 } 595 595 else 596 table << UITextTableLine(QApplication::translate("UI GDetails", "Information Inaccessible", "details"),596 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), 597 597 QString()); 598 598 … … 602 602 603 603 604 void UI GDetailsUpdateTaskNetwork::run()604 void UIDetailsUpdateTaskNetwork::run() 605 605 { 606 606 /* Acquire corresponding machine: */ … … 630 630 case KNetworkAttachmentType_Bridged: 631 631 { 632 strAttachmentType = strAttachmentType.arg(QApplication::translate("UI GDetails", "Bridged Adapter, %1", "details (network)")632 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "Bridged Adapter, %1", "details (network)") 633 633 .arg(adapter.GetBridgedInterface())); 634 634 break; … … 636 636 case KNetworkAttachmentType_Internal: 637 637 { 638 strAttachmentType = strAttachmentType.arg(QApplication::translate("UI GDetails", "Internal Network, '%1'", "details (network)")638 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "Internal Network, '%1'", "details (network)") 639 639 .arg(adapter.GetInternalNetwork())); 640 640 break; … … 642 642 case KNetworkAttachmentType_HostOnly: 643 643 { 644 strAttachmentType = strAttachmentType.arg(QApplication::translate("UI GDetails", "Host-only Adapter, '%1'", "details (network)")644 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "Host-only Adapter, '%1'", "details (network)") 645 645 .arg(adapter.GetHostOnlyInterface())); 646 646 break; … … 650 650 QString strGenericDriverProperties(summarizeGenericProperties(adapter)); 651 651 strAttachmentType = strGenericDriverProperties.isNull() ? 652 strAttachmentType.arg(QApplication::translate("UI GDetails", "Generic Driver, '%1'", "details (network)").arg(adapter.GetGenericDriver())) :653 strAttachmentType.arg(QApplication::translate("UI GDetails", "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)") 654 654 .arg(adapter.GetGenericDriver(), strGenericDriverProperties)); 655 655 break; … … 657 657 case KNetworkAttachmentType_NATNetwork: 658 658 { 659 strAttachmentType = strAttachmentType.arg(QApplication::translate("UI GDetails", "NAT Network, '%1'", "details (network)")659 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "NAT Network, '%1'", "details (network)") 660 660 .arg(adapter.GetNATNetwork())); 661 661 break; … … 667 667 } 668 668 } 669 table << UITextTableLine(QApplication::translate("UI GDetails", "Adapter %1", "details (network)").arg(adapter.GetSlot() + 1), strAttachmentType);669 table << UITextTableLine(QApplication::translate("UIDetails", "Adapter %1", "details (network)").arg(adapter.GetSlot() + 1), strAttachmentType); 670 670 fSomeInfo = true; 671 671 } 672 672 } 673 673 if (!fSomeInfo) 674 table << UITextTableLine(QApplication::translate("UI GDetails", "Disabled", "details (network/adapter)"), QString());675 } 676 else 677 table << UITextTableLine(QApplication::translate("UI GDetails", "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()); 678 678 679 679 /* Save the table as property: */ … … 682 682 683 683 /* static */ 684 QString UI GDetailsUpdateTaskNetwork::summarizeGenericProperties(const CNetworkAdapter &adapter)684 QString UIDetailsUpdateTaskNetwork::summarizeGenericProperties(const CNetworkAdapter &adapter) 685 685 { 686 686 QVector<QString> names; … … 698 698 699 699 700 void UI GDetailsUpdateTaskSerial::run()700 void UIDetailsUpdateTaskSerial::run() 701 701 { 702 702 /* Acquire corresponding machine: */ … … 726 726 else 727 727 data += gpConverter->toString(mode); 728 table << UITextTableLine(QApplication::translate("UI GDetails", "Port %1", "details (serial)").arg(port.GetSlot() + 1), data);728 table << UITextTableLine(QApplication::translate("UIDetails", "Port %1", "details (serial)").arg(port.GetSlot() + 1), data); 729 729 fSomeInfo = true; 730 730 } 731 731 } 732 732 if (!fSomeInfo) 733 table << UITextTableLine(QApplication::translate("UI GDetails", "Disabled", "details (serial)"), QString());734 } 735 else 736 table << UITextTableLine(QApplication::translate("UI GDetails", "Information Inaccessible", "details"), QString());737 738 /* Save the table as property: */ 739 setProperty("table", QVariant::fromValue(table)); 740 } 741 742 743 void UI GDetailsUpdateTaskUSB::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 743 void UIDetailsUpdateTaskUSB::run() 744 744 { 745 745 /* Acquire corresponding machine: */ … … 766 766 foreach (const CUSBController &controller, controllers) 767 767 controllerList << gpConverter->toString(controller.GetType()); 768 table << UITextTableLine(QApplication::translate("UI GDetails", "USB Controller", "details (usb)"),768 table << UITextTableLine(QApplication::translate("UIDetails", "USB Controller", "details (usb)"), 769 769 controllerList.join(", ")); 770 770 /* USB Device Filters info: */ … … 774 774 if (coll[i].GetActive()) 775 775 ++uActive; 776 table << UITextTableLine(QApplication::translate("UI GDetails", "Device Filters", "details (usb)"),777 QApplication::translate("UI GDetails", "%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)); 778 778 } 779 779 else 780 table << UITextTableLine(QApplication::translate("UI GDetails", "Disabled", "details (usb)"), QString());780 table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (usb)"), QString()); 781 781 } 782 782 else 783 table << UITextTableLine(QApplication::translate("UI GDetails", "USB Controller Inaccessible", "details (usb)"), QString());784 } 785 else 786 table << UITextTableLine(QApplication::translate("UI GDetails", "Information Inaccessible", "details"), QString());787 788 /* Save the table as property: */ 789 setProperty("table", QVariant::fromValue(table)); 790 } 791 792 793 void UI GDetailsUpdateTaskSF::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 793 void UIDetailsUpdateTaskSF::run() 794 794 { 795 795 /* Acquire corresponding machine: */ … … 807 807 ulong uCount = machine.GetSharedFolders().size(); 808 808 if (uCount > 0) 809 table << UITextTableLine(QApplication::translate("UI GDetails", "Shared Folders", "details (shared folders)"), QString::number(uCount));809 table << UITextTableLine(QApplication::translate("UIDetails", "Shared Folders", "details (shared folders)"), QString::number(uCount)); 810 810 else 811 table << UITextTableLine(QApplication::translate("UI GDetails", "None", "details (shared folders)"), QString());812 } 813 else 814 table << UITextTableLine(QApplication::translate("UI GDetails", "Information Inaccessible", "details"), QString());815 816 /* Save the table as property: */ 817 setProperty("table", QVariant::fromValue(table)); 818 } 819 820 821 void UI GDetailsUpdateTaskUI::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 821 void UIDetailsUpdateTaskUI::run() 822 822 { 823 823 /* Acquire corresponding machine: */ … … 842 842 strMenubarEnabled == "0"); 843 843 /* Append information: */ 844 table << UITextTableLine(QApplication::translate("UI GDetails", "Menu-bar", "details (user interface)"),845 fEnabled ? QApplication::translate("UI GDetails", "Enabled", "details (user interface/menu-bar)") :846 QApplication::translate("UI GDetails", "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)")); 847 847 } 848 848 #endif /* !VBOX_WS_MAC */ … … 857 857 strStatusbarEnabled == "0"); 858 858 /* Append information: */ 859 table << UITextTableLine(QApplication::translate("UI GDetails", "Status-bar", "details (user interface)"),860 fEnabled ? QApplication::translate("UI GDetails", "Enabled", "details (user interface/status-bar)") :861 QApplication::translate("UI GDetails", "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)")); 862 862 } 863 863 … … 882 882 /* Append information: */ 883 883 case MiniToolbarAlignment_Top: 884 table << UITextTableLine(QApplication::translate("UI GDetails", "Mini-toolbar Position", "details (user interface)"),885 QApplication::translate("UI GDetails", "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)")); 886 886 break; 887 887 /* Append information: */ 888 888 case MiniToolbarAlignment_Bottom: 889 table << UITextTableLine(QApplication::translate("UI GDetails", "Mini-toolbar Position", "details (user interface)"),890 QApplication::translate("UI GDetails", "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)")); 891 891 break; 892 892 } … … 895 895 /* Append information: */ 896 896 else 897 table << UITextTableLine(QApplication::translate("UI GDetails", "Mini-toolbar", "details (user interface)"),898 QApplication::translate("UI GDetails", "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)")); 899 899 } 900 900 #endif /* !VBOX_WS_MAC */ 901 901 } 902 902 else 903 table << UITextTableLine(QApplication::translate("UI GDetails", "Information Inaccessible", "details"), QString());904 905 /* Save the table as property: */ 906 setProperty("table", QVariant::fromValue(table)); 907 } 908 909 910 void UI GDetailsUpdateTaskDescription::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 910 void UIDetailsUpdateTaskDescription::run() 911 911 { 912 912 /* Acquire corresponding machine: */ … … 926 926 table << UITextTableLine(strDesc, QString()); 927 927 else 928 table << UITextTableLine(QApplication::translate("UI GDetails", "None", "details (description)"), QString());929 } 930 else 931 table << UITextTableLine(QApplication::translate("UI GDetails", "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 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsElement[Name] classes declaration.3 * VBox Qt GUI - UIDetailsElement[Name] classes declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef ___UI GDetailsElements_h___19 #define ___UI GDetailsElements_h___18 #ifndef ___UIDetailsElements_h___ 19 #define ___UIDetailsElements_h___ 20 20 21 21 /* GUI includes: */ 22 22 #include "UIThreadPool.h" 23 #include "UI GDetailsElement.h"23 #include "UIDetailsElement.h" 24 24 25 25 /* Forward declarations: */ 26 class UI GMachinePreview;26 class UIMachinePreview; 27 27 class CNetworkAdapter; 28 28 29 29 30 30 /** UITask extension used as update task for the details-element. */ 31 class UI GDetailsUpdateTask : public UITask31 class UIDetailsUpdateTask : public UITask 32 32 { 33 33 Q_OBJECT; … … 36 36 37 37 /** Constructs update task taking @a machine as data. */ 38 UI GDetailsUpdateTask(const CMachine &machine);39 }; 40 41 /** UI GDetailsElement extension used as a wrapping interface to38 UIDetailsUpdateTask(const CMachine &machine); 39 }; 40 41 /** UIDetailsElement extension used as a wrapping interface to 42 42 * extend base-class with async functionality performed by the COM worker-threads. */ 43 class UI GDetailsElementInterface : public UIGDetailsElement43 class UIDetailsElementInterface : public UIDetailsElement 44 44 { 45 45 Q_OBJECT; … … 50 50 * @param type brings the details-element type this element belongs to. 51 51 * @param fOpened brings whether the details-element should be visually opened. */ 52 UI GDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened);52 UIDetailsElementInterface(UIDetailsSet *pParent, DetailsElementType type, bool fOpened); 53 53 54 54 protected: … … 75 75 76 76 77 /** UI GDetailsElementInterface extension for the details-element type 'Preview'. */78 class UI GDetailsElementPreview : public UIGDetailsElement77 /** UIDetailsElementInterface extension for the details-element type 'Preview'. */ 78 class UIDetailsElementPreview : public UIDetailsElement 79 79 { 80 80 Q_OBJECT; … … 84 84 /** Constructs details-element interface for passed @a pParent set. 85 85 * @param fOpened brings whether the details-element should be opened. */ 86 UI GDetailsElementPreview(UIGDetailsSet *pParent, bool fOpened);86 UIDetailsElementPreview(UIDetailsSet *pParent, bool fOpened); 87 87 88 88 private slots: … … 109 109 110 110 /** Holds the instance of VM preview. */ 111 UI GMachinePreview *m_pPreview;111 UIMachinePreview *m_pPreview; 112 112 }; 113 113 114 114 115 115 /** UITask extension used as update task for the details-element type 'General'. */ 116 class UI GDetailsUpdateTaskGeneral : public UIGDetailsUpdateTask117 { 118 Q_OBJECT; 119 120 public: 121 122 /** Constructs update task passing @a machine to the base-class. */ 123 UI GDetailsUpdateTaskGeneral(const CMachine &machine)124 : UI GDetailsUpdateTask(machine) {}125 126 private: 127 128 /** Contains update task body. */ 129 void run(); 130 }; 131 132 /** UI GDetailsElementInterface extension for the details-element type 'General'. */133 class UI GDetailsElementGeneral : public UIGDetailsElementInterface134 { 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 UI GDetailsElementGeneral(UIGDetailsSet *pParent, bool fOpened)142 : UI GDetailsElementInterface(pParent, DetailsElementType_General, fOpened) {}143 144 private: 145 146 /** Creates update task for this element. */ 147 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskGeneral(machine()); }116 class UIDetailsUpdateTaskGeneral : public UIDetailsUpdateTask 117 { 118 Q_OBJECT; 119 120 public: 121 122 /** Constructs update task passing @a machine to the base-class. */ 123 UIDetailsUpdateTaskGeneral(const CMachine &machine) 124 : UIDetailsUpdateTask(machine) {} 125 126 private: 127 128 /** Contains update task body. */ 129 void run(); 130 }; 131 132 /** UIDetailsElementInterface extension for the details-element type 'General'. */ 133 class UIDetailsElementGeneral : public UIDetailsElementInterface 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 UIDetailsElementGeneral(UIDetailsSet *pParent, bool fOpened) 142 : UIDetailsElementInterface(pParent, DetailsElementType_General, fOpened) {} 143 144 private: 145 146 /** Creates update task for this element. */ 147 UITask* createUpdateTask() { return new UIDetailsUpdateTaskGeneral(machine()); } 148 148 }; 149 149 150 150 151 151 /** UITask extension used as update task for the details-element type 'System'. */ 152 class UI GDetailsUpdateTaskSystem : public UIGDetailsUpdateTask153 { 154 Q_OBJECT; 155 156 public: 157 158 /** Constructs update task passing @a machine to the base-class. */ 159 UI GDetailsUpdateTaskSystem(const CMachine &machine)160 : UI GDetailsUpdateTask(machine) {}161 162 private: 163 164 /** Contains update task body. */ 165 void run(); 166 }; 167 168 /** UI GDetailsElementInterface extension for the details-element type 'System'. */169 class UI GDetailsElementSystem : public UIGDetailsElementInterface170 { 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 UI GDetailsElementSystem(UIGDetailsSet *pParent, bool fOpened)178 : UI GDetailsElementInterface(pParent, DetailsElementType_System, fOpened) {}179 180 private: 181 182 /** Creates update task for this element. */ 183 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskSystem(machine()); }152 class UIDetailsUpdateTaskSystem : public UIDetailsUpdateTask 153 { 154 Q_OBJECT; 155 156 public: 157 158 /** Constructs update task passing @a machine to the base-class. */ 159 UIDetailsUpdateTaskSystem(const CMachine &machine) 160 : UIDetailsUpdateTask(machine) {} 161 162 private: 163 164 /** Contains update task body. */ 165 void run(); 166 }; 167 168 /** UIDetailsElementInterface extension for the details-element type 'System'. */ 169 class UIDetailsElementSystem : public UIDetailsElementInterface 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 UIDetailsElementSystem(UIDetailsSet *pParent, bool fOpened) 178 : UIDetailsElementInterface(pParent, DetailsElementType_System, fOpened) {} 179 180 private: 181 182 /** Creates update task for this element. */ 183 UITask* createUpdateTask() { return new UIDetailsUpdateTaskSystem(machine()); } 184 184 }; 185 185 186 186 187 187 /** UITask extension used as update task for the details-element type 'Display'. */ 188 class UI GDetailsUpdateTaskDisplay : public UIGDetailsUpdateTask189 { 190 Q_OBJECT; 191 192 public: 193 194 /** Constructs update task passing @a machine to the base-class. */ 195 UI GDetailsUpdateTaskDisplay(const CMachine &machine)196 : UI GDetailsUpdateTask(machine) {}197 198 private: 199 200 /** Contains update task body. */ 201 void run(); 202 }; 203 204 /** UI GDetailsElementInterface extension for the details-element type 'Display'. */205 class UI GDetailsElementDisplay : public UIGDetailsElementInterface206 { 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 UI GDetailsElementDisplay(UIGDetailsSet *pParent, bool fOpened)214 : UI GDetailsElementInterface(pParent, DetailsElementType_Display, fOpened) {}215 216 private: 217 218 /** Creates update task for this element. */ 219 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskDisplay(machine()); }188 class UIDetailsUpdateTaskDisplay : public UIDetailsUpdateTask 189 { 190 Q_OBJECT; 191 192 public: 193 194 /** Constructs update task passing @a machine to the base-class. */ 195 UIDetailsUpdateTaskDisplay(const CMachine &machine) 196 : UIDetailsUpdateTask(machine) {} 197 198 private: 199 200 /** Contains update task body. */ 201 void run(); 202 }; 203 204 /** UIDetailsElementInterface extension for the details-element type 'Display'. */ 205 class UIDetailsElementDisplay : public UIDetailsElementInterface 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 UIDetailsElementDisplay(UIDetailsSet *pParent, bool fOpened) 214 : UIDetailsElementInterface(pParent, DetailsElementType_Display, fOpened) {} 215 216 private: 217 218 /** Creates update task for this element. */ 219 UITask* createUpdateTask() { return new UIDetailsUpdateTaskDisplay(machine()); } 220 220 }; 221 221 222 222 223 223 /** UITask extension used as update task for the details-element type 'Storage'. */ 224 class UI GDetailsUpdateTaskStorage : public UIGDetailsUpdateTask225 { 226 Q_OBJECT; 227 228 public: 229 230 /** Constructs update task passing @a machine to the base-class. */ 231 UI GDetailsUpdateTaskStorage(const CMachine &machine)232 : UI GDetailsUpdateTask(machine) {}233 234 private: 235 236 /** Contains update task body. */ 237 void run(); 238 }; 239 240 /** UI GDetailsElementInterface extension for the details-element type 'Storage'. */241 class UI GDetailsElementStorage : public UIGDetailsElementInterface242 { 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 UI GDetailsElementStorage(UIGDetailsSet *pParent, bool fOpened)250 : UI GDetailsElementInterface(pParent, DetailsElementType_Storage, fOpened) {}251 252 private: 253 254 /** Creates update task for this element. */ 255 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskStorage(machine()); }224 class UIDetailsUpdateTaskStorage : public UIDetailsUpdateTask 225 { 226 Q_OBJECT; 227 228 public: 229 230 /** Constructs update task passing @a machine to the base-class. */ 231 UIDetailsUpdateTaskStorage(const CMachine &machine) 232 : UIDetailsUpdateTask(machine) {} 233 234 private: 235 236 /** Contains update task body. */ 237 void run(); 238 }; 239 240 /** UIDetailsElementInterface extension for the details-element type 'Storage'. */ 241 class UIDetailsElementStorage : public UIDetailsElementInterface 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 UIDetailsElementStorage(UIDetailsSet *pParent, bool fOpened) 250 : UIDetailsElementInterface(pParent, DetailsElementType_Storage, fOpened) {} 251 252 private: 253 254 /** Creates update task for this element. */ 255 UITask* createUpdateTask() { return new UIDetailsUpdateTaskStorage(machine()); } 256 256 }; 257 257 258 258 259 259 /** UITask extension used as update task for the details-element type 'Audio'. */ 260 class UI GDetailsUpdateTaskAudio : public UIGDetailsUpdateTask261 { 262 Q_OBJECT; 263 264 public: 265 266 /** Constructs update task passing @a machine to the base-class. */ 267 UI GDetailsUpdateTaskAudio(const CMachine &machine)268 : UI GDetailsUpdateTask(machine) {}269 270 private: 271 272 /** Contains update task body. */ 273 void run(); 274 }; 275 276 /** UI GDetailsElementInterface extension for the details-element type 'Audio'. */277 class UI GDetailsElementAudio : public UIGDetailsElementInterface278 { 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 UI GDetailsElementAudio(UIGDetailsSet *pParent, bool fOpened)286 : UI GDetailsElementInterface(pParent, DetailsElementType_Audio, fOpened) {}287 288 private: 289 290 /** Creates update task for this element. */ 291 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskAudio(machine()); }260 class UIDetailsUpdateTaskAudio : public UIDetailsUpdateTask 261 { 262 Q_OBJECT; 263 264 public: 265 266 /** Constructs update task passing @a machine to the base-class. */ 267 UIDetailsUpdateTaskAudio(const CMachine &machine) 268 : UIDetailsUpdateTask(machine) {} 269 270 private: 271 272 /** Contains update task body. */ 273 void run(); 274 }; 275 276 /** UIDetailsElementInterface extension for the details-element type 'Audio'. */ 277 class UIDetailsElementAudio : public UIDetailsElementInterface 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 UIDetailsElementAudio(UIDetailsSet *pParent, bool fOpened) 286 : UIDetailsElementInterface(pParent, DetailsElementType_Audio, fOpened) {} 287 288 private: 289 290 /** Creates update task for this element. */ 291 UITask* createUpdateTask() { return new UIDetailsUpdateTaskAudio(machine()); } 292 292 }; 293 293 294 294 295 295 /** UITask extension used as update task for the details-element type 'Network'. */ 296 class UI GDetailsUpdateTaskNetwork : public UIGDetailsUpdateTask297 { 298 Q_OBJECT; 299 300 public: 301 302 /** Constructs update task passing @a machine to the base-class. */ 303 UI GDetailsUpdateTaskNetwork(const CMachine &machine)304 : UI GDetailsUpdateTask(machine) {}296 class UIDetailsUpdateTaskNetwork : public UIDetailsUpdateTask 297 { 298 Q_OBJECT; 299 300 public: 301 302 /** Constructs update task passing @a machine to the base-class. */ 303 UIDetailsUpdateTaskNetwork(const CMachine &machine) 304 : UIDetailsUpdateTask(machine) {} 305 305 306 306 private: … … 313 313 }; 314 314 315 /** UI GDetailsElementInterface extension for the details-element type 'Network'. */316 class UI GDetailsElementNetwork : public UIGDetailsElementInterface317 { 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 UI GDetailsElementNetwork(UIGDetailsSet *pParent, bool fOpened)325 : UI GDetailsElementInterface(pParent, DetailsElementType_Network, fOpened) {}326 327 private: 328 329 /** Creates update task for this element. */ 330 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskNetwork(machine()); }315 /** UIDetailsElementInterface extension for the details-element type 'Network'. */ 316 class UIDetailsElementNetwork : public UIDetailsElementInterface 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 UIDetailsElementNetwork(UIDetailsSet *pParent, bool fOpened) 325 : UIDetailsElementInterface(pParent, DetailsElementType_Network, fOpened) {} 326 327 private: 328 329 /** Creates update task for this element. */ 330 UITask* createUpdateTask() { return new UIDetailsUpdateTaskNetwork(machine()); } 331 331 }; 332 332 333 333 334 334 /** UITask extension used as update task for the details-element type 'Serial'. */ 335 class UI GDetailsUpdateTaskSerial : public UIGDetailsUpdateTask336 { 337 Q_OBJECT; 338 339 public: 340 341 /** Constructs update task passing @a machine to the base-class. */ 342 UI GDetailsUpdateTaskSerial(const CMachine &machine)343 : UI GDetailsUpdateTask(machine) {}344 345 private: 346 347 /** Contains update task body. */ 348 void run(); 349 }; 350 351 /** UI GDetailsElementInterface extension for the details-element type 'Serial'. */352 class UI GDetailsElementSerial : public UIGDetailsElementInterface353 { 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 UI GDetailsElementSerial(UIGDetailsSet *pParent, bool fOpened)361 : UI GDetailsElementInterface(pParent, DetailsElementType_Serial, fOpened) {}362 363 private: 364 365 /** Creates update task for this element. */ 366 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskSerial(machine()); }335 class UIDetailsUpdateTaskSerial : public UIDetailsUpdateTask 336 { 337 Q_OBJECT; 338 339 public: 340 341 /** Constructs update task passing @a machine to the base-class. */ 342 UIDetailsUpdateTaskSerial(const CMachine &machine) 343 : UIDetailsUpdateTask(machine) {} 344 345 private: 346 347 /** Contains update task body. */ 348 void run(); 349 }; 350 351 /** UIDetailsElementInterface extension for the details-element type 'Serial'. */ 352 class UIDetailsElementSerial : public UIDetailsElementInterface 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 UIDetailsElementSerial(UIDetailsSet *pParent, bool fOpened) 361 : UIDetailsElementInterface(pParent, DetailsElementType_Serial, fOpened) {} 362 363 private: 364 365 /** Creates update task for this element. */ 366 UITask* createUpdateTask() { return new UIDetailsUpdateTaskSerial(machine()); } 367 367 }; 368 368 369 369 370 370 /** UITask extension used as update task for the details-element type 'USB'. */ 371 class UI GDetailsUpdateTaskUSB : public UIGDetailsUpdateTask372 { 373 Q_OBJECT; 374 375 public: 376 377 /** Constructs update task passing @a machine to the base-class. */ 378 UI GDetailsUpdateTaskUSB(const CMachine &machine)379 : UI GDetailsUpdateTask(machine) {}380 381 private: 382 383 /** Contains update task body. */ 384 void run(); 385 }; 386 387 /** UI GDetailsElementInterface extension for the details-element type 'USB'. */388 class UI GDetailsElementUSB : public UIGDetailsElementInterface389 { 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 UI GDetailsElementUSB(UIGDetailsSet *pParent, bool fOpened)397 : UI GDetailsElementInterface(pParent, DetailsElementType_USB, fOpened) {}398 399 private: 400 401 /** Creates update task for this element. */ 402 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskUSB(machine()); }371 class UIDetailsUpdateTaskUSB : public UIDetailsUpdateTask 372 { 373 Q_OBJECT; 374 375 public: 376 377 /** Constructs update task passing @a machine to the base-class. */ 378 UIDetailsUpdateTaskUSB(const CMachine &machine) 379 : UIDetailsUpdateTask(machine) {} 380 381 private: 382 383 /** Contains update task body. */ 384 void run(); 385 }; 386 387 /** UIDetailsElementInterface extension for the details-element type 'USB'. */ 388 class UIDetailsElementUSB : public UIDetailsElementInterface 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 UIDetailsElementUSB(UIDetailsSet *pParent, bool fOpened) 397 : UIDetailsElementInterface(pParent, DetailsElementType_USB, fOpened) {} 398 399 private: 400 401 /** Creates update task for this element. */ 402 UITask* createUpdateTask() { return new UIDetailsUpdateTaskUSB(machine()); } 403 403 }; 404 404 405 405 406 406 /** UITask extension used as update task for the details-element type 'SF'. */ 407 class UI GDetailsUpdateTaskSF : public UIGDetailsUpdateTask408 { 409 Q_OBJECT; 410 411 public: 412 413 /** Constructs update task passing @a machine to the base-class. */ 414 UI GDetailsUpdateTaskSF(const CMachine &machine)415 : UI GDetailsUpdateTask(machine) {}416 417 private: 418 419 /** Contains update task body. */ 420 void run(); 421 }; 422 423 /** UI GDetailsElementInterface extension for the details-element type 'SF'. */424 class UI GDetailsElementSF : public UIGDetailsElementInterface425 { 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 UI GDetailsElementSF(UIGDetailsSet *pParent, bool fOpened)433 : UI GDetailsElementInterface(pParent, DetailsElementType_SF, fOpened) {}434 435 private: 436 437 /** Creates update task for this element. */ 438 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskSF(machine()); }407 class UIDetailsUpdateTaskSF : public UIDetailsUpdateTask 408 { 409 Q_OBJECT; 410 411 public: 412 413 /** Constructs update task passing @a machine to the base-class. */ 414 UIDetailsUpdateTaskSF(const CMachine &machine) 415 : UIDetailsUpdateTask(machine) {} 416 417 private: 418 419 /** Contains update task body. */ 420 void run(); 421 }; 422 423 /** UIDetailsElementInterface extension for the details-element type 'SF'. */ 424 class UIDetailsElementSF : public UIDetailsElementInterface 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 UIDetailsElementSF(UIDetailsSet *pParent, bool fOpened) 433 : UIDetailsElementInterface(pParent, DetailsElementType_SF, fOpened) {} 434 435 private: 436 437 /** Creates update task for this element. */ 438 UITask* createUpdateTask() { return new UIDetailsUpdateTaskSF(machine()); } 439 439 }; 440 440 441 441 442 442 /** UITask extension used as update task for the details-element type 'UI'. */ 443 class UI GDetailsUpdateTaskUI : public UIGDetailsUpdateTask444 { 445 Q_OBJECT; 446 447 public: 448 449 /** Constructs update task passing @a machine to the base-class. */ 450 UI GDetailsUpdateTaskUI(const CMachine &machine)451 : UI GDetailsUpdateTask(machine) {}452 453 private: 454 455 /** Contains update task body. */ 456 void run(); 457 }; 458 459 /** UI GDetailsElementInterface extension for the details-element type 'UI'. */460 class UI GDetailsElementUI : public UIGDetailsElementInterface461 { 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 UI GDetailsElementUI(UIGDetailsSet *pParent, bool fOpened)469 : UI GDetailsElementInterface(pParent, DetailsElementType_UI, fOpened) {}470 471 private: 472 473 /** Creates update task for this element. */ 474 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskUI(machine()); }443 class UIDetailsUpdateTaskUI : public UIDetailsUpdateTask 444 { 445 Q_OBJECT; 446 447 public: 448 449 /** Constructs update task passing @a machine to the base-class. */ 450 UIDetailsUpdateTaskUI(const CMachine &machine) 451 : UIDetailsUpdateTask(machine) {} 452 453 private: 454 455 /** Contains update task body. */ 456 void run(); 457 }; 458 459 /** UIDetailsElementInterface extension for the details-element type 'UI'. */ 460 class UIDetailsElementUI : public UIDetailsElementInterface 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 UIDetailsElementUI(UIDetailsSet *pParent, bool fOpened) 469 : UIDetailsElementInterface(pParent, DetailsElementType_UI, fOpened) {} 470 471 private: 472 473 /** Creates update task for this element. */ 474 UITask* createUpdateTask() { return new UIDetailsUpdateTaskUI(machine()); } 475 475 }; 476 476 477 477 478 478 /** UITask extension used as update task for the details-element type 'Description'. */ 479 class UI GDetailsUpdateTaskDescription : public UIGDetailsUpdateTask480 { 481 Q_OBJECT; 482 483 public: 484 485 /** Constructs update task passing @a machine to the base-class. */ 486 UI GDetailsUpdateTaskDescription(const CMachine &machine)487 : UI GDetailsUpdateTask(machine) {}488 489 private: 490 491 /** Contains update task body. */ 492 void run(); 493 }; 494 495 /** UI GDetailsElementInterface extension for the details-element type 'Description'. */496 class UI GDetailsElementDescription : public UIGDetailsElementInterface497 { 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 UI GDetailsElementDescription(UIGDetailsSet *pParent, bool fOpened)505 : UI GDetailsElementInterface(pParent, DetailsElementType_Description, fOpened) {}506 507 private: 508 509 /** Creates update task for this element. */ 510 UITask* createUpdateTask() { return new UI GDetailsUpdateTaskDescription(machine()); }511 }; 512 513 #endif /* !___UI GDetailsElements_h___ */514 479 class UIDetailsUpdateTaskDescription : public UIDetailsUpdateTask 480 { 481 Q_OBJECT; 482 483 public: 484 485 /** Constructs update task passing @a machine to the base-class. */ 486 UIDetailsUpdateTaskDescription(const CMachine &machine) 487 : UIDetailsUpdateTask(machine) {} 488 489 private: 490 491 /** Contains update task body. */ 492 void run(); 493 }; 494 495 /** UIDetailsElementInterface extension for the details-element type 'Description'. */ 496 class UIDetailsElementDescription : public UIDetailsElementInterface 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 UIDetailsElementDescription(UIDetailsSet *pParent, bool fOpened) 505 : UIDetailsElementInterface(pParent, DetailsElementType_Description, fOpened) {} 506 507 private: 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 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsGroup class implementation.3 * VBox Qt GUI - UIDetailsGroup class implementation. 4 4 */ 5 5 … … 25 25 26 26 /* GUI includes: */ 27 # include "UI GDetailsGroup.h"28 # include "UI GDetailsSet.h"29 # include "UI GDetailsModel.h"27 # include "UIDetailsGroup.h" 28 # include "UIDetailsSet.h" 29 # include "UIDetailsModel.h" 30 30 # include "UIExtraDataManager.h" 31 31 # include "VBoxGlobal.h" 32 # include "UIV MItem.h"32 # include "UIVirtualMachineItem.h" 33 33 34 34 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 35 35 36 36 37 UI GDetailsGroup::UIGDetailsGroup(QGraphicsScene *pParent)38 : UI GDetailsItem(0)37 UIDetailsGroup::UIDetailsGroup(QGraphicsScene *pParent) 38 : UIDetailsItem(0) 39 39 , m_iPreviousMinimumWidthHint(0) 40 40 , m_iPreviousMinimumHeightHint(0) … … 48 48 } 49 49 50 UI GDetailsGroup::~UIGDetailsGroup()50 UIDetailsGroup::~UIDetailsGroup() 51 51 { 52 52 /* Cleanup items: */ … … 54 54 } 55 55 56 void UI GDetailsGroup::buildGroup(const QList<UIVMItem*> &machineItems)56 void UIDetailsGroup::buildGroup(const QList<UIVirtualMachineItem*> &machineItems) 57 57 { 58 58 /* Remember passed machine-items: */ … … 70 70 } 71 71 72 void UI GDetailsGroup::rebuildGroup()72 void UIDetailsGroup::rebuildGroup() 73 73 { 74 74 /* Cleanup build-step: */ … … 83 83 } 84 84 85 void UI GDetailsGroup::stopBuildingGroup()85 void UIDetailsGroup::stopBuildingGroup() 86 86 { 87 87 /* Generate new group-id: */ … … 89 89 } 90 90 91 void UI GDetailsGroup::sltBuildStep(QString strStepId, int iStepNumber)91 void UIDetailsGroup::sltBuildStep(QString strStepId, int iStepNumber) 92 92 { 93 93 /* Cleanup build-step: */ … … 103 103 { 104 104 /* Should we create a new set for this step? */ 105 UI GDetailsSet *pSet = 0;105 UIDetailsSet *pSet = 0; 106 106 if (iStepNumber > m_items.size() - 1) 107 pSet = new UI GDetailsSet(this);107 pSet = new UIDetailsSet(this); 108 108 /* Or use existing? */ 109 109 else … … 111 111 112 112 /* Create next build-step: */ 113 m_pBuildStep = new UI BuildStep(this, pSet, strStepId, iStepNumber + 1);113 m_pBuildStep = new UIPrepareStep(this, pSet, strStepId, iStepNumber + 1); 114 114 115 115 /* Build set: */ … … 123 123 } 124 124 125 QVariant UI GDetailsGroup::data(int iKey) const125 QVariant UIDetailsGroup::data(int iKey) const 126 126 { 127 127 /* Provide other members with required data: */ … … 137 137 } 138 138 139 void UI GDetailsGroup::addItem(UIGDetailsItem *pItem)139 void UIDetailsGroup::addItem(UIDetailsItem *pItem) 140 140 { 141 141 switch (pItem->type()) 142 142 { 143 case UI GDetailsItemType_Set: m_items.append(pItem); break;144 default: AssertMsgFailed(("Invalid item type!")); break; 145 } 146 } 147 148 void UI GDetailsGroup::removeItem(UIGDetailsItem *pItem)143 case UIDetailsItemType_Set: m_items.append(pItem); break; 144 default: AssertMsgFailed(("Invalid item type!")); break; 145 } 146 } 147 148 void UIDetailsGroup::removeItem(UIDetailsItem *pItem) 149 149 { 150 150 switch (pItem->type()) 151 151 { 152 case UI GDetailsItemType_Set: m_items.removeAt(m_items.indexOf(pItem)); break;153 default: AssertMsgFailed(("Invalid item type!")); break; 154 } 155 } 156 157 QList<UI GDetailsItem*> UIGDetailsGroup::items(UIGDetailsItemType type /* = UIGDetailsItemType_Set */) const152 case UIDetailsItemType_Set: m_items.removeAt(m_items.indexOf(pItem)); break; 153 default: AssertMsgFailed(("Invalid item type!")); break; 154 } 155 } 156 157 QList<UIDetailsItem*> UIDetailsGroup::items(UIDetailsItemType type /* = UIDetailsItemType_Set */) const 158 158 { 159 159 switch (type) 160 160 { 161 case UI GDetailsItemType_Set: return m_items;162 case UI GDetailsItemType_Any: return items(UIGDetailsItemType_Set);163 default: AssertMsgFailed(("Invalid item type!")); break; 164 } 165 return QList<UI GDetailsItem*>();166 } 167 168 bool UI GDetailsGroup::hasItems(UIGDetailsItemType type /* = UIGDetailsItemType_Set */) const161 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 168 bool UIDetailsGroup::hasItems(UIDetailsItemType type /* = UIDetailsItemType_Set */) const 169 169 { 170 170 switch (type) 171 171 { 172 case UI GDetailsItemType_Set: return !m_items.isEmpty();173 case UI GDetailsItemType_Any: return hasItems(UIGDetailsItemType_Set);172 case UIDetailsItemType_Set: return !m_items.isEmpty(); 173 case UIDetailsItemType_Any: return hasItems(UIDetailsItemType_Set); 174 174 default: AssertMsgFailed(("Invalid item type!")); break; 175 175 } … … 177 177 } 178 178 179 void UI GDetailsGroup::clearItems(UIGDetailsItemType type /* = UIGDetailsItemType_Set */)179 void UIDetailsGroup::clearItems(UIDetailsItemType type /* = UIDetailsItemType_Set */) 180 180 { 181 181 switch (type) 182 182 { 183 case UI GDetailsItemType_Set: while (!m_items.isEmpty()) { delete m_items.last(); } break;184 case UI GDetailsItemType_Any: clearItems(UIGDetailsItemType_Set); break;185 default: AssertMsgFailed(("Invalid item type!")); break; 186 } 187 } 188 189 void UI GDetailsGroup::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 189 void UIDetailsGroup::prepareConnections() 190 190 { 191 191 /* Prepare group-item connections: */ … … 196 196 } 197 197 198 void UI GDetailsGroup::updateGeometry()198 void UIDetailsGroup::updateGeometry() 199 199 { 200 200 /* Call to base class: */ 201 UI GDetailsItem::updateGeometry();201 UIDetailsItem::updateGeometry(); 202 202 203 203 /* Group-item should notify details-view if minimum-width-hint was changed: */ … … 219 219 } 220 220 221 int UI GDetailsGroup::minimumWidthHint() const221 int UIDetailsGroup::minimumWidthHint() const 222 222 { 223 223 /* Prepare variables: */ … … 227 227 /* For each the set we have: */ 228 228 bool fHasItems = false; 229 foreach (UI GDetailsItem *pItem, items())229 foreach (UIDetailsItem *pItem, items()) 230 230 { 231 231 /* Ignore which are with no details: */ 232 if (UI GDetailsSet *pSetItem = pItem->toSet())232 if (UIDetailsSet *pSetItem = pItem->toSet()) 233 233 if (!pSetItem->hasDetails()) 234 234 continue; … … 247 247 } 248 248 249 int UI GDetailsGroup::minimumHeightHint() const249 int UIDetailsGroup::minimumHeightHint() const 250 250 { 251 251 /* Prepare variables: */ … … 256 256 /* For each the set we have: */ 257 257 bool fHasItems = false; 258 foreach (UI GDetailsItem *pItem, items())258 foreach (UIDetailsItem *pItem, items()) 259 259 { 260 260 /* Ignore which are with no details: */ 261 if (UI GDetailsSet *pSetItem = pItem->toSet())261 if (UIDetailsSet *pSetItem = pItem->toSet()) 262 262 if (!pSetItem->hasDetails()) 263 263 continue; … … 279 279 } 280 280 281 void UI GDetailsGroup::updateLayout()281 void UIDetailsGroup::updateLayout() 282 282 { 283 283 /* Prepare variables: */ … … 288 288 289 289 /* Layout all the sets: */ 290 foreach (UI GDetailsItem *pItem, items())290 foreach (UIDetailsItem *pItem, items()) 291 291 { 292 292 /* Ignore sets with no details: */ 293 if (UI GDetailsSet *pSetItem = pItem->toSet())293 if (UIDetailsSet *pSetItem = pItem->toSet()) 294 294 if (!pSetItem->hasDetails()) 295 295 continue; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsGroup.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsGroup class declaration.3 * VBox Qt GUI - UIDetailsGroup class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GDetailsGroup_h__19 #define __UI GDetailsGroup_h__18 #ifndef __UIDetailsGroup_h__ 19 #define __UIDetailsGroup_h__ 20 20 21 21 /* GUI includes: */ 22 #include "UI GDetailsItem.h"22 #include "UIDetailsItem.h" 23 23 24 24 /* Forward declarations: */ 25 class UIV MItem;25 class UIVirtualMachineItem; 26 26 class QGraphicsScene; 27 27 28 28 /* Details group 29 29 * for graphics details model/view architecture: */ 30 class UI GDetailsGroup : public UIGDetailsItem30 class UIDetailsGroup : public UIDetailsItem 31 31 { 32 32 Q_OBJECT; … … 41 41 42 42 /* Graphics-item type: */ 43 enum { Type = UI GDetailsItemType_Group };43 enum { Type = UIDetailsItemType_Group }; 44 44 int type() const { return Type; } 45 45 46 46 /* Constructor/destructor: */ 47 UI GDetailsGroup(QGraphicsScene *pParent);48 ~UI GDetailsGroup();47 UIDetailsGroup(QGraphicsScene *pParent); 48 ~UIDetailsGroup(); 49 49 50 50 /* API: Build stuff: */ 51 void buildGroup(const QList<UIV MItem*> &machineItems);51 void buildGroup(const QList<UIVirtualMachineItem*> &machineItems); 52 52 void rebuildGroup(); 53 53 void stopBuildingGroup(); … … 75 75 76 76 /* Hidden API: Children stuff: */ 77 void addItem(UI GDetailsItem *pItem);78 void removeItem(UI GDetailsItem *pItem);79 QList<UI GDetailsItem*> items(UIGDetailsItemType type = UIGDetailsItemType_Set) const;80 bool hasItems(UI GDetailsItemType type = UIGDetailsItemType_Set) const;81 void clearItems(UI GDetailsItemType 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); 82 82 83 83 /* Helpers: Prepare stuff: */ … … 93 93 int m_iPreviousMinimumWidthHint; 94 94 int m_iPreviousMinimumHeightHint; 95 QList<UI GDetailsItem*> m_items;96 QList<UIV MItem*> m_machineItems;97 UI BuildStep *m_pBuildStep;95 QList<UIDetailsItem*> m_items; 96 QList<UIVirtualMachineItem*> m_machineItems; 97 UIPrepareStep *m_pBuildStep; 98 98 QString m_strGroupId; 99 99 100 100 /* Friends: */ 101 friend class UI GDetailsModel;101 friend class UIDetailsModel; 102 102 }; 103 103 104 #endif /* __UI GDetailsGroup_h__ */104 #endif /* __UIDetailsGroup_h__ */ 105 105 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsItem.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsItem class definition.3 * VBox Qt GUI - UIDetailsItem class definition. 4 4 */ 5 5 … … 29 29 /* GUI includes: */ 30 30 # include "UIGraphicsTextPane.h" 31 # include "UI GDetailsGroup.h"32 # include "UI GDetailsSet.h"33 # include "UI GDetailsElement.h"34 # include "UI GDetailsModel.h"35 # include "UI GDetailsView.h"36 # include "UI GDetails.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" 37 37 38 38 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 40 40 41 41 /** QAccessibleObject extension used as an accessibility interface for Details-view items. */ 42 class UIAccessibilityInterfaceForUI GDetailsItem : public QAccessibleObject42 class UIAccessibilityInterfaceForUIDetailsItem : public QAccessibleObject 43 43 { 44 44 public: … … 48 48 { 49 49 /* Creating Details-view accessibility interface: */ 50 if (pObject && strClassname == QLatin1String("UI GDetailsItem"))51 return new UIAccessibilityInterfaceForUI GDetailsItem(pObject);50 if (pObject && strClassname == QLatin1String("UIDetailsItem")) 51 return new UIAccessibilityInterfaceForUIDetailsItem(pObject); 52 52 53 53 /* Null by default: */ … … 56 56 57 57 /** Constructs an accessibility interface passing @a pObject to the base-class. */ 58 UIAccessibilityInterfaceForUI GDetailsItem(QObject *pObject)58 UIAccessibilityInterfaceForUIDetailsItem(QObject *pObject) 59 59 : QAccessibleObject(pObject) 60 60 {} … … 70 70 { 71 71 /* For a set: */ 72 case UI GDetailsItemType_Set:72 case UIDetailsItemType_Set: 73 73 { 74 74 /* Always return parent view: */ … … 76 76 } 77 77 /* For an element: */ 78 case UI GDetailsItemType_Element:78 case UIDetailsItemType_Element: 79 79 { 80 80 /* What amount of children root has? */ … … 105 105 switch (item()->type()) 106 106 { 107 case UI GDetailsItemType_Set: return item()->items().size();108 case UI GDetailsItemType_Element: return item()->toElement()->text().size();107 case UIDetailsItemType_Set: return item()->items().size(); 108 case UIDetailsItemType_Element: return item()->toElement()->text().size(); 109 109 default: break; 110 110 } … … 125 125 switch (item()->type()) 126 126 { 127 case UI GDetailsItemType_Set: return QAccessible::queryAccessibleInterface(item()->items().at(iIndex));128 case UI GDetailsItemType_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]); 129 129 default: break; 130 130 } … … 189 189 190 190 /** Returns corresponding Details-view item. */ 191 UI GDetailsItem *item() const { return qobject_cast<UIGDetailsItem*>(object()); }191 UIDetailsItem *item() const { return qobject_cast<UIDetailsItem*>(object()); } 192 192 }; 193 193 194 194 195 UI GDetailsItem::UIGDetailsItem(UIGDetailsItem *pParent)195 UIDetailsItem::UIDetailsItem(UIDetailsItem *pParent) 196 196 : QIWithRetranslateUI4<QIGraphicsWidget>(pParent) 197 197 , m_pParent(pParent) 198 198 { 199 199 /* Install Details-view item accessibility interface factory: */ 200 QAccessible::installFactory(UIAccessibilityInterfaceForUI GDetailsItem::pFactory);200 QAccessible::installFactory(UIAccessibilityInterfaceForUIDetailsItem::pFactory); 201 201 202 202 /* Basic item setup: */ … … 218 218 } 219 219 220 UI GDetailsGroup* UIGDetailsItem::toGroup()221 { 222 UI GDetailsGroup *pItem = qgraphicsitem_cast<UIGDetailsGroup*>(this);223 AssertMsg(pItem, ("Trying to cast invalid item type to UI GDetailsGroup!"));220 UIDetailsGroup* UIDetailsItem::toGroup() 221 { 222 UIDetailsGroup *pItem = qgraphicsitem_cast<UIDetailsGroup*>(this); 223 AssertMsg(pItem, ("Trying to cast invalid item type to UIDetailsGroup!")); 224 224 return pItem; 225 225 } 226 226 227 UI GDetailsSet* UIGDetailsItem::toSet()228 { 229 UI GDetailsSet *pItem = qgraphicsitem_cast<UIGDetailsSet*>(this);230 AssertMsg(pItem, ("Trying to cast invalid item type to UI GDetailsSet!"));227 UIDetailsSet* UIDetailsItem::toSet() 228 { 229 UIDetailsSet *pItem = qgraphicsitem_cast<UIDetailsSet*>(this); 230 AssertMsg(pItem, ("Trying to cast invalid item type to UIDetailsSet!")); 231 231 return pItem; 232 232 } 233 233 234 UI GDetailsElement* UIGDetailsItem::toElement()235 { 236 UI GDetailsElement *pItem = qgraphicsitem_cast<UIGDetailsElement*>(this);237 AssertMsg(pItem, ("Trying to cast invalid item type to UI GDetailsElement!"));234 UIDetailsElement* UIDetailsItem::toElement() 235 { 236 UIDetailsElement *pItem = qgraphicsitem_cast<UIDetailsElement*>(this); 237 AssertMsg(pItem, ("Trying to cast invalid item type to UIDetailsElement!")); 238 238 return pItem; 239 239 } 240 240 241 UI GDetailsModel* UIGDetailsItem::model() const242 { 243 UI GDetailsModel *pModel = qobject_cast<UIGDetailsModel*>(QIGraphicsWidget::scene()->parent());241 UIDetailsModel* UIDetailsItem::model() const 242 { 243 UIDetailsModel *pModel = qobject_cast<UIDetailsModel*>(QIGraphicsWidget::scene()->parent()); 244 244 AssertMsg(pModel, ("Incorrect graphics scene parent set!")); 245 245 return pModel; 246 246 } 247 247 248 UI GDetailsItem* UIGDetailsItem::parentItem() const248 UIDetailsItem* UIDetailsItem::parentItem() const 249 249 { 250 250 return m_pParent; 251 251 } 252 252 253 void UI GDetailsItem::updateGeometry()253 void UIDetailsItem::updateGeometry() 254 254 { 255 255 /* Call to base-class: */ … … 261 261 } 262 262 263 QSizeF UI GDetailsItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const263 QSizeF UIDetailsItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const 264 264 { 265 265 /* If Qt::MinimumSize or Qt::PreferredSize requested: */ … … 271 271 } 272 272 273 void UI GDetailsItem::sltBuildStep(QString, int)273 void UIDetailsItem::sltBuildStep(QString, int) 274 274 { 275 275 AssertMsgFailed(("This item doesn't support building!")); … … 277 277 278 278 /* static */ 279 void UI GDetailsItem::configurePainterShape(QPainter *pPainter,279 void UIDetailsItem::configurePainterShape(QPainter *pPainter, 280 280 const QStyleOptionGraphicsItem *pOption, 281 281 int iRadius) … … 293 293 294 294 /* static */ 295 void UI GDetailsItem::paintFrameRect(QPainter *pPainter, const QRect &rect, int iRadius)295 void UIDetailsItem::paintFrameRect(QPainter *pPainter, const QRect &rect, int iRadius) 296 296 { 297 297 pPainter->save(); … … 307 307 308 308 /* static */ 309 void UI GDetailsItem::paintPixmap(QPainter *pPainter, const QRect &rect, const QPixmap &pixmap)309 void UIDetailsItem::paintPixmap(QPainter *pPainter, const QRect &rect, const QPixmap &pixmap) 310 310 { 311 311 pPainter->drawPixmap(rect, pixmap); … … 313 313 314 314 /* static */ 315 void UI GDetailsItem::paintText(QPainter *pPainter, QPoint point,315 void UIDetailsItem::paintText(QPainter *pPainter, QPoint point, 316 316 const QFont &font, QPaintDevice *pPaintDevice, 317 317 const QString &strText, const QColor &color) … … 329 329 } 330 330 331 UI BuildStep::UIBuildStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber)331 UIPrepareStep::UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber) 332 332 : QObject(pParent) 333 333 , m_strStepId(strStepId) … … 339 339 } 340 340 341 void UI BuildStep::sltStepDone()341 void UIPrepareStep::sltStepDone() 342 342 { 343 343 emit sigStepDone(m_strStepId, m_iStepNumber); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsItem.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsItem class declaration.3 * VBox Qt GUI - UIDetailsItem class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GDetailsItem_h__19 #define __UI GDetailsItem_h__18 #ifndef __UIDetailsItem_h__ 19 #define __UIDetailsItem_h__ 20 20 21 21 /* GUI includes: */ … … 24 24 25 25 /* Forward declaration: */ 26 class UI GDetailsModel;26 class UIDetailsModel; 27 27 class QGraphicsSceneHoverEvent; 28 28 class QGraphicsSceneMouseEvent; 29 class UI GDetailsGroup;30 class UI GDetailsSet;31 class UI GDetailsElement;29 class UIDetailsGroup; 30 class UIDetailsSet; 31 class UIDetailsElement; 32 32 33 /* UI GDetailsItem types: */34 enum UI GDetailsItemType33 /* UIDetailsItem types: */ 34 enum UIDetailsItemType 35 35 { 36 UI GDetailsItemType_Any = QGraphicsItem::UserType,37 UI GDetailsItemType_Group = QGraphicsItem::UserType + 1,38 UI GDetailsItemType_Set = QGraphicsItem::UserType + 2,39 UI GDetailsItemType_Element = QGraphicsItem::UserType + 3,40 UI GDetailsItemType_Preview = QGraphicsItem::UserType + 1036 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 41 41 }; 42 42 43 43 /* Details item interface 44 44 * for graphics details model/view architecture: */ 45 class UI GDetailsItem : public QIWithRetranslateUI4<QIGraphicsWidget>45 class UIDetailsItem : public QIWithRetranslateUI4<QIGraphicsWidget> 46 46 { 47 47 Q_OBJECT; … … 56 56 57 57 /* Constructor: */ 58 UI GDetailsItem(UIGDetailsItem *pParent);58 UIDetailsItem(UIDetailsItem *pParent); 59 59 60 60 /* API: Cast stuff: */ 61 UI GDetailsGroup* toGroup();62 UI GDetailsSet* toSet();63 UI GDetailsElement* toElement();61 UIDetailsGroup* toGroup(); 62 UIDetailsSet* toSet(); 63 UIDetailsElement* toElement(); 64 64 65 65 /* API: Model stuff: */ 66 UI GDetailsModel* model() const;66 UIDetailsModel* model() const; 67 67 68 68 /* API: Parent stuff: */ 69 UI GDetailsItem* parentItem() const;69 UIDetailsItem* parentItem() const; 70 70 71 71 /** Returns the description of the item. */ … … 73 73 74 74 /* API: Children stuff: */ 75 virtual void addItem(UI GDetailsItem *pItem) = 0;76 virtual void removeItem(UI GDetailsItem *pItem) = 0;77 virtual QList<UI GDetailsItem*> items(UIGDetailsItemType type = UIGDetailsItemType_Any) const = 0;78 virtual bool hasItems(UI GDetailsItemType type = UIGDetailsItemType_Any) const = 0;79 virtual void clearItems(UI GDetailsItemType 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; 80 80 81 81 /* API: Layout stuff: */ … … 107 107 108 108 /* Variables: */ 109 UI GDetailsItem *m_pParent;109 UIDetailsItem *m_pParent; 110 110 }; 111 111 112 112 /* Allows to build item content synchronously: */ 113 class UI BuildStep : public QObject113 class UIPrepareStep : public QObject 114 114 { 115 115 Q_OBJECT; … … 123 123 124 124 /* Constructor: */ 125 UI BuildStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber);125 UIPrepareStep(QObject *pParent, QObject *pBuildObject, const QString &strStepId, int iStepNumber); 126 126 127 127 private slots: … … 137 137 }; 138 138 139 #endif /* __UI GDetailsItem_h__ */139 #endif /* __UIDetailsItem_h__ */ 140 140 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsModel class implementation.3 * VBox Qt GUI - UIDetailsModel class implementation. 4 4 */ 5 5 … … 28 28 29 29 /* GUI includes: */ 30 # include "UI GDetails.h"31 # include "UI GDetailsModel.h"32 # include "UI GDetailsGroup.h"33 # include "UI GDetailsElement.h"30 # include "UIDetails.h" 31 # include "UIDetailsModel.h" 32 # include "UIDetailsGroup.h" 33 # include "UIDetailsElement.h" 34 34 # include "UIExtraDataManager.h" 35 35 # include "VBoxGlobal.h" … … 39 39 40 40 41 UI GDetailsModel::UIGDetailsModel(UIGDetails *pParent)41 UIDetailsModel::UIDetailsModel(UIDetails *pParent) 42 42 : QObject(pParent) 43 43 , m_pDetails(pParent) … … 59 59 } 60 60 61 UI GDetailsModel::~UIGDetailsModel()61 UIDetailsModel::~UIDetailsModel() 62 62 { 63 63 /* Save settings: */ … … 71 71 } 72 72 73 QGraphicsScene* UI GDetailsModel::scene() const73 QGraphicsScene* UIDetailsModel::scene() const 74 74 { 75 75 return m_pScene; 76 76 } 77 77 78 QGraphicsView* UI GDetailsModel::paintDevice() const78 QGraphicsView* UIDetailsModel::paintDevice() const 79 79 { 80 80 if (!m_pScene || m_pScene->views().isEmpty()) … … 83 83 } 84 84 85 QGraphicsItem* UI GDetailsModel::itemAt(const QPointF &position) const85 QGraphicsItem* UIDetailsModel::itemAt(const QPointF &position) const 86 86 { 87 87 return scene()->itemAt(position, QTransform()); 88 88 } 89 89 90 UI GDetailsItem *UIGDetailsModel::root() const90 UIDetailsItem *UIDetailsModel::root() const 91 91 { 92 92 return m_pRoot; 93 93 } 94 94 95 void UI GDetailsModel::updateLayout()95 void UIDetailsModel::updateLayout() 96 96 { 97 97 /* Prepare variables: */ … … 109 109 } 110 110 111 void UI GDetailsModel::setItems(const QList<UIVMItem*> &items)111 void UIDetailsModel::setItems(const QList<UIVirtualMachineItem*> &items) 112 112 { 113 113 m_pRoot->buildGroup(items); 114 114 } 115 115 116 void UI GDetailsModel::sltHandleViewResize()116 void UIDetailsModel::sltHandleViewResize() 117 117 { 118 118 /* Relayout: */ … … 120 120 } 121 121 122 void UI GDetailsModel::sltToggleElements(DetailsElementType type, bool fToggled)122 void UIDetailsModel::sltToggleElements(DetailsElementType type, bool fToggled) 123 123 { 124 124 /* Make sure it is not started yet: */ … … 127 127 128 128 /* Prepare/configure animation callback: */ 129 m_pAnimationCallback = new UI GDetailsElementAnimationCallback(this, type, fToggled);129 m_pAnimationCallback = new UIDetailsElementAnimationCallback(this, type, fToggled); 130 130 connect(m_pAnimationCallback, SIGNAL(sigAllAnimationFinished(DetailsElementType, bool)), 131 131 this, SLOT(sltToggleAnimationFinished(DetailsElementType, bool)), Qt::QueuedConnection); 132 132 /* For each the set of the group: */ 133 foreach (UI GDetailsItem *pSetItem, m_pRoot->items())133 foreach (UIDetailsItem *pSetItem, m_pRoot->items()) 134 134 { 135 135 /* For each the element of the set: */ 136 foreach (UI GDetailsItem *pElementItem, pSetItem->items())136 foreach (UIDetailsItem *pElementItem, pSetItem->items()) 137 137 { 138 138 /* Get each element: */ 139 UI GDetailsElement *pElement = pElementItem->toElement();139 UIDetailsElement *pElement = pElementItem->toElement(); 140 140 /* Check if this element is of required type: */ 141 141 if (pElement->elementType() == type) … … 158 158 } 159 159 160 void UI GDetailsModel::sltToggleAnimationFinished(DetailsElementType type, bool fToggled)160 void UIDetailsModel::sltToggleAnimationFinished(DetailsElementType type, bool fToggled) 161 161 { 162 162 /* Cleanup animation callback: */ … … 165 165 166 166 /* Mark animation finished: */ 167 foreach (UI GDetailsItem *pSetItem, m_pRoot->items())168 { 169 foreach (UI GDetailsItem *pElementItem, pSetItem->items())167 foreach (UIDetailsItem *pSetItem, m_pRoot->items()) 168 { 169 foreach (UIDetailsItem *pElementItem, pSetItem->items()) 170 170 { 171 UI GDetailsElement *pElement = pElementItem->toElement();171 UIDetailsElement *pElement = pElementItem->toElement(); 172 172 if (pElement->elementType() == type) 173 173 pElement->markAnimationFinished(); … … 182 182 } 183 183 184 void UI GDetailsModel::sltElementTypeToggled()184 void UIDetailsModel::sltElementTypeToggled() 185 185 { 186 186 /* Which item was toggled? */ … … 198 198 } 199 199 200 void UI GDetailsModel::sltHandleSlidingStarted()200 void UIDetailsModel::sltHandleSlidingStarted() 201 201 { 202 202 m_pRoot->stopBuildingGroup(); 203 203 } 204 204 205 void UI GDetailsModel::sltHandleToggleStarted()205 void UIDetailsModel::sltHandleToggleStarted() 206 206 { 207 207 m_pRoot->stopBuildingGroup(); 208 208 } 209 209 210 void UI GDetailsModel::sltHandleToggleFinished()210 void UIDetailsModel::sltHandleToggleFinished() 211 211 { 212 212 m_pRoot->rebuildGroup(); 213 213 } 214 214 215 QVariant UI GDetailsModel::data(int iKey) const215 QVariant UIDetailsModel::data(int iKey) const 216 216 { 217 217 switch (iKey) … … 223 223 } 224 224 225 void UI GDetailsModel::prepareScene()225 void UIDetailsModel::prepareScene() 226 226 { 227 227 m_pScene = new QGraphicsScene(this); … … 229 229 } 230 230 231 void UI GDetailsModel::prepareRoot()232 { 233 m_pRoot = new UI GDetailsGroup(scene());234 } 235 236 void UI GDetailsModel::loadSettings()231 void UIDetailsModel::prepareRoot() 232 { 233 m_pRoot = new UIDetailsGroup(scene()); 234 } 235 236 void UIDetailsModel::loadSettings() 237 237 { 238 238 /* Load settings: */ … … 255 255 } 256 256 257 void UI GDetailsModel::saveSettings()257 void UIDetailsModel::saveSettings() 258 258 { 259 259 /* Save settings: */ … … 261 261 } 262 262 263 void UI GDetailsModel::cleanupRoot()263 void UIDetailsModel::cleanupRoot() 264 264 { 265 265 delete m_pRoot; … … 267 267 } 268 268 269 void UI GDetailsModel::cleanupScene()269 void UIDetailsModel::cleanupScene() 270 270 { 271 271 delete m_pScene; … … 273 273 } 274 274 275 bool UI GDetailsModel::eventFilter(QObject *pObject, QEvent *pEvent)275 bool UIDetailsModel::eventFilter(QObject *pObject, QEvent *pEvent) 276 276 { 277 277 /* Ignore if no scene object: */ … … 287 287 } 288 288 289 bool UI GDetailsModel::processContextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent)289 bool UIDetailsModel::processContextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent) 290 290 { 291 291 /* Pass preview context menu instead: */ 292 292 if (QGraphicsItem *pItem = itemAt(pEvent->scenePos())) 293 if (pItem->type() == UI GDetailsItemType_Preview)293 if (pItem->type() == UIDetailsItemType_Preview) 294 294 return false; 295 295 … … 312 312 } 313 313 314 UI GDetailsElementAnimationCallback::UIGDetailsElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled)314 UIDetailsElementAnimationCallback::UIDetailsElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled) 315 315 : QObject(pParent) 316 316 , m_type(type) … … 319 319 } 320 320 321 void UI GDetailsElementAnimationCallback::addNotifier(UIGDetailsItem *pItem)321 void UIDetailsElementAnimationCallback::addNotifier(UIDetailsItem *pItem) 322 322 { 323 323 /* Connect notifier: */ … … 327 327 } 328 328 329 void UI GDetailsElementAnimationCallback::sltAnimationFinished()329 void UIDetailsElementAnimationCallback::sltAnimationFinished() 330 330 { 331 331 /* Determine notifier: */ 332 UI GDetailsItem *pItem = qobject_cast<UIGDetailsItem*>(sender());332 UIDetailsItem *pItem = qobject_cast<UIDetailsItem*>(sender()); 333 333 /* Disconnect notifier: */ 334 334 disconnect(pItem, SIGNAL(sigToggleElementFinished()), this, SLOT(sltAnimationFinished())); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsModel class declaration.3 * VBox Qt GUI - UIDetailsModel class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GDetailsModel_h__19 #define __UI GDetailsModel_h__18 #ifndef __UIDetailsModel_h__ 19 #define __UIDetailsModel_h__ 20 20 21 21 /* Qt includes: */ … … 36 36 class QGraphicsSceneContextMenuEvent; 37 37 class QGraphicsView; 38 class UIV MItem;39 class UI GDetailsElementAnimationCallback;40 class UI GDetailsGroup;41 class UI GDetailsItem;42 class UI GDetails;38 class UIVirtualMachineItem; 39 class UIDetailsElementAnimationCallback; 40 class UIDetailsGroup; 41 class UIDetailsItem; 42 class UIDetails; 43 43 44 44 /* Graphics details-model: */ 45 class UI GDetailsModel : public QObject45 class UIDetailsModel : public QObject 46 46 { 47 47 Q_OBJECT; … … 60 60 /** Constructs a details-model passing @a pParent to the base-class. 61 61 * @param pParent Brings the details container to embed into. */ 62 UI GDetailsModel(UIGDetails *pParent);62 UIDetailsModel(UIDetails *pParent); 63 63 /** Destructs a details-model. */ 64 ~UI GDetailsModel();64 ~UIDetailsModel(); 65 65 66 66 /* API: Scene stuff: */ … … 70 70 71 71 /** Returns the details reference. */ 72 UI GDetails *details() const { return m_pDetails; }72 UIDetails *details() const { return m_pDetails; } 73 73 74 74 /** Returns the root item instance. */ 75 UI GDetailsItem *root() const;75 UIDetailsItem *root() const; 76 76 77 77 /* API: Layout stuff: */ … … 79 79 80 80 /* API: Current-item(s) stuff: */ 81 void setItems(const QList<UIV MItem*> &items);81 void setItems(const QList<UIVirtualMachineItem*> &items); 82 82 83 83 /** Returns the details settings. */ … … 128 128 129 129 /** Holds the details reference. */ 130 UI GDetails *m_pDetails;130 UIDetails *m_pDetails; 131 131 132 132 /* Variables: */ 133 133 QGraphicsScene *m_pScene; 134 UI GDetailsGroup *m_pRoot;135 UI GDetailsElementAnimationCallback *m_pAnimationCallback;134 UIDetailsGroup *m_pRoot; 135 UIDetailsElementAnimationCallback *m_pAnimationCallback; 136 136 /** Holds the details settings. */ 137 137 QMap<DetailsElementType, bool> m_settings; … … 139 139 140 140 /* Details-element animation callback: */ 141 class UI GDetailsElementAnimationCallback : public QObject141 class UIDetailsElementAnimationCallback : public QObject 142 142 { 143 143 Q_OBJECT; … … 151 151 152 152 /* Constructor: */ 153 UI GDetailsElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled);153 UIDetailsElementAnimationCallback(QObject *pParent, DetailsElementType type, bool fToggled); 154 154 155 155 /* API: Notifiers stuff: */ 156 void addNotifier(UI GDetailsItem *pItem);156 void addNotifier(UIDetailsItem *pItem); 157 157 158 158 private slots: … … 164 164 165 165 /* Variables: */ 166 QList<UI GDetailsItem*> m_notifiers;166 QList<UIDetailsItem*> m_notifiers; 167 167 DetailsElementType m_type; 168 168 bool m_fToggled; 169 169 }; 170 170 171 #endif /* __UI GDetailsModel_h__ */171 #endif /* __UIDetailsModel_h__ */ 172 172 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsSet class implementation.3 * VBox Qt GUI - UIDetailsSet class implementation. 4 4 */ 5 5 … … 24 24 25 25 /* GUI includes: */ 26 # include "UI GDetailsSet.h"27 # include "UI GDetailsModel.h"28 # include "UI GDetailsElements.h"29 # include "UIV MItem.h"26 # include "UIDetailsSet.h" 27 # include "UIDetailsModel.h" 28 # include "UIDetailsElements.h" 29 # include "UIVirtualMachineItem.h" 30 30 # include "UIVirtualBoxEventHandler.h" 31 31 # include "VBoxGlobal.h" … … 38 38 39 39 40 UI GDetailsSet::UIGDetailsSet(UIGDetailsItem *pParent)41 : UI GDetailsItem(pParent)40 UIDetailsSet::UIDetailsSet(UIDetailsItem *pParent) 41 : UIDetailsItem(pParent) 42 42 , m_pMachineItem(0) 43 43 , m_fHasDetails(false) … … 57 57 } 58 58 59 UI GDetailsSet::~UIGDetailsSet()59 UIDetailsSet::~UIDetailsSet() 60 60 { 61 61 /* Cleanup items: */ … … 66 66 } 67 67 68 void UI GDetailsSet::buildSet(UIVMItem *pMachineItem, bool fFullSet, const QMap<DetailsElementType, bool> &settings)68 void UIDetailsSet::buildSet(UIVirtualMachineItem *pMachineItem, bool fFullSet, const QMap<DetailsElementType, bool> &settings) 69 69 { 70 70 /* Remember passed arguments: */ … … 113 113 } 114 114 115 void UI GDetailsSet::sltBuildStep(QString strStepId, int iStepNumber)115 void UIDetailsSet::sltBuildStep(QString strStepId, int iStepNumber) 116 116 { 117 117 /* Cleanup build-step: */ … … 134 134 135 135 /* Check if element is present already: */ 136 UI GDetailsElement *pElement = element(elementType);136 UIDetailsElement *pElement = element(elementType); 137 137 if (pElement && fOpen) 138 138 pElement->open(false); … … 173 173 { 174 174 /* Create next build-step: */ 175 m_pBuildStep = new UI BuildStep(this, pElement, strStepId, iStepNumber + 1);175 m_pBuildStep = new UIPrepareStep(this, pElement, strStepId, iStepNumber + 1); 176 176 177 177 /* Build element: */ … … 191 191 model()->updateLayout(); 192 192 /* Repaint all the items: */ 193 foreach (UI GDetailsItem *pItem, items())193 foreach (UIDetailsItem *pItem, items()) 194 194 pItem->update(); 195 195 /* Notify listener about build done: */ … … 198 198 } 199 199 200 void UI GDetailsSet::sltMachineStateChange(QString strId)200 void UIDetailsSet::sltMachineStateChange(QString strId) 201 201 { 202 202 /* Is this our VM changed? */ … … 208 208 } 209 209 210 void UI GDetailsSet::sltMachineAttributesChange(QString strId)210 void UIDetailsSet::sltMachineAttributesChange(QString strId) 211 211 { 212 212 /* Is this our VM changed? */ … … 218 218 } 219 219 220 void UI GDetailsSet::sltUpdateAppearance()220 void UIDetailsSet::sltUpdateAppearance() 221 221 { 222 222 /* Update appearance: */ … … 224 224 } 225 225 226 QString UI GDetailsSet::description() const226 QString UIDetailsSet::description() const 227 227 { 228 228 return tr("Contains the details of virtual machine '%1'").arg(m_pMachineItem->name()); 229 229 } 230 230 231 QVariant UI GDetailsSet::data(int iKey) const231 QVariant UIDetailsSet::data(int iKey) const 232 232 { 233 233 /* Provide other members with required data: */ … … 243 243 } 244 244 245 void UI GDetailsSet::addItem(UIGDetailsItem *pItem)245 void UIDetailsSet::addItem(UIDetailsItem *pItem) 246 246 { 247 247 switch (pItem->type()) 248 248 { 249 case UI GDetailsItemType_Element:250 { 251 UI GDetailsElement *pElement = pItem->toElement();249 case UIDetailsItemType_Element: 250 { 251 UIDetailsElement *pElement = pItem->toElement(); 252 252 DetailsElementType type = pElement->elementType(); 253 253 AssertMsg(!m_elements.contains(type), ("Element already added!")); … … 263 263 } 264 264 265 void UI GDetailsSet::removeItem(UIGDetailsItem *pItem)265 void UIDetailsSet::removeItem(UIDetailsItem *pItem) 266 266 { 267 267 switch (pItem->type()) 268 268 { 269 case UI GDetailsItemType_Element:270 { 271 UI GDetailsElement *pElement = pItem->toElement();269 case UIDetailsItemType_Element: 270 { 271 UIDetailsElement *pElement = pItem->toElement(); 272 272 DetailsElementType type = pElement->elementType(); 273 273 AssertMsg(m_elements.contains(type), ("Element do not present (type = %d)!", (int)type)); … … 283 283 } 284 284 285 QList<UI GDetailsItem*> UIGDetailsSet::items(UIGDetailsItemType type /* = UIGDetailsItemType_Element */) const285 QList<UIDetailsItem*> UIDetailsSet::items(UIDetailsItemType type /* = UIDetailsItemType_Element */) const 286 286 { 287 287 switch (type) 288 288 { 289 case UI GDetailsItemType_Element: return m_elements.values();290 case UI GDetailsItemType_Any: return items(UIGDetailsItemType_Element);289 case UIDetailsItemType_Element: return m_elements.values(); 290 case UIDetailsItemType_Any: return items(UIDetailsItemType_Element); 291 291 default: AssertMsgFailed(("Invalid item type!")); break; 292 292 } 293 return QList<UI GDetailsItem*>();294 } 295 296 bool UI GDetailsSet::hasItems(UIGDetailsItemType type /* = UIGDetailsItemType_Element */) const293 return QList<UIDetailsItem*>(); 294 } 295 296 bool UIDetailsSet::hasItems(UIDetailsItemType type /* = UIDetailsItemType_Element */) const 297 297 { 298 298 switch (type) 299 299 { 300 case UI GDetailsItemType_Element: return !m_elements.isEmpty();301 case UI GDetailsItemType_Any: return hasItems(UIGDetailsItemType_Element);300 case UIDetailsItemType_Element: return !m_elements.isEmpty(); 301 case UIDetailsItemType_Any: return hasItems(UIDetailsItemType_Element); 302 302 default: AssertMsgFailed(("Invalid item type!")); break; 303 303 } … … 305 305 } 306 306 307 void UI GDetailsSet::clearItems(UIGDetailsItemType type /* = UIGDetailsItemType_Element */)307 void UIDetailsSet::clearItems(UIDetailsItemType type /* = UIDetailsItemType_Element */) 308 308 { 309 309 switch (type) 310 310 { 311 case UI GDetailsItemType_Element:311 case UIDetailsItemType_Element: 312 312 { 313 313 foreach (int iKey, m_elements.keys()) … … 316 316 break; 317 317 } 318 case UI GDetailsItemType_Any:319 { 320 clearItems(UI GDetailsItemType_Element);318 case UIDetailsItemType_Any: 319 { 320 clearItems(UIDetailsItemType_Element); 321 321 break; 322 322 } … … 329 329 } 330 330 331 UI GDetailsElement* UIGDetailsSet::element(DetailsElementType elementType) const332 { 333 UI GDetailsItem *pItem = m_elements.value(elementType, 0);331 UIDetailsElement* UIDetailsSet::element(DetailsElementType elementType) const 332 { 333 UIDetailsItem *pItem = m_elements.value(elementType, 0); 334 334 if (pItem) 335 335 return pItem->toElement(); … … 337 337 } 338 338 339 void UI GDetailsSet::prepareSet()339 void UIDetailsSet::prepareSet() 340 340 { 341 341 /* Setup size-policy: */ … … 343 343 } 344 344 345 void UI GDetailsSet::prepareConnections()345 void UIDetailsSet::prepareConnections() 346 346 { 347 347 /* Global-events connections: */ … … 359 359 } 360 360 361 int UI GDetailsSet::minimumWidthHint() const361 int UIDetailsSet::minimumWidthHint() const 362 362 { 363 363 /* Zero if has no details: */ … … 371 371 372 372 /* Take into account all the elements: */ 373 foreach (UI GDetailsItem *pItem, items())373 foreach (UIDetailsItem *pItem, items()) 374 374 { 375 375 /* Skip hidden: */ … … 378 378 379 379 /* For each particular element: */ 380 UI GDetailsElement *pElement = pItem->toElement();380 UIDetailsElement *pElement = pItem->toElement(); 381 381 switch (pElement->elementType()) 382 382 { … … 398 398 case DetailsElementType_Preview: 399 399 { 400 UI GDetailsItem *pGeneralItem = element(DetailsElementType_General);401 UI GDetailsItem *pSystemItem = element(DetailsElementType_System);400 UIDetailsItem *pGeneralItem = element(DetailsElementType_General); 401 UIDetailsItem *pSystemItem = element(DetailsElementType_System); 402 402 int iGeneralElementWidth = pGeneralItem ? pGeneralItem->minimumWidthHint() : 0; 403 403 int iSystemElementWidth = pSystemItem ? pSystemItem->minimumWidthHint() : 0; … … 417 417 } 418 418 419 int UI GDetailsSet::minimumHeightHint() const419 int UIDetailsSet::minimumHeightHint() const 420 420 { 421 421 /* Zero if has no details: */ … … 429 429 430 430 /* Take into account all the elements: */ 431 foreach (UI GDetailsItem *pItem, items())431 foreach (UIDetailsItem *pItem, items()) 432 432 { 433 433 /* Skip hidden: */ … … 436 436 437 437 /* For each particular element: */ 438 UI GDetailsElement *pElement = pItem->toElement();438 UIDetailsElement *pElement = pItem->toElement(); 439 439 switch (pElement->elementType()) 440 440 { … … 473 473 } 474 474 475 void UI GDetailsSet::updateLayout()475 void UIDetailsSet::updateLayout() 476 476 { 477 477 /* Prepare variables: */ … … 482 482 483 483 /* Layout all the elements: */ 484 foreach (UI GDetailsItem *pItem, items())484 foreach (UIDetailsItem *pItem, items()) 485 485 { 486 486 /* Skip hidden: */ … … 489 489 490 490 /* For each particular element: */ 491 UI GDetailsElement *pElement = pItem->toElement();491 UIDetailsElement *pElement = pItem->toElement(); 492 492 switch (pElement->elementType()) 493 493 { … … 510 510 if (pElement->elementType() == DetailsElementType_General || 511 511 pElement->elementType() == DetailsElementType_System) 512 if (UI GDetailsElement *pPreviewElement = element(DetailsElementType_Preview))512 if (UIDetailsElement *pPreviewElement = element(DetailsElementType_Preview)) 513 513 if (pPreviewElement->isVisible()) 514 514 iWidth -= (iSpacing + pPreviewElement->minimumWidthHint()); … … 553 553 } 554 554 555 void UI GDetailsSet::rebuildSet()555 void UIDetailsSet::rebuildSet() 556 556 { 557 557 /* Make sure we have details: */ … … 573 573 } 574 574 575 UI GDetailsElement* UIGDetailsSet::createElement(DetailsElementType elementType, bool fOpen)575 UIDetailsElement* UIDetailsSet::createElement(DetailsElementType elementType, bool fOpen) 576 576 { 577 577 /* Element factory: */ 578 578 switch (elementType) 579 579 { 580 case DetailsElementType_General: return new UI GDetailsElementGeneral(this, fOpen);581 case DetailsElementType_System: return new UI GDetailsElementSystem(this, fOpen);582 case DetailsElementType_Preview: return new UI GDetailsElementPreview(this, fOpen);583 case DetailsElementType_Display: return new UI GDetailsElementDisplay(this, fOpen);584 case DetailsElementType_Storage: return new UI GDetailsElementStorage(this, fOpen);585 case DetailsElementType_Audio: return new UI GDetailsElementAudio(this, fOpen);586 case DetailsElementType_Network: return new UI GDetailsElementNetwork(this, fOpen);587 case DetailsElementType_Serial: return new UI GDetailsElementSerial(this, fOpen);588 case DetailsElementType_USB: return new UI GDetailsElementUSB(this, fOpen);589 case DetailsElementType_SF: return new UI GDetailsElementSF(this, fOpen);590 case DetailsElementType_UI: return new UI GDetailsElementUI(this, fOpen);591 case DetailsElementType_Description: return new UI GDetailsElementDescription(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); 592 592 case DetailsElementType_Invalid: AssertFailed(); break; /* Shut up, MSC! */ 593 593 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsSet.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsSet class declaration.3 * VBox Qt GUI - UIDetailsSet class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GDetailsSet_h__19 #define __UI GDetailsSet_h__18 #ifndef __UIDetailsSet_h__ 19 #define __UIDetailsSet_h__ 20 20 21 21 /* GUI includes: */ 22 #include "UI GDetailsItem.h"22 #include "UIDetailsItem.h" 23 23 #include "UIExtraDataDefs.h" 24 24 #include "UISettingsDefs.h" … … 29 29 30 30 /* Forward declarations: */ 31 class UIV MItem;31 class UIVirtualMachineItem; 32 32 33 33 /* Using declarations: */ … … 36 36 /* Details set 37 37 * for graphics details model/view architecture: */ 38 class UI GDetailsSet : public UIGDetailsItem38 class UIDetailsSet : public UIDetailsItem 39 39 { 40 40 Q_OBJECT; … … 43 43 44 44 /* Graphics-item type: */ 45 enum { Type = UI GDetailsItemType_Set };45 enum { Type = UIDetailsItemType_Set }; 46 46 int type() const { return Type; } 47 47 48 48 /* Constructor/destructor: */ 49 UI GDetailsSet(UIGDetailsItem *pParent);50 ~UI GDetailsSet();49 UIDetailsSet(UIDetailsItem *pParent); 50 ~UIDetailsSet(); 51 51 52 52 /* API: Build stuff: */ 53 void buildSet(UIV MItem *pMachineItem, bool fFullSet, const QMap<DetailsElementType, bool> &settings);53 void buildSet(UIVirtualMachineItem *pMachineItem, bool fFullSet, const QMap<DetailsElementType, bool> &settings); 54 54 55 55 /* API: Machine stuff: */ … … 89 89 90 90 /* Hidden API: Children stuff: */ 91 void addItem(UI GDetailsItem *pItem);92 void removeItem(UI GDetailsItem *pItem);93 QList<UI GDetailsItem*> items(UIGDetailsItemType type = UIGDetailsItemType_Element) const;94 bool hasItems(UI GDetailsItemType type = UIGDetailsItemType_Element) const;95 void clearItems(UI GDetailsItemType type = UIGDetailsItemType_Element);96 UI GDetailsElement* 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; 97 97 98 98 /* Helpers: Prepare stuff: */ … … 107 107 /* Helpers: Build stuff: */ 108 108 void rebuildSet(); 109 UI GDetailsElement* createElement(DetailsElementType elementType, bool fOpen);109 UIDetailsElement* createElement(DetailsElementType elementType, bool fOpen); 110 110 111 111 /** Machine-item this set built for. */ 112 UIV MItem *m_pMachineItem;112 UIVirtualMachineItem *m_pMachineItem; 113 113 114 114 /* Main variables: */ 115 115 CMachine m_machine; 116 QMap<int, UI GDetailsItem*> m_elements;116 QMap<int, UIDetailsItem*> m_elements; 117 117 bool m_fHasDetails; 118 118 … … 122 122 /* Prepare variables: */ 123 123 bool m_fFullSet; 124 UI BuildStep *m_pBuildStep;124 UIPrepareStep *m_pBuildStep; 125 125 int m_iLastStepNumber; 126 126 QString m_strSetId; … … 128 128 }; 129 129 130 #endif /* __UI GDetailsSet_h__ */130 #endif /* __UIDetailsSet_h__ */ 131 131 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsView.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsView class implementation.3 * VBox Qt GUI - UIDetailsView class implementation. 4 4 */ 5 5 … … 26 26 27 27 /* GUI includes: */ 28 # include "UI GDetails.h"29 # include "UI GDetailsModel.h"30 # include "UI GDetailsView.h"31 # include "UI GDetailsItem.h"28 # include "UIDetails.h" 29 # include "UIDetailsModel.h" 30 # include "UIDetailsView.h" 31 # include "UIDetailsItem.h" 32 32 33 33 /* Other VBox includes: */ … … 38 38 39 39 /** QAccessibleWidget extension used as an accessibility interface for Details-view. */ 40 class UIAccessibilityInterfaceForUI GDetailsView : public QAccessibleWidget40 class UIAccessibilityInterfaceForUIDetailsView : public QAccessibleWidget 41 41 { 42 42 public: … … 46 46 { 47 47 /* Creating Details-view accessibility interface: */ 48 if (pObject && strClassname == QLatin1String("UI GDetailsView"))49 return new UIAccessibilityInterfaceForUI GDetailsView(qobject_cast<QWidget*>(pObject));48 if (pObject && strClassname == QLatin1String("UIDetailsView")) 49 return new UIAccessibilityInterfaceForUIDetailsView(qobject_cast<QWidget*>(pObject)); 50 50 51 51 /* Null by default: */ … … 54 54 55 55 /** Constructs an accessibility interface passing @a pWidget to the base-class. */ 56 UIAccessibilityInterfaceForUI GDetailsView(QWidget *pWidget)56 UIAccessibilityInterfaceForUIDetailsView(QWidget *pWidget) 57 57 : QAccessibleWidget(pWidget, QAccessible::List) 58 58 {} … … 108 108 109 109 /** Returns corresponding Details-view. */ 110 UI GDetailsView *view() const { return qobject_cast<UIGDetailsView*>(widget()); }110 UIDetailsView *view() const { return qobject_cast<UIDetailsView*>(widget()); } 111 111 }; 112 112 113 113 114 UI GDetailsView::UIGDetailsView(UIGDetails *pParent)114 UIDetailsView::UIDetailsView(UIDetails *pParent) 115 115 : QIWithRetranslateUI<QIGraphicsView>(pParent) 116 116 , m_pDetails(pParent) … … 119 119 { 120 120 /* Install Details-view accessibility interface factory: */ 121 QAccessible::installFactory(UIAccessibilityInterfaceForUI GDetailsView::pFactory);121 QAccessible::installFactory(UIAccessibilityInterfaceForUIDetailsView::pFactory); 122 122 123 123 /* Prepare palette: */ … … 139 139 } 140 140 141 void UI GDetailsView::sltMinimumWidthHintChanged(int iMinimumWidthHint)141 void UIDetailsView::sltMinimumWidthHintChanged(int iMinimumWidthHint) 142 142 { 143 143 /* Is there something changed? */ … … 157 157 } 158 158 159 void UI GDetailsView::sltMinimumHeightHintChanged(int iMinimumHeightHint)159 void UIDetailsView::sltMinimumHeightHintChanged(int iMinimumHeightHint) 160 160 { 161 161 /* Is there something changed? */ … … 172 172 } 173 173 174 void UI GDetailsView::retranslateUi()174 void UIDetailsView::retranslateUi() 175 175 { 176 176 /* Translate this: */ … … 178 178 } 179 179 180 void UI GDetailsView::preparePalette()180 void UIDetailsView::preparePalette() 181 181 { 182 182 /* Setup palette: */ … … 186 186 } 187 187 188 void UI GDetailsView::resizeEvent(QResizeEvent *pEvent)188 void UIDetailsView::resizeEvent(QResizeEvent *pEvent) 189 189 { 190 190 /* Call to base-class: */ … … 194 194 } 195 195 196 void UI GDetailsView::updateSceneRect()196 void UIDetailsView::updateSceneRect() 197 197 { 198 198 setSceneRect(0, 0, m_iMinimumWidthHint, m_iMinimumHeightHint); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsView.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GDetailsView class declaration.3 * VBox Qt GUI - UIDetailsView class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GDetailsView_h__19 #define __UI GDetailsView_h__18 #ifndef __UIDetailsView_h__ 19 #define __UIDetailsView_h__ 20 20 21 21 /* GUI includes: */ … … 24 24 25 25 /* Forward declarations: */ 26 class UI GDetails;26 class UIDetails; 27 27 28 28 /* Graphics details-view: */ 29 class UI GDetailsView : public QIWithRetranslateUI<QIGraphicsView>29 class UIDetailsView : public QIWithRetranslateUI<QIGraphicsView> 30 30 { 31 31 Q_OBJECT; … … 40 40 /** Constructs a details-view passing @a pParent to the base-class. 41 41 * @param pParent Brings the details container to embed into. */ 42 UI GDetailsView(UIGDetails *pParent);42 UIDetailsView(UIDetails *pParent); 43 43 44 44 /** Returns the details reference. */ 45 UI GDetails *details() const { return m_pDetails; }45 UIDetails *details() const { return m_pDetails; } 46 46 47 47 private slots: … … 66 66 67 67 /** Holds the details reference. */ 68 UI GDetails *m_pDetails;68 UIDetails *m_pDetails; 69 69 70 70 /* Variables: */ … … 73 73 }; 74 74 75 #endif /* __UI GDetailsView_h__ */75 #endif /* __UIDetailsView_h__ */ 76 76 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIMachinePreview.cpp
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GMachinePreview class implementation.3 * VBox Qt GUI - UIMachinePreview class implementation. 4 4 */ 5 5 … … 28 28 29 29 /* GUI includes: */ 30 # include "UI GMachinePreview.h"30 # include "UIMachinePreview.h" 31 31 # include "UIVirtualBoxEventHandler.h" 32 32 # include "UIExtraDataManager.h" … … 49 49 #endif /* VBOX_WITH_XPCOM */ 50 50 51 UI GMachinePreview::UIGMachinePreview(QIGraphicsWidget *pParent)51 UIMachinePreview::UIMachinePreview(QIGraphicsWidget *pParent) 52 52 : QIWithRetranslateUI4<QIGraphicsWidget>(pParent) 53 53 , m_pUpdateTimer(new QTimer(this)) … … 120 120 } 121 121 122 UI GMachinePreview::~UIGMachinePreview()122 UIMachinePreview::~UIMachinePreview() 123 123 { 124 124 /* Close any open session: */ … … 147 147 } 148 148 149 void UI GMachinePreview::setMachine(const CMachine& machine)149 void UIMachinePreview::setMachine(const CMachine& machine) 150 150 { 151 151 /* Pause: */ … … 165 165 } 166 166 167 CMachine UI GMachinePreview::machine() const167 CMachine UIMachinePreview::machine() const 168 168 { 169 169 return m_machine; 170 170 } 171 171 172 void UI GMachinePreview::sltMachineStateChange(QString strId)172 void UIMachinePreview::sltMachineStateChange(QString strId) 173 173 { 174 174 /* Make sure its the event for our machine: */ … … 180 180 } 181 181 182 void UI GMachinePreview::sltRecreatePreview()182 void UIMachinePreview::sltRecreatePreview() 183 183 { 184 184 /* Skip invisible preview: */ … … 331 331 } 332 332 333 void UI GMachinePreview::resizeEvent(QGraphicsSceneResizeEvent *pEvent)333 void UIMachinePreview::resizeEvent(QGraphicsSceneResizeEvent *pEvent) 334 334 { 335 335 recalculatePreviewRectangle(); … … 338 338 } 339 339 340 void UI GMachinePreview::showEvent(QShowEvent *pEvent)340 void UIMachinePreview::showEvent(QShowEvent *pEvent) 341 341 { 342 342 restart(); … … 344 344 } 345 345 346 void UI GMachinePreview::hideEvent(QHideEvent *pEvent)346 void UIMachinePreview::hideEvent(QHideEvent *pEvent) 347 347 { 348 348 stop(); … … 350 350 } 351 351 352 void UI GMachinePreview::contextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent)352 void UIMachinePreview::contextMenuEvent(QGraphicsSceneContextMenuEvent *pEvent) 353 353 { 354 354 QAction *pReturn = m_pUpdateTimerMenu->exec(pEvent->screenPos(), 0); … … 361 361 } 362 362 363 void UI GMachinePreview::retranslateUi()363 void UIMachinePreview::retranslateUi() 364 364 { 365 365 m_actions.value(PreviewUpdateIntervalType_Disabled)->setText(tr("Update disabled")); … … 371 371 } 372 372 373 QSizeF UI GMachinePreview::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const373 QSizeF UIMachinePreview::sizeHint(Qt::SizeHint which, const QSizeF &constraint /* = QSizeF() */) const 374 374 { 375 375 if (which == Qt::MinimumSize) … … 388 388 } 389 389 390 void UI GMachinePreview::paint(QPainter *pPainter, const QStyleOptionGraphicsItem*, QWidget*)390 void UIMachinePreview::paint(QPainter *pPainter, const QStyleOptionGraphicsItem*, QWidget*) 391 391 { 392 392 /* Where should the content go: */ … … 444 444 } 445 445 446 void UI GMachinePreview::setUpdateInterval(PreviewUpdateIntervalType interval, bool fSave)446 void UIMachinePreview::setUpdateInterval(PreviewUpdateIntervalType interval, bool fSave) 447 447 { 448 448 switch (interval) … … 474 474 } 475 475 476 void UI GMachinePreview::recalculatePreviewRectangle()476 void UIMachinePreview::recalculatePreviewRectangle() 477 477 { 478 478 /* Contents rectangle: */ … … 482 482 } 483 483 484 void UI GMachinePreview::restart()484 void UIMachinePreview::restart() 485 485 { 486 486 /* Fetch the latest machine-state: */ … … 508 508 } 509 509 510 void UI GMachinePreview::stop()510 void UIMachinePreview::stop() 511 511 { 512 512 /* Stop the timer: */ … … 515 515 516 516 /* static */ 517 UI GMachinePreview::AspectRatioPreset UIGMachinePreview::bestAspectRatioPreset(const double dAspectRatio,517 UIMachinePreview::AspectRatioPreset UIMachinePreview::bestAspectRatioPreset(const double dAspectRatio, 518 518 const QMap<AspectRatioPreset, double> &ratios) 519 519 { … … 543 543 544 544 /* static */ 545 QSize UI GMachinePreview::imageAspectRatioSize(const QSize &hostSize, const QSize &guestSize)545 QSize UIMachinePreview::imageAspectRatioSize(const QSize &hostSize, const QSize &guestSize) 546 546 { 547 547 /* Make sure host-size and guest-size are valid: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIMachinePreview.h
r73385 r73424 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GMachinePreview class declaration.3 * VBox Qt GUI - UIMachinePreview class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef __UI GMachinePreview_h__19 #define __UI GMachinePreview_h__18 #ifndef __UIMachinePreview_h__ 19 #define __UIMachinePreview_h__ 20 20 21 21 /* Qt includes: */ … … 24 24 /* GUI includes: */ 25 25 #include "QIWithRetranslateUI.h" 26 #include "UI GDetailsItem.h"26 #include "UIDetailsItem.h" 27 27 #include "UIExtraDataDefs.h" 28 28 … … 40 40 41 41 /* Preview window class: */ 42 class UI GMachinePreview : public QIWithRetranslateUI4<QIGraphicsWidget>42 class UIMachinePreview : public QIWithRetranslateUI4<QIGraphicsWidget> 43 43 { 44 44 Q_OBJECT; … … 52 52 53 53 /* Graphics-item type: */ 54 enum { Type = UI GDetailsItemType_Preview };54 enum { Type = UIDetailsItemType_Preview }; 55 55 int type() const { return Type; } 56 56 57 57 /* Constructor/destructor: */ 58 UI GMachinePreview(QIGraphicsWidget *pParent);59 ~UI GMachinePreview();58 UIMachinePreview(QIGraphicsWidget *pParent); 59 ~UIMachinePreview(); 60 60 61 61 /* API: Machine stuff: */ … … 125 125 }; 126 126 127 #endif /* !__UI GMachinePreview_h__ */127 #endif /* !__UIMachinePreview_h__ */ 128 128
Note:
See TracChangeset
for help on using the changeset viewer.