- Timestamp:
- Mar 27, 2009 12:28:02 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxApplianceEditorWgt.h
r18378 r18384 245 245 CAppliance* appliance() const { return mAppliance; } 246 246 247 static int minGuestRAM() { return mMinGuestRAM; } 248 static int maxGuestRAM() { return mMaxGuestRAM; } 249 static int minGuestCPUCount() { return mMinGuestCPUCount; } 250 static int maxGuestCPUCount() { return mMaxGuestCPUCount; } 251 247 252 public slots: 248 253 void restoreDefaults(); … … 254 259 CAppliance *mAppliance; 255 260 VirtualSystemModel *mModel; 261 262 private: 263 static void initSystemSettings(); 264 265 /* Private member vars */ 266 static int mMinGuestRAM; 267 static int mMaxGuestRAM; 268 static int mMinGuestCPUCount; 269 static int mMaxGuestCPUCount; 256 270 }; 257 271 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxImportApplianceWgt.h
r18378 r18384 39 39 40 40 QList < QPair <QString, QString> > licenseAgreements() const; 41 42 static int minGuestRAM() { return mMinGuestRAM; }43 static int maxGuestRAM() { return mMaxGuestRAM; }44 static int minGuestCPUCount() { return mMinGuestCPUCount; }45 static int maxGuestCPUCount() { return mMaxGuestCPUCount; }46 47 private:48 static void initSystemSettings();49 50 /* Private member vars */51 static int mMinGuestRAM;52 static int mMaxGuestRAM;53 static int mMinGuestCPUCount;54 static int mMaxGuestCPUCount;55 41 }; 56 42 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxApplianceEditorWgt.cpp
r18378 r18384 23 23 /* VBox includes */ 24 24 #include "VBoxApplianceEditorWgt.h" 25 #include "VBoxImportApplianceWzd.h"26 25 #include "VBoxGlobal.h" 27 26 #include "VBoxProblemReporter.h" 28 #include "VBoxFilePathSelectorWidget.h"29 27 #include "VBoxOSTypeSelectorButton.h" 30 28 #include "VBoxLineTextEdit.h" … … 100 98 if (aColumn == DescriptionSection && 101 99 aRole == Qt::DisplayRole) 102 v = VBox ImportApplianceWgt::tr ("Virtual System %1").arg (mNumber + 1);100 v = VBoxApplianceEditorWgt::tr ("Virtual System %1").arg (mNumber + 1); 103 101 return v; 104 102 } … … 180 178 switch (mType) 181 179 { 182 case KVirtualSystemDescriptionType_Name: v = VBox ImportApplianceWgt::tr ("Name"); break;183 case KVirtualSystemDescriptionType_Product: v = VBox ImportApplianceWgt::tr ("Product"); break;184 case KVirtualSystemDescriptionType_ProductUrl: v = VBox ImportApplianceWgt::tr ("Product-URL"); break;185 case KVirtualSystemDescriptionType_Vendor: v = VBox ImportApplianceWgt::tr ("Vendor"); break;186 case KVirtualSystemDescriptionType_VendorUrl: v = VBox ImportApplianceWgt::tr ("Vendor-URL"); break;187 case KVirtualSystemDescriptionType_Version: v = VBox ImportApplianceWgt::tr ("Version"); break;188 case KVirtualSystemDescriptionType_Description: v = VBox ImportApplianceWgt::tr ("Description"); break;189 case KVirtualSystemDescriptionType_License: v = VBox ImportApplianceWgt::tr ("License"); break;190 case KVirtualSystemDescriptionType_OS: v = VBox ImportApplianceWgt::tr ("Guest OS Type"); break;191 case KVirtualSystemDescriptionType_CPU: v = VBox ImportApplianceWgt::tr ("CPU"); break;192 case KVirtualSystemDescriptionType_Memory: v = VBox ImportApplianceWgt::tr ("RAM"); break;193 case KVirtualSystemDescriptionType_HardDiskControllerIDE: v = VBox ImportApplianceWgt::tr ("Hard Disk Controller IDE"); break;194 case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = VBox ImportApplianceWgt::tr ("Hard Disk Controller SATA"); break;195 case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = VBox ImportApplianceWgt::tr ("Hard Disk Controller SCSI"); break;196 case KVirtualSystemDescriptionType_CDROM: v = VBox ImportApplianceWgt::tr ("DVD"); break;197 case KVirtualSystemDescriptionType_Floppy: v = VBox ImportApplianceWgt::tr ("Floppy"); break;198 case KVirtualSystemDescriptionType_NetworkAdapter: v = VBox ImportApplianceWgt::tr ("Network Adapter"); break;199 case KVirtualSystemDescriptionType_USBController: v = VBox ImportApplianceWgt::tr ("USB Controller"); break;200 case KVirtualSystemDescriptionType_SoundCard: v = VBox ImportApplianceWgt::tr ("Sound Card"); break;201 case KVirtualSystemDescriptionType_HardDiskImage: v = VBox ImportApplianceWgt::tr ("Virtual Disk Image"); break;202 default: v = VBox ImportApplianceWgt::tr ("Unknown Hardware Item"); break;180 case KVirtualSystemDescriptionType_Name: v = VBoxApplianceEditorWgt::tr ("Name"); break; 181 case KVirtualSystemDescriptionType_Product: v = VBoxApplianceEditorWgt::tr ("Product"); break; 182 case KVirtualSystemDescriptionType_ProductUrl: v = VBoxApplianceEditorWgt::tr ("Product-URL"); break; 183 case KVirtualSystemDescriptionType_Vendor: v = VBoxApplianceEditorWgt::tr ("Vendor"); break; 184 case KVirtualSystemDescriptionType_VendorUrl: v = VBoxApplianceEditorWgt::tr ("Vendor-URL"); break; 185 case KVirtualSystemDescriptionType_Version: v = VBoxApplianceEditorWgt::tr ("Version"); break; 186 case KVirtualSystemDescriptionType_Description: v = VBoxApplianceEditorWgt::tr ("Description"); break; 187 case KVirtualSystemDescriptionType_License: v = VBoxApplianceEditorWgt::tr ("License"); break; 188 case KVirtualSystemDescriptionType_OS: v = VBoxApplianceEditorWgt::tr ("Guest OS Type"); break; 189 case KVirtualSystemDescriptionType_CPU: v = VBoxApplianceEditorWgt::tr ("CPU"); break; 190 case KVirtualSystemDescriptionType_Memory: v = VBoxApplianceEditorWgt::tr ("RAM"); break; 191 case KVirtualSystemDescriptionType_HardDiskControllerIDE: v = VBoxApplianceEditorWgt::tr ("Hard Disk Controller IDE"); break; 192 case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = VBoxApplianceEditorWgt::tr ("Hard Disk Controller SATA"); break; 193 case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = VBoxApplianceEditorWgt::tr ("Hard Disk Controller SCSI"); break; 194 case KVirtualSystemDescriptionType_CDROM: v = VBoxApplianceEditorWgt::tr ("DVD"); break; 195 case KVirtualSystemDescriptionType_Floppy: v = VBoxApplianceEditorWgt::tr ("Floppy"); break; 196 case KVirtualSystemDescriptionType_NetworkAdapter: v = VBoxApplianceEditorWgt::tr ("Network Adapter"); break; 197 case KVirtualSystemDescriptionType_USBController: v = VBoxApplianceEditorWgt::tr ("USB Controller"); break; 198 case KVirtualSystemDescriptionType_SoundCard: v = VBoxApplianceEditorWgt::tr ("Sound Card"); break; 199 case KVirtualSystemDescriptionType_HardDiskImage: v = VBoxApplianceEditorWgt::tr ("Virtual Disk Image"); break; 200 default: v = VBoxApplianceEditorWgt::tr ("Unknown Hardware Item"); break; 203 201 } 204 202 } … … 219 217 } 220 218 case KVirtualSystemDescriptionType_OS: v = vboxGlobal().vmGuestOSTypeDescription (mConfigValue); break; 221 case KVirtualSystemDescriptionType_Memory: v = mConfigValue + " " + VBox ImportApplianceWgt::tr ("MB"); break;219 case KVirtualSystemDescriptionType_Memory: v = mConfigValue + " " + VBoxApplianceEditorWgt::tr ("MB"); break; 222 220 case KVirtualSystemDescriptionType_SoundCard: v = vboxGlobal().toString (static_cast<KAudioControllerType> (mConfigValue.toInt())); break; 223 221 case KVirtualSystemDescriptionType_NetworkAdapter: v = vboxGlobal().toString (static_cast<KNetworkAdapterType> (mConfigValue.toInt())); break; … … 232 230 { 233 231 if (!mOrigValue.isEmpty()) 234 v = VBox ImportApplianceWgt::tr ("<b>Original Value:</b> %1").arg (mOrigValue);232 v = VBoxApplianceEditorWgt::tr ("<b>Original Value:</b> %1").arg (mOrigValue); 235 233 } 236 234 break; … … 382 380 { 383 381 QSpinBox *e = new QSpinBox (aParent); 384 e->setRange (VBox ImportApplianceWgt::minGuestCPUCount(), VBoxImportApplianceWgt::maxGuestCPUCount());382 e->setRange (VBoxApplianceEditorWgt::minGuestCPUCount(), VBoxApplianceEditorWgt::maxGuestCPUCount()); 385 383 editor = e; 386 384 break; … … 389 387 { 390 388 QSpinBox *e = new QSpinBox (aParent); 391 e->setRange (VBox ImportApplianceWgt::minGuestRAM(), VBoxImportApplianceWgt::maxGuestRAM());392 e->setSuffix (" " + VBox ImportApplianceWgt::tr ("MB"));389 e->setRange (VBoxApplianceEditorWgt::minGuestRAM(), VBoxApplianceEditorWgt::maxGuestRAM()); 390 e->setSuffix (" " + VBoxApplianceEditorWgt::tr ("MB")); 393 391 editor = e; 394 392 break; … … 777 775 switch (aSection) 778 776 { 779 case DescriptionSection: title = VBox ImportApplianceWgt::tr ("Description"); break;780 case ConfigValueSection: title = VBox ImportApplianceWgt::tr ("Configuration"); break;777 case DescriptionSection: title = VBoxApplianceEditorWgt::tr ("Description"); break; 778 case ConfigValueSection: title = VBoxApplianceEditorWgt::tr ("Configuration"); break; 781 779 } 782 780 return title; … … 960 958 // VBoxApplianceEditorWgt 961 959 960 int VBoxApplianceEditorWgt::mMinGuestRAM = -1; 961 int VBoxApplianceEditorWgt::mMaxGuestRAM = -1; 962 int VBoxApplianceEditorWgt::mMinGuestCPUCount = -1; 963 int VBoxApplianceEditorWgt::mMaxGuestCPUCount = -1; 964 962 965 VBoxApplianceEditorWgt::VBoxApplianceEditorWgt (QWidget *aParent /* = NULL */) 963 966 : QIWithRetranslateUI<QWidget> (aParent) … … 965 968 , mModel (NULL) 966 969 { 970 /* Make sure all static content is properly initialized */ 971 initSystemSettings(); 972 967 973 /* Apply UI decorations */ 968 974 Ui::VBoxApplianceEditorWgt::setupUi (this); … … 989 995 } 990 996 991 997 /* static */ 998 void VBoxApplianceEditorWgt::initSystemSettings() 999 { 1000 if (mMinGuestRAM == -1) 1001 { 1002 /* We need some global defaults from the current VirtualBox 1003 installation */ 1004 CSystemProperties sp = vboxGlobal().virtualBox().GetSystemProperties(); 1005 mMinGuestRAM = sp.GetMinGuestRAM(); 1006 mMaxGuestRAM = sp.GetMaxGuestRAM(); 1007 mMinGuestCPUCount = sp.GetMinGuestCPUCount(); 1008 mMaxGuestCPUCount = sp.GetMaxGuestCPUCount(); 1009 } 1010 } 1011 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxImportApplianceWgt.cpp
r18378 r18384 42 42 // VBoxImportApplianceWgt 43 43 44 int VBoxImportApplianceWgt::mMinGuestRAM = -1;45 int VBoxImportApplianceWgt::mMaxGuestRAM = -1;46 int VBoxImportApplianceWgt::mMinGuestCPUCount = -1;47 int VBoxImportApplianceWgt::mMaxGuestCPUCount = -1;48 49 44 VBoxImportApplianceWgt::VBoxImportApplianceWgt (QWidget *aParent) 50 45 : VBoxApplianceEditorWgt (aParent) 51 46 { 52 /* Make sure all static content is properly initialized */53 initSystemSettings();54 47 } 55 48 … … 175 168 } 176 169 177 /* static */178 void VBoxImportApplianceWgt::initSystemSettings()179 {180 if (mMinGuestRAM == -1)181 {182 /* We need some global defaults from the current VirtualBox183 installation */184 CSystemProperties sp = vboxGlobal().virtualBox().GetSystemProperties();185 mMinGuestRAM = sp.GetMinGuestRAM();186 mMaxGuestRAM = sp.GetMaxGuestRAM();187 mMinGuestCPUCount = sp.GetMinGuestCPUCount();188 mMaxGuestCPUCount = sp.GetMaxGuestCPUCount();189 }190 }191 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxImportApplianceWzd.cpp
r18200 r18384 21 21 */ 22 22 23 /* VBox includes */ 23 24 #include "VBoxImportApplianceWzd.h" 24 25 #include "VBoxGlobal.h" … … 70 71 71 72 void VBoxImportLicenseViewer::setContent (const QString &aName, const QString &aText) 72 { 73 mName = aName; 74 mText = aText; 73 { 74 mName = aName; 75 mText = aText; 75 76 mCaption->setText (tr ("<b>To continue importing the Appliance you must agree to the terms of the software license agreement for the Virtual System \"%1\".</b><br /><br />Click <b>Agree</b> to continue or click <b>Disagree</b> to cancel the import.").arg (mName)); 76 77 mLicenseText->setText (mText); … … 93 94 QPrinter printer; 94 95 QPrintDialog pd (&printer, this); 95 if (pd.exec() == QDialog::Accepted) 96 if (pd.exec() == QDialog::Accepted) 96 97 mLicenseText->print (&printer); 97 98 } … … 103 104 { 104 105 QFile file (fileName); 105 if (file.open(QFile::WriteOnly | QFile::Truncate)) 106 if (file.open(QFile::WriteOnly | QFile::Truncate)) 106 107 { 107 108 QTextStream out (&file);
Note:
See TracChangeset
for help on using the changeset viewer.