VirtualBox

Changeset 18384 in vbox for trunk/src


Ignore:
Timestamp:
Mar 27, 2009 12:28:02 PM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: remove import dependency

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxApplianceEditorWgt.h

    r18378 r18384  
    245245    CAppliance* appliance() const { return mAppliance; }
    246246
     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
    247252public slots:
    248253    void restoreDefaults();
     
    254259    CAppliance *mAppliance;
    255260    VirtualSystemModel *mModel;
     261
     262private:
     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;
    256270};
    257271
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxImportApplianceWgt.h

    r18378 r18384  
    3939
    4040    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;
    5541};
    5642
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxApplianceEditorWgt.cpp

    r18378 r18384  
    2323/* VBox includes */
    2424#include "VBoxApplianceEditorWgt.h"
    25 #include "VBoxImportApplianceWzd.h"
    2625#include "VBoxGlobal.h"
    2726#include "VBoxProblemReporter.h"
    28 #include "VBoxFilePathSelectorWidget.h"
    2927#include "VBoxOSTypeSelectorButton.h"
    3028#include "VBoxLineTextEdit.h"
     
    10098    if (aColumn == DescriptionSection &&
    10199        aRole == Qt::DisplayRole)
    102         v = VBoxImportApplianceWgt::tr ("Virtual System %1").arg (mNumber + 1);
     100        v = VBoxApplianceEditorWgt::tr ("Virtual System %1").arg (mNumber + 1);
    103101    return v;
    104102}
     
    180178                    switch (mType)
    181179                    {
    182                         case KVirtualSystemDescriptionType_Name: v = VBoxImportApplianceWgt::tr ("Name"); break;
    183                         case KVirtualSystemDescriptionType_Product: v = VBoxImportApplianceWgt::tr ("Product"); break;
    184                         case KVirtualSystemDescriptionType_ProductUrl: v = VBoxImportApplianceWgt::tr ("Product-URL"); break;
    185                         case KVirtualSystemDescriptionType_Vendor: v = VBoxImportApplianceWgt::tr ("Vendor"); break;
    186                         case KVirtualSystemDescriptionType_VendorUrl: v = VBoxImportApplianceWgt::tr ("Vendor-URL"); break;
    187                         case KVirtualSystemDescriptionType_Version: v = VBoxImportApplianceWgt::tr ("Version"); break;
    188                         case KVirtualSystemDescriptionType_Description: v = VBoxImportApplianceWgt::tr ("Description"); break;
    189                         case KVirtualSystemDescriptionType_License: v = VBoxImportApplianceWgt::tr ("License"); break;
    190                         case KVirtualSystemDescriptionType_OS: v = VBoxImportApplianceWgt::tr ("Guest OS Type"); break;
    191                         case KVirtualSystemDescriptionType_CPU: v = VBoxImportApplianceWgt::tr ("CPU"); break;
    192                         case KVirtualSystemDescriptionType_Memory: v = VBoxImportApplianceWgt::tr ("RAM"); break;
    193                         case KVirtualSystemDescriptionType_HardDiskControllerIDE: v = VBoxImportApplianceWgt::tr ("Hard Disk Controller IDE"); break;
    194                         case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = VBoxImportApplianceWgt::tr ("Hard Disk Controller SATA"); break;
    195                         case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = VBoxImportApplianceWgt::tr ("Hard Disk Controller SCSI"); break;
    196                         case KVirtualSystemDescriptionType_CDROM: v = VBoxImportApplianceWgt::tr ("DVD"); break;
    197                         case KVirtualSystemDescriptionType_Floppy: v = VBoxImportApplianceWgt::tr ("Floppy"); break;
    198                         case KVirtualSystemDescriptionType_NetworkAdapter: v = VBoxImportApplianceWgt::tr ("Network Adapter"); break;
    199                         case KVirtualSystemDescriptionType_USBController: v = VBoxImportApplianceWgt::tr ("USB Controller"); break;
    200                         case KVirtualSystemDescriptionType_SoundCard: v = VBoxImportApplianceWgt::tr ("Sound Card"); break;
    201                         case KVirtualSystemDescriptionType_HardDiskImage: v = VBoxImportApplianceWgt::tr ("Virtual Disk Image"); break;
    202                         default: v = VBoxImportApplianceWgt::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;
    203201                    }
    204202                }
     
    219217                            }
    220218                        case KVirtualSystemDescriptionType_OS: v = vboxGlobal().vmGuestOSTypeDescription (mConfigValue); break;
    221                         case KVirtualSystemDescriptionType_Memory: v = mConfigValue + " " + VBoxImportApplianceWgt::tr ("MB"); break;
     219                        case KVirtualSystemDescriptionType_Memory: v = mConfigValue + " " + VBoxApplianceEditorWgt::tr ("MB"); break;
    222220                        case KVirtualSystemDescriptionType_SoundCard: v = vboxGlobal().toString (static_cast<KAudioControllerType> (mConfigValue.toInt())); break;
    223221                        case KVirtualSystemDescriptionType_NetworkAdapter: v = vboxGlobal().toString (static_cast<KNetworkAdapterType> (mConfigValue.toInt())); break;
     
    232230                {
    233231                    if (!mOrigValue.isEmpty())
    234                         v = VBoxImportApplianceWgt::tr ("<b>Original Value:</b> %1").arg (mOrigValue);
     232                        v = VBoxApplianceEditorWgt::tr ("<b>Original Value:</b> %1").arg (mOrigValue);
    235233                }
    236234                break;
     
    382380                {
    383381                    QSpinBox *e = new QSpinBox (aParent);
    384                     e->setRange (VBoxImportApplianceWgt::minGuestCPUCount(), VBoxImportApplianceWgt::maxGuestCPUCount());
     382                    e->setRange (VBoxApplianceEditorWgt::minGuestCPUCount(), VBoxApplianceEditorWgt::maxGuestCPUCount());
    385383                    editor = e;
    386384                    break;
     
    389387                {
    390388                    QSpinBox *e = new QSpinBox (aParent);
    391                     e->setRange (VBoxImportApplianceWgt::minGuestRAM(), VBoxImportApplianceWgt::maxGuestRAM());
    392                     e->setSuffix (" " + VBoxImportApplianceWgt::tr ("MB"));
     389                    e->setRange (VBoxApplianceEditorWgt::minGuestRAM(), VBoxApplianceEditorWgt::maxGuestRAM());
     390                    e->setSuffix (" " + VBoxApplianceEditorWgt::tr ("MB"));
    393391                    editor = e;
    394392                    break;
     
    777775    switch (aSection)
    778776    {
    779         case DescriptionSection: title = VBoxImportApplianceWgt::tr ("Description"); break;
    780         case ConfigValueSection: title = VBoxImportApplianceWgt::tr ("Configuration"); break;
     777        case DescriptionSection: title = VBoxApplianceEditorWgt::tr ("Description"); break;
     778        case ConfigValueSection: title = VBoxApplianceEditorWgt::tr ("Configuration"); break;
    781779    }
    782780    return title;
     
    960958// VBoxApplianceEditorWgt
    961959
     960int VBoxApplianceEditorWgt::mMinGuestRAM = -1;
     961int VBoxApplianceEditorWgt::mMaxGuestRAM = -1;
     962int VBoxApplianceEditorWgt::mMinGuestCPUCount = -1;
     963int VBoxApplianceEditorWgt::mMaxGuestCPUCount = -1;
     964
    962965VBoxApplianceEditorWgt::VBoxApplianceEditorWgt (QWidget *aParent /* = NULL */)
    963966    : QIWithRetranslateUI<QWidget> (aParent)
     
    965968    , mModel (NULL)
    966969{
     970    /* Make sure all static content is properly initialized */
     971    initSystemSettings();
     972
    967973    /* Apply UI decorations */
    968974    Ui::VBoxApplianceEditorWgt::setupUi (this);
     
    989995}
    990996
    991 
     997/* static */
     998void 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  
    4242// VBoxImportApplianceWgt
    4343
    44 int VBoxImportApplianceWgt::mMinGuestRAM = -1;
    45 int VBoxImportApplianceWgt::mMaxGuestRAM = -1;
    46 int VBoxImportApplianceWgt::mMinGuestCPUCount = -1;
    47 int VBoxImportApplianceWgt::mMaxGuestCPUCount = -1;
    48 
    4944VBoxImportApplianceWgt::VBoxImportApplianceWgt (QWidget *aParent)
    5045    : VBoxApplianceEditorWgt (aParent)
    5146{
    52     /* Make sure all static content is properly initialized */
    53     initSystemSettings();
    5447}
    5548
     
    175168}
    176169
    177 /* static */
    178 void VBoxImportApplianceWgt::initSystemSettings()
    179 {
    180     if (mMinGuestRAM == -1)
    181     {
    182         /* We need some global defaults from the current VirtualBox
    183            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  
    2121 */
    2222
     23/* VBox includes */
    2324#include "VBoxImportApplianceWzd.h"
    2425#include "VBoxGlobal.h"
     
    7071
    7172void VBoxImportLicenseViewer::setContent (const QString &aName, const QString &aText)
    72 { 
    73     mName = aName; 
    74     mText = aText; 
     73{
     74    mName = aName;
     75    mText = aText;
    7576    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));
    7677    mLicenseText->setText (mText);
     
    9394    QPrinter printer;
    9495    QPrintDialog pd (&printer, this);
    95     if (pd.exec() == QDialog::Accepted) 
     96    if (pd.exec() == QDialog::Accepted)
    9697        mLicenseText->print (&printer);
    9798}
     
    103104    {
    104105        QFile file (fileName);
    105         if (file.open(QFile::WriteOnly | QFile::Truncate)) 
     106        if (file.open(QFile::WriteOnly | QFile::Truncate))
    106107        {
    107108            QTextStream out (&file);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette