Changeset 65285 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 13, 2017 2:31:24 PM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationDataItem.cpp
r64840 r65285 60 60 61 61 62 /********************************************************************************************************************************* 63 * Class UIInformationDataItem implementation. * 64 *********************************************************************************************************************************/ 65 62 66 UIInformationDataItem::UIInformationDataItem(InformationElementType type, const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 63 67 : m_type(type) … … 75 79 { 76 80 RT_NOREF(index); 81 82 /* For particular role: */ 77 83 switch (role) 78 84 { … … 97 103 } 98 104 105 106 /********************************************************************************************************************************* 107 * Class UIInformationDataGeneral implementation. * 108 *********************************************************************************************************************************/ 109 99 110 UIInformationDataGeneral::UIInformationDataGeneral(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 100 111 : UIInformationDataItem(InformationElementType_General, machine, console, pModel) … … 104 115 QVariant UIInformationDataGeneral::data(const QModelIndex &index, int role) const 105 116 { 117 /* For particular role: */ 106 118 switch (role) 107 119 { … … 129 141 } 130 142 143 144 /********************************************************************************************************************************* 145 * Class UIInformationDataSystem implementation. * 146 *********************************************************************************************************************************/ 147 131 148 UIInformationDataSystem::UIInformationDataSystem(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 132 149 : UIInformationDataItem(InformationElementType_System, machine, console, pModel) … … 136 153 QVariant UIInformationDataSystem::data(const QModelIndex &index, int role) const 137 154 { 155 /* For particular role: */ 138 156 switch (role) 139 157 { … … 218 236 } 219 237 238 239 /********************************************************************************************************************************* 240 * Class UIInformationDataDisplay implementation. * 241 *********************************************************************************************************************************/ 242 220 243 UIInformationDataDisplay::UIInformationDataDisplay(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 221 244 : UIInformationDataItem(InformationElementType_Display, machine, console, pModel) … … 225 248 QVariant UIInformationDataDisplay::data(const QModelIndex &index, int role) const 226 249 { 250 /* For particular role: */ 227 251 switch (role) 228 252 { … … 277 301 } 278 302 303 304 /********************************************************************************************************************************* 305 * Class UIInformationDataStorage implementation. * 306 *********************************************************************************************************************************/ 307 279 308 UIInformationDataStorage::UIInformationDataStorage(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 280 309 : UIInformationDataItem(InformationElementType_Storage, machine, console, pModel) … … 284 313 QVariant UIInformationDataStorage::data(const QModelIndex &index, int role) const 285 314 { 315 /* For particular role: */ 286 316 switch (role) 287 317 { … … 341 371 } 342 372 373 374 /********************************************************************************************************************************* 375 * Class UIInformationDataAudio implementation. * 376 *********************************************************************************************************************************/ 377 343 378 UIInformationDataAudio::UIInformationDataAudio(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 344 379 : UIInformationDataItem(InformationElementType_Audio, machine, console, pModel) … … 348 383 QVariant UIInformationDataAudio::data(const QModelIndex &index, int role) const 349 384 { 385 /* For particular role: */ 350 386 switch (role) 351 387 { … … 379 415 } 380 416 417 418 /********************************************************************************************************************************* 419 * Class UIInformationDataNetwork implementation. * 420 *********************************************************************************************************************************/ 421 381 422 UIInformationDataNetwork::UIInformationDataNetwork(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 382 423 : UIInformationDataItem(InformationElementType_Network, machine, console, pModel) … … 386 427 QVariant UIInformationDataNetwork::data(const QModelIndex &index, int role) const 387 428 { 429 /* For particular role: */ 388 430 switch (role) 389 431 { … … 444 486 } 445 487 488 489 /********************************************************************************************************************************* 490 * Class UIInformationDataSerialPorts implementation. * 491 *********************************************************************************************************************************/ 492 446 493 UIInformationDataSerialPorts::UIInformationDataSerialPorts(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 447 494 : UIInformationDataItem(InformationElementType_Serial, machine, console, pModel) … … 451 498 QVariant UIInformationDataSerialPorts::data(const QModelIndex &index, int role) const 452 499 { 500 /* For particular role: */ 453 501 switch (role) 454 502 { … … 497 545 } 498 546 547 499 548 #ifdef VBOX_WITH_PARALLEL_PORTS 549 /********************************************************************************************************************************* 550 * Class UIInformationDataParallelPorts implementation. * 551 *********************************************************************************************************************************/ 552 500 553 UIInformationDataParallelPorts::UIInformationDataParallelPorts(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 501 554 : UIInformationDataItem(InformationElementType_Parallel, machine, console, pModel) … … 505 558 QVariant UIInformationDataParallelPorts::data(const QModelIndex &index, int role) const 506 559 { 560 /* For particular role: */ 507 561 switch (role) 508 562 { … … 539 593 #endif /* VBOX_WITH_PARALLEL_PORTS */ 540 594 595 596 /********************************************************************************************************************************* 597 * Class UIInformationDataUSB implementation. * 598 *********************************************************************************************************************************/ 599 541 600 UIInformationDataUSB::UIInformationDataUSB(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 542 601 : UIInformationDataItem(InformationElementType_USB, machine, console, pModel) … … 546 605 QVariant UIInformationDataUSB::data(const QModelIndex &index, int role) const 547 606 { 607 /* For particular role: */ 548 608 switch (role) 549 609 { … … 588 648 } 589 649 650 651 /********************************************************************************************************************************* 652 * Class UIInformationDataSharedFolders implementation. * 653 *********************************************************************************************************************************/ 654 590 655 UIInformationDataSharedFolders::UIInformationDataSharedFolders(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 591 656 : UIInformationDataItem(InformationElementType_SharedFolders, machine, console, pModel) … … 596 661 QVariant UIInformationDataSharedFolders::data(const QModelIndex &index, int role) const 597 662 { 663 /* For particular role: */ 598 664 switch (role) 599 665 { … … 629 695 } 630 696 697 698 /********************************************************************************************************************************* 699 * Class UIInformationDataRuntimeAttributes implementation. * 700 *********************************************************************************************************************************/ 701 631 702 UIInformationDataRuntimeAttributes::UIInformationDataRuntimeAttributes(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 632 703 : UIInformationDataItem(InformationElementType_RuntimeAttributes, machine, console, pModel) … … 636 707 QVariant UIInformationDataRuntimeAttributes::data(const QModelIndex &index, int role) const 637 708 { 709 /* For particular role: */ 638 710 switch (role) 639 711 { … … 771 843 } 772 844 845 846 /********************************************************************************************************************************* 847 * Class UIInformationDataNetworkStatistics implementation. * 848 *********************************************************************************************************************************/ 849 773 850 UIInformationDataNetworkStatistics::UIInformationDataNetworkStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) 774 851 : UIInformationDataItem(InformationElementType_NetworkStatistics, machine, console, pModel) … … 822 899 QVariant UIInformationDataNetworkStatistics::data(const QModelIndex &index, int role) const 823 900 { 901 /* For particular role: */ 824 902 switch (role) 825 903 { … … 917 995 m_pModel->updateData(index); 918 996 } 997 998 999 /********************************************************************************************************************************* 1000 * Class UIInformationDataStorageStatistics implementation. * 1001 *********************************************************************************************************************************/ 919 1002 920 1003 UIInformationDataStorageStatistics::UIInformationDataStorageStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel) … … 1013 1096 QVariant UIInformationDataStorageStatistics::data(const QModelIndex &index, int role) const 1014 1097 { 1098 /* For particular role: */ 1015 1099 switch (role) 1016 1100 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationDataItem.h
r64840 r65285 29 29 30 30 /* COM includes: */ 31 /* COMEnums.h should be first header included for enum definitions: */32 31 #include "COMEnums.h" 33 32 #include "CGuest.h" … … 46 45 class UIInformationModel; 47 46 47 48 48 /** QObject extension 49 49 * used as data-item in information-model in session-information window. */ … … 55 55 56 56 /** Constructs information data-item of type @a type. 57 * @param machine is machine reference. 58 * @param console is machine console reference. */ 57 * @param machine Brings the machine reference. 58 * @param console Brings the machine console reference. 59 * @param pModel Brings the information model this item belings to. */ 59 60 UIInformationDataItem(InformationElementType type, const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 60 61 … … 65 66 InformationElementType elementType() const { return m_type; } 66 67 67 /** Returns data for item specified by @a i dx for the @a role. */68 /** Returns data for item specified by @a index for the @a role. */ 68 69 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 69 70 … … 89 90 }; 90 91 92 91 93 /** UIInformationDataItem extension for the details-element type 'General'. */ 92 94 class UIInformationDataGeneral : public UIInformationDataItem … … 96 98 public: 97 99 98 /** Constructs details-element object for passed @a pParent set. 99 * @param fOpened brings whether the details-element should be visually opened. */ 100 /** Constructs details-element object. 101 * @param machine Brings the machine reference. 102 * @param console Brings the machine console reference. 103 * @param pModel Brings the information model this item belings to. */ 100 104 UIInformationDataGeneral(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 101 105 102 /** Returns data for item specified by @a idx for the @a role. */ 103 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 104 }; 106 /** Returns data for item specified by @a index for the @a role. */ 107 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 108 }; 109 105 110 106 111 /** UIInformationDataItem extension for the details-element type 'System'. */ … … 111 116 public: 112 117 113 /** Constructs details-element object for passed @a pParent set. 114 * @param fOpened brings whether the details-element should be visually opened. */ 118 /** Constructs details-element object. 119 * @param machine Brings the machine reference. 120 * @param console Brings the machine console reference. 121 * @param pModel Brings the information model this item belings to. */ 115 122 UIInformationDataSystem(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 116 123 117 /** Returns data for item specified by @a idx for the @a role. */ 118 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 119 }; 124 /** Returns data for item specified by @a index for the @a role. */ 125 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 126 }; 127 120 128 121 129 /** UIInformationDataItem extension for the details-element type 'System'. */ … … 126 134 public: 127 135 128 /** Constructs details-element object for passed @a pParent set. 129 * @param fOpened brings whether the details-element should be visually opened. */ 136 /** Constructs details-element object. 137 * @param machine Brings the machine reference. 138 * @param console Brings the machine console reference. 139 * @param pModel Brings the information model this item belings to. */ 130 140 UIInformationDataDisplay(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 131 141 132 /** Returns data for item specified by @a idx for the @a role. */ 133 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 134 }; 142 /** Returns data for item specified by @a index for the @a role. */ 143 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 144 }; 145 135 146 136 147 /** UIInformationDataItem extension for the details-element type 'Storage'. */ … … 141 152 public: 142 153 143 /** Constructs details-element object for passed @a pParent set. */ 154 /** Constructs details-element object. 155 * @param machine Brings the machine reference. 156 * @param console Brings the machine console reference. 157 * @param pModel Brings the information model this item belings to. */ 144 158 UIInformationDataStorage(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 145 159 146 /** Returns data for item specified by @a idx for the @a role. */ 147 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 148 }; 160 /** Returns data for item specified by @a index for the @a role. */ 161 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 162 }; 163 149 164 150 165 /** UIInformationDataItem extension for the details-element type 'Audio'. */ … … 155 170 public: 156 171 157 /** Constructs details-element object for passed @a pParent set. */ 172 /** Constructs details-element object. 173 * @param machine Brings the machine reference. 174 * @param console Brings the machine console reference. 175 * @param pModel Brings the information model this item belings to. */ 158 176 UIInformationDataAudio(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 159 177 160 /** Returns data for item specified by @a idx for the @a role. */ 161 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 162 }; 178 /** Returns data for item specified by @a index for the @a role. */ 179 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 180 }; 181 163 182 164 183 /** UIInformationDataItem extension for the details-element type 'Network'. */ … … 169 188 public: 170 189 171 /** Constructs details-element object for passed @a pParent set. */ 190 /** Constructs details-element object. 191 * @param machine Brings the machine reference. 192 * @param console Brings the machine console reference. 193 * @param pModel Brings the information model this item belings to. */ 172 194 UIInformationDataNetwork(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 173 195 174 /** Returns data for item specified by @a idx for the @a role. */ 175 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 176 }; 196 /** Returns data for item specified by @a index for the @a role. */ 197 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 198 }; 199 177 200 178 201 /** UIInformationDataItem extension for the details-element type 'Serial ports'. */ … … 183 206 public: 184 207 185 /** Constructs details-element object for passed @a pParent set. */ 208 /** Constructs details-element object. 209 * @param machine Brings the machine reference. 210 * @param console Brings the machine console reference. 211 * @param pModel Brings the information model this item belings to. */ 186 212 UIInformationDataSerialPorts(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 187 213 188 /** Returns data for item specified by @a idx for the @a role. */ 189 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 190 }; 214 /** Returns data for item specified by @a index for the @a role. */ 215 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 216 }; 217 191 218 192 219 #ifdef VBOX_WITH_PARALLEL_PORTS … … 198 225 public: 199 226 200 /** Constructs details-element object for passed @a pParent set. */ 227 /** Constructs details-element object. 228 * @param machine Brings the machine reference. 229 * @param console Brings the machine console reference. 230 * @param pModel Brings the information model this item belings to. */ 201 231 UIInformationDataParallelPorts(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 202 232 203 /** Returns data for item specified by @a i dx for the @a role. */233 /** Returns data for item specified by @a index for the @a role. */ 204 234 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 205 235 }; 206 236 #endif /* VBOX_WITH_PARALLEL_PORTS */ 237 207 238 208 239 /** UIInformationDataItem extension for the details-element type 'USB'. */ … … 213 244 public: 214 245 215 /** Constructs details-element object for passed @a pParent set. */ 246 /** Constructs details-element object. 247 * @param machine Brings the machine reference. 248 * @param console Brings the machine console reference. 249 * @param pModel Brings the information model this item belings to. */ 216 250 UIInformationDataUSB(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 217 251 218 /** Returns data for item specified by @a idx for the @a role. */ 219 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 220 }; 252 /** Returns data for item specified by @a index for the @a role. */ 253 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 254 }; 255 221 256 222 257 /** UIInformationDataItem extension for the details-element type 'Shared folders'. */ … … 227 262 public: 228 263 229 /** Constructs details-element object for passed @a pParent set. */ 264 /** Constructs details-element object. 265 * @param machine Brings the machine reference. 266 * @param console Brings the machine console reference. 267 * @param pModel Brings the information model this item belings to. */ 230 268 UIInformationDataSharedFolders(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 231 269 232 /** Returns data for item specified by @a i dx for the @a role. */270 /** Returns data for item specified by @a index for the @a role. */ 233 271 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 234 272 235 273 protected slots: 274 275 /** Updates item data. */ 236 276 void updateData(); 237 277 }; 278 238 279 239 280 /** UIInformationDataItem extension for the details-element type 'runtime attributes'. */ … … 244 285 public: 245 286 246 /** Constructs details-element object for passed @a pParent set. */ 287 /** Constructs details-element object. 288 * @param machine Brings the machine reference. 289 * @param console Brings the machine console reference. 290 * @param pModel Brings the information model this item belings to. */ 247 291 UIInformationDataRuntimeAttributes(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 248 292 249 /** Returns data for item specified by @a idx for the @a role. */ 250 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 251 }; 293 /** Returns data for item specified by @a index for the @a role. */ 294 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 295 }; 296 252 297 253 298 /** UIInformationDataItem extension for the details-element type 'network statistics'. */ … … 258 303 public: 259 304 260 /** Constructs details-element object for passed @a pParent set. */ 305 /** Constructs details-element object. 306 * @param machine Brings the machine reference. 307 * @param console Brings the machine console reference. 308 * @param pModel Brings the information model this item belings to. */ 261 309 UIInformationDataNetworkStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 262 310 263 /** Returns data for item specified by @a i dx for the @a role. */311 /** Returns data for item specified by @a index for the @a role. */ 264 312 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 265 313 266 314 private slots: 315 267 316 /** Handles processing of statistics. */ 268 317 void sltProcessStatistics(); … … 280 329 struct CounterElementType { QString type; DataMapType list; }; 281 330 282 /** VM statistics counter names. */331 /** Holds the VM statistics counter names. */ 283 332 DataMapType m_names; 284 /** VM statistics counter values. */333 /** Holds the VM statistics counter values. */ 285 334 DataMapType m_values; 286 /** VM statistics counter units. */335 /** Holds the VM statistics counter units. */ 287 336 DataMapType m_units; 288 /** VM statistics counter links. */337 /** Holds the VM statistics counter links. */ 289 338 LinksMapType m_links; 290 /** VM statistics update timer. */339 /** Holds the VM statistics update timer instance. */ 291 340 QTimer *m_pTimer; 292 341 }; 342 293 343 294 344 /** UIInformationDataItem extension for the details-element type 'storage statistics'. */ … … 299 349 public: 300 350 301 /** Constructs details-element object for passed @a pParent set. */ 351 /** Constructs details-element object. 352 * @param machine Brings the machine reference. 353 * @param console Brings the machine console reference. 354 * @param pModel Brings the information model this item belings to. */ 302 355 UIInformationDataStorageStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 303 356 304 /** Returns data for item specified by @a i dx for the @a role. */357 /** Returns data for item specified by @a index for the @a role. */ 305 358 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 306 359 307 360 private slots: 361 308 362 /** Handles processing of statistics. */ 309 363 void sltProcessStatistics(); … … 314 368 QString parseStatistics(const QString &strText); 315 369 316 /** Converts a given storage controller type to the string representation used 317 * in statistics. */ 370 /** Converts a given storage controller type to the string representation used in statistics. */ 318 371 const char *storCtrlType2Str(const KStorageControllerType enmCtrlType) const; 319 372 … … 325 378 struct CounterElementType { QString type; DataMapType list; }; 326 379 327 /** VM statistics counter names. */380 /** Holds the VM statistics counter names. */ 328 381 DataMapType m_names; 329 /** VM statistics counter values. */382 /** Holds the VM statistics counter values. */ 330 383 DataMapType m_values; 331 /** VM statistics counter units. */384 /** Holds the VM statistics counter units. */ 332 385 DataMapType m_units; 333 /** VM statistics counter links. */386 /** Holds the VM statistics counter links. */ 334 387 LinksMapType m_links; 335 /** VM statistics update timer. */388 /** Holds the VM statistics update timer instance. */ 336 389 QTimer *m_pTimer; 337 390 };
Note:
See TracChangeset
for help on using the changeset viewer.