Changeset 57829 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Sep 18, 2015 2:21:13 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h
r55554 r57829 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 16 16 */ 17 17 18 #ifndef __ UISelectorWindow_h__19 #define __ UISelectorWindow_h__18 #ifndef ___UISelectorWindow_h___ 19 #define ___UISelectorWindow_h___ 20 20 21 21 /* Qt includes: */ … … 27 27 28 28 /* Forward declarations: */ 29 class QISplitter;30 class QMenu;31 29 class UIAction; 30 class UIActionPool; 32 31 class UIActionPolymorphic; 32 class UIGChooser; 33 class UIGDetails; 33 34 class UIMainBar; 34 35 class UIToolBar; 35 36 class UIVMDesktop; 36 37 class UIVMItem; 37 class UIGChooser; 38 class UIGDetails; 39 class UIActionPool; 38 class QISplitter; 39 class QMenu; 40 40 class QStackedWidget; 41 41 42 /* VM selector window class: */ 42 /** QMainWindow extension 43 * used as VirtualBox Manager (selector-window) instance. */ 43 44 class UISelectorWindow : public QIWithRetranslateUI2<QMainWindow> 44 45 { … … 47 48 public: 48 49 49 /* Constructor/destructor: */ 50 /** Constructs selector-window passing @a pParent to the QMainWindow base-class. 51 * @param ppSelf brings the pointer to pointer to this window instance used by the external caller. 52 * @param flags brings the selector-window flags dialogs should have. */ 50 53 UISelectorWindow(UISelectorWindow **ppSelf, 51 QWidget *pParent = 0,54 QWidget *pParent = 0, 52 55 Qt::WindowFlags flags = Qt::Window); 56 /** Destructs selector-window. */ 53 57 ~UISelectorWindow(); 54 58 … … 58 62 private slots: 59 63 60 /* Handlers: Global-event stuff:*/64 /** Handles CVirtualBox event about state change for machine with @a strId. */ 61 65 void sltStateChanged(QString strId); 66 /** Handles CVirtualBox event about snapshot change for machine with @a strId. */ 62 67 void sltSnapshotChanged(QString strId); 63 68 64 /* Handler: Details-view stuff:*/69 /** Handles signal about Details-view @a iWidgetIndex change. */ 65 70 void sltDetailsViewIndexChanged(int iWidgetIndex); 66 71 67 /* Handler: Medium enumeration stuff:*/72 /** Handles signal about medium-enumeration finished. */ 68 73 void sltHandleMediumEnumerationFinish(); 69 74 70 /* Handler: Menubar/status stuff:*/75 /** Handles selector-window context-menu call for passed @a pos. */ 71 76 void sltShowSelectorContextMenu(const QPoint &pos); 72 77 73 /* Handlers: File-menu stuff:*/78 /** Handles call to open Media Manager dialog. */ 74 79 void sltShowMediumManager(); 80 /** Handles call to open Import Appliance wizard. 81 * @param strFileName can bring the name of file to import appliance from. */ 75 82 void sltShowImportApplianceWizard(const QString &strFileName = QString()); 83 /** Handles call to open Export Appliance wizard. */ 76 84 void sltShowExportApplianceWizard(); 77 85 #ifdef DEBUG 86 /** Handles call to open Extra-data Manager dialog. */ 78 87 void sltOpenExtraDataManagerWindow(); 79 88 #endif /* DEBUG */ 89 /** Handles call to open Preferences dialog. */ 80 90 void sltShowPreferencesDialog(); 91 /** Handles call to exit application. */ 81 92 void sltPerformExit(); 82 93 83 /* Handlers: Machine-menu slots: */ 94 /** Handles call to open Add Machine dialog. 95 * @param strFileName can bring the name of file to add machine from. */ 84 96 void sltShowAddMachineDialog(const QString &strFileName = QString()); 97 /** Handles call to open Machine Settings dialog. 98 * @param strCategory can bring the settings category to start from. 99 * @param strControl can bring the widget of the page to focus. 100 * @param strId can bring the ID of machine to manage. */ 85 101 void sltShowMachineSettingsDialog(const QString &strCategory = QString(), 86 102 const QString &strControl = QString(), 87 103 const QString &strId = QString()); 104 /** Handles call to open Clone Machine wizard. */ 88 105 void sltShowCloneMachineWizard(); 106 /** Handles call to start or show machine. */ 89 107 void sltPerformStartOrShowAction(); 108 /** Handles call to start machine in normal mode. */ 90 109 void sltPerformStartNormal(); 110 /** Handles call to start machine in headless mode. */ 91 111 void sltPerformStartHeadless(); 112 /** Handles call to start machine in detachable mode. */ 92 113 void sltPerformStartDetachable(); 114 /** Handles call to discard machine state. */ 93 115 void sltPerformDiscardAction(); 116 /** Handles call to @a fPause or resume machine otherwise. */ 94 117 void sltPerformPauseResumeAction(bool fPause); 118 /** Handles call to reset machine. */ 95 119 void sltPerformResetAction(); 120 /** Handles call to save machine state. */ 96 121 void sltPerformSaveAction(); 122 /** Handles call to ask machine for shutdown. */ 97 123 void sltPerformACPIShutdownAction(); 124 /** Handles call to power machine off. */ 98 125 void sltPerformPowerOffAction(); 126 /** Handles call to open machine Log dialog. */ 99 127 void sltShowLogDialog(); 128 /** Handles call to show machine in File Manager. */ 100 129 void sltShowMachineInFileManager(); 130 /** Handles call to create machine shortcut. */ 101 131 void sltPerformCreateShortcutAction(); 132 /** Handles call to show group Close menu. */ 102 133 void sltGroupCloseMenuAboutToShow(); 134 /** Handles call to show machine Close menu. */ 103 135 void sltMachineCloseMenuAboutToShow(); 104 136 105 /* VM list slots: */ 137 /** Handles signal about Chooser-pane index change. 138 * @param fRefreshDetails brings whether details should be updated. 139 * @param fRefreshSnapshots brings whether snapshots should be updated. 140 * @param fRefreshDescription brings whether description should be updated. */ 106 141 void sltCurrentVMItemChanged(bool fRefreshDetails = true, bool fRefreshSnapshots = true, bool fRefreshDescription = true); 142 143 /** Handles call to open a @a list of URLs. */ 107 144 void sltOpenUrls(QList<QUrl> list = QList<QUrl>()); 108 145 109 /* Handlers: Group saving stuff:*/146 /** Handles signal about group saving process status change. */ 110 147 void sltGroupSavingUpdate(); 111 148 112 149 private: 113 150 114 /* Translation stuff:*/151 /** Handles translation event. */ 115 152 void retranslateUi(); 116 153 117 /* Event handlers:*/154 /** Handles any Qt @a pEvent. */ 118 155 bool event(QEvent *pEvent); 156 /** Handles Qt show @a pEvent. */ 119 157 void showEvent(QShowEvent *pEvent); 158 /** Handles Qt polish @a pEvent. */ 120 159 void polishEvent(QShowEvent *pEvent); 121 160 #ifdef Q_WS_MAC 161 /** Preprocesses any Qt @a pEvent for passed @a pObject. */ 122 162 bool eventFilter(QObject *pObject, QEvent *pEvent); 123 163 #endif /* Q_WS_MAC */ 124 164 125 /* Helpers: Prepare stuff:*/165 /** Prepares icon. */ 126 166 void prepareIcon(); 167 /** Prepares menu-bar. */ 127 168 void prepareMenuBar(); 169 /** Prepares @a pMenu File. */ 128 170 void prepareMenuFile(QMenu *pMenu); 171 /** Prepares @a pMenu Group. */ 129 172 void prepareMenuGroup(QMenu *pMenu); 173 /** Prepares @a pMenu Machine. */ 130 174 void prepareMenuMachine(QMenu *pMenu); 175 /** Prepares @a pMenu Group => Start or Show. */ 131 176 void prepareMenuGroupStartOrShow(QMenu *pMenu); 177 /** Prepares @a pMenu Machine => Start or Show. */ 132 178 void prepareMenuMachineStartOrShow(QMenu *pMenu); 179 /** Prepares @a pMenu Group => Close. */ 133 180 void prepareMenuGroupClose(QMenu *pMenu); 181 /** Prepares @a pMenu Machine => Close. */ 134 182 void prepareMenuMachineClose(QMenu *pMenu); 183 /** Prepares status-bar. */ 135 184 void prepareStatusBar(); 185 /** Prepares widgets. */ 136 186 void prepareWidgets(); 187 /** Prepares connections. */ 137 188 void prepareConnections(); 189 /** Loads settings. */ 138 190 void loadSettings(); 191 192 /** Saves settings. */ 139 193 void saveSettings(); 194 /** Cleanups connections. */ 140 195 void cleanupConnections(); 196 /** Cleanups menu-bar. */ 141 197 void cleanupMenuBar(); 142 198 143 /* Helpers: Current item stuff:*/199 /** Returns current-item. */ 144 200 UIVMItem* currentItem() const; 201 /** Returns a list of current-items. */ 145 202 QList<UIVMItem*> currentItems() const; 146 203 147 /* Helper: Action update stuff:*/204 /** Performs update of actions appearance. */ 148 205 void updateActionsAppearance(); 149 206 150 /* Helpers: Action stuff: */ 207 /** Returns whether the action with @a iActionIndex is enabled. 208 * @param items used to calculate verdict about should the action be enabled. */ 151 209 bool isActionEnabled(int iActionIndex, const QList<UIVMItem*> &items); 210 211 /** Returns whether all passed @a items are powered off. */ 152 212 static bool isItemsPoweredOff(const QList<UIVMItem*> &items); 213 /** Returns whether at least one of passed @a items is able to shutdown. */ 153 214 static bool isAtLeastOneItemAbleToShutdown(const QList<UIVMItem*> &items); 215 /** Returns whether at least one of passed @a items supports shortcut creation. */ 154 216 static bool isAtLeastOneItemSupportsShortcuts(const QList<UIVMItem*> &items); 217 /** Returns whether at least one of passed @a items is accessible. */ 155 218 static bool isAtLeastOneItemAccessible(const QList<UIVMItem*> &items); 219 /** Returns whether at least one of passed @a items is inaccessible. */ 156 220 static bool isAtLeastOneItemInaccessible(const QList<UIVMItem*> &items); 221 /** Returns whether at least one of passed @a items is removable. */ 157 222 static bool isAtLeastOneItemRemovable(const QList<UIVMItem*> &items); 223 /** Returns whether at least one of passed @a items can be started or shown. */ 158 224 static bool isAtLeastOneItemCanBeStartedOrShowed(const QList<UIVMItem*> &items); 225 /** Returns whether at least one of passed @a items can be discarded. */ 159 226 static bool isAtLeastOneItemDiscardable(const QList<UIVMItem*> &items); 227 /** Returns whether at least one of passed @a items is started. */ 160 228 static bool isAtLeastOneItemStarted(const QList<UIVMItem*> &items); 229 /** Returns whether at least one of passed @a items is running. */ 161 230 static bool isAtLeastOneItemRunning(const QList<UIVMItem*> &items); 162 231 163 /* Variables:*/232 /** Holds whether the dialog is polished. */ 164 233 bool m_fPolished : 1; 234 /** Holds whether the warning about inaccessible mediums shown. */ 165 235 bool m_fWarningAboutInaccessibleMediumShown : 1; 166 236 … … 168 238 UIActionPool *m_pActionPool; 169 239 170 /* Central splitter window:*/240 /** Holds the central splitter instance. */ 171 241 QISplitter *m_pSplitter; 172 242 173 /* Main toolbar: */174 243 #ifndef Q_WS_MAC 244 /** Holds the main bar instance. */ 175 245 UIMainBar *m_pBar; 176 246 #endif /* !Q_WS_MAC */ 247 /** Holds the main toolbar instance. */ 177 248 UIToolBar *mVMToolBar; 178 249 179 /* Details widgets container:*/250 /** Holds the Details-view container instance. */ 180 251 QStackedWidget *m_pContainer; 181 252 182 /* Graphics chooser/details:*/253 /** Holds the Chooser-pane instance. */ 183 254 UIGChooser *m_pChooser; 255 /** Holds the Details-pane instance. */ 184 256 UIGDetails *m_pDetails; 185 257 186 /* VM details widget:*/258 /** Holds the Desktop-widget instance. */ 187 259 UIVMDesktop *m_pVMDesktop; 188 260 189 /* 'Group' menu action pointers:*/261 /** Holds the list of Group menu actions. */ 190 262 QList<UIAction*> m_groupActions; 263 /** Holds the Group menu parent action. */ 191 264 QAction *m_pGroupMenuAction; 192 265 193 /* 'Machine' menu action pointers:*/266 /** Holds the list of Machine menu actions. */ 194 267 QList<UIAction*> m_machineActions; 268 /** Holds the Machine menu parent action. */ 195 269 QAction *m_pMachineMenuAction; 196 270 197 /* Other variables:*/271 /** Holds the dialog geometry. */ 198 272 QRect m_geometry; 199 273 }; 200 274 201 #endif / / __UISelectorWindow_h__202 275 #endif /* !___UISelectorWindow_h___ */ 276
Note:
See TracChangeset
for help on using the changeset viewer.