Changeset 75526 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 16, 2018 4:47:56 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/details
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.cpp
r75525 r75526 46 46 , m_pAnimationCallback(0) 47 47 { 48 /* Prepare scene: */ 49 prepareScene(); 50 51 /* Prepare root: */ 52 prepareRoot(); 53 54 /* Load settings: */ 55 loadSettings(); 56 57 /* Register meta-type: */ 58 qRegisterMetaType<DetailsElementType>(); 48 prepare(); 59 49 } 60 50 61 51 UIDetailsModel::~UIDetailsModel() 62 52 { 63 /* Save settings: */ 64 saveSettings(); 65 66 /* Cleanup root: */ 67 cleanupRoot(); 68 69 /* Cleanup scene: */ 70 cleanupScene(); 71 } 53 cleanup(); 54 } 72 55 73 56 QGraphicsScene* UIDetailsModel::scene() const … … 222 205 } 223 206 207 void UIDetailsModel::prepare() 208 { 209 /* Register meta-types: */ 210 qRegisterMetaType<DetailsElementType>(); 211 212 /* Prepare things: */ 213 prepareScene(); 214 prepareRoot(); 215 loadSettings(); 216 } 217 224 218 void UIDetailsModel::prepareScene() 225 219 { 226 220 m_pScene = new QGraphicsScene(this); 227 m_pScene->installEventFilter(this); 221 if (m_pScene) 222 m_pScene->installEventFilter(this); 228 223 } 229 224 … … 235 230 void UIDetailsModel::loadSettings() 236 231 { 237 /* Load settings: */238 232 m_categories = gEDataManager->selectorWindowDetailsElements(); 239 233 } … … 241 235 void UIDetailsModel::saveSettings() 242 236 { 243 /* Save settings: */244 237 gEDataManager->setSelectorWindowDetailsElements(m_categories); 245 238 } … … 255 248 delete m_pScene; 256 249 m_pScene = 0; 250 } 251 252 void UIDetailsModel::cleanup() 253 { 254 /* Cleanup things: */ 255 saveSettings(); 256 cleanupRoot(); 257 cleanupScene(); 257 258 } 258 259 … … 268 269 269 270 /* Process context menu event: */ 270 return processContextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent*>(pEvent));271 return processContextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent*>(pEvent)); 271 272 } 272 273 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsModel.h
r75525 r75526 108 108 private: 109 109 110 /* Helpers: Prepare stuff: */ 111 void prepareScene(); 112 void prepareRoot(); 113 void loadSettings(); 110 /** @name Prepare/Cleanup cascade. 111 * @{ */ 112 /** Prepares all. */ 113 void prepare(); 114 /** Prepares scene. */ 115 void prepareScene(); 116 /** Prepares root. */ 117 void prepareRoot(); 118 /** Loads settings. */ 119 void loadSettings(); 114 120 115 /* Helpers: Cleanup stuff: */ 116 void saveSettings(); 117 void cleanupRoot(); 118 void cleanupScene(); 121 /** Saves settings. */ 122 void saveSettings(); 123 /** Cleanups root. */ 124 void cleanupRoot(); 125 /** Cleanups scene. */ 126 void cleanupScene(); 127 /** Cleanups all. */ 128 void cleanup(); 129 /** @} */ 119 130 120 131 /* Handler: Event-filter: */
Note:
See TracChangeset
for help on using the changeset viewer.