Changeset 59702 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Feb 16, 2016 12:26:05 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformation.cpp
r59641 r59702 42 42 { 43 43 /* Prepare main-layout: */ 44 prepare Layout();44 prepareMainLayout(); 45 45 46 46 /* Prepare model: */ … … 51 51 } 52 52 53 void UIInformation::prepare Layout()53 void UIInformation::prepareMainLayout() 54 54 { 55 55 /* Create main-layout: */ … … 69 69 m_pModel = new UIInformationModel(this, m_machine, m_console); 70 70 AssertPtrReturnVoid(m_pModel); 71 { 72 /* Prepare data for information-model: */ 73 /* General data-item: */ 74 UIInformationDataItem *pGeneral = new UIInformationDataGeneral(m_machine, m_console, m_pModel); 75 AssertPtrReturnVoid(pGeneral); 76 { 77 m_pModel->addItem(pGeneral); 78 } 71 79 72 /* Prepare data for information-model: */ 73 /* General data-item: */ 74 UIInformationDataItem *pGeneral = new UIInformationDataGeneral(m_machine, m_console, m_pModel); 75 AssertPtrReturnVoid(pGeneral); 76 { 77 m_pModel->addItem(pGeneral); 78 } 79 /* System data-item: */ 80 UIInformationDataItem *pSystem = new UIInformationDataSystem(m_machine, m_console, m_pModel); 81 AssertPtrReturnVoid(pSystem); 82 { 83 m_pModel->addItem(pSystem); 84 } 85 /* Display data-item: */ 86 UIInformationDataItem *pDisplay = new UIInformationDataDisplay(m_machine, m_console, m_pModel); 87 AssertPtrReturnVoid(pDisplay); 88 { 89 m_pModel->addItem(pDisplay); 90 } 91 /* Storage data-item: */ 92 UIInformationDataItem *pStorage = new UIInformationDataStorage(m_machine, m_console, m_pModel); 93 AssertPtrReturnVoid(pStorage); 94 { 95 m_pModel->addItem(pStorage); 96 } 97 /* Audio data-item: */ 98 UIInformationDataItem *pAudio = new UIInformationDataAudio(m_machine, m_console, m_pModel); 99 AssertPtrReturnVoid(pAudio); 100 { 101 m_pModel->addItem(pAudio); 102 } 103 /* Network data-item: */ 104 UIInformationDataItem *pNetwork = new UIInformationDataNetwork(m_machine, m_console, m_pModel); 105 AssertPtrReturnVoid(pNetwork); 106 { 107 m_pModel->addItem(pNetwork); 108 } 109 /* Serial ports data-item: */ 110 UIInformationDataItem *pSerialPorts = new UIInformationDataSerialPorts(m_machine, m_console, m_pModel); 111 AssertPtrReturnVoid(pSerialPorts); 112 { 113 m_pModel->addItem(pSerialPorts); 114 } 80 /* System data-item: */ 81 UIInformationDataItem *pSystem = new UIInformationDataSystem(m_machine, m_console, m_pModel); 82 AssertPtrReturnVoid(pSystem); 83 { 84 m_pModel->addItem(pSystem); 85 } 86 87 /* Display data-item: */ 88 UIInformationDataItem *pDisplay = new UIInformationDataDisplay(m_machine, m_console, m_pModel); 89 AssertPtrReturnVoid(pDisplay); 90 { 91 m_pModel->addItem(pDisplay); 92 } 93 94 /* Storage data-item: */ 95 UIInformationDataItem *pStorage = new UIInformationDataStorage(m_machine, m_console, m_pModel); 96 AssertPtrReturnVoid(pStorage); 97 { 98 m_pModel->addItem(pStorage); 99 } 100 101 /* Audio data-item: */ 102 UIInformationDataItem *pAudio = new UIInformationDataAudio(m_machine, m_console, m_pModel); 103 AssertPtrReturnVoid(pAudio); 104 { 105 m_pModel->addItem(pAudio); 106 } 107 108 /* Network data-item: */ 109 UIInformationDataItem *pNetwork = new UIInformationDataNetwork(m_machine, m_console, m_pModel); 110 AssertPtrReturnVoid(pNetwork); 111 { 112 m_pModel->addItem(pNetwork); 113 } 114 115 /* Serial ports data-item: */ 116 UIInformationDataItem *pSerialPorts = new UIInformationDataSerialPorts(m_machine, m_console, m_pModel); 117 AssertPtrReturnVoid(pSerialPorts); 118 { 119 m_pModel->addItem(pSerialPorts); 120 } 121 115 122 #ifdef VBOX_WITH_PARALLEL_PORTS 116 /* Parallel ports data-item: */117 UIInformationDataItem *pParallelPorts = new UIInformationDataParallelPorts(m_machine, m_console, m_pModel);118 AssertPtrReturnVoid(pParallelPorts);119 {120 m_list.append(pParallelPorts);121 }123 /* Parallel ports data-item: */ 124 UIInformationDataItem *pParallelPorts = new UIInformationDataParallelPorts(m_machine, m_console, m_pModel); 125 AssertPtrReturnVoid(pParallelPorts); 126 { 127 m_list.append(pParallelPorts); 128 } 122 129 #endif /* VBOX_WITH_PARALLEL_PORTS */ 123 /* USB data-item: */ 124 UIInformationDataItem *pUSB = new UIInformationDataUSB(m_machine, m_console, m_pModel); 125 AssertPtrReturnVoid(pUSB); 126 { 127 m_pModel->addItem(pUSB); 128 } 129 /* Shared folders data-item: */ 130 UIInformationDataItem *pSharedFolders = new UIInformationDataSharedFolders(m_machine, m_console, m_pModel); 131 AssertPtrReturnVoid(pSharedFolders); 132 { 133 m_pModel->addItem(pSharedFolders); 130 131 /* USB data-item: */ 132 UIInformationDataItem *pUSB = new UIInformationDataUSB(m_machine, m_console, m_pModel); 133 AssertPtrReturnVoid(pUSB); 134 { 135 m_pModel->addItem(pUSB); 136 } 137 138 /* Shared folders data-item: */ 139 UIInformationDataItem *pSharedFolders = new UIInformationDataSharedFolders(m_machine, m_console, m_pModel); 140 AssertPtrReturnVoid(pSharedFolders); 141 { 142 m_pModel->addItem(pSharedFolders); 143 } 134 144 } 135 145 } … … 150 160 } 151 161 /* Connect datachanged signal: */ 152 connect(m_pModel, SIGNAL(dataChanged(const QModelIndex , const QModelIndex)), m_pView, SLOT(updateData(const QModelIndex, const QModelIndex)));162 connect(m_pModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), m_pView, SLOT(updateData(const QModelIndex&, const QModelIndex&))); 153 163 154 164 /* Set model: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformation.h
r59641 r59702 49 49 50 50 /** Prepares main-layout. */ 51 void prepare Layout();51 void prepareMainLayout(); 52 52 53 53 /** Prepares model. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationDataItem.cpp
r59642 r59702 72 72 QVariant UIInformationDataItem::data(const QModelIndex &index, int role) const 73 73 { 74 switch (role) 75 { 76 case Qt::DisplayRole: 77 { 78 return tr("General", "details report"); 79 } 80 break; 81 82 case Qt::DecorationRole: 83 { 84 return QIcon(":/machine_16px.png"); 85 } 86 break; 87 88 default: 89 break; 90 } 74 Q_UNUSED(index); 75 Q_UNUSED(role); 76 /* Return null QVariant by default: */ 91 77 return QVariant(); 92 78 } … … 113 99 break; 114 100 115 case Qt::UserRole +1:101 case Qt::UserRole + 1: 116 102 { 117 103 UITextTable p_text; … … 122 108 break; 123 109 124 case Qt::UserRole +2:110 case Qt::UserRole + 2: 125 111 { 126 112 return m_type; … … 155 141 break; 156 142 157 case Qt::UserRole +1:143 case Qt::UserRole + 1: 158 144 { 159 145 #ifdef VBOX_WITH_FULL_DETAILS_REPORT … … 161 147 CBIOSSettings biosSettings = aMachine.GetBIOSSettings(); 162 148 /* ACPI: */ 163 QString acpi = biosSettings.GetACPIEnabled() 164 ? tr("Enabled", "details report (ACPI)") 165 : tr("Disabled", "details report (ACPI)"); 149 QString acpi = biosSettings.GetACPIEnabled() ? tr("Enabled", "details report (ACPI)") : 150 tr("Disabled", "details report (ACPI)"); 166 151 /* I/O APIC: */ 167 QString ioapic = biosSettings.GetIOAPICEnabled() 168 ? tr("Enabled", "details report (I/O APIC)") 169 : tr("Disabled", "details report (I/O APIC)"); 152 QString ioapic = biosSettings.GetIOAPICEnabled() ? tr("Enabled", "details report (I/O APIC)") : 153 tr("Disabled", "details report (I/O APIC)"); 170 154 /* PAE/NX: */ 171 QString pae = aMachine.GetCpuProperty(KCpuPropertyType_PAE) 172 ? tr("Enabled", "details report (PAE/NX)") 173 : tr("Disabled", "details report (PAE/NX)"); 155 QString pae = aMachine.GetCpuProperty(KCpuPropertyType_PAE) ? tr("Enabled", "details report (PAE/NX)") : 156 tr("Disabled", "details report (PAE/NX)"); 174 157 175 158 iRowCount += 3; /* Full report rows: */ … … 179 162 for (ulong i = 1; i <= vboxGlobal().virtualBox().GetSystemProperties().GetMaxBootPosition(); ++i) 180 163 { 181 KDeviceType device = m_machine.GetBootOrder 164 KDeviceType device = m_machine.GetBootOrder(i); 182 165 if (device == KDeviceType_Null) 183 166 continue; 184 167 if (!bootOrder.isEmpty()) 185 168 bootOrder += ", "; 186 bootOrder += gpConverter->toString 169 bootOrder += gpConverter->toString(device); 187 170 } 188 171 if (bootOrder.isEmpty()) 189 bootOrder = gpConverter->toString 172 bootOrder = gpConverter->toString(KDeviceType_Null); 190 173 191 174 /* Prepare data: */ … … 206 189 { 207 190 /* VT-x/AMD-V: */ 208 QString virt = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled) 209 ? tr ("Enabled", "details report (VT-x/AMD-V)")210 : tr("Disabled", "details report (VT-x/AMD-V)");191 QString virt = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled) ? 192 tr("Enabled", "details report (VT-x/AMD-V)") : 193 tr("Disabled", "details report (VT-x/AMD-V)"); 211 194 p_text << UITextTableLine(tr("VT-x/AMD-V", "details report"), virt); 212 195 /* Nested Paging: */ 213 QString nested = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging) 214 ? tr ("Enabled", "details report (Nested Paging)")215 : tr("Disabled", "details report (Nested Paging)");196 QString nested = m_machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging) ? 197 tr("Enabled", "details report (Nested Paging)") : 198 tr("Disabled", "details report (Nested Paging)"); 216 199 p_text << UITextTableLine(tr("Nested Paging", "details report"), nested); 217 200 } … … 224 207 break; 225 208 226 case Qt::UserRole +2:209 case Qt::UserRole + 2: 227 210 { 228 211 return m_type; … … 267 250 p_text << UITextTableLine(tr("Screens", "details report"), QString::number(cGuestScreens)); 268 251 269 QString acc3d = m_machine.GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable() 270 ? tr("Enabled", "details report (3D Acceleration)")271 :tr("Disabled", "details report (3D Acceleration)");252 QString acc3d = m_machine.GetAccelerate3DEnabled() && vboxGlobal().is3DAvailable() ? 253 tr("Enabled", "details report (3D Acceleration)") : 254 tr("Disabled", "details report (3D Acceleration)"); 272 255 p_text << UITextTableLine(tr("3D Acceleration", "details report"), acc3d); 273 256 274 257 #ifdef VBOX_WITH_VIDEOHWACCEL 275 QString acc2dVideo = m_machine.GetAccelerate2DVideoEnabled() 276 ? tr("Enabled", "details report (2D Video Acceleration)")277 :tr("Disabled", "details report (2D Video Acceleration)");258 QString acc2dVideo = m_machine.GetAccelerate2DVideoEnabled() ? 259 tr("Enabled", "details report (2D Video Acceleration)") : 260 tr("Disabled", "details report (2D Video Acceleration)"); 278 261 p_text << UITextTableLine(tr("2D Video Acceleration", "details report"), acc2dVideo); 279 262 #endif … … 293 276 break; 294 277 295 case Qt::UserRole +2:278 case Qt::UserRole + 2: 296 279 { 297 280 return m_type; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationDataItem.h
r59642 r59702 85 85 CConsole m_console; 86 86 87 /** Holds the model. */87 /** Holds the instance of model. */ 88 88 UIInformationModel *m_pModel; 89 89 }; … … 234 234 }; 235 235 236 /** UIInformationData RuntimeAttributesextension for the details-element type 'runtime attributes'. */236 /** UIInformationDataItem extension for the details-element type 'runtime attributes'. */ 237 237 class UIInformationDataRuntimeAttributes : public UIInformationDataItem 238 238 { … … 248 248 }; 249 249 250 /** UIInformationData NetworkStatisticsextension for the details-element type 'network statistics'. */250 /** UIInformationDataItem extension for the details-element type 'network statistics'. */ 251 251 class UIInformationDataNetworkStatistics : public UIInformationDataItem 252 252 { … … 254 254 255 255 public: 256 257 /** Constructs details-element object for passed @a pParent set. */ 258 UIInformationDataNetworkStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 259 260 /** Returns data for item specified by @a idx for the @a role. */ 261 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 262 263 private slots: 264 /** Handles processing of statistics. */ 265 void sltProcessStatistics(); 266 267 private: 268 269 /** Returns parsed-data of statistics. */ 270 QString parseStatistics(const QString &strText); 256 271 257 272 /** VM statistics counter data map. */ … … 261 276 /** VM statistics counter struct. */ 262 277 struct CounterElementType { QString type; DataMapType list; }; 263 264 /** Constructs details-element object for passed @a pParent set. */265 UIInformationDataNetworkStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);266 267 /** Returns data for item specified by @a idx for the @a role. */268 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;269 270 QString parseStatistics(const QString &strText);271 272 public slots:273 void sltProcessStatistics();274 275 private:276 278 277 279 /** VM statistics counter names. */ … … 287 289 }; 288 290 289 /** UIInformationData StorageStatisticsextension for the details-element type 'storage statistics'. */291 /** UIInformationDataItem extension for the details-element type 'storage statistics'. */ 290 292 class UIInformationDataStorageStatistics : public UIInformationDataItem 291 293 { … … 293 295 294 296 public: 297 298 /** Constructs details-element object for passed @a pParent set. */ 299 UIInformationDataStorageStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel); 300 301 /** Returns data for item specified by @a idx for the @a role. */ 302 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 303 304 private slots: 305 /** Handles processing of statistics. */ 306 void sltProcessStatistics(); 307 308 private: 309 310 /** Returns parsed-data of statistics. */ 311 QString parseStatistics(const QString &strText); 295 312 296 313 /** VM statistics counter data map. */ … … 300 317 /** VM statistics counter struct. */ 301 318 struct CounterElementType { QString type; DataMapType list; }; 302 303 /** Constructs details-element object for passed @a pParent set. */304 UIInformationDataStorageStatistics(const CMachine &machine, const CConsole &console, UIInformationModel *pModel);305 306 /** Returns data for item specified by @a idx for the @a role. */307 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;308 309 QString parseStatistics(const QString &strText);310 311 public slots:312 void sltProcessStatistics();313 314 private:315 319 316 320 /** VM statistics counter names. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationModel.cpp
r59644 r59702 71 71 roleNames[Qt::UserRole + 1] = ""; 72 72 roleNames[Qt::UserRole + 2] = ""; 73 # if QT_VERSION < 0x050000 73 74 setRoleNames(roleNames); 75 # endif /* QT_VERSION < 0x050000 */ 74 76 75 77 /* Register meta-type: */
Note:
See TracChangeset
for help on using the changeset viewer.