Changeset 64691 in vbox
- Timestamp:
- Nov 17, 2016 2:58:03 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 111967
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
r64689 r64691 52 52 public: 53 53 54 /** Constructs item with specified @a number, @a type and @a pParent. */55 ModelItem(int number, ApplianceModelItemType type, ModelItem *pParent = NULL);54 /** Constructs item with specified @a iNumber, @a enmType and @a pParentItem. */ 55 ModelItem(int iNumber, ApplianceModelItemType enmType, ModelItem *pParentItem = 0); 56 56 /** Destructs item. */ 57 57 virtual ~ModelItem(); 58 58 59 59 /** Returns the item type. */ 60 ApplianceModelItemType type() const { return m_ type; }60 ApplianceModelItemType type() const { return m_enmType; } 61 61 62 62 /** Returns the parent of the item. */ 63 63 ModelItem *parent() const { return m_pParentItem; } 64 64 65 /** Appends the passed @a pChild to the item's list of children. */66 void appendChild(ModelItem *pChild );67 /** Returns the child specified by the @a row. */68 ModelItem *child(int row) const;65 /** Appends the passed @a pChildItem to the item's list of children. */ 66 void appendChild(ModelItem *pChildItem); 67 /** Returns the child specified by the @a iRow. */ 68 ModelItem *child(int iRow) const; 69 69 70 70 /** Returns the row of the item in the parent. */ … … 76 76 int columnCount() const { return 3; } 77 77 78 /** Returns the item flags for the given @a column. */79 virtual Qt::ItemFlags itemFlags(int /* column */) const { return 0; }80 81 /** Defines the @a role data for the item at @a column to @a value. */82 virtual bool setData(int /* column */, const QVariant & /* value */, int /* role */) { return false; }83 /** Returns the data stored under the given @a role for the item referred to by the @a column. */84 virtual QVariant data(int /* column */, int /* role */) const { return QVariant(); }78 /** Returns the item flags for the given @a iColumn. */ 79 virtual Qt::ItemFlags itemFlags(int /* iColumn */) const { return 0; } 80 81 /** Defines the @a iRole data for the item at @a iColumn to @a value. */ 82 virtual bool setData(int /* iColumn */, const QVariant & /* value */, int /* iRole */) { return false; } 83 /** Returns the data stored under the given @a iRole for the item referred to by the @a iColumn. */ 84 virtual QVariant data(int /* iColumn */, int /* iRole */) const { return QVariant(); } 85 85 86 86 /** Returns the widget used to edit the item specified by @a idx for editing. 87 87 * @param pParent Brings the parent to be assigned for newly created editor. 88 88 * @param styleOption Bring the style option set for the newly created editor. */ 89 virtual QWidget *createEditor(QWidget * /* pParent */, const QStyleOptionViewItem & /* styleOption */, const QModelIndex & /* idx */) const { return NULL; }89 virtual QWidget *createEditor(QWidget * /* pParent */, const QStyleOptionViewItem & /* styleOption */, const QModelIndex & /* idx */) const { return 0; } 90 90 91 91 /** Defines the contents of the given @a pEditor to the data for the item at the given @a idx. */ … … 98 98 99 99 /** Cache currently stored values, such as @a finalStates, @a finalValues and @a finalExtraValues. */ 100 virtual void putBack(QVector<BOOL> & finalStates, QVector<QString>& finalValues, QVector<QString>&finalExtraValues);100 virtual void putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues); 101 101 102 102 protected: 103 103 104 104 /** Holds the item number. */ 105 int m_ number;105 int m_iNumber; 106 106 /** Holds the item type. */ 107 ApplianceModelItemType m_ type;107 ApplianceModelItemType m_enmType; 108 108 109 109 /** Holds the parent item reference. */ … … 119 119 public: 120 120 121 /** Constructs item passing @a number and @a pParentto the base-class.122 * @param aDescBrings the Virtual System Description. */123 VirtualSystemItem(int number, CVirtualSystemDescription aDesc, ModelItem *pParent);124 125 /** Returns the data stored under the given @a role for the item referred to by the @a column. */126 virtual QVariant data(int column, int role) const;121 /** Constructs item passing @a iNumber and @a pParentItem to the base-class. 122 * @param enmDescription Brings the Virtual System Description. */ 123 VirtualSystemItem(int iNumber, CVirtualSystemDescription enmDescription, ModelItem *pParentItem); 124 125 /** Returns the data stored under the given @a iRole for the item referred to by the @a iColumn. */ 126 virtual QVariant data(int iColumn, int iRole) const; 127 127 128 128 /** Cache currently stored values, such as @a finalStates, @a finalValues and @a finalExtraValues. */ 129 virtual void putBack(QVector<BOOL> & finalStates, QVector<QString>& finalValues, QVector<QString>&finalExtraValues);129 virtual void putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues); 130 130 131 131 private: 132 132 133 133 /** Holds the Virtual System Description. */ 134 CVirtualSystemDescription m_ desc;134 CVirtualSystemDescription m_enmDescription; 135 135 }; 136 136 … … 150 150 public: 151 151 152 /** Constructs item passing @a number and @a pParentto the base-class.153 * @param typeBrings the Virtual System Description type.152 /** Constructs item passing @a iNumber and @a pParentItem to the base-class. 153 * @param enmType Brings the Virtual System Description type. 154 154 * @param strRef Brings something totally useless. 155 155 * @param strOrigValue Brings the original value. 156 156 * @param strConfigValue Brings the configuration value. 157 157 * @param strExtraConfigValue Brings the extra configuration value. */ 158 HardwareItem(int number,159 KVirtualSystemDescriptionType type,158 HardwareItem(int iNumber, 159 KVirtualSystemDescriptionType enmType, 160 160 const QString &strRef, 161 161 const QString &strOrigValue, 162 162 const QString &strConfigValue, 163 163 const QString &strExtraConfigValue, 164 ModelItem *pParent );165 166 /** Returns the item flags for the given @a column. */167 virtual Qt::ItemFlags itemFlags(int column) const;168 169 /** Defines the @a role data for the item at @a column to @a value. */170 virtual bool setData(int column, const QVariant &value, int role);171 /** Returns the data stored under the given @a role for the item referred to by the @a column. */172 virtual QVariant data(int column, int role) const;164 ModelItem *pParentItem); 165 166 /** Returns the item flags for the given @a iColumn. */ 167 virtual Qt::ItemFlags itemFlags(int iColumn) const; 168 169 /** Defines the @a iRole data for the item at @a iColumn to @a value. */ 170 virtual bool setData(int iColumn, const QVariant &value, int iRole); 171 /** Returns the data stored under the given @a iRole for the item referred to by the @a iColumn. */ 172 virtual QVariant data(int iColumn, int iRole) const; 173 173 174 174 /** Returns the widget used to edit the item specified by @a idx for editing. … … 186 186 187 187 /** Cache currently stored values, such as @a finalStates, @a finalValues and @a finalExtraValues. */ 188 virtual void putBack(QVector<BOOL> & finalStates, QVector<QString>& finalValues, QVector<QString>&finalExtraValues);188 virtual void putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues); 189 189 190 190 private: 191 191 192 192 /** Holds the Virtual System description type. */ 193 KVirtualSystemDescriptionType m_ type;193 KVirtualSystemDescriptionType m_enmType; 194 194 /** Holds something totally useless. */ 195 195 QString m_strRef; … … 213 213 *********************************************************************************************************************************/ 214 214 215 /* This & the following derived classes represent the data items of a Virtual 216 System. All access/manipulation is done with the help of virtual functions 217 to keep the interface clean. ModelItem is able to handle tree structures 218 with a parent & several children's. */ 219 ModelItem::ModelItem(int number, ApplianceModelItemType type, ModelItem *pParent /* = NULL */) 220 : m_number(number) 221 , m_type(type) 222 , m_pParentItem(pParent) 223 {} 215 ModelItem::ModelItem(int iNumber, ApplianceModelItemType enmType, ModelItem *pParentItem /* = 0 */) 216 : m_iNumber(iNumber) 217 , m_enmType(enmType) 218 , m_pParentItem(pParentItem) 219 { 220 } 224 221 225 222 ModelItem::~ModelItem() … … 228 225 } 229 226 230 void ModelItem::appendChild(ModelItem *pChild )231 { 232 AssertPtr(pChild );233 m_childItems << pChild ;234 } 235 236 ModelItem *ModelItem::child(int row) const237 { 238 return m_childItems.value( row);227 void ModelItem::appendChild(ModelItem *pChildItem) 228 { 229 AssertPtr(pChildItem); 230 m_childItems << pChildItem; 231 } 232 233 ModelItem *ModelItem::child(int iRow) const 234 { 235 return m_childItems.value(iRow); 239 236 } 240 237 … … 252 249 } 253 250 254 void ModelItem::putBack(QVector<BOOL> & finalStates, QVector<QString>& finalValues, QVector<QString>&finalExtraValues)251 void ModelItem::putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues) 255 252 { 256 253 for (int i = 0; i < childCount(); ++i) … … 263 260 *********************************************************************************************************************************/ 264 261 265 VirtualSystemItem::VirtualSystemItem(int number, CVirtualSystemDescription aDesc, ModelItem *pParent) 266 : ModelItem(number, ApplianceModelItemType_VirtualSystem, pParent) 267 , m_desc(aDesc) 268 {} 269 270 QVariant VirtualSystemItem::data(int column, int role) const 271 { 272 QVariant v; 273 if (column == ApplianceViewSection_Description && 274 role == Qt::DisplayRole) 275 v = UIApplianceEditorWidget::tr("Virtual System %1").arg(m_number + 1); 276 return v; 277 } 278 279 void VirtualSystemItem::putBack(QVector<BOOL>& finalStates, QVector<QString>& finalValues, QVector<QString>& finalExtraValues) 262 VirtualSystemItem::VirtualSystemItem(int iNumber, CVirtualSystemDescription enmDescription, ModelItem *pParentItem) 263 : ModelItem(iNumber, ApplianceModelItemType_VirtualSystem, pParentItem) 264 , m_enmDescription(enmDescription) 265 { 266 } 267 268 QVariant VirtualSystemItem::data(int iColumn, int iRole) const 269 { 270 QVariant value; 271 if (iColumn == ApplianceViewSection_Description && 272 iRole == Qt::DisplayRole) 273 value = UIApplianceEditorWidget::tr("Virtual System %1").arg(m_iNumber + 1); 274 return value; 275 } 276 277 void VirtualSystemItem::putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues) 280 278 { 281 279 /* Resize the vectors */ 282 unsigned long count = m_desc.GetCount();283 finalStates.resize( count);284 finalValues.resize( count);285 finalExtraValues.resize( count);280 unsigned long iCount = m_enmDescription.GetCount(); 281 finalStates.resize(iCount); 282 finalValues.resize(iCount); 283 finalExtraValues.resize(iCount); 286 284 /* Recursively fill the vectors */ 287 285 ModelItem::putBack(finalStates, finalValues, finalExtraValues); 288 286 /* Set all final values at once */ 289 m_ desc.SetFinalValues(finalStates, finalValues, finalExtraValues);287 m_enmDescription.SetFinalValues(finalStates, finalValues, finalExtraValues); 290 288 } 291 289 … … 295 293 *********************************************************************************************************************************/ 296 294 297 HardwareItem::HardwareItem(int number,298 KVirtualSystemDescriptionType type,295 HardwareItem::HardwareItem(int iNumber, 296 KVirtualSystemDescriptionType enmType, 299 297 const QString &strRef, 300 298 const QString &aOrigValue, 301 299 const QString &strConfigValue, 302 300 const QString &strExtraConfigValue, 303 ModelItem *pParent )304 : ModelItem(number, ApplianceModelItemType_Hardware, pParent)305 , m_type(type)306 , m_strRef(strRef)307 , m_strOrigValue(aOrigValue)308 , m_strConfigValue(strConfigValue)309 , m_strConfigDefaultValue(strConfigValue)310 , m_strExtraConfigValue(strExtraConfigValue)311 , m_checkState(Qt::Checked)312 , m_fModified(false)313 { 314 } 315 316 Qt::ItemFlags HardwareItem::itemFlags(int column) const317 { 318 Qt::ItemFlags flags = 0;319 if ( column == ApplianceViewSection_ConfigValue)301 ModelItem *pParentItem) 302 : ModelItem(iNumber, ApplianceModelItemType_Hardware, pParentItem) 303 , m_enmType(enmType) 304 , m_strRef(strRef) 305 , m_strOrigValue(aOrigValue) 306 , m_strConfigValue(strConfigValue) 307 , m_strConfigDefaultValue(strConfigValue) 308 , m_strExtraConfigValue(strExtraConfigValue) 309 , m_checkState(Qt::Checked) 310 , m_fModified(false) 311 { 312 } 313 314 Qt::ItemFlags HardwareItem::itemFlags(int iColumn) const 315 { 316 Qt::ItemFlags enmFlags = 0; 317 if (iColumn == ApplianceViewSection_ConfigValue) 320 318 { 321 319 /* Some items are checkable */ 322 if (m_ type == KVirtualSystemDescriptionType_Floppy ||323 m_ type == KVirtualSystemDescriptionType_CDROM ||324 m_ type == KVirtualSystemDescriptionType_USBController ||325 m_ type == KVirtualSystemDescriptionType_SoundCard ||326 m_ type == KVirtualSystemDescriptionType_NetworkAdapter)327 flags |= Qt::ItemIsUserCheckable;320 if (m_enmType == KVirtualSystemDescriptionType_Floppy || 321 m_enmType == KVirtualSystemDescriptionType_CDROM || 322 m_enmType == KVirtualSystemDescriptionType_USBController || 323 m_enmType == KVirtualSystemDescriptionType_SoundCard || 324 m_enmType == KVirtualSystemDescriptionType_NetworkAdapter) 325 enmFlags |= Qt::ItemIsUserCheckable; 328 326 /* Some items are editable */ 329 if ((m_ type == KVirtualSystemDescriptionType_Name ||330 m_ type == KVirtualSystemDescriptionType_Product ||331 m_ type == KVirtualSystemDescriptionType_ProductUrl ||332 m_ type == KVirtualSystemDescriptionType_Vendor ||333 m_ type == KVirtualSystemDescriptionType_VendorUrl ||334 m_ type == KVirtualSystemDescriptionType_Version ||335 m_ type == KVirtualSystemDescriptionType_Description ||336 m_ type == KVirtualSystemDescriptionType_License ||337 m_ type == KVirtualSystemDescriptionType_OS ||338 m_ type == KVirtualSystemDescriptionType_CPU ||339 m_ type == KVirtualSystemDescriptionType_Memory ||340 m_ type == KVirtualSystemDescriptionType_SoundCard ||341 m_ type == KVirtualSystemDescriptionType_NetworkAdapter ||342 m_ type == KVirtualSystemDescriptionType_HardDiskControllerIDE ||343 m_ type == KVirtualSystemDescriptionType_HardDiskImage) &&327 if ((m_enmType == KVirtualSystemDescriptionType_Name || 328 m_enmType == KVirtualSystemDescriptionType_Product || 329 m_enmType == KVirtualSystemDescriptionType_ProductUrl || 330 m_enmType == KVirtualSystemDescriptionType_Vendor || 331 m_enmType == KVirtualSystemDescriptionType_VendorUrl || 332 m_enmType == KVirtualSystemDescriptionType_Version || 333 m_enmType == KVirtualSystemDescriptionType_Description || 334 m_enmType == KVirtualSystemDescriptionType_License || 335 m_enmType == KVirtualSystemDescriptionType_OS || 336 m_enmType == KVirtualSystemDescriptionType_CPU || 337 m_enmType == KVirtualSystemDescriptionType_Memory || 338 m_enmType == KVirtualSystemDescriptionType_SoundCard || 339 m_enmType == KVirtualSystemDescriptionType_NetworkAdapter || 340 m_enmType == KVirtualSystemDescriptionType_HardDiskControllerIDE || 341 m_enmType == KVirtualSystemDescriptionType_HardDiskImage) && 344 342 m_checkState == Qt::Checked) /* Item has to be enabled */ 345 flags |= Qt::ItemIsEditable;343 enmFlags |= Qt::ItemIsEditable; 346 344 } 347 return flags;348 } 349 350 bool HardwareItem::setData(int column, const QVariant &value, int role)345 return enmFlags; 346 } 347 348 bool HardwareItem::setData(int iColumn, const QVariant &value, int iRole) 351 349 { 352 350 bool fDone = false; 353 switch ( role)351 switch (iRole) 354 352 { 355 353 case Qt::CheckStateRole: 356 354 { 357 if ( column == ApplianceViewSection_ConfigValue &&358 (m_ type == KVirtualSystemDescriptionType_Floppy ||359 m_ type == KVirtualSystemDescriptionType_CDROM ||360 m_ type == KVirtualSystemDescriptionType_USBController ||361 m_ type == KVirtualSystemDescriptionType_SoundCard ||362 m_ type == KVirtualSystemDescriptionType_NetworkAdapter))355 if (iColumn == ApplianceViewSection_ConfigValue && 356 (m_enmType == KVirtualSystemDescriptionType_Floppy || 357 m_enmType == KVirtualSystemDescriptionType_CDROM || 358 m_enmType == KVirtualSystemDescriptionType_USBController || 359 m_enmType == KVirtualSystemDescriptionType_SoundCard || 360 m_enmType == KVirtualSystemDescriptionType_NetworkAdapter)) 363 361 { 364 362 m_checkState = static_cast<Qt::CheckState>(value.toInt()); … … 369 367 case Qt::EditRole: 370 368 { 371 if ( column == ApplianceViewSection_OriginalValue)369 if (iColumn == ApplianceViewSection_OriginalValue) 372 370 m_strOrigValue = value.toString(); 373 else if ( column == ApplianceViewSection_ConfigValue)371 else if (iColumn == ApplianceViewSection_ConfigValue) 374 372 m_strConfigValue = value.toString(); 375 373 break; … … 380 378 } 381 379 382 QVariant HardwareItem::data(int column, int role) const383 { 384 QVariant v ;385 switch ( role)380 QVariant HardwareItem::data(int iColumn, int iRole) const 381 { 382 QVariant value; 383 switch (iRole) 386 384 { 387 385 case Qt::EditRole: 388 386 { 389 if ( column == ApplianceViewSection_OriginalValue)390 v = m_strOrigValue;391 else if ( column == ApplianceViewSection_ConfigValue)392 v = m_strConfigValue;387 if (iColumn == ApplianceViewSection_OriginalValue) 388 value = m_strOrigValue; 389 else if (iColumn == ApplianceViewSection_ConfigValue) 390 value = m_strConfigValue; 393 391 break; 394 392 } 395 393 case Qt::DisplayRole: 396 394 { 397 if ( column == ApplianceViewSection_Description)398 { 399 switch (m_ type)395 if (iColumn == ApplianceViewSection_Description) 396 { 397 switch (m_enmType) 400 398 { 401 case KVirtualSystemDescriptionType_Name: v = UIApplianceEditorWidget::tr("Name"); break;402 case KVirtualSystemDescriptionType_Product: v = UIApplianceEditorWidget::tr("Product"); break;403 case KVirtualSystemDescriptionType_ProductUrl: v = UIApplianceEditorWidget::tr("Product-URL"); break;404 case KVirtualSystemDescriptionType_Vendor: v = UIApplianceEditorWidget::tr("Vendor"); break;405 case KVirtualSystemDescriptionType_VendorUrl: v = UIApplianceEditorWidget::tr("Vendor-URL"); break;406 case KVirtualSystemDescriptionType_Version: v = UIApplianceEditorWidget::tr("Version"); break;407 case KVirtualSystemDescriptionType_Description: v = UIApplianceEditorWidget::tr("Description"); break;408 case KVirtualSystemDescriptionType_License: v = UIApplianceEditorWidget::tr("License"); break;409 case KVirtualSystemDescriptionType_OS: v = UIApplianceEditorWidget::tr("Guest OS Type"); break;410 case KVirtualSystemDescriptionType_CPU: v = UIApplianceEditorWidget::tr("CPU"); break;411 case KVirtualSystemDescriptionType_Memory: v = UIApplianceEditorWidget::tr("RAM"); break;412 case KVirtualSystemDescriptionType_HardDiskControllerIDE: v = UIApplianceEditorWidget::tr("Storage Controller (IDE)"); break;413 case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = UIApplianceEditorWidget::tr("Storage Controller (SATA)"); break;414 case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = UIApplianceEditorWidget::tr("Storage Controller (SCSI)"); break;415 case KVirtualSystemDescriptionType_HardDiskControllerSAS: v = UIApplianceEditorWidget::tr("Storage Controller (SAS)"); break;416 case KVirtualSystemDescriptionType_CDROM: v = UIApplianceEditorWidget::tr("DVD"); break;417 case KVirtualSystemDescriptionType_Floppy: v = UIApplianceEditorWidget::tr("Floppy"); break;418 case KVirtualSystemDescriptionType_NetworkAdapter: v = UIApplianceEditorWidget::tr("Network Adapter"); break;419 case KVirtualSystemDescriptionType_USBController: v = UIApplianceEditorWidget::tr("USB Controller"); break;420 case KVirtualSystemDescriptionType_SoundCard: v = UIApplianceEditorWidget::tr("Sound Card"); break;421 case KVirtualSystemDescriptionType_HardDiskImage: v = UIApplianceEditorWidget::tr("Virtual Disk Image"); break;422 default: v = UIApplianceEditorWidget::tr("Unknown Hardware Item"); break;399 case KVirtualSystemDescriptionType_Name: value = UIApplianceEditorWidget::tr("Name"); break; 400 case KVirtualSystemDescriptionType_Product: value = UIApplianceEditorWidget::tr("Product"); break; 401 case KVirtualSystemDescriptionType_ProductUrl: value = UIApplianceEditorWidget::tr("Product-URL"); break; 402 case KVirtualSystemDescriptionType_Vendor: value = UIApplianceEditorWidget::tr("Vendor"); break; 403 case KVirtualSystemDescriptionType_VendorUrl: value = UIApplianceEditorWidget::tr("Vendor-URL"); break; 404 case KVirtualSystemDescriptionType_Version: value = UIApplianceEditorWidget::tr("Version"); break; 405 case KVirtualSystemDescriptionType_Description: value = UIApplianceEditorWidget::tr("Description"); break; 406 case KVirtualSystemDescriptionType_License: value = UIApplianceEditorWidget::tr("License"); break; 407 case KVirtualSystemDescriptionType_OS: value = UIApplianceEditorWidget::tr("Guest OS Type"); break; 408 case KVirtualSystemDescriptionType_CPU: value = UIApplianceEditorWidget::tr("CPU"); break; 409 case KVirtualSystemDescriptionType_Memory: value = UIApplianceEditorWidget::tr("RAM"); break; 410 case KVirtualSystemDescriptionType_HardDiskControllerIDE: value = UIApplianceEditorWidget::tr("Storage Controller (IDE)"); break; 411 case KVirtualSystemDescriptionType_HardDiskControllerSATA: value = UIApplianceEditorWidget::tr("Storage Controller (SATA)"); break; 412 case KVirtualSystemDescriptionType_HardDiskControllerSCSI: value = UIApplianceEditorWidget::tr("Storage Controller (SCSI)"); break; 413 case KVirtualSystemDescriptionType_HardDiskControllerSAS: value = UIApplianceEditorWidget::tr("Storage Controller (SAS)"); break; 414 case KVirtualSystemDescriptionType_CDROM: value = UIApplianceEditorWidget::tr("DVD"); break; 415 case KVirtualSystemDescriptionType_Floppy: value = UIApplianceEditorWidget::tr("Floppy"); break; 416 case KVirtualSystemDescriptionType_NetworkAdapter: value = UIApplianceEditorWidget::tr("Network Adapter"); break; 417 case KVirtualSystemDescriptionType_USBController: value = UIApplianceEditorWidget::tr("USB Controller"); break; 418 case KVirtualSystemDescriptionType_SoundCard: value = UIApplianceEditorWidget::tr("Sound Card"); break; 419 case KVirtualSystemDescriptionType_HardDiskImage: value = UIApplianceEditorWidget::tr("Virtual Disk Image"); break; 420 default: value = UIApplianceEditorWidget::tr("Unknown Hardware Item"); break; 423 421 } 424 422 } 425 else if ( column == ApplianceViewSection_OriginalValue)426 v = m_strOrigValue;427 else if ( column == ApplianceViewSection_ConfigValue)428 { 429 switch (m_ type)423 else if (iColumn == ApplianceViewSection_OriginalValue) 424 value = m_strOrigValue; 425 else if (iColumn == ApplianceViewSection_ConfigValue) 426 { 427 switch (m_enmType) 430 428 { 431 429 case KVirtualSystemDescriptionType_Description: … … 434 432 /* Shorten the big text if there is more than 435 433 * one line */ 436 QString tmp(m_strConfigValue);437 int i = tmp.indexOf('\n');434 QString strTmp(m_strConfigValue); 435 int i = strTmp.indexOf('\n'); 438 436 if (i > -1) 439 tmp.replace(i, tmp.length(), "...");440 v = tmp; break;437 strTmp.replace(i, strTmp.length(), "..."); 438 value = strTmp; break; 441 439 } 442 case KVirtualSystemDescriptionType_OS: v = vboxGlobal().vmGuestOSTypeDescription(m_strConfigValue); break;443 case KVirtualSystemDescriptionType_Memory: v = m_strConfigValue + " " + VBoxGlobal::tr("MB", "size suffix MBytes=1024 KBytes"); break;444 case KVirtualSystemDescriptionType_SoundCard: v = gpConverter->toString(static_cast<KAudioControllerType>(m_strConfigValue.toInt())); break;445 case KVirtualSystemDescriptionType_NetworkAdapter: v = gpConverter->toString(static_cast<KNetworkAdapterType>(m_strConfigValue.toInt())); break;446 default: v = m_strConfigValue; break;440 case KVirtualSystemDescriptionType_OS: value = vboxGlobal().vmGuestOSTypeDescription(m_strConfigValue); break; 441 case KVirtualSystemDescriptionType_Memory: value = m_strConfigValue + " " + VBoxGlobal::tr("MB", "size suffix MBytes=1024 KBytes"); break; 442 case KVirtualSystemDescriptionType_SoundCard: value = gpConverter->toString(static_cast<KAudioControllerType>(m_strConfigValue.toInt())); break; 443 case KVirtualSystemDescriptionType_NetworkAdapter: value = gpConverter->toString(static_cast<KNetworkAdapterType>(m_strConfigValue.toInt())); break; 444 default: value = m_strConfigValue; break; 447 445 } 448 446 } … … 451 449 case Qt::ToolTipRole: 452 450 { 453 if ( column == ApplianceViewSection_ConfigValue)451 if (iColumn == ApplianceViewSection_ConfigValue) 454 452 { 455 453 if (!m_strOrigValue.isEmpty()) 456 v = UIApplianceEditorWidget::tr("<b>Original Value:</b> %1").arg(m_strOrigValue);454 value = UIApplianceEditorWidget::tr("<b>Original Value:</b> %1").arg(m_strOrigValue); 457 455 } 458 456 break; … … 460 458 case Qt::DecorationRole: 461 459 { 462 if ( column == ApplianceViewSection_Description)463 { 464 switch (m_ type)460 if (iColumn == ApplianceViewSection_Description) 461 { 462 switch (m_enmType) 465 463 { 466 case KVirtualSystemDescriptionType_Name: v = UIIconPool::iconSet(":/name_16px.png"); break;464 case KVirtualSystemDescriptionType_Name: value = UIIconPool::iconSet(":/name_16px.png"); break; 467 465 case KVirtualSystemDescriptionType_Product: 468 466 case KVirtualSystemDescriptionType_ProductUrl: … … 471 469 case KVirtualSystemDescriptionType_Version: 472 470 case KVirtualSystemDescriptionType_Description: 473 case KVirtualSystemDescriptionType_License: v = UIIconPool::iconSet(":/description_16px.png"); break;474 case KVirtualSystemDescriptionType_OS: v = UIIconPool::iconSet(":/os_type_16px.png"); break;475 case KVirtualSystemDescriptionType_CPU: v = UIIconPool::iconSet(":/cpu_16px.png"); break;476 case KVirtualSystemDescriptionType_Memory: v = UIIconPool::iconSet(":/ram_16px.png"); break;477 case KVirtualSystemDescriptionType_HardDiskControllerIDE: v = UIIconPool::iconSet(":/ide_16px.png"); break;478 case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = UIIconPool::iconSet(":/sata_16px.png"); break;479 case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = UIIconPool::iconSet(":/scsi_16px.png"); break;480 case KVirtualSystemDescriptionType_HardDiskControllerSAS: v = UIIconPool::iconSet(":/scsi_16px.png"); break;481 case KVirtualSystemDescriptionType_HardDiskImage: v = UIIconPool::iconSet(":/hd_16px.png"); break;482 case KVirtualSystemDescriptionType_CDROM: v = UIIconPool::iconSet(":/cd_16px.png"); break;483 case KVirtualSystemDescriptionType_Floppy: v = UIIconPool::iconSet(":/fd_16px.png"); break;484 case KVirtualSystemDescriptionType_NetworkAdapter: v = UIIconPool::iconSet(":/nw_16px.png"); break;485 case KVirtualSystemDescriptionType_USBController: v = UIIconPool::iconSet(":/usb_16px.png"); break;486 case KVirtualSystemDescriptionType_SoundCard: v = UIIconPool::iconSet(":/sound_16px.png"); break;471 case KVirtualSystemDescriptionType_License: value = UIIconPool::iconSet(":/description_16px.png"); break; 472 case KVirtualSystemDescriptionType_OS: value = UIIconPool::iconSet(":/os_type_16px.png"); break; 473 case KVirtualSystemDescriptionType_CPU: value = UIIconPool::iconSet(":/cpu_16px.png"); break; 474 case KVirtualSystemDescriptionType_Memory: value = UIIconPool::iconSet(":/ram_16px.png"); break; 475 case KVirtualSystemDescriptionType_HardDiskControllerIDE: value = UIIconPool::iconSet(":/ide_16px.png"); break; 476 case KVirtualSystemDescriptionType_HardDiskControllerSATA: value = UIIconPool::iconSet(":/sata_16px.png"); break; 477 case KVirtualSystemDescriptionType_HardDiskControllerSCSI: value = UIIconPool::iconSet(":/scsi_16px.png"); break; 478 case KVirtualSystemDescriptionType_HardDiskControllerSAS: value = UIIconPool::iconSet(":/scsi_16px.png"); break; 479 case KVirtualSystemDescriptionType_HardDiskImage: value = UIIconPool::iconSet(":/hd_16px.png"); break; 480 case KVirtualSystemDescriptionType_CDROM: value = UIIconPool::iconSet(":/cd_16px.png"); break; 481 case KVirtualSystemDescriptionType_Floppy: value = UIIconPool::iconSet(":/fd_16px.png"); break; 482 case KVirtualSystemDescriptionType_NetworkAdapter: value = UIIconPool::iconSet(":/nw_16px.png"); break; 483 case KVirtualSystemDescriptionType_USBController: value = UIIconPool::iconSet(":/usb_16px.png"); break; 484 case KVirtualSystemDescriptionType_SoundCard: value = UIIconPool::iconSet(":/sound_16px.png"); break; 487 485 default: break; 488 486 } 489 487 } 490 else if ( column == ApplianceViewSection_ConfigValue &&491 m_ type == KVirtualSystemDescriptionType_OS)488 else if (iColumn == ApplianceViewSection_ConfigValue && 489 m_enmType == KVirtualSystemDescriptionType_OS) 492 490 { 493 491 const QStyle *pStyle = QApplication::style(); 494 492 const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize); 495 v = vboxGlobal().vmGuestOSTypeIcon(m_strConfigValue).scaledToHeight(iIconMetric, Qt::SmoothTransformation);493 value = vboxGlobal().vmGuestOSTypeIcon(m_strConfigValue).scaledToHeight(iIconMetric, Qt::SmoothTransformation); 496 494 } 497 495 break; … … 500 498 { 501 499 /* If the item is unchecked mark it with italic text. */ 502 if ( column == ApplianceViewSection_ConfigValue &&500 if (iColumn == ApplianceViewSection_ConfigValue && 503 501 m_checkState == Qt::Unchecked) 504 502 { 505 503 QFont font = qApp->font(); 506 504 font.setItalic(true); 507 v = font;505 value = font; 508 506 } 509 507 break; … … 512 510 { 513 511 /* If the item is unchecked mark it with gray text. */ 514 if ( column == ApplianceViewSection_ConfigValue &&512 if (iColumn == ApplianceViewSection_ConfigValue && 515 513 m_checkState == Qt::Unchecked) 516 514 { 517 515 QPalette pal = qApp->palette(); 518 v = pal.brush(QPalette::Disabled, QPalette::WindowText);516 value = pal.brush(QPalette::Disabled, QPalette::WindowText); 519 517 } 520 518 break; … … 522 520 case Qt::CheckStateRole: 523 521 { 524 if ( column == ApplianceViewSection_ConfigValue &&525 (m_ type == KVirtualSystemDescriptionType_Floppy ||526 m_ type == KVirtualSystemDescriptionType_CDROM ||527 m_ type == KVirtualSystemDescriptionType_USBController ||528 m_ type == KVirtualSystemDescriptionType_SoundCard ||529 m_ type == KVirtualSystemDescriptionType_NetworkAdapter))530 v = m_checkState;522 if (iColumn == ApplianceViewSection_ConfigValue && 523 (m_enmType == KVirtualSystemDescriptionType_Floppy || 524 m_enmType == KVirtualSystemDescriptionType_CDROM || 525 m_enmType == KVirtualSystemDescriptionType_USBController || 526 m_enmType == KVirtualSystemDescriptionType_SoundCard || 527 m_enmType == KVirtualSystemDescriptionType_NetworkAdapter)) 528 value = m_checkState; 531 529 break; 532 530 } 533 531 case HardwareItem::TypeRole: 534 532 { 535 v = m_type;533 value = m_enmType; 536 534 break; 537 535 } 538 536 case HardwareItem::ModifiedRole: 539 537 { 540 if ( column == ApplianceViewSection_ConfigValue)541 v = m_fModified;538 if (iColumn == ApplianceViewSection_ConfigValue) 539 value = m_fModified; 542 540 break; 543 541 } 544 542 } 545 return v ;543 return value; 546 544 } 547 545 548 546 QWidget *HardwareItem::createEditor(QWidget *pParent, const QStyleOptionViewItem & /* styleOption */, const QModelIndex &idx) const 549 547 { 550 QWidget * editor = NULL;548 QWidget *pEditor = 0; 551 549 if (idx.column() == ApplianceViewSection_ConfigValue) 552 550 { 553 switch (m_ type)551 switch (m_enmType) 554 552 { 555 553 case KVirtualSystemDescriptionType_OS: 556 554 { 557 VBoxOSTypeSelectorButton * e= new VBoxOSTypeSelectorButton(pParent);555 VBoxOSTypeSelectorButton *pButton = new VBoxOSTypeSelectorButton(pParent); 558 556 /* Fill the background with the highlight color in the case 559 557 * the button hasn't a rectangle shape. This prevents the … … 562 560 /* Use the palette from the tree view, not the one from the 563 561 * editor. */ 564 QPalette p = e->palette();562 QPalette p = pButton->palette(); 565 563 p.setBrush(QPalette::Highlight, pParent->palette().brush(QPalette::Highlight)); 566 e->setPalette(p);564 pButton->setPalette(p); 567 565 #endif /* VBOX_WS_MAC */ 568 e->setAutoFillBackground(true);569 e->setBackgroundRole(QPalette::Highlight);570 editor = e;566 pButton->setAutoFillBackground(true); 567 pButton->setBackgroundRole(QPalette::Highlight); 568 pEditor = pButton; 571 569 break; 572 570 } … … 578 576 case KVirtualSystemDescriptionType_Version: 579 577 { 580 QLineEdit * e= new QLineEdit(pParent);581 editor = e;578 QLineEdit *pLineEdit = new QLineEdit(pParent); 579 pEditor = pLineEdit; 582 580 break; 583 581 } … … 585 583 case KVirtualSystemDescriptionType_License: 586 584 { 587 UILineTextEdit * e= new UILineTextEdit(pParent);588 editor = e;585 UILineTextEdit *pLineTextEdit = new UILineTextEdit(pParent); 586 pEditor = pLineTextEdit; 589 587 break; 590 588 } 591 589 case KVirtualSystemDescriptionType_CPU: 592 590 { 593 QSpinBox * e= new QSpinBox(pParent);594 e->setRange(UIApplianceEditorWidget::minGuestCPUCount(), UIApplianceEditorWidget::maxGuestCPUCount());595 editor = e;591 QSpinBox *pSpinBox = new QSpinBox(pParent); 592 pSpinBox->setRange(UIApplianceEditorWidget::minGuestCPUCount(), UIApplianceEditorWidget::maxGuestCPUCount()); 593 pEditor = pSpinBox; 596 594 break; 597 595 } 598 596 case KVirtualSystemDescriptionType_Memory: 599 597 { 600 QSpinBox * e= new QSpinBox(pParent);601 e->setRange(UIApplianceEditorWidget::minGuestRAM(), UIApplianceEditorWidget::maxGuestRAM());602 e->setSuffix(" " + VBoxGlobal::tr("MB", "size suffix MBytes=1024 KBytes"));603 editor = e;598 QSpinBox *pSpinBox = new QSpinBox(pParent); 599 pSpinBox->setRange(UIApplianceEditorWidget::minGuestRAM(), UIApplianceEditorWidget::maxGuestRAM()); 600 pSpinBox->setSuffix(" " + VBoxGlobal::tr("MB", "size suffix MBytes=1024 KBytes")); 601 pEditor = pSpinBox; 604 602 break; 605 603 } 606 604 case KVirtualSystemDescriptionType_SoundCard: 607 605 { 608 QComboBox * e= new QComboBox(pParent);609 e->addItem(gpConverter->toString(KAudioControllerType_AC97), KAudioControllerType_AC97);610 e->addItem(gpConverter->toString(KAudioControllerType_SB16), KAudioControllerType_SB16);611 e->addItem(gpConverter->toString(KAudioControllerType_HDA), KAudioControllerType_HDA);612 editor = e;606 QComboBox *pComboBox = new QComboBox(pParent); 607 pComboBox->addItem(gpConverter->toString(KAudioControllerType_AC97), KAudioControllerType_AC97); 608 pComboBox->addItem(gpConverter->toString(KAudioControllerType_SB16), KAudioControllerType_SB16); 609 pComboBox->addItem(gpConverter->toString(KAudioControllerType_HDA), KAudioControllerType_HDA); 610 pEditor = pComboBox; 613 611 break; 614 612 } 615 613 case KVirtualSystemDescriptionType_NetworkAdapter: 616 614 { 617 QComboBox * e= new QComboBox(pParent);618 e->addItem(gpConverter->toString(KNetworkAdapterType_Am79C970A), KNetworkAdapterType_Am79C970A);619 e->addItem(gpConverter->toString(KNetworkAdapterType_Am79C973), KNetworkAdapterType_Am79C973);615 QComboBox *pComboBox = new QComboBox(pParent); 616 pComboBox->addItem(gpConverter->toString(KNetworkAdapterType_Am79C970A), KNetworkAdapterType_Am79C970A); 617 pComboBox->addItem(gpConverter->toString(KNetworkAdapterType_Am79C973), KNetworkAdapterType_Am79C973); 620 618 #ifdef VBOX_WITH_E1000 621 e->addItem(gpConverter->toString(KNetworkAdapterType_I82540EM), KNetworkAdapterType_I82540EM);622 e->addItem(gpConverter->toString(KNetworkAdapterType_I82543GC), KNetworkAdapterType_I82543GC);623 e->addItem(gpConverter->toString(KNetworkAdapterType_I82545EM), KNetworkAdapterType_I82545EM);619 pComboBox->addItem(gpConverter->toString(KNetworkAdapterType_I82540EM), KNetworkAdapterType_I82540EM); 620 pComboBox->addItem(gpConverter->toString(KNetworkAdapterType_I82543GC), KNetworkAdapterType_I82543GC); 621 pComboBox->addItem(gpConverter->toString(KNetworkAdapterType_I82545EM), KNetworkAdapterType_I82545EM); 624 622 #endif /* VBOX_WITH_E1000 */ 625 623 #ifdef VBOX_WITH_VIRTIO 626 e->addItem(gpConverter->toString(KNetworkAdapterType_Virtio), KNetworkAdapterType_Virtio);624 pComboBox->addItem(gpConverter->toString(KNetworkAdapterType_Virtio), KNetworkAdapterType_Virtio); 627 625 #endif /* VBOX_WITH_VIRTIO */ 628 editor = e;626 pEditor = pComboBox; 629 627 break; 630 628 } 631 629 case KVirtualSystemDescriptionType_HardDiskControllerIDE: 632 630 { 633 QComboBox * e= new QComboBox(pParent);634 e->addItem(gpConverter->toString(KStorageControllerType_PIIX3), "PIIX3");635 e->addItem(gpConverter->toString(KStorageControllerType_PIIX4), "PIIX4");636 e->addItem(gpConverter->toString(KStorageControllerType_ICH6), "ICH6");637 editor = e;631 QComboBox *pComboBox = new QComboBox(pParent); 632 pComboBox->addItem(gpConverter->toString(KStorageControllerType_PIIX3), "PIIX3"); 633 pComboBox->addItem(gpConverter->toString(KStorageControllerType_PIIX4), "PIIX4"); 634 pComboBox->addItem(gpConverter->toString(KStorageControllerType_ICH6), "ICH6"); 635 pEditor = pComboBox; 638 636 break; 639 637 } … … 641 639 { 642 640 /* disabled for now 643 UIFilePathSelector * e= new UIFilePathSelector(pParent);644 e->setMode(UIFilePathSelector::Mode_File);645 e->setResetEnabled(false);641 UIFilePathSelector *pFileChooser = new UIFilePathSelector(pParent); 642 pFileChooser->setMode(UIFilePathSelector::Mode_File); 643 pFileChooser->setResetEnabled(false); 646 644 */ 647 QLineEdit * e= new QLineEdit(pParent);648 editor = e;645 QLineEdit *pLineEdit = new QLineEdit(pParent); 646 pEditor = pLineEdit; 649 647 break; 650 648 } … … 652 650 } 653 651 } 654 return editor;652 return pEditor; 655 653 } 656 654 … … 658 656 { 659 657 bool fDone = false; 660 switch (m_ type)658 switch (m_enmType) 661 659 { 662 660 case KVirtualSystemDescriptionType_OS: 663 661 { 664 if (VBoxOSTypeSelectorButton * e= qobject_cast<VBoxOSTypeSelectorButton*>(pEditor))665 { 666 e->setOSTypeId(m_strConfigValue);662 if (VBoxOSTypeSelectorButton *pButton = qobject_cast<VBoxOSTypeSelectorButton*>(pEditor)) 663 { 664 pButton->setOSTypeId(m_strConfigValue); 667 665 fDone = true; 668 666 } … … 671 669 case KVirtualSystemDescriptionType_HardDiskControllerIDE: 672 670 { 673 if (QComboBox * e= qobject_cast<QComboBox*>(pEditor))674 { 675 int i = e->findData(m_strConfigValue);671 if (QComboBox *pComboBox = qobject_cast<QComboBox*>(pEditor)) 672 { 673 int i = pComboBox->findData(m_strConfigValue); 676 674 if (i != -1) 677 e->setCurrentIndex(i);675 pComboBox->setCurrentIndex(i); 678 676 fDone = true; 679 677 } … … 683 681 case KVirtualSystemDescriptionType_Memory: 684 682 { 685 if (QSpinBox * e= qobject_cast<QSpinBox*>(pEditor))686 { 687 e->setValue(m_strConfigValue.toInt());683 if (QSpinBox *pSpinBox = qobject_cast<QSpinBox*>(pEditor)) 684 { 685 pSpinBox->setValue(m_strConfigValue.toInt()); 688 686 fDone = true; 689 687 } … … 697 695 case KVirtualSystemDescriptionType_Version: 698 696 { 699 if (QLineEdit * e= qobject_cast<QLineEdit*>(pEditor))700 { 701 e->setText(m_strConfigValue);697 if (QLineEdit *pLineEdit = qobject_cast<QLineEdit*>(pEditor)) 698 { 699 pLineEdit->setText(m_strConfigValue); 702 700 fDone = true; 703 701 } … … 707 705 case KVirtualSystemDescriptionType_License: 708 706 { 709 if (UILineTextEdit * e= qobject_cast<UILineTextEdit*>(pEditor))710 { 711 e->setText(m_strConfigValue);707 if (UILineTextEdit *pLineTextEdit = qobject_cast<UILineTextEdit*>(pEditor)) 708 { 709 pLineTextEdit->setText(m_strConfigValue); 712 710 fDone = true; 713 711 } … … 717 715 case KVirtualSystemDescriptionType_NetworkAdapter: 718 716 { 719 if (QComboBox * e= qobject_cast<QComboBox*>(pEditor))720 { 721 int i = e->findData(m_strConfigValue.toInt());717 if (QComboBox *pComboBox = qobject_cast<QComboBox*>(pEditor)) 718 { 719 int i = pComboBox->findData(m_strConfigValue.toInt()); 722 720 if (i != -1) 723 e->setCurrentIndex(i);721 pComboBox->setCurrentIndex(i); 724 722 fDone = true; 725 723 } … … 729 727 { 730 728 /* disabled for now 731 if (UIFilePathSelector * e= qobject_cast<UIFilePathSelector*>(pEditor))729 if (UIFilePathSelector *pFileChooser = qobject_cast<UIFilePathSelector*>(pEditor)) 732 730 { 733 e->setPath(m_strConfigValue);731 pFileChooser->setPath(m_strConfigValue); 734 732 } 735 733 */ 736 if (QLineEdit * e= qobject_cast<QLineEdit*>(pEditor))737 { 738 e->setText(m_strConfigValue);734 if (QLineEdit *pLineEdit = qobject_cast<QLineEdit*>(pEditor)) 735 { 736 pLineEdit->setText(m_strConfigValue); 739 737 fDone = true; 740 738 } … … 749 747 { 750 748 bool fDone = false; 751 switch (m_ type)749 switch (m_enmType) 752 750 { 753 751 case KVirtualSystemDescriptionType_OS: 754 752 { 755 if (VBoxOSTypeSelectorButton * e= qobject_cast<VBoxOSTypeSelectorButton*>(pEditor))756 { 757 m_strConfigValue = e->osTypeId();753 if (VBoxOSTypeSelectorButton *pButton = qobject_cast<VBoxOSTypeSelectorButton*>(pEditor)) 754 { 755 m_strConfigValue = pButton->osTypeId(); 758 756 fDone = true; 759 757 } … … 762 760 case KVirtualSystemDescriptionType_HardDiskControllerIDE: 763 761 { 764 if (QComboBox * e= qobject_cast<QComboBox*>(pEditor))765 { 766 m_strConfigValue = e->itemData(e->currentIndex()).toString();762 if (QComboBox *pComboBox = qobject_cast<QComboBox*>(pEditor)) 763 { 764 m_strConfigValue = pComboBox->itemData(pComboBox->currentIndex()).toString(); 767 765 fDone = true; 768 766 } … … 772 770 case KVirtualSystemDescriptionType_Memory: 773 771 { 774 if (QSpinBox * e= qobject_cast<QSpinBox*>(pEditor))775 { 776 m_strConfigValue = QString::number( e->value());772 if (QSpinBox *pSpinBox = qobject_cast<QSpinBox*>(pEditor)) 773 { 774 m_strConfigValue = QString::number(pSpinBox->value()); 777 775 fDone = true; 778 776 } … … 781 779 case KVirtualSystemDescriptionType_Name: 782 780 { 783 if (QLineEdit * e= qobject_cast<QLineEdit*>(pEditor))781 if (QLineEdit *pLineEdit = qobject_cast<QLineEdit*>(pEditor)) 784 782 { 785 783 /* When the VM name is changed the path of the disk images … … 811 809 foreach (QString a, splittedOriginalPath) 812 810 { 813 (a.compare(m_strConfigValue) == 0) ? splittedNewPath << e->text() : splittedNewPath << a;811 (a.compare(m_strConfigValue) == 0) ? splittedNewPath << pLineEdit->text() : splittedNewPath << a; 814 812 } 815 813 … … 821 819 } 822 820 } 823 m_strConfigValue = e->text();821 m_strConfigValue = pLineEdit->text(); 824 822 fDone = true; 825 823 } … … 832 830 case KVirtualSystemDescriptionType_Version: 833 831 { 834 if (QLineEdit * e= qobject_cast<QLineEdit*>(pEditor))835 { 836 m_strConfigValue = e->text();832 if (QLineEdit *pLineEdit = qobject_cast<QLineEdit*>(pEditor)) 833 { 834 m_strConfigValue = pLineEdit->text(); 837 835 fDone = true; 838 836 } … … 842 840 case KVirtualSystemDescriptionType_License: 843 841 { 844 if (UILineTextEdit * e= qobject_cast<UILineTextEdit*>(pEditor))845 { 846 m_strConfigValue = e->text();842 if (UILineTextEdit *pLineTextEdit = qobject_cast<UILineTextEdit*>(pEditor)) 843 { 844 m_strConfigValue = pLineTextEdit->text(); 847 845 fDone = true; 848 846 } … … 852 850 case KVirtualSystemDescriptionType_NetworkAdapter: 853 851 { 854 if (QComboBox * e= qobject_cast<QComboBox*>(pEditor))855 { 856 m_strConfigValue = e->itemData(e->currentIndex()).toString();852 if (QComboBox *pComboBox = qobject_cast<QComboBox*>(pEditor)) 853 { 854 m_strConfigValue = pComboBox->itemData(pComboBox->currentIndex()).toString(); 857 855 fDone = true; 858 856 } … … 862 860 { 863 861 /* disabled for now 864 if (UIFilePathSelector * e= qobject_cast<UIFilePathSelector*>(pEditor))862 if (UIFilePathSelector *pFileChooser = qobject_cast<UIFilePathSelector*>(pEditor)) 865 863 { 866 m_strConfigValue = e->path();864 m_strConfigValue = pFileChooser->path(); 867 865 } 868 866 */ 869 if (QLineEdit * e= qobject_cast<QLineEdit*>(pEditor))870 { 871 m_strConfigValue = e->text();867 if (QLineEdit *pLineEdit = qobject_cast<QLineEdit*>(pEditor)) 868 { 869 m_strConfigValue = pLineEdit->text(); 872 870 fDone = true; 873 871 } … … 888 886 } 889 887 890 void HardwareItem::putBack(QVector<BOOL> & finalStates, QVector<QString>& finalValues, QVector<QString>&finalExtraValues)891 { 892 finalStates[m_ number]= m_checkState == Qt::Checked;893 finalValues[m_ number]= m_strConfigValue;894 finalExtraValues[m_ number] = m_strExtraConfigValue;888 void HardwareItem::putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues) 889 { 890 finalStates[m_iNumber] = m_checkState == Qt::Checked; 891 finalValues[m_iNumber] = m_strConfigValue; 892 finalExtraValues[m_iNumber] = m_strExtraConfigValue; 895 893 ModelItem::putBack(finalStates, finalValues, finalExtraValues); 896 894 } … … 901 899 *********************************************************************************************************************************/ 902 900 903 /* This class is a wrapper model for our ModelItem. It could be used with any 904 TreeView & forward mostly all calls to the methods of ModelItem. The 905 ModelItems itself are stored as internal pointers in the QModelIndex class. */ 906 VirtualSystemModel::VirtualSystemModel(QVector<CVirtualSystemDescription>& aVSDs, QObject *pParent /* = NULL */) 907 : QAbstractItemModel(pParent) 901 VirtualSystemModel::VirtualSystemModel(QVector<CVirtualSystemDescription>& aVSDs, QObject *pParent /* = 0 */) 902 : QAbstractItemModel(pParent) 908 903 { 909 904 m_pRootItem = new ModelItem(0, ApplianceModelItemType_Root); 910 for (int a = 0; a < aVSDs.size(); ++a)905 for (int iVSDIndex = 0; iVSDIndex < aVSDs.size(); ++iVSDIndex) 911 906 { 912 CVirtualSystemDescription vs = aVSDs[a];913 914 VirtualSystemItem * vi = new VirtualSystemItem(a, vs, m_pRootItem);915 m_pRootItem->appendChild( vi);907 CVirtualSystemDescription vsd = aVSDs[iVSDIndex]; 908 909 VirtualSystemItem *pVirtualSystemItem = new VirtualSystemItem(iVSDIndex, vsd, m_pRootItem); 910 m_pRootItem->appendChild(pVirtualSystemItem); 916 911 917 912 /** @todo ask Dmitry about include/COMDefs.h:232 */ … … 922 917 QVector<QString> extraConfigValues; 923 918 924 QList<int> hdInd izies;919 QList<int> hdIndexes; 925 920 QMap<int, HardwareItem*> controllerMap; 926 vs .GetDescription(types, refs, origValues, configValues, extraConfigValues);921 vsd.GetDescription(types, refs, origValues, configValues, extraConfigValues); 927 922 for (int i = 0; i < types.size(); ++i) 928 923 { … … 930 925 reference to them. */ 931 926 if (types[i] == KVirtualSystemDescriptionType_HardDiskImage) 932 hdInd izies << i;927 hdIndexes << i; 933 928 else 934 929 { 935 HardwareItem * hi = new HardwareItem(i, types[i], refs[i], origValues[i], configValues[i], extraConfigValues[i], vi);936 vi->appendChild(hi);930 HardwareItem *pHardwareItem = new HardwareItem(i, types[i], refs[i], origValues[i], configValues[i], extraConfigValues[i], pVirtualSystemItem); 931 pVirtualSystemItem->appendChild(pHardwareItem); 937 932 /* Save the hard disk controller types in an extra map */ 938 933 if (types[i] == KVirtualSystemDescriptionType_HardDiskControllerIDE || … … 940 935 types[i] == KVirtualSystemDescriptionType_HardDiskControllerSCSI || 941 936 types[i] == KVirtualSystemDescriptionType_HardDiskControllerSAS) 942 controllerMap[i] = hi;937 controllerMap[i] = pHardwareItem; 943 938 } 944 939 } 945 940 QRegExp rx("controller=(\\d+);?"); 946 941 /* Now process the hard disk images */ 947 for (int a = 0; a < hdIndizies.size(); ++a)948 { 949 int i = hdInd izies[a];942 for (int iHDIndex = 0; iHDIndex < hdIndexes.size(); ++iHDIndex) 943 { 944 int i = hdIndexes[iHDIndex]; 950 945 QString ecnf = extraConfigValues[i]; 951 946 if (rx.indexIn(ecnf) != -1) 952 947 { 953 948 /* Get the controller */ 954 HardwareItem * ci= controllerMap[rx.cap(1).toInt()];955 if ( ci)949 HardwareItem *pControllerItem = controllerMap[rx.cap(1).toInt()]; 950 if (pControllerItem) 956 951 { 957 952 /* New hardware item as child of the controller */ 958 HardwareItem * hi = new HardwareItem(i, types[i], refs[i], origValues[i], configValues[i], extraConfigValues[i], ci);959 ci->appendChild(hi);953 HardwareItem *pStorageItem = new HardwareItem(i, types[i], refs[i], origValues[i], configValues[i], extraConfigValues[i], pControllerItem); 954 pControllerItem->appendChild(pStorageItem); 960 955 } 961 956 } … … 970 965 } 971 966 972 QModelIndex VirtualSystemModel::index(int row, int column, const QModelIndex &parentIdx /* = QModelIndex() */) const973 { 974 if (!hasIndex( row, column, parentIdx))967 QModelIndex VirtualSystemModel::index(int iRow, int iColumn, const QModelIndex &parentIdx /* = QModelIndex() */) const 968 { 969 if (!hasIndex(iRow, iColumn, parentIdx)) 975 970 return QModelIndex(); 976 971 977 ModelItem *p arentItem;972 ModelItem *pParentItem; 978 973 979 974 if (!parentIdx.isValid()) 980 p arentItem = m_pRootItem;975 pParentItem = m_pRootItem; 981 976 else 982 p arentItem = static_cast<ModelItem*>(parentIdx.internalPointer());983 984 ModelItem * childItem = parentItem->child(row);985 if ( childItem)986 return createIndex( row, column, childItem);977 pParentItem = static_cast<ModelItem*>(parentIdx.internalPointer()); 978 979 ModelItem *pChildItem = pParentItem->child(iRow); 980 if (pChildItem) 981 return createIndex(iRow, iColumn, pChildItem); 987 982 else 988 983 return QModelIndex(); … … 994 989 return QModelIndex(); 995 990 996 ModelItem * childItem = static_cast<ModelItem*>(idx.internalPointer());997 ModelItem *p arentItem = childItem->parent();998 999 if (p arentItem == m_pRootItem)991 ModelItem *pChildItem = static_cast<ModelItem*>(idx.internalPointer()); 992 ModelItem *pParentItem = pChildItem->parent(); 993 994 if (pParentItem == m_pRootItem) 1000 995 return QModelIndex(); 1001 996 1002 return createIndex(p arentItem->row(), 0, parentItem);997 return createIndex(pParentItem->row(), 0, pParentItem); 1003 998 } 1004 999 1005 1000 int VirtualSystemModel::rowCount(const QModelIndex &parentIdx /* = QModelIndex() */) const 1006 1001 { 1007 ModelItem *p arentItem;1002 ModelItem *pParentItem; 1008 1003 if (parentIdx.column() > 0) 1009 1004 return 0; 1010 1005 1011 1006 if (!parentIdx.isValid()) 1012 p arentItem = m_pRootItem;1007 pParentItem = m_pRootItem; 1013 1008 else 1014 p arentItem = static_cast<ModelItem*>(parentIdx.internalPointer());1015 1016 return p arentItem->childCount();1009 pParentItem = static_cast<ModelItem*>(parentIdx.internalPointer()); 1010 1011 return pParentItem->childCount(); 1017 1012 } 1018 1013 … … 1030 1025 return 0; 1031 1026 1032 ModelItem * item = static_cast<ModelItem*>(idx.internalPointer());1033 1034 return Qt::ItemIsEnabled | Qt::ItemIsSelectable | item->itemFlags(idx.column());1035 } 1036 1037 QVariant VirtualSystemModel::headerData(int section, Qt::Orientation orientation, int role) const1038 { 1039 if ( role != Qt::DisplayRole ||1040 orientation != Qt::Horizontal)1027 ModelItem *pItem = static_cast<ModelItem*>(idx.internalPointer()); 1028 1029 return Qt::ItemIsEnabled | Qt::ItemIsSelectable | pItem->itemFlags(idx.column()); 1030 } 1031 1032 QVariant VirtualSystemModel::headerData(int iSection, Qt::Orientation enmOrientation, int iRole) const 1033 { 1034 if (iRole != Qt::DisplayRole || 1035 enmOrientation != Qt::Horizontal) 1041 1036 return QVariant(); 1042 1037 1043 QString title;1044 switch ( section)1038 QString strTitle; 1039 switch (iSection) 1045 1040 { 1046 case ApplianceViewSection_Description: title = UIApplianceEditorWidget::tr("Description"); break;1047 case ApplianceViewSection_ConfigValue: title = UIApplianceEditorWidget::tr("Configuration"); break;1041 case ApplianceViewSection_Description: strTitle = UIApplianceEditorWidget::tr("Description"); break; 1042 case ApplianceViewSection_ConfigValue: strTitle = UIApplianceEditorWidget::tr("Configuration"); break; 1048 1043 } 1049 return title;1050 } 1051 1052 bool VirtualSystemModel::setData(const QModelIndex &idx, const QVariant &value, int role)1044 return strTitle; 1045 } 1046 1047 bool VirtualSystemModel::setData(const QModelIndex &idx, const QVariant &value, int iRole) 1053 1048 { 1054 1049 if (!idx.isValid()) 1055 1050 return false; 1056 1051 1057 ModelItem * item = static_cast<ModelItem*>(idx.internalPointer());1058 1059 return item->setData(idx.column(), value, role);1060 } 1061 1062 QVariant VirtualSystemModel::data(const QModelIndex &idx, int role /* = Qt::DisplayRole */) const1052 ModelItem *pTtem = static_cast<ModelItem*>(idx.internalPointer()); 1053 1054 return pTtem->setData(idx.column(), value, iRole); 1055 } 1056 1057 QVariant VirtualSystemModel::data(const QModelIndex &idx, int iRole /* = Qt::DisplayRole */) const 1063 1058 { 1064 1059 if (!idx.isValid()) 1065 1060 return QVariant(); 1066 1061 1067 ModelItem * item = static_cast<ModelItem*>(idx.internalPointer());1068 1069 return item->data(idx.column(), role);1062 ModelItem *pTtem = static_cast<ModelItem*>(idx.internalPointer()); 1063 1064 return pTtem->data(idx.column(), iRole); 1070 1065 } 1071 1066 … … 1083 1078 void VirtualSystemModel::restoreDefaults(const QModelIndex &parentIdx /* = QModelIndex() */) 1084 1079 { 1085 ModelItem *p arentItem;1080 ModelItem *pParentItem; 1086 1081 1087 1082 if (!parentIdx.isValid()) 1088 p arentItem = m_pRootItem;1083 pParentItem = m_pRootItem; 1089 1084 else 1090 p arentItem = static_cast<ModelItem*>(parentIdx.internalPointer());1091 1092 for (int i = 0; i < p arentItem->childCount(); ++i)1085 pParentItem = static_cast<ModelItem*>(parentIdx.internalPointer()); 1086 1087 for (int i = 0; i < pParentItem->childCount(); ++i) 1093 1088 { 1094 p arentItem->child(i)->restoreDefaults();1089 pParentItem->child(i)->restoreDefaults(); 1095 1090 restoreDefaults(index(i, 0, parentIdx)); 1096 1091 } 1097 emit dataChanged(index(0, 0, parentIdx), index(p arentItem->childCount()-1, 0, parentIdx));1092 emit dataChanged(index(0, 0, parentIdx), index(pParentItem->childCount()-1, 0, parentIdx)); 1098 1093 } 1099 1094 … … 1111 1106 *********************************************************************************************************************************/ 1112 1107 1113 /* The delegate is used for creating/handling the different editors for the 1114 various types we support. This class forward the requests to the virtual 1115 methods of our different ModelItems. If this is not possible the default 1116 methods of QItemDelegate are used to get some standard behavior. Note: We 1117 have to handle the proxy model ourself. I really don't understand why Qt is 1118 not doing this for us. */ 1119 VirtualSystemDelegate::VirtualSystemDelegate(QAbstractProxyModel *pProxy, QObject *pParent /* = NULL */) 1120 : QItemDelegate(pParent) 1121 , mProxy(pProxy) 1122 {} 1108 VirtualSystemDelegate::VirtualSystemDelegate(QAbstractProxyModel *pProxy, QObject *pParent /* = 0 */) 1109 : QItemDelegate(pParent) 1110 , m_pProxy(pProxy) 1111 { 1112 } 1123 1113 1124 1114 QWidget *VirtualSystemDelegate::createEditor(QWidget *pParent, const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const … … 1128 1118 1129 1119 QModelIndex index(idx); 1130 if (m Proxy)1131 index = m Proxy->mapToSource(idx);1132 1133 ModelItem * item = static_cast<ModelItem*>(index.internalPointer());1134 QWidget * editor = item->createEditor(pParent, styleOption, index);1120 if (m_pProxy) 1121 index = m_pProxy->mapToSource(idx); 1122 1123 ModelItem *pItem = static_cast<ModelItem*>(index.internalPointer()); 1124 QWidget *pEditor = pItem->createEditor(pParent, styleOption, index); 1135 1125 1136 1126 /* Allow UILineTextEdit to commit data early: */ 1137 if ( editor && qobject_cast<UILineTextEdit*>(editor))1138 connect( editor, SIGNAL(sigFinished(QWidget*)), this, SIGNAL(commitData(QWidget*)));1139 1140 if ( editor == NULL)1127 if (pEditor && qobject_cast<UILineTextEdit*>(pEditor)) 1128 connect(pEditor, SIGNAL(sigFinished(QWidget*)), this, SIGNAL(commitData(QWidget*))); 1129 1130 if (pEditor == 0) 1141 1131 return QItemDelegate::createEditor(pParent, styleOption, index); 1142 1132 else 1143 return editor;1133 return pEditor; 1144 1134 } 1145 1135 … … 1150 1140 1151 1141 QModelIndex index(idx); 1152 if (m Proxy)1153 index = m Proxy->mapToSource(idx);1154 1155 ModelItem * item = static_cast<ModelItem*>(index.internalPointer());1156 1157 if (! item->setEditorData(pEditor, index))1142 if (m_pProxy) 1143 index = m_pProxy->mapToSource(idx); 1144 1145 ModelItem *pItem = static_cast<ModelItem*>(index.internalPointer()); 1146 1147 if (!pItem->setEditorData(pEditor, index)) 1158 1148 QItemDelegate::setEditorData(pEditor, index); 1159 1149 } … … 1165 1155 1166 1156 QModelIndex index = pModel->index(idx.row(), idx.column()); 1167 if (m Proxy)1168 index = m Proxy->mapToSource(idx);1169 1170 ModelItem * item = static_cast<ModelItem*>(index.internalPointer());1171 if (! item->setModelData(pEditor, pModel, idx))1157 if (m_pProxy) 1158 index = m_pProxy->mapToSource(idx); 1159 1160 ModelItem *pItem = static_cast<ModelItem*>(index.internalPointer()); 1161 if (!pItem->setModelData(pEditor, pModel, idx)) 1172 1162 QItemDelegate::setModelData(pEditor, pModel, idx); 1173 1163 } … … 1218 1208 1219 1209 /* static */ 1220 KVirtualSystemDescriptionType VirtualSystemSortProxyModel:: m_sortList[] =1210 KVirtualSystemDescriptionType VirtualSystemSortProxyModel::s_aSortList[] = 1221 1211 { 1222 1212 KVirtualSystemDescriptionType_Name, … … 1244 1234 VirtualSystemSortProxyModel::VirtualSystemSortProxyModel(QObject *pParent) 1245 1235 : QSortFilterProxyModel(pParent) 1246 {} 1247 1248 bool VirtualSystemSortProxyModel::filterAcceptsRow(int srcRow, const QModelIndex & srcParenIdx) const 1236 { 1237 } 1238 1239 bool VirtualSystemSortProxyModel::filterAcceptsRow(int iSourceRow, const QModelIndex &srcParenIdx) const 1249 1240 { 1250 1241 /* By default enable all, we will explicitly filter out below */ 1251 1242 if (srcParenIdx.isValid()) 1252 1243 { 1253 QModelIndex i = srcParenIdx.child( srcRow, 0);1244 QModelIndex i = srcParenIdx.child(iSourceRow, 0); 1254 1245 if (i.isValid()) 1255 1246 { 1256 ModelItem * item = static_cast<ModelItem*>(i.internalPointer());1247 ModelItem *pItem = static_cast<ModelItem*>(i.internalPointer()); 1257 1248 /* We filter hardware types only */ 1258 if ( item->type() == ApplianceModelItemType_Hardware)1259 { 1260 HardwareItem *hwItem = static_cast<HardwareItem*>( item);1249 if (pItem->type() == ApplianceModelItemType_Hardware) 1250 { 1251 HardwareItem *hwItem = static_cast<HardwareItem*>(pItem); 1261 1252 /* The license type shouldn't be displayed */ 1262 if (m_ filterList.contains(hwItem->m_type))1253 if (m_aFilteredList.contains(hwItem->m_enmType)) 1263 1254 return false; 1264 1255 } … … 1285 1276 HardwareItem *pHwRight = static_cast<HardwareItem*>(pRightItem); 1286 1277 1287 for (unsigned int i = 0; i < RT_ELEMENTS( m_sortList); ++i)1288 if (pHwLeft->m_ type == m_sortList[i])1278 for (unsigned int i = 0; i < RT_ELEMENTS(s_aSortList); ++i) 1279 if (pHwLeft->m_enmType == s_aSortList[i]) 1289 1280 { 1290 1281 for (unsigned int a = 0; a <= i; ++a) 1291 if (pHwRight->m_ type == m_sortList[a])1282 if (pHwRight->m_enmType == s_aSortList[a]) 1292 1283 return true; 1293 1284 return false; … … 1308 1299 int UIApplianceEditorWidget::m_maxGuestCPUCount = -1; 1309 1300 1310 UIApplianceEditorWidget::UIApplianceEditorWidget(QWidget *pParent /* = NULL*/)1301 UIApplianceEditorWidget::UIApplianceEditorWidget(QWidget *pParent /* = 0 */) 1311 1302 : QIWithRetranslateUI<QWidget>(pParent) 1312 , m_pAppliance( NULL)1313 , m_pModel( NULL)1303 , m_pAppliance(0) 1304 , m_pModel(0) 1314 1305 { 1315 1306 /* Make sure all static content is properly initialized */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.h
r64689 r64691 65 65 /** Constructs the Virtual System model passing @a pParent to the base-class. 66 66 * @param aVSDs Brings the Virtual System descriptions. */ 67 VirtualSystemModel(QVector<CVirtualSystemDescription>& aVSDs, QObject *pParent = NULL);67 VirtualSystemModel(QVector<CVirtualSystemDescription>& aVSDs, QObject *pParent = 0); 68 68 /** Destructs the Virtual System model. */ 69 69 ~VirtualSystemModel(); 70 70 71 /** Returns the index of the item in the model specified by the given @a row, @a column and @a parentIdx. */72 QModelIndex index(int row, int column, const QModelIndex &parentIdx = QModelIndex()) const;71 /** Returns the index of the item in the model specified by the given @a iRow, @a iColumn and @a parentIdx. */ 72 QModelIndex index(int iRow, int iColumn, const QModelIndex &parentIdx = QModelIndex()) const; 73 73 /** Returns the parent of the model item with the given @a idx. */ 74 74 QModelIndex parent(const QModelIndex &idx) const; … … 81 81 /** Returns the item flags for the given @a idx. */ 82 82 Qt::ItemFlags flags(const QModelIndex &idx) const; 83 /** Returns the data for the given @a role and @a section in the header with the specified @a orientation. */84 QVariant headerData(int section, Qt::Orientation orientation, int role) const;85 86 /** Defines the @a role data for the item at @a idx to @a value. */87 bool setData(const QModelIndex &idx, const QVariant &value, int role);88 /** Returns the data stored under the given @a role for the item referred to by the @a idx. */89 QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const;83 /** Returns the data for the given @a iRole and @a iSection in the header with the specified @a enmOrientation. */ 84 QVariant headerData(int iSection, Qt::Orientation enmOrientation, int iRole) const; 85 86 /** Defines the @a iRole data for the item at @a idx to @a value. */ 87 bool setData(const QModelIndex &idx, const QVariant &value, int iRole); 88 /** Returns the data stored under the given @a iRole for the item referred to by the @a idx. */ 89 QVariant data(const QModelIndex &idx, int iRole = Qt::DisplayRole) const; 90 90 91 91 /** Returns a model index for the buddy of the item represented by @a idx. */ … … 112 112 /** Constructs the Virtual System Delegate passing @a pParent to the base-class. 113 113 * @param pProxy Brings the proxy model reference used to redirect requests to. */ 114 VirtualSystemDelegate(QAbstractProxyModel *pProxy, QObject *pParent = NULL);114 VirtualSystemDelegate(QAbstractProxyModel *pProxy, QObject *pParent = 0); 115 115 116 116 /** Returns the widget used to edit the item specified by @a idx for editing. … … 140 140 141 141 /** Holds the proxy model reference used to redirect requests to. */ 142 QAbstractProxyModel *m Proxy;142 QAbstractProxyModel *m_pProxy; 143 143 }; 144 144 … … 150 150 151 151 /** Constructs the Virtual System Sorting model passing @a pParent to the base-class. */ 152 VirtualSystemSortProxyModel(QObject *pParent = NULL);152 VirtualSystemSortProxyModel(QObject *pParent = 0); 153 153 154 154 protected: 155 155 156 /** Returns whether item in the row indicated by the given @a srcRow and @a srcParenIdx should be included in the model. */157 bool filterAcceptsRow(int srcRow, const QModelIndex &srcParenIdx) const;156 /** Returns whether item in the row indicated by the given @a iSourceRow and @a srcParenIdx should be included in the model. */ 157 bool filterAcceptsRow(int iSourceRow, const QModelIndex &srcParenIdx) const; 158 158 159 159 /** Returns whether value of the item referred to by the given index @a leftIdx is less … … 162 162 163 163 /** Holds the array of sorted Virtual System Description types. */ 164 static KVirtualSystemDescriptionType m_sortList[];164 static KVirtualSystemDescriptionType s_aSortList[]; 165 165 166 166 /** Holds the filtered list of Virtual System Description types. */ 167 QList<KVirtualSystemDescriptionType> m_ filterList;167 QList<KVirtualSystemDescriptionType> m_aFilteredList; 168 168 }; 169 169 … … 177 177 178 178 /** Constructs the Appliance Editor widget passing @a pParent to the base-class. */ 179 UIApplianceEditorWidget(QWidget *pParent = NULL);179 UIApplianceEditorWidget(QWidget *pParent = 0); 180 180 181 181 /** Returns whether the Appliance Editor has valid state. */ 182 bool isValid() const { return m_pAppliance != NULL; }182 bool isValid() const { return m_pAppliance != 0; } 183 183 /** Returns the currently set appliance reference. */ 184 CAppliance *appliance() const { return m_pAppliance; }184 CAppliance *appliance() const { return m_pAppliance; } 185 185 186 186 /** Returns the minimum guest RAM. */ … … 209 209 210 210 /** Holds the information pane instance. */ 211 QWidget *m_pPaneInformation;211 QWidget *m_pPaneInformation; 212 212 /** Holds the settings tree-view instance. */ 213 213 QTreeView *m_pTreeViewSettings; … … 216 216 217 217 /** Holds the warning pane instance. */ 218 QWidget *m_pPaneWarning;218 QWidget *m_pPaneWarning; 219 219 /** Holds the warning label instance. */ 220 QLabel *m_pLabelWarning;220 QLabel *m_pLabelWarning; 221 221 /** Holds the warning browser instance. */ 222 222 QTextEdit *m_pTextEditWarning; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceExportEditorWidget.cpp
r64685 r64691 44 44 : VirtualSystemSortProxyModel(pParent) 45 45 { 46 m_ filterList46 m_aFilteredList 47 47 << KVirtualSystemDescriptionType_OS 48 48 << KVirtualSystemDescriptionType_CPU -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceImportEditorWidget.cpp
r64685 r64691 45 45 : VirtualSystemSortProxyModel(pParent) 46 46 { 47 m_ filterList << KVirtualSystemDescriptionType_License;47 m_aFilteredList << KVirtualSystemDescriptionType_License; 48 48 } 49 49 };
Note:
See TracChangeset
for help on using the changeset viewer.